From 26f69dc09fa3c459fca53bbfd267cbfc2682201e Mon Sep 17 00:00:00 2001 From: bellard Date: Sat, 25 Mar 2006 01:25:02 +0000 Subject: upgrade to latest vgabios version - added Video Parameter Table support - added 1600x1200x8 Cirrus mode git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1789 c046a42c-6fe2-441c-8c8c-71466251a162 --- pc-bios/vgabios-cirrus.bin | Bin 32768 -> 32768 bytes pc-bios/vgabios.bin | Bin 32768 -> 32768 bytes pc-bios/vgabios.diff | 864 +++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 789 insertions(+), 75 deletions(-) (limited to 'pc-bios') diff --git a/pc-bios/vgabios-cirrus.bin b/pc-bios/vgabios-cirrus.bin index 4978e42cd8..6f72d1ebd3 100644 Binary files a/pc-bios/vgabios-cirrus.bin and b/pc-bios/vgabios-cirrus.bin differ diff --git a/pc-bios/vgabios.bin b/pc-bios/vgabios.bin index 072f8bd2bb..1d6e511759 100644 Binary files a/pc-bios/vgabios.bin and b/pc-bios/vgabios.bin differ diff --git a/pc-bios/vgabios.diff b/pc-bios/vgabios.diff index d3a3ef7a2a..73159a0fd0 100644 --- a/pc-bios/vgabios.diff +++ b/pc-bios/vgabios.diff @@ -1,97 +1,811 @@ -? biossums -? vgabios.cirrus.debug.txt -? vgabios.cirrus.txt -? vgabios.debug.txt -? vgabios.txt -? tests/Makefile -? tests/setmode.S -? tests/setmode.c -? tests/setmode.com -? tests/setmode.elf Index: Makefile =================================================================== -RCS file: /cvsroot/vgabios/vgabios/Makefile,v -retrieving revision 1.15 -diff -u -w -r1.15 Makefile -Index: VGABIOS-lgpl-latest.bin -=================================================================== -RCS file: /cvsroot/vgabios/vgabios/VGABIOS-lgpl-latest.bin,v -retrieving revision 1.60 -diff -u -w -r1.60 VGABIOS-lgpl-latest.bin -Binary files /tmp/cvsCahrMA and VGABIOS-lgpl-latest.bin differ -Index: VGABIOS-lgpl-latest.cirrus.bin -=================================================================== -RCS file: /cvsroot/vgabios/vgabios/VGABIOS-lgpl-latest.cirrus.bin,v -retrieving revision 1.12 -diff -u -w -r1.12 VGABIOS-lgpl-latest.cirrus.bin -Binary files /tmp/cvsewygNU and VGABIOS-lgpl-latest.cirrus.bin differ -Index: VGABIOS-lgpl-latest.cirrus.debug.bin -=================================================================== -RCS file: /cvsroot/vgabios/vgabios/VGABIOS-lgpl-latest.cirrus.debug.bin,v -retrieving revision 1.12 -diff -u -w -r1.12 VGABIOS-lgpl-latest.cirrus.debug.bin -Binary files /tmp/cvsey9TQf and VGABIOS-lgpl-latest.cirrus.debug.bin differ -Index: VGABIOS-lgpl-latest.debug.bin -=================================================================== -RCS file: /cvsroot/vgabios/vgabios/VGABIOS-lgpl-latest.debug.bin,v -retrieving revision 1.60 -diff -u -w -r1.60 VGABIOS-lgpl-latest.debug.bin -Binary files /tmp/cvskxbTbC and VGABIOS-lgpl-latest.debug.bin differ +RCS file: /sources/vgabios/vgabios/Makefile,v +retrieving revision 1.17 +diff -u -w -r1.17 Makefile +--- Makefile 6 Mar 2005 13:06:47 -0000 1.17 ++++ Makefile 25 Mar 2006 01:19:02 -0000 +@@ -17,9 +17,9 @@ + all: bios cirrus-bios + + +-bios: biossums vgabios.bin vgabios.debug.bin ++bios: biossums vgabios.bin #vgabios.debug.bin + +-cirrus-bios: vgabios-cirrus.bin vgabios-cirrus.debug.bin ++cirrus-bios: vgabios-cirrus.bin #vgabios-cirrus.debug.bin + + clean: + /bin/rm -f biossums *.o *.s *.ld86 \ Index: clext.c =================================================================== -RCS file: /cvsroot/vgabios/vgabios/clext.c,v -retrieving revision 1.8 -diff -u -w -r1.8 clext.c ---- clext.c 8 Aug 2004 16:52:55 -0000 1.8 -+++ clext.c 30 Nov 2004 23:38:32 -0000 -@@ -222,7 +222,21 @@ - 0x001a,0x221b,0x001d, +RCS file: /sources/vgabios/vgabios/clext.c,v +retrieving revision 1.9 +diff -u -w -r1.9 clext.c +--- clext.c 4 Dec 2004 15:26:17 -0000 1.9 ++++ clext.c 25 Mar 2006 01:19:03 -0000 +@@ -238,6 +238,21 @@ 0xffff }; -- -+/* 1280x1024x16 */ -+unsigned short cseq_1280x1024x16[] = { -+0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1707, + ++/* 1600x1200x8 */ ++unsigned short cseq_1600x1200x8[] = { ++0x0300,0x2101,0x0f02,0x0003,0x0e04,0x1107, +0x760b,0x760c,0x760d,0x760e, +0x0412,0x0013,0x2017, +0x341b,0x341c,0x341d,0x341e, +0xffff +}; -+unsigned short ccrtc_1280x1024x16[] = { ++unsigned short ccrtc_1600x1200x8[] = { +0x2911,0xc300,0x9f01,0x9f02,0x8603,0x8304,0x9405,0x2406,0xf707, +0x6009,0x000c,0x000d, -+0x0310,0xff12,0x4013,0x4014,0xff15,0x2416,0xc317,0xff18, -+0x001a,0x321b,0x001d, ++0x0310,0xff12,0xa013,0x4014,0xff15,0x2416,0xc317,0xff18, ++0x001a,0x221b,0x001d, +0xffff +}; cirrus_mode_t cirrus_modes[] = { -@@ -269,6 +283,12 @@ - {0x6d,1280,1024,8,0x00, - cseq_1280x1024x8,cgraph_svgacolor,ccrtc_1280x1024x8,8, - 4,0,0,0,0,0,0,0,0}, -+ {0x69,1280,1024,15,0xf0, -+ cseq_1280x1024x16,cgraph_svgacolor,ccrtc_1280x1024x16,16, -+ 6,5,10,5,5,5,0,1,15}, -+ {0x75,1280,1024,16,0xe1, -+ cseq_1280x1024x16,cgraph_svgacolor,ccrtc_1280x1024x16,16, -+ 6,5,11,6,5,5,0,0,0}, +@@ -291,6 +306,10 @@ + cseq_1280x1024x16,cgraph_svgacolor,ccrtc_1280x1024x16,16, + 6,5,11,6,5,5,0,0,0}, ++ {0x7b,1600,1200,8,0x00, ++ cseq_1600x1200x8,cgraph_svgacolor,ccrtc_1600x1200x8,8, ++ 4,0,0,0,0,0,0,0,0}, ++ {0xfe,0,0,0,0,cseq_vga,cgraph_vga,ccrtc_vga,0, 0xff,0,0,0,0,0,0,0,0}, -@@ -310,9 +330,13 @@ - // 1024x768x16 - 0x117, 0x74, - // 1024x768x24 --//0x118, 0x79, -+ 0x118, 0x79, - // 1280x1024x8 - 0x107, 0x6d, -+// 1280x1024x15 -+ 0x119, 0x69, -+// 1280x1024x16 -+ 0x11a, 0x75, - // invalid - 0xffff,0xffff + {0xff,0,0,0,0,0,0,0,0, +Index: vgabios.c +=================================================================== +RCS file: /sources/vgabios/vgabios/vgabios.c,v +retrieving revision 1.63 +diff -u -w -r1.63 vgabios.c +--- vgabios.c 26 Dec 2005 19:50:26 -0000 1.63 ++++ vgabios.c 25 Mar 2006 01:19:03 -0000 +@@ -111,6 +111,7 @@ + static void biosfn_read_video_state_size(); + static void biosfn_save_video_state(); + static void biosfn_restore_video_state(); ++extern Bit8u video_save_pointer_table[]; + + // This is for compiling with gcc2 and gcc3 + #define ASM_START #asm +@@ -459,6 +460,29 @@ + + pop ds + ret ++ ++_video_save_pointer_table: ++ .word _video_param_table ++ .word 0xc000 ++ ++ .word 0 /* XXX: fill it */ ++ .word 0 ++ ++ .word 0 /* XXX: fill it */ ++ .word 0 ++ ++ .word 0 /* XXX: fill it */ ++ .word 0 ++ ++ .word 0 /* XXX: fill it */ ++ .word 0 ++ ++ .word 0 /* XXX: fill it */ ++ .word 0 ++ ++ .word 0 /* XXX: fill it */ ++ .word 0 ++ + ASM_END + + // -------------------------------------------------------------------------------------------- +@@ -780,8 +804,8 @@ + + // Should we clear the screen ? + Bit8u noclearmem=mode&0x80; +- Bit8u line,mmask,*palette; +- Bit16u i,twidth,theight,cheight; ++ Bit8u line,mmask,*palette,vpti; ++ Bit16u i,twidth,theightm1,cheight; + Bit8u modeset_ctl,video_ctl,vga_switches; + Bit16u crtc_addr; + +@@ -804,9 +828,10 @@ + if(line==0xFF) + return; + +- twidth=vga_modes[line].twidth; +- theight=vga_modes[line].theight; +- cheight=vga_modes[line].cheight; ++ vpti=line_to_vpti[line]; ++ twidth=video_param_table[vpti].twidth; ++ theightm1=video_param_table[vpti].theightm1; ++ cheight=video_param_table[vpti].cheight; + + // Read the bios vga control + video_ctl=read_byte(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL); +@@ -866,21 +891,25 @@ + inb(VGAREG_ACTL_RESET); + + // Set Attribute Ctl +- for(i=0;i<=ACTL_MAX_REG;i++) ++ for(i=0;i<=0x13;i++) + {outb(VGAREG_ACTL_ADDRESS,i); +- outb(VGAREG_ACTL_WRITE_DATA,actl_regs[vga_modes[line].actlmodel][i]); ++ outb(VGAREG_ACTL_WRITE_DATA,video_param_table[vpti].actl_regs[i]); + } ++ outb(VGAREG_ACTL_ADDRESS,0x14); ++ outb(VGAREG_ACTL_WRITE_DATA,0x00); + + // Set Sequencer Ctl +- for(i=0;i<=SEQU_MAX_REG;i++) ++ outb(VGAREG_SEQU_ADDRESS,0); ++ outb(VGAREG_SEQU_DATA,0x03); ++ for(i=1;i<=4;i++) + {outb(VGAREG_SEQU_ADDRESS,i); +- outb(VGAREG_SEQU_DATA,sequ_regs[vga_modes[line].sequmodel][i]); ++ outb(VGAREG_SEQU_DATA,video_param_table[vpti].sequ_regs[i - 1]); + } + + // Set Grafx Ctl +- for(i=0;i<=GRDC_MAX_REG;i++) ++ for(i=0;i<=8;i++) + {outb(VGAREG_GRDC_ADDRESS,i); +- outb(VGAREG_GRDC_DATA,grdc_regs[vga_modes[line].grdcmodel][i]); ++ outb(VGAREG_GRDC_DATA,video_param_table[vpti].grdc_regs[i]); + } + + // Set CRTC address VGA or MDA +@@ -889,13 +918,13 @@ + // Disable CRTC write protection + outw(crtc_addr,0x0011); + // Set CRTC regs +- for(i=0;i<=CRTC_MAX_REG;i++) ++ for(i=0;i<=0x18;i++) + {outb(crtc_addr,i); +- outb(crtc_addr+1,crtc_regs[vga_modes[line].crtcmodel][i]); ++ outb(crtc_addr+1,video_param_table[vpti].crtc_regs[i]); + } + + // Set the misc register +- outb(VGAREG_WRITE_MISC_OUTPUT,vga_modes[line].miscreg); ++ outb(VGAREG_WRITE_MISC_OUTPUT,video_param_table[vpti].miscreg); + + // Enable video + outb(VGAREG_ACTL_ADDRESS,0x20); +@@ -927,9 +956,9 @@ + // Set the BIOS mem + write_byte(BIOSMEM_SEG,BIOSMEM_CURRENT_MODE,mode); + write_word(BIOSMEM_SEG,BIOSMEM_NB_COLS,twidth); +- write_word(BIOSMEM_SEG,BIOSMEM_PAGE_SIZE,vga_modes[line].slength); ++ write_word(BIOSMEM_SEG,BIOSMEM_PAGE_SIZE,*(Bit16u *)&video_param_table[vpti].slength_l); + write_word(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS,crtc_addr); +- write_byte(BIOSMEM_SEG,BIOSMEM_NB_ROWS,theight-1); ++ write_byte(BIOSMEM_SEG,BIOSMEM_NB_ROWS,theightm1); + write_word(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT,cheight); + write_byte(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL,(0x60|noclearmem)); + write_byte(BIOSMEM_SEG,BIOSMEM_SWITCHES,0xF9); +@@ -937,8 +966,8 @@ + + // FIXME We nearly have the good tables. to be reworked + write_byte(BIOSMEM_SEG,BIOSMEM_DCC_INDEX,0x08); // 8 is VGA should be ok for now +- write_word(BIOSMEM_SEG,BIOSMEM_VS_POINTER,0x00); +- write_word(BIOSMEM_SEG,BIOSMEM_VS_POINTER+2,0x00); ++ write_word(BIOSMEM_SEG,BIOSMEM_VS_POINTER, video_save_pointer_table); ++ write_word(BIOSMEM_SEG,BIOSMEM_VS_POINTER+2, 0xc000); + + // FIXME + write_byte(BIOSMEM_SEG,BIOSMEM_CURRENT_MSR,0x00); // Unavailable on vanilla vga, but... +@@ -1114,7 +1143,7 @@ + } + else + { +- address = page*vga_modes[line].slength; ++ address = page * (*(Bit16u *)&video_param_table[line_to_vpti[line]].slength_l); + } + + // CRTC regs 0x0c and 0x0d +@@ -1271,7 +1300,7 @@ + else + { + // FIXME gfx mode not complete +- cheight=vga_modes[line].cheight; ++ cheight=video_param_table[line_to_vpti[line]].cheight; + switch(vga_modes[line].memmodel) + { + case PLANAR4: +@@ -1581,7 +1610,7 @@ + else + { + // FIXME gfx mode not complete +- cheight=vga_modes[line].cheight; ++ cheight=video_param_table[line_to_vpti[line]].cheight; + bpp=vga_modes[line].pixbits; + while((count-->0) && (xcurs0) && (xcurs