Line
Link Here
|
0 |
-- snes9x-1.51-src/gfx.h |
0 |
++ snes9x-1.51-src/gfx.h |
Lines 331-337
Link Here
|
331 |
|
331 |
|
332 |
inline uint16 COLOR_SUB(uint16 C1, uint16 C2) |
332 |
inline uint16 COLOR_SUB(uint16 C1, uint16 C2) |
333 |
{ |
333 |
{ |
334 |
uint16 mC1, mC2, v = 0; |
334 |
uint16 mC1, mC2, v = ALPHA_BITS_MASK; |
335 |
|
335 |
|
336 |
mC1 = C1 & FIRST_COLOR_MASK; |
336 |
mC1 = C1 & FIRST_COLOR_MASK; |
337 |
mC2 = C2 & FIRST_COLOR_MASK; |
337 |
mC2 = C2 & FIRST_COLOR_MASK; |
338 |
-- snes9x-1.51-src/unix/opengl.cpp |
338 |
++ snes9x-1.51-src/unix/opengl.cpp |
Lines 233-246
Link Here
|
233 |
|
233 |
|
234 |
// Strip dots from the version string |
234 |
// Strip dots from the version string |
235 |
char *ptr; |
235 |
char *ptr; |
236 |
while (ptr = strchr (ver, '.')) |
236 |
while ( (ptr = strchr (ver, '.')) != 0) |
237 |
memmove (ptr, ptr + 1, strlen (ptr + 1) + 1); |
237 |
memmove (ptr, ptr + 1, strlen (ptr + 1) + 1); |
238 |
|
238 |
|
239 |
// Pad the string with zeros to 4 digits |
|
|
240 |
while (strlen (ver) < 4) |
241 |
strcat (ver, "0"); |
242 |
|
243 |
OpenGL.version = atoi (ver); |
239 |
OpenGL.version = atoi (ver); |
|
|
240 |
|
241 |
// Pad the number with zeros to 4 digits |
242 |
while (OpenGL.version < 1000) |
243 |
OpenGL.version *= 10; |
244 |
} |
244 |
} |
245 |
else |
245 |
else |
246 |
OpenGL.version = 1100; |
246 |
OpenGL.version = 1100; |
Lines 400-406
Link Here
|
400 |
int i = 0; |
400 |
int i = 0; |
401 |
for (uint32 y = 0; y < pheight; y++) |
401 |
for (uint32 y = 0; y < pheight; y++) |
402 |
{ |
402 |
{ |
403 |
uint16 *ptr = (uint16 *) (GFX.Screen + (y + startl) * GFX.Pitch) + startx; |
403 |
uint16 *ptr = (uint16 *) (GFX.Screen + (y + startl) * GFX.Pitch/2) + startx; |
404 |
for (uint32 x = 0; x < pwidth; x++) |
404 |
for (uint32 x = 0; x < pwidth; x++) |
405 |
{ |
405 |
{ |
406 |
int color = *ptr++; |
406 |
int color = *ptr++; |
Lines 418-424
Link Here
|
418 |
for (uint32 y = 0; y < pheight; y++) |
418 |
for (uint32 y = 0; y < pheight; y++) |
419 |
{ |
419 |
{ |
420 |
memmove (basetexbuffer + sizeof (uint16) * texture_size * y, |
420 |
memmove (basetexbuffer + sizeof (uint16) * texture_size * y, |
421 |
(GFX.Screen + (y + startl) * GFX.Pitch) + startx, |
421 |
(GFX.Screen + (y + startl) * GFX.Pitch/2) + startx, |
422 |
sizeof (uint16) * texture_size); |
422 |
sizeof (uint16) * texture_size); |
423 |
} |
423 |
} |
424 |
data = basetexbuffer; |
424 |
data = basetexbuffer; |
425 |
-- snes9x-1.51-src/unix/x11.cpp |
425 |
++ snes9x-1.51-src/unix/x11.cpp |
Lines 572-586
Link Here
|
572 |
} |
572 |
} |
573 |
delete[] color_diff; |
573 |
delete[] color_diff; |
574 |
|
574 |
|
|
|
575 |
GUI.cmap = XCreateColormap (GUI.display, RootWindowOfScreen (GUI.screen), |
576 |
GUI.visual, GUI.pseudo ? AllocAll : AllocNone); |
577 |
if (GUI.pseudo) |
578 |
{ |
579 |
for (i = 0; i < 256; i++) |
580 |
{ |
581 |
GUI.colors[i].red = GUI.colors[i].green = GUI.colors[i].blue = 0; |
582 |
GUI.colors[i].pixel = i; |
583 |
GUI.colors[i].flags = DoRed | DoGreen | DoBlue; |
584 |
} |
585 |
XStoreColors (GUI.display, GUI.cmap, GUI.colors, 256); |
586 |
} |
587 |
|
575 |
XSetWindowAttributes attrib; |
588 |
XSetWindowAttributes attrib; |
576 |
|
589 |
|
577 |
attrib.background_pixel = BlackPixelOfScreen (GUI.screen); |
590 |
attrib.background_pixel = BlackPixelOfScreen (GUI.screen); |
|
|
591 |
attrib.colormap = GUI.cmap; |
578 |
GUI.window = XCreateWindow (GUI.display, RootWindowOfScreen (GUI.screen), |
592 |
GUI.window = XCreateWindow (GUI.display, RootWindowOfScreen (GUI.screen), |
579 |
(WidthOfScreen(GUI.screen) - GUI.window_width) / 2, |
593 |
(WidthOfScreen(GUI.screen) - GUI.window_width) / 2, |
580 |
(HeightOfScreen(GUI.screen) - GUI.window_height) / 2, |
594 |
(HeightOfScreen(GUI.screen) - GUI.window_height) / 2, |
581 |
GUI.window_width, GUI.window_height, 0, |
595 |
GUI.window_width, GUI.window_height, 0, |
582 |
GUI.depth, InputOutput, GUI.visual, |
596 |
GUI.depth, InputOutput, GUI.visual, |
583 |
CWBackPixel, &attrib); |
597 |
CWBackPixel | CWColormap, &attrib); |
584 |
|
598 |
|
585 |
#ifdef USE_DGA_EXTENSION |
599 |
#ifdef USE_DGA_EXTENSION |
586 |
CreateFullScreenWindow (); |
600 |
CreateFullScreenWindow (); |
Lines 625-642
Link Here
|
625 |
ButtonPressMask | ButtonReleaseMask); |
639 |
ButtonPressMask | ButtonReleaseMask); |
626 |
#endif |
640 |
#endif |
627 |
|
641 |
|
628 |
if (GUI.pseudo) |
|
|
629 |
{ |
630 |
GUI.cmap = XCreateColormap (GUI.display, GUI.window, GUI.visual, True); |
631 |
XSetWindowColormap (GUI.display, GUI.window, GUI.cmap); |
632 |
for (i = 0; i < 256; i++) |
633 |
{ |
634 |
GUI.colors[i].red = GUI.colors[i].green = GUI.colors[i].blue = 0; |
635 |
GUI.colors[i].pixel = i; |
636 |
GUI.colors[i].flags = DoRed | DoGreen | DoBlue; |
637 |
} |
638 |
XStoreColors (GUI.display, GUI.cmap, GUI.colors, 256); |
639 |
} |
640 |
XMapRaised (GUI.display, GUI.window); |
642 |
XMapRaised (GUI.display, GUI.window); |
641 |
XClearWindow (GUI.display, GUI.window); |
643 |
XClearWindow (GUI.display, GUI.window); |
642 |
SetupImage (); |
644 |
SetupImage (); |