127 |
|
const int y2 = mainBuffer.pageInfo[page - 1].bottom; |
128 |
|
const int height = y2 - y1 + 1; |
129 |
|
|
130 |
< |
const int bytes_per_row = VideoMonitor.bytes_per_row; |
131 |
< |
const int bytes_per_pixel = VideoMonitor.bytes_per_row / VideoMonitor.x; |
130 |
> |
const int bytes_per_row = VideoMonitor.mode.bytes_per_row; |
131 |
> |
const int bytes_per_pixel = VideoMonitor.mode.bytes_per_row / VideoMonitor.mode.x; |
132 |
|
int i = y1 * bytes_per_row, j; |
133 |
|
|
134 |
|
if (depth == 1) { |
135 |
|
|
136 |
|
// Update the_host_buffer and copy of the_buffer |
137 |
|
for (j = y1; j <= y2; j++) { |
138 |
< |
Screen_blit(the_host_buffer + i, the_buffer + i, VideoMonitor.x >> 3); |
138 |
> |
Screen_blit(the_host_buffer + i, the_buffer + i, VideoMonitor.mode.x >> 3); |
139 |
|
i += bytes_per_row; |
140 |
|
} |
141 |
|
|
143 |
|
|
144 |
|
// Update the_host_buffer and copy of the_buffer |
145 |
|
for (j = y1; j <= y2; j++) { |
146 |
< |
Screen_blit(the_host_buffer + i, the_buffer + i, bytes_per_pixel * VideoMonitor.x); |
146 |
> |
Screen_blit(the_host_buffer + i, the_buffer + i, bytes_per_pixel * VideoMonitor.mode.x); |
147 |
|
i += bytes_per_row; |
148 |
|
} |
149 |
|
} |
150 |
|
|
151 |
|
if (have_shm) |
152 |
< |
XShmPutImage(x_display, the_win, the_gc, img, 0, y1, 0, y1, VideoMonitor.x, height, 0); |
152 |
> |
XShmPutImage(x_display, the_win, the_gc, img, 0, y1, 0, y1, VideoMonitor.mode.x, height, 0); |
153 |
|
else |
154 |
< |
XPutImage(x_display, the_win, the_gc, img, 0, y1, 0, y1, VideoMonitor.x, height); |
154 |
> |
XPutImage(x_display, the_win, the_gc, img, 0, y1, 0, y1, VideoMonitor.mode.x, height); |
155 |
|
} |
156 |
|
|
157 |
|
mainBuffer.dirty = false; |
184 |
|
const int y1 = mainBuffer.pageInfo[first_page].top; |
185 |
|
const int y2 = mainBuffer.pageInfo[page - 1].bottom; |
186 |
|
|
187 |
< |
const int bytes_per_row = VideoMonitor.bytes_per_row; |
188 |
< |
const int bytes_per_pixel = VideoMonitor.bytes_per_row / VideoMonitor.x; |
187 |
> |
const int bytes_per_row = VideoMonitor.mode.bytes_per_row; |
188 |
> |
const int bytes_per_pixel = VideoMonitor.mode.bytes_per_row / VideoMonitor.mode.x; |
189 |
|
int i, j; |
190 |
|
|
191 |
|
// Check for first column from left and first column |
192 |
|
// from right that have changed |
193 |
< |
int x1 = VideoMonitor.x * bytes_per_pixel - 1; |
193 |
> |
int x1 = VideoMonitor.mode.x * bytes_per_pixel - 1; |
194 |
|
for (j = y1; j <= y2; j++) { |
195 |
|
uint8 * const p1 = &the_buffer[j * bytes_per_row]; |
196 |
|
uint8 * const p2 = &the_buffer_copy[j * bytes_per_row]; |
207 |
|
for (j = y2; j >= y1; j--) { |
208 |
|
uint8 * const p1 = &the_buffer[j * bytes_per_row]; |
209 |
|
uint8 * const p2 = &the_buffer_copy[j * bytes_per_row]; |
210 |
< |
for (i = VideoMonitor.x * bytes_per_pixel - 1; i > x2; i--) { |
210 |
> |
for (i = VideoMonitor.mode.x * bytes_per_pixel - 1; i > x2; i--) { |
211 |
|
if (p1[i] != p2[i]) { |
212 |
|
x2 = i; |
213 |
|
break; |