Commit 550be127 authored by bellard's avatar bellard
Browse files

fixed refresh logic (initial patch by Igor Kovalenko)


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2077 c046a42c-6fe2-441c-8c8c-71466251a162
parent 979b67ad
...@@ -31,7 +31,7 @@ typedef struct TCXState { ...@@ -31,7 +31,7 @@ typedef struct TCXState {
uint32_t addr; uint32_t addr;
DisplayState *ds; DisplayState *ds;
uint8_t *vram; uint8_t *vram;
unsigned long vram_offset; ram_addr_t vram_offset;
uint16_t width, height; uint16_t width, height;
uint8_t r[256], g[256], b[256]; uint8_t r[256], g[256], b[256];
uint8_t dac_index, dac_state; uint8_t dac_index, dac_state;
...@@ -86,8 +86,8 @@ static void tcx_draw_line8(TCXState *s1, uint8_t *d, ...@@ -86,8 +86,8 @@ static void tcx_draw_line8(TCXState *s1, uint8_t *d,
static void tcx_update_display(void *opaque) static void tcx_update_display(void *opaque)
{ {
TCXState *ts = opaque; TCXState *ts = opaque;
uint32_t page; ram_addr_t page, page_min, page_max;
int y, page_min, page_max, y_start, dd, ds; int y, y_start, dd, ds;
uint8_t *d, *s; uint8_t *d, *s;
void (*f)(TCXState *s1, uint8_t *d, const uint8_t *s, int width); void (*f)(TCXState *s1, uint8_t *d, const uint8_t *s, int width);
...@@ -95,8 +95,8 @@ static void tcx_update_display(void *opaque) ...@@ -95,8 +95,8 @@ static void tcx_update_display(void *opaque)
return; return;
page = ts->vram_offset; page = ts->vram_offset;
y_start = -1; y_start = -1;
page_min = 0x7fffffff; page_min = 0xffffffff;
page_max = -1; page_max = 0;
d = ts->ds->data; d = ts->ds->data;
s = ts->vram; s = ts->vram;
dd = ts->ds->linesize; dd = ts->ds->linesize;
...@@ -154,7 +154,7 @@ static void tcx_update_display(void *opaque) ...@@ -154,7 +154,7 @@ static void tcx_update_display(void *opaque)
ts->width, y - y_start); ts->width, y - y_start);
} }
/* reset modified pages */ /* reset modified pages */
if (page_max != -1) { if (page_min <= page_max) {
cpu_physical_memory_reset_dirty(page_min, page_max + TARGET_PAGE_SIZE, cpu_physical_memory_reset_dirty(page_min, page_max + TARGET_PAGE_SIZE,
VGA_DIRTY_FLAG); VGA_DIRTY_FLAG);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment