Commit f87fc09b15bb73874b812ab82e96105ef6c7a2ba
1 parent
2d6f8971
Fix dots per clock value, cleanup and "optimize"
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5338 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
9 additions
and
10 deletions
hw/vga.c
... | ... | @@ -192,7 +192,7 @@ static void vga_precise_update_retrace_info(VGAState *s) |
192 | 192 | |
193 | 193 | clocking_mode = (s->sr[0x01] >> 3) & 1; |
194 | 194 | clock_sel = (s->msr >> 2) & 3; |
195 | - dots = (s->msr & 1) ? 9 : 8; | |
195 | + dots = (s->msr & 1) ? 8 : 9; | |
196 | 196 | |
197 | 197 | chars_per_sec = hz[clock_sel] / dots; |
198 | 198 | |
... | ... | @@ -213,12 +213,10 @@ static void vga_precise_update_retrace_info(VGAState *s) |
213 | 213 | r->hend = r->hstart + hretr_end_char + 1; |
214 | 214 | r->htotal = htotal_chars; |
215 | 215 | |
216 | +#if 0 | |
216 | 217 | printf("hz=%f\n", |
217 | - (double) ticks_per_sec / (r->ticks_per_char * r->total_chars)); | |
218 | -#if 0 /* def DEBUG_RETRACE */ | |
219 | - printf("hz=%f\n", | |
220 | - (double) ticks_per_sec / (r->ticks_per_char * r->total_chars)); | |
221 | 218 | printf ( |
219 | + "hz=%f\n" | |
222 | 220 | "htotal = %d\n" |
223 | 221 | "hretr_start = %d\n" |
224 | 222 | "hretr_skew = %d\n" |
... | ... | @@ -232,6 +230,7 @@ static void vga_precise_update_retrace_info(VGAState *s) |
232 | 230 | "dots = %d\n" |
233 | 231 | "ticks/char = %lld\n" |
234 | 232 | "\n", |
233 | + (double) ticks_per_sec / (r->ticks_per_char * r->total_chars), | |
235 | 234 | htotal_chars, |
236 | 235 | hretr_start_char, |
237 | 236 | hretr_skew_chars, |
... | ... | @@ -265,11 +264,11 @@ static uint8_t vga_precise_retrace(VGAState *s) |
265 | 264 | |
266 | 265 | if (cur_line >= r->vstart && cur_line <= r->vend) { |
267 | 266 | val |= ST01_V_RETRACE | ST01_DISP_ENABLE; |
268 | - } | |
269 | - | |
270 | - cur_line_char = cur_char % r->htotal; | |
271 | - if (cur_line_char >= r->hstart && cur_line_char <= r->hend) { | |
272 | - val |= ST01_DISP_ENABLE; | |
267 | + } else { | |
268 | + cur_line_char = cur_char % r->htotal; | |
269 | + if (cur_line_char >= r->hstart && cur_line_char <= r->hend) { | |
270 | + val |= ST01_DISP_ENABLE; | |
271 | + } | |
273 | 272 | } |
274 | 273 | |
275 | 274 | return val; | ... | ... |