625 |
|
class driver_window; |
626 |
|
static void update_display_window_vosf(driver_window *drv); |
627 |
|
static void update_display_dynamic(int ticker, driver_window *drv); |
628 |
< |
static void update_display_static(driver_window *drv); |
628 |
> |
static void update_display_static(driver_base *drv); |
629 |
|
|
630 |
|
class driver_window : public driver_base { |
631 |
|
friend void update_display_window_vosf(driver_window *drv); |
632 |
|
friend void update_display_dynamic(int ticker, driver_window *drv); |
633 |
< |
friend void update_display_static(driver_window *drv); |
633 |
> |
friend void update_display_static(driver_base *drv); |
634 |
|
|
635 |
|
public: |
636 |
|
driver_window(SDL_monitor_desc &monitor); |
1238 |
|
continue; |
1239 |
|
if (w == 512 && h == 384) |
1240 |
|
continue; |
1241 |
– |
#ifdef ENABLE_VOSF |
1241 |
|
for (int d = VIDEO_DEPTH_1BIT; d <= default_depth; d++) |
1242 |
|
add_mode(display_type, w, h, video_modes[i].resolution_id, TrivialBytesPerRow(w, (video_depth)d), d); |
1244 |
– |
#else |
1245 |
– |
add_mode(display_type, w, h, video_modes[i].resolution_id, TrivialBytesPerRow(w, (video_depth)default_depth), default_depth); |
1246 |
– |
#endif |
1243 |
|
} |
1244 |
|
} |
1245 |
|
|
1893 |
|
*/ |
1894 |
|
|
1895 |
|
// Static display update (fixed frame rate, but incremental) |
1896 |
< |
static void update_display_static(driver_window *drv) |
1896 |
> |
static void update_display_static(driver_base *drv) |
1897 |
|
{ |
1898 |
|
// Incremental update code |
1899 |
|
int wide = 0, high = 0, x1, x2, y1, y2, i, j; |
1982 |
|
|
1983 |
|
} else { |
1984 |
|
const int bytes_per_pixel = VIDEO_MODE_ROW_BYTES / VIDEO_MODE_X; |
1985 |
+ |
const int dst_bytes_per_row = drv->s->pitch; |
1986 |
|
|
1987 |
|
x1 = VIDEO_MODE_X; |
1988 |
|
for (j=y1; j<=y2; j++) { |
2023 |
|
// Blit to screen surface |
2024 |
|
for (j=y1; j<=y2; j++) { |
2025 |
|
i = j * bytes_per_row + x1 * bytes_per_pixel; |
2026 |
+ |
int dst_i = j * dst_bytes_per_row + x1 * bytes_per_pixel; |
2027 |
|
memcpy(the_buffer_copy + i, the_buffer + i, bytes_per_pixel * wide); |
2028 |
< |
Screen_blit((uint8 *)drv->s->pixels + i, the_buffer + i, bytes_per_pixel * wide); |
2028 |
> |
Screen_blit((uint8 *)drv->s->pixels + dst_i, the_buffer + i, bytes_per_pixel * wide); |
2029 |
|
} |
2030 |
|
|
2031 |
|
// Unlock surface, if required |
2041 |
|
|
2042 |
|
// Static display update (fixed frame rate, bounding boxes based) |
2043 |
|
// XXX use NQD bounding boxes to help detect dirty areas? |
2044 |
< |
static void update_display_static_bbox(driver_window *drv) |
2044 |
> |
static void update_display_static_bbox(driver_base *drv) |
2045 |
|
{ |
2046 |
|
const VIDEO_MODE &mode = drv->mode; |
2047 |
|
|
2059 |
|
// Update the surface from Mac screen |
2060 |
|
const int bytes_per_row = VIDEO_MODE_ROW_BYTES; |
2061 |
|
const int bytes_per_pixel = bytes_per_row / VIDEO_MODE_X; |
2062 |
+ |
const int dst_bytes_per_row = drv->s->pitch; |
2063 |
|
int x, y; |
2064 |
|
for (y = 0; y < VIDEO_MODE_Y; y += N_PIXELS) { |
2065 |
|
int h = N_PIXELS; |
2074 |
|
bool dirty = false; |
2075 |
|
for (int j = y; j < (y + h); j++) { |
2076 |
|
const int yb = j * bytes_per_row; |
2077 |
+ |
const int dst_yb = j * dst_bytes_per_row; |
2078 |
|
if (memcmp(&the_buffer[yb + xb], &the_buffer_copy[yb + xb], xs) != 0) { |
2079 |
|
memcpy(&the_buffer_copy[yb + xb], &the_buffer[yb + xb], xs); |
2080 |
< |
Screen_blit((uint8 *)drv->s->pixels + yb + xb, the_buffer + yb + xb, xs); |
2080 |
> |
Screen_blit((uint8 *)drv->s->pixels + dst_yb + xb, the_buffer + yb + xb, xs); |
2081 |
|
dirty = true; |
2082 |
|
} |
2083 |
|
} |
2141 |
|
UNLOCK_PALETTE; |
2142 |
|
} |
2143 |
|
|
2144 |
+ |
static void video_refresh_window_static(void); |
2145 |
+ |
|
2146 |
|
static void video_refresh_dga(void) |
2147 |
|
{ |
2148 |
|
// Quit DGA mode if requested |
2149 |
|
possibly_quit_dga_mode(); |
2150 |
+ |
video_refresh_window_static(); |
2151 |
|
} |
2152 |
|
|
2153 |
|
#ifdef ENABLE_VOSF |
2199 |
|
tick_counter = 0; |
2200 |
|
const VIDEO_MODE &mode = drv->mode; |
2201 |
|
if ((int)VIDEO_MODE_DEPTH >= VIDEO_DEPTH_8BIT) |
2202 |
< |
update_display_static_bbox(static_cast<driver_window *>(drv)); |
2202 |
> |
update_display_static_bbox(drv); |
2203 |
|
else |
2204 |
< |
update_display_static(static_cast<driver_window *>(drv)); |
2204 |
> |
update_display_static(drv); |
2205 |
|
} |
2206 |
|
} |
2207 |
|
|