ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Unix/video_x.cpp
(Generate patch)

Comparing BasiliskII/src/Unix/video_x.cpp (file contents):
Revision 1.69 by gbeauche, 2003-05-22T22:13:56Z vs.
Revision 1.72 by gbeauche, 2004-11-08T21:07:07Z

# Line 1 | Line 1
1   /*
2   *  video_x.cpp - Video/graphics emulation, X11 specific stuff
3   *
4 < *  Basilisk II (C) 1997-2002 Christian Bauer
4 > *  Basilisk II (C) 1997-2004 Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 62 | Line 62
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"
# Line 122 | Line 123 | static bool use_keycodes = false;                                      //
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
# Line 131 | Line 134 | static unsigned long black_pixel, white_
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;
# Line 188 | Line 192 | static void *redraw_func(void *arg);
192   // From main_unix.cpp
193   extern char *x_display_name;
194   extern Display *x_display;
195 + extern void *vm_acquire_mac(size_t size);
196  
197   // From sys_unix.cpp
198   extern void SysMountFirstFloppy(void);
# Line 726 | Line 731 | driver_window::driver_window(X11_monitor
731          // Allocate memory for frame buffer (SIZE is extended to page-boundary)
732          the_host_buffer = the_buffer_copy;
733          the_buffer_size = page_extend((aligned_height + 2) * img->bytes_per_line);
734 <        the_buffer = (uint8 *)vm_acquire(the_buffer_size);
734 >        the_buffer = (uint8 *)vm_acquire_mac(the_buffer_size);
735          the_buffer_copy = (uint8 *)malloc(the_buffer_size);
736          D(bug("the_buffer = %p, the_buffer_copy = %p, the_host_buffer = %p\n", the_buffer, the_buffer_copy, the_host_buffer));
737   #else
# Line 754 | Line 759 | driver_window::driver_window(X11_monitor
759          native_byte_order = (XImageByteOrder(x_display) == LSBFirst);
760   #endif
761   #ifdef ENABLE_VOSF
762 <        Screen_blitter_init(&visualInfo, native_byte_order, depth_of_video_mode(mode));
762 >        Screen_blitter_init(visualFormat, native_byte_order, depth_of_video_mode(mode));
763   #endif
764  
765          // Set frame buffer base
# Line 1115 | Line 1120 | driver_fbdev::driver_fbdev(X11_monitor_d
1120   #if REAL_ADDRESSING || DIRECT_ADDRESSING
1121          // Screen_blitter_init() returns TRUE if VOSF is mandatory
1122          // i.e. the framebuffer update function is not Blit_Copy_Raw
1123 <        use_vosf = Screen_blitter_init(&visualInfo, true, mode.depth);
1123 >        use_vosf = Screen_blitter_init(visualFormat, true, mode.depth);
1124          
1125          if (use_vosf) {
1126            // Allocate memory for frame buffer (SIZE is extended to page-boundary)
1127            the_host_buffer = the_buffer;
1128            the_buffer_size = page_extend((height + 2) * bytes_per_row);
1129            the_buffer_copy = (uint8 *)malloc(the_buffer_size);
1130 <          the_buffer = (uint8 *)vm_acquire(the_buffer_size);
1130 >          the_buffer = (uint8 *)vm_acquire_mac(the_buffer_size);
1131          }
1132   #else
1133          use_vosf = false;
# Line 1255 | Line 1260 | driver_xf86dga::driver_xf86dga(X11_monit
1260   #if REAL_ADDRESSING || DIRECT_ADDRESSING
1261          // Screen_blitter_init() returns TRUE if VOSF is mandatory
1262          // i.e. the framebuffer update function is not Blit_Copy_Raw
1263 <        use_vosf = Screen_blitter_init(&visualInfo, native_byte_order, depth_of_video_mode(mode));
1263 >        use_vosf = Screen_blitter_init(visualFormat, native_byte_order, depth_of_video_mode(mode));
1264          
1265          if (use_vosf) {
1266            // Allocate memory for frame buffer (SIZE is extended to page-boundary)
1267            the_host_buffer = the_buffer;
1268            the_buffer_size = page_extend((height + 2) * bytes_per_row);
1269            the_buffer_copy = (uint8 *)malloc(the_buffer_size);
1270 <          the_buffer = (uint8 *)vm_acquire(the_buffer_size);
1270 >          the_buffer = (uint8 *)vm_acquire_mac(the_buffer_size);
1271          }
1272   #else
1273          use_vosf = false;
# Line 1397 | Line 1402 | bool X11_monitor_desc::video_open(void)
1402                  return false;
1403          }
1404  
1405 +        // Build up visualFormat structure
1406 +        visualFormat.depth = visualInfo.depth;
1407 +        visualFormat.Rmask = visualInfo.red_mask;
1408 +        visualFormat.Gmask = visualInfo.green_mask;
1409 +        visualFormat.Bmask = visualInfo.blue_mask;
1410 +
1411          // Create color maps
1412          if (color_class == PseudoColor || color_class == DirectColor) {
1413                  cmap[0] = XCreateColormap(x_display, rootwin, vis, AllocAll);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines