aboutsummaryrefslogtreecommitdiff
path: root/hw/sm501.c
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2011-01-21 17:56:32 +0100
committerAurelien Jarno <aurelien@aurel32.net>2011-01-21 17:56:32 +0100
commit543c4c94cf235d11315157bab25a24f7d9a48711 (patch)
tree2204870d38f6a322c25ee65fd27e129dfaf61195 /hw/sm501.c
parentb646968336d4180bdd7d2e24209708dcee6ba400 (diff)
sm501: fix screen redraw
Due to signed/unsigned comparison, the dirty bits are never reset, and the screen redrawn each time. Fix that by only using ram_addr_t types, and looking for page_min != addr_max instead. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'hw/sm501.c')
-rw-r--r--hw/sm501.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/hw/sm501.c b/hw/sm501.c
index 388fc085be..0f0bf96609 100644
--- a/hw/sm501.c
+++ b/hw/sm501.c
@@ -1274,8 +1274,8 @@ static void sm501_draw_crt(SM501State * s)
draw_hwc_line_func * draw_hwc_line = NULL;
int full_update = 0;
int y_start = -1;
- int page_min = 0x7fffffff;
- int page_max = -1;
+ ram_addr_t page_min = ~0l;
+ ram_addr_t page_max = 0l;
ram_addr_t offset = s->local_mem_offset;
/* choose draw_line function */
@@ -1371,9 +1371,10 @@ static void sm501_draw_crt(SM501State * s)
dpy_update(s->ds, 0, y_start, width, y - y_start);
/* clear dirty flags */
- if (page_max != -1)
+ if (page_min != ~0l) {
cpu_physical_memory_reset_dirty(page_min, page_max + TARGET_PAGE_SIZE,
VGA_DIRTY_FLAG);
+ }
}
static void sm501_update_display(void *opaque)