Sparc32: fix SDL zooming with TCX

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
Blue Swirl 2009-07-16 13:45:57 +00:00
parent 24d904eab3
commit d3ffcafe25

View File

@ -49,8 +49,25 @@ typedef struct TCXState {
static void tcx_screen_dump(void *opaque, const char *filename); static void tcx_screen_dump(void *opaque, const char *filename);
static void tcx24_screen_dump(void *opaque, const char *filename); static void tcx24_screen_dump(void *opaque, const char *filename);
static void tcx_invalidate_display(void *opaque);
static void tcx24_invalidate_display(void *opaque); static void tcx_set_dirty(TCXState *s)
{
unsigned int i;
for (i = 0; i < MAXX * MAXY; i += TARGET_PAGE_SIZE) {
cpu_physical_memory_set_dirty(s->vram_offset + i);
}
}
static void tcx24_set_dirty(TCXState *s)
{
unsigned int i;
for (i = 0; i < MAXX * MAXY * 4; i += TARGET_PAGE_SIZE) {
cpu_physical_memory_set_dirty(s->vram24_offset + i);
cpu_physical_memory_set_dirty(s->cplane_offset + i);
}
}
static void update_palette_entries(TCXState *s, int start, int end) static void update_palette_entries(TCXState *s, int start, int end)
{ {
@ -75,10 +92,11 @@ static void update_palette_entries(TCXState *s, int start, int end)
break; break;
} }
} }
if (s->depth == 24) if (s->depth == 24) {
tcx24_invalidate_display(s); tcx24_set_dirty(s);
else } else {
tcx_invalidate_display(s); tcx_set_dirty(s);
}
} }
static void tcx_draw_line32(TCXState *s1, uint8_t *d, static void tcx_draw_line32(TCXState *s1, uint8_t *d,
@ -344,23 +362,18 @@ static void tcx24_update_display(void *opaque)
static void tcx_invalidate_display(void *opaque) static void tcx_invalidate_display(void *opaque)
{ {
TCXState *s = opaque; TCXState *s = opaque;
int i;
for (i = 0; i < MAXX*MAXY; i += TARGET_PAGE_SIZE) { tcx_set_dirty(s);
cpu_physical_memory_set_dirty(s->vram_offset + i); qemu_console_resize(s->ds, s->width, s->height);
}
} }
static void tcx24_invalidate_display(void *opaque) static void tcx24_invalidate_display(void *opaque)
{ {
TCXState *s = opaque; TCXState *s = opaque;
int i;
tcx_invalidate_display(s); tcx_set_dirty(s);
for (i = 0; i < MAXX*MAXY * 4; i += TARGET_PAGE_SIZE) { tcx24_set_dirty(s);
cpu_physical_memory_set_dirty(s->vram24_offset + i); qemu_console_resize(s->ds, s->width, s->height);
cpu_physical_memory_set_dirty(s->cplane_offset + i);
}
} }
static void tcx_save(QEMUFile *f, void *opaque) static void tcx_save(QEMUFile *f, void *opaque)
@ -399,10 +412,11 @@ static int tcx_load(QEMUFile *f, void *opaque, int version_id)
qemu_get_8s(f, &s->dac_index); qemu_get_8s(f, &s->dac_index);
qemu_get_8s(f, &s->dac_state); qemu_get_8s(f, &s->dac_state);
update_palette_entries(s, 0, 256); update_palette_entries(s, 0, 256);
if (s->depth == 24) if (s->depth == 24) {
tcx24_invalidate_display(s); tcx24_set_dirty(s);
else } else {
tcx_invalidate_display(s); tcx_set_dirty(s);
}
return 0; return 0;
} }