Commit 550be12730cfe3c2374deed6189bad281f476ec7
1 parent
979b67ad
fixed refresh logic (initial patch by Igor Kovalenko)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2077 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
6 additions
and
6 deletions
hw/tcx.c
... | ... | @@ -31,7 +31,7 @@ typedef struct TCXState { |
31 | 31 | uint32_t addr; |
32 | 32 | DisplayState *ds; |
33 | 33 | uint8_t *vram; |
34 | - unsigned long vram_offset; | |
34 | + ram_addr_t vram_offset; | |
35 | 35 | uint16_t width, height; |
36 | 36 | uint8_t r[256], g[256], b[256]; |
37 | 37 | uint8_t dac_index, dac_state; |
... | ... | @@ -86,8 +86,8 @@ static void tcx_draw_line8(TCXState *s1, uint8_t *d, |
86 | 86 | static void tcx_update_display(void *opaque) |
87 | 87 | { |
88 | 88 | TCXState *ts = opaque; |
89 | - uint32_t page; | |
90 | - int y, page_min, page_max, y_start, dd, ds; | |
89 | + ram_addr_t page, page_min, page_max; | |
90 | + int y, y_start, dd, ds; | |
91 | 91 | uint8_t *d, *s; |
92 | 92 | void (*f)(TCXState *s1, uint8_t *d, const uint8_t *s, int width); |
93 | 93 | |
... | ... | @@ -95,8 +95,8 @@ static void tcx_update_display(void *opaque) |
95 | 95 | return; |
96 | 96 | page = ts->vram_offset; |
97 | 97 | y_start = -1; |
98 | - page_min = 0x7fffffff; | |
99 | - page_max = -1; | |
98 | + page_min = 0xffffffff; | |
99 | + page_max = 0; | |
100 | 100 | d = ts->ds->data; |
101 | 101 | s = ts->vram; |
102 | 102 | dd = ts->ds->linesize; |
... | ... | @@ -154,7 +154,7 @@ static void tcx_update_display(void *opaque) |
154 | 154 | ts->width, y - y_start); |
155 | 155 | } |
156 | 156 | /* reset modified pages */ |
157 | - if (page_max != -1) { | |
157 | + if (page_min <= page_max) { | |
158 | 158 | cpu_physical_memory_reset_dirty(page_min, page_max + TARGET_PAGE_SIZE, |
159 | 159 | VGA_DIRTY_FLAG); |
160 | 160 | } | ... | ... |