Commit 5467a722943adaa3d11e97656cf789586e31ee93
1 parent
1b8eb456
disabled S3 VGA
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@747 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
32 additions
and
22 deletions
hw/vga.c
@@ -30,7 +30,8 @@ | @@ -30,7 +30,8 @@ | ||
30 | //#define DEBUG_S3 | 30 | //#define DEBUG_S3 |
31 | //#define DEBUG_BOCHS_VBE | 31 | //#define DEBUG_BOCHS_VBE |
32 | 32 | ||
33 | -#define CONFIG_S3VGA | 33 | +/* S3 VGA is deprecated - another graphic card will be emulated */ |
34 | +//#define CONFIG_S3VGA | ||
34 | 35 | ||
35 | #define MSR_COLOR_EMULATION 0x01 | 36 | #define MSR_COLOR_EMULATION 0x01 |
36 | #define MSR_PAGE_SELECT 0x20 | 37 | #define MSR_PAGE_SELECT 0x20 |
@@ -335,7 +336,7 @@ static uint32_t vga_ioport_read(void *opaque, uint32_t addr) | @@ -335,7 +336,7 @@ static uint32_t vga_ioport_read(void *opaque, uint32_t addr) | ||
335 | static void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val) | 336 | static void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val) |
336 | { | 337 | { |
337 | VGAState *s = opaque; | 338 | VGAState *s = opaque; |
338 | - int index, v; | 339 | + int index; |
339 | 340 | ||
340 | /* check port range access depending on color/monochrome mode */ | 341 | /* check port range access depending on color/monochrome mode */ |
341 | if ((addr >= 0x3b0 && addr <= 0x3bf && (s->msr & MSR_COLOR_EMULATION)) || | 342 | if ((addr >= 0x3b0 && addr <= 0x3bf && (s->msr & MSR_COLOR_EMULATION)) || |
@@ -453,15 +454,21 @@ static void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val) | @@ -453,15 +454,21 @@ static void vga_ioport_write(void *opaque, uint32_t addr, uint32_t val) | ||
453 | break; | 454 | break; |
454 | case 0x31: | 455 | case 0x31: |
455 | /* update start address */ | 456 | /* update start address */ |
456 | - s->cr[s->cr_index] = val; | ||
457 | - v = (val >> 4) & 3; | ||
458 | - s->cr[0x69] = (s->cr[69] & ~0x03) | v; | 457 | + { |
458 | + int v; | ||
459 | + s->cr[s->cr_index] = val; | ||
460 | + v = (val >> 4) & 3; | ||
461 | + s->cr[0x69] = (s->cr[69] & ~0x03) | v; | ||
462 | + } | ||
459 | break; | 463 | break; |
460 | case 0x51: | 464 | case 0x51: |
461 | /* update start address */ | 465 | /* update start address */ |
462 | - s->cr[s->cr_index] = val; | ||
463 | - v = val & 3; | ||
464 | - s->cr[0x69] = (s->cr[69] & ~0x0c) | (v << 2); | 466 | + { |
467 | + int v; | ||
468 | + s->cr[s->cr_index] = val; | ||
469 | + v = val & 3; | ||
470 | + s->cr[0x69] = (s->cr[69] & ~0x0c) | (v << 2); | ||
471 | + } | ||
465 | break; | 472 | break; |
466 | #endif | 473 | #endif |
467 | default: | 474 | default: |
@@ -716,7 +723,7 @@ static uint32_t vga_mem_readl(uint32_t addr) | @@ -716,7 +723,7 @@ static uint32_t vga_mem_readl(uint32_t addr) | ||
716 | } | 723 | } |
717 | 724 | ||
718 | /* called for accesses between 0xa0000 and 0xc0000 */ | 725 | /* called for accesses between 0xa0000 and 0xc0000 */ |
719 | -static void vga_mem_writeb(uint32_t addr, uint32_t val, uint32_t vaddr) | 726 | +static void vga_mem_writeb(uint32_t addr, uint32_t val) |
720 | { | 727 | { |
721 | VGAState *s = &vga_state; | 728 | VGAState *s = &vga_state; |
722 | int memory_map_mode, plane, write_mode, b, func_select; | 729 | int memory_map_mode, plane, write_mode, b, func_select; |
@@ -844,18 +851,18 @@ static void vga_mem_writeb(uint32_t addr, uint32_t val, uint32_t vaddr) | @@ -844,18 +851,18 @@ static void vga_mem_writeb(uint32_t addr, uint32_t val, uint32_t vaddr) | ||
844 | } | 851 | } |
845 | } | 852 | } |
846 | 853 | ||
847 | -static void vga_mem_writew(uint32_t addr, uint32_t val, uint32_t vaddr) | 854 | +static void vga_mem_writew(uint32_t addr, uint32_t val) |
848 | { | 855 | { |
849 | - vga_mem_writeb(addr, val & 0xff, vaddr); | ||
850 | - vga_mem_writeb(addr + 1, (val >> 8) & 0xff, vaddr); | 856 | + vga_mem_writeb(addr, val & 0xff); |
857 | + vga_mem_writeb(addr + 1, (val >> 8) & 0xff); | ||
851 | } | 858 | } |
852 | 859 | ||
853 | -static void vga_mem_writel(uint32_t addr, uint32_t val, uint32_t vaddr) | 860 | +static void vga_mem_writel(uint32_t addr, uint32_t val) |
854 | { | 861 | { |
855 | - vga_mem_writeb(addr, val & 0xff, vaddr); | ||
856 | - vga_mem_writeb(addr + 1, (val >> 8) & 0xff, vaddr); | ||
857 | - vga_mem_writeb(addr + 2, (val >> 16) & 0xff, vaddr); | ||
858 | - vga_mem_writeb(addr + 3, (val >> 24) & 0xff, vaddr); | 862 | + vga_mem_writeb(addr, val & 0xff); |
863 | + vga_mem_writeb(addr + 1, (val >> 8) & 0xff); | ||
864 | + vga_mem_writeb(addr + 2, (val >> 16) & 0xff); | ||
865 | + vga_mem_writeb(addr + 3, (val >> 24) & 0xff); | ||
859 | } | 866 | } |
860 | 867 | ||
861 | typedef void vga_draw_glyph8_func(uint8_t *d, int linesize, | 868 | typedef void vga_draw_glyph8_func(uint8_t *d, int linesize, |
@@ -992,7 +999,7 @@ static int update_palette256(VGAState *s) | @@ -992,7 +999,7 @@ static int update_palette256(VGAState *s) | ||
992 | static int update_basic_params(VGAState *s) | 999 | static int update_basic_params(VGAState *s) |
993 | { | 1000 | { |
994 | int full_update; | 1001 | int full_update; |
995 | - uint32_t start_addr, line_offset, line_compare, v; | 1002 | + uint32_t start_addr, line_offset, line_compare; |
996 | 1003 | ||
997 | full_update = 0; | 1004 | full_update = 0; |
998 | 1005 | ||
@@ -1006,10 +1013,13 @@ static int update_basic_params(VGAState *s) | @@ -1006,10 +1013,13 @@ static int update_basic_params(VGAState *s) | ||
1006 | /* compute line_offset in bytes */ | 1013 | /* compute line_offset in bytes */ |
1007 | line_offset = s->cr[0x13]; | 1014 | line_offset = s->cr[0x13]; |
1008 | #ifdef CONFIG_S3VGA | 1015 | #ifdef CONFIG_S3VGA |
1009 | - v = (s->cr[0x51] >> 4) & 3; /* S3 extension */ | ||
1010 | - if (v == 0) | ||
1011 | - v = (s->cr[0x43] >> 2) & 1; /* S3 extension */ | ||
1012 | - line_offset |= (v << 8); | 1016 | + { |
1017 | + uinr32_t v; | ||
1018 | + v = (s->cr[0x51] >> 4) & 3; /* S3 extension */ | ||
1019 | + if (v == 0) | ||
1020 | + v = (s->cr[0x43] >> 2) & 1; /* S3 extension */ | ||
1021 | + line_offset |= (v << 8); | ||
1022 | + } | ||
1013 | #endif | 1023 | #endif |
1014 | line_offset <<= 3; | 1024 | line_offset <<= 3; |
1015 | 1025 |