Sparc32: fix SDL zooming with TCX
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
24d904eab3
commit
d3ffcafe25
54
hw/tcx.c
54
hw/tcx.c
@ -49,8 +49,25 @@ typedef struct TCXState {
|
||||
|
||||
static void tcx_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)
|
||||
{
|
||||
@ -75,10 +92,11 @@ static void update_palette_entries(TCXState *s, int start, int end)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (s->depth == 24)
|
||||
tcx24_invalidate_display(s);
|
||||
else
|
||||
tcx_invalidate_display(s);
|
||||
if (s->depth == 24) {
|
||||
tcx24_set_dirty(s);
|
||||
} else {
|
||||
tcx_set_dirty(s);
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
TCXState *s = opaque;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAXX*MAXY; i += TARGET_PAGE_SIZE) {
|
||||
cpu_physical_memory_set_dirty(s->vram_offset + i);
|
||||
}
|
||||
tcx_set_dirty(s);
|
||||
qemu_console_resize(s->ds, s->width, s->height);
|
||||
}
|
||||
|
||||
static void tcx24_invalidate_display(void *opaque)
|
||||
{
|
||||
TCXState *s = opaque;
|
||||
int i;
|
||||
|
||||
tcx_invalidate_display(s);
|
||||
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);
|
||||
}
|
||||
tcx_set_dirty(s);
|
||||
tcx24_set_dirty(s);
|
||||
qemu_console_resize(s->ds, s->width, s->height);
|
||||
}
|
||||
|
||||
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_state);
|
||||
update_palette_entries(s, 0, 256);
|
||||
if (s->depth == 24)
|
||||
tcx24_invalidate_display(s);
|
||||
else
|
||||
tcx_invalidate_display(s);
|
||||
if (s->depth == 24) {
|
||||
tcx24_set_dirty(s);
|
||||
} else {
|
||||
tcx_set_dirty(s);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user