62 |
|
#include "prefs.h" |
63 |
|
#include "user_strings.h" |
64 |
|
#include "video.h" |
65 |
+ |
#include "video_blit.h" |
66 |
|
|
67 |
|
#define DEBUG 0 |
68 |
|
#include "debug.h" |
123 |
|
static int keycode_table[256]; // X keycode -> Mac keycode translation table |
124 |
|
|
125 |
|
// X11 variables |
126 |
+ |
char *x_display_name = NULL; // X11 display name |
127 |
+ |
Display *x_display = NULL; // X11 display handle |
128 |
|
static int screen; // Screen number |
129 |
|
static Window rootwin; // Root window and our window |
130 |
|
static int num_depths = 0; // Number of available X depths |
134 |
|
static int eventmask; |
135 |
|
|
136 |
|
static int xdepth; // Depth of X screen |
137 |
+ |
static VisualFormat visualFormat; |
138 |
|
static XVisualInfo visualInfo; |
139 |
|
static Visual *vis; |
140 |
|
static int color_class; |
758 |
|
native_byte_order = (XImageByteOrder(x_display) == LSBFirst); |
759 |
|
#endif |
760 |
|
#ifdef ENABLE_VOSF |
761 |
< |
Screen_blitter_init(&visualInfo, native_byte_order, depth_of_video_mode(mode)); |
761 |
> |
Screen_blitter_init(visualFormat, native_byte_order, depth_of_video_mode(mode)); |
762 |
|
#endif |
763 |
|
|
764 |
|
// Set frame buffer base |
1119 |
|
#if REAL_ADDRESSING || DIRECT_ADDRESSING |
1120 |
|
// Screen_blitter_init() returns TRUE if VOSF is mandatory |
1121 |
|
// i.e. the framebuffer update function is not Blit_Copy_Raw |
1122 |
< |
use_vosf = Screen_blitter_init(&visualInfo, true, mode.depth); |
1122 |
> |
use_vosf = Screen_blitter_init(visualFormat, true, mode.depth); |
1123 |
|
|
1124 |
|
if (use_vosf) { |
1125 |
|
// Allocate memory for frame buffer (SIZE is extended to page-boundary) |
1259 |
|
#if REAL_ADDRESSING || DIRECT_ADDRESSING |
1260 |
|
// Screen_blitter_init() returns TRUE if VOSF is mandatory |
1261 |
|
// i.e. the framebuffer update function is not Blit_Copy_Raw |
1262 |
< |
use_vosf = Screen_blitter_init(&visualInfo, native_byte_order, depth_of_video_mode(mode)); |
1262 |
> |
use_vosf = Screen_blitter_init(visualFormat, native_byte_order, depth_of_video_mode(mode)); |
1263 |
|
|
1264 |
|
if (use_vosf) { |
1265 |
|
// Allocate memory for frame buffer (SIZE is extended to page-boundary) |
1401 |
|
return false; |
1402 |
|
} |
1403 |
|
|
1404 |
+ |
// Build up visualFormat structure |
1405 |
+ |
visualFormat.depth = visualInfo.depth; |
1406 |
+ |
visualFormat.Rmask = visualInfo.red_mask; |
1407 |
+ |
visualFormat.Gmask = visualInfo.green_mask; |
1408 |
+ |
visualFormat.Bmask = visualInfo.blue_mask; |
1409 |
+ |
|
1410 |
|
// Create color maps |
1411 |
|
if (color_class == PseudoColor || color_class == DirectColor) { |
1412 |
|
cmap[0] = XCreateColormap(x_display, rootwin, vis, AllocAll); |