Revision c60e08d9 hw/musicpal.c
b/hw/musicpal.c | ||
---|---|---|
758 | 758 |
int page; |
759 | 759 |
int page_off; |
760 | 760 |
DisplayState *ds; |
761 |
QEMUConsole *console; |
|
761 | 762 |
uint8_t video_ram[128*64/8]; |
762 |
int invalidate; |
|
763 | 763 |
} musicpal_lcd_state; |
764 | 764 |
|
765 | 765 |
static uint32_t lcd_brightness; |
... | ... | |
818 | 818 |
musicpal_lcd_state *s = opaque; |
819 | 819 |
int x, y, col; |
820 | 820 |
|
821 |
if (s->invalidate && (s->ds->width != 128*3 || s->ds->height != 64*3)) { |
|
822 |
dpy_resize(s->ds, 128*3, 64*3); |
|
823 |
s->invalidate = 0; |
|
824 |
} |
|
825 |
|
|
826 | 821 |
switch (s->ds->depth) { |
827 | 822 |
case 0: |
828 | 823 |
return; |
... | ... | |
851 | 846 |
|
852 | 847 |
static void lcd_invalidate(void *opaque) |
853 | 848 |
{ |
854 |
musicpal_lcd_state *s = opaque; |
|
855 |
|
|
856 |
s->invalidate = 1; |
|
857 | 849 |
} |
858 | 850 |
|
859 | 851 |
static uint32_t musicpal_lcd_read(void *opaque, target_phys_addr_t offset) |
... | ... | |
932 | 924 |
return; |
933 | 925 |
s->base = base; |
934 | 926 |
s->ds = ds; |
935 |
s->invalidate = 1; |
|
936 | 927 |
iomemtype = cpu_register_io_memory(0, musicpal_lcd_readfn, |
937 | 928 |
musicpal_lcd_writefn, s); |
938 | 929 |
cpu_register_physical_memory(base, MP_LCD_SIZE, iomemtype); |
939 | 930 |
|
940 |
graphic_console_init(ds, lcd_refresh, lcd_invalidate, NULL, NULL, s); |
|
931 |
s->console = graphic_console_init(ds, lcd_refresh, lcd_invalidate, |
|
932 |
NULL, NULL, s); |
|
933 |
qemu_console_resize(s->console, 128*3, 64*3); |
|
941 | 934 |
} |
942 | 935 |
|
943 | 936 |
/* PIC register offsets */ |
Also available in: Unified diff