Commit 97e7df27cfed973532d125125c9152ddffadbf64

Authored by blueswir1
1 parent 92b72cbc

Force display update on palette change or loadvm


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2915 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 10 additions and 1 deletions
hw/tcx.c
@@ -44,6 +44,8 @@ typedef struct TCXState { @@ -44,6 +44,8 @@ typedef struct TCXState {
44 44
45 static void tcx_screen_dump(void *opaque, const char *filename); 45 static void tcx_screen_dump(void *opaque, const char *filename);
46 static void tcx24_screen_dump(void *opaque, const char *filename); 46 static void tcx24_screen_dump(void *opaque, const char *filename);
  47 +static void tcx_invalidate_display(void *opaque);
  48 +static void tcx24_invalidate_display(void *opaque);
47 49
48 /* XXX: unify with vga draw line functions */ 50 /* XXX: unify with vga draw line functions */
49 static inline unsigned int rgb_to_pixel8(unsigned int r, unsigned int g, unsigned b) 51 static inline unsigned int rgb_to_pixel8(unsigned int r, unsigned int g, unsigned b)
@@ -86,6 +88,10 @@ static void update_palette_entries(TCXState *s, int start, int end) @@ -86,6 +88,10 @@ static void update_palette_entries(TCXState *s, int start, int end)
86 break; 88 break;
87 } 89 }
88 } 90 }
  91 + if (s->depth == 24)
  92 + tcx24_invalidate_display(s);
  93 + else
  94 + tcx_invalidate_display(s);
89 } 95 }
90 96
91 static void tcx_draw_line32(TCXState *s1, uint8_t *d, 97 static void tcx_draw_line32(TCXState *s1, uint8_t *d,
@@ -391,7 +397,10 @@ static int tcx_load(QEMUFile *f, void *opaque, int version_id) @@ -391,7 +397,10 @@ static int tcx_load(QEMUFile *f, void *opaque, int version_id)
391 qemu_get_8s(f, &s->dac_index); 397 qemu_get_8s(f, &s->dac_index);
392 qemu_get_8s(f, &s->dac_state); 398 qemu_get_8s(f, &s->dac_state);
393 update_palette_entries(s, 0, 256); 399 update_palette_entries(s, 0, 256);
394 - tcx_invalidate_display(s); 400 + if (s->depth == 24)
  401 + tcx24_invalidate_display(s);
  402 + else
  403 + tcx_invalidate_display(s);
395 404
396 return 0; 405 return 0;
397 } 406 }