diff options
author | malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-09-28 02:43:18 +0000 |
---|---|---|
committer | malc <malc@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-09-28 02:43:18 +0000 |
commit | f87fc09b15bb73874b812ab82e96105ef6c7a2ba (patch) | |
tree | bfe3b0c544b445762614e89760073bd62602d502 /hw/vga.c | |
parent | 2d6f89714186bc51d20d34641bf4ab5a726ab54a (diff) | |
download | qemu-f87fc09b15bb73874b812ab82e96105ef6c7a2ba.tar.gz qemu-f87fc09b15bb73874b812ab82e96105ef6c7a2ba.tar.bz2 qemu-f87fc09b15bb73874b812ab82e96105ef6c7a2ba.zip |
Fix dots per clock value, cleanup and "optimize"
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5338 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/vga.c')
-rw-r--r-- | hw/vga.c | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -192,7 +192,7 @@ static void vga_precise_update_retrace_info(VGAState *s) clocking_mode = (s->sr[0x01] >> 3) & 1; clock_sel = (s->msr >> 2) & 3; - dots = (s->msr & 1) ? 9 : 8; + dots = (s->msr & 1) ? 8 : 9; chars_per_sec = hz[clock_sel] / dots; @@ -213,12 +213,10 @@ static void vga_precise_update_retrace_info(VGAState *s) r->hend = r->hstart + hretr_end_char + 1; r->htotal = htotal_chars; +#if 0 printf("hz=%f\n", - (double) ticks_per_sec / (r->ticks_per_char * r->total_chars)); -#if 0 /* def DEBUG_RETRACE */ - printf("hz=%f\n", - (double) ticks_per_sec / (r->ticks_per_char * r->total_chars)); printf ( + "hz=%f\n" "htotal = %d\n" "hretr_start = %d\n" "hretr_skew = %d\n" @@ -232,6 +230,7 @@ static void vga_precise_update_retrace_info(VGAState *s) "dots = %d\n" "ticks/char = %lld\n" "\n", + (double) ticks_per_sec / (r->ticks_per_char * r->total_chars), htotal_chars, hretr_start_char, hretr_skew_chars, @@ -265,11 +264,11 @@ static uint8_t vga_precise_retrace(VGAState *s) if (cur_line >= r->vstart && cur_line <= r->vend) { val |= ST01_V_RETRACE | ST01_DISP_ENABLE; - } - - cur_line_char = cur_char % r->htotal; - if (cur_line_char >= r->hstart && cur_line_char <= r->hend) { - val |= ST01_DISP_ENABLE; + } else { + cur_line_char = cur_char % r->htotal; + if (cur_line_char >= r->hstart && cur_line_char <= r->hend) { + val |= ST01_DISP_ENABLE; + } } return val; |