Changeset 2980 in vbox for trunk/src/VBox/Devices/Graphics
- Timestamp:
- Jun 1, 2007 3:56:12 PM (18 years ago)
- Location:
- trunk/src/VBox/Devices/Graphics/BIOS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/BIOS/vbe.c
r1397 r2980 72 72 73 73 _vbebios_vendor_name: 74 .ascii " InnoTek SystemberatungGmbH"74 .ascii "innotek GmbH" 75 75 .byte 0x00 76 76 … … 80 80 81 81 _vbebios_product_revision: 82 .ascii " InnoTek VirtualBox Version "82 .ascii "innotek VirtualBox Version " 83 83 .ascii VBOX_VERSION_STRING 84 84 .byte 0x00 … … 86 86 _vbebios_info_string: 87 87 //.ascii "Bochs VBE Display Adapter enabled" 88 .ascii " InnoTek VirtualBox VBE Display Adapter enabled"88 .ascii "innotek VirtualBox VBE Display Adapter enabled" 89 89 .byte 0x0a,0x0d 90 90 .byte 0x0a,0x0d … … 98 98 99 99 msg_vbe_init: 100 .ascii " InnoTek VirtualBox Version "100 .ascii "innotek VirtualBox Version " 101 101 .ascii VBOX_VERSION_STRING 102 102 .ascii " VBE Display Adapter" -
trunk/src/VBox/Devices/Graphics/BIOS/vgabios.c
r1397 r2980 4 4 */ 5 5 // ============================================================================================ 6 // 6 // 7 7 // Copyright (C) 2001,2002 the LGPL VGABios developers Team 8 8 // … … 20 20 // License along with this library; if not, write to the Free Software 21 21 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 22 // 22 // 23 23 // ============================================================================================ 24 // 25 // This VGA Bios is specific to the plex86/bochs Emulated VGA card. 26 // You can NOT drive any physical vga card with it. 27 // 24 // 25 // This VGA Bios is specific to the plex86/bochs Emulated VGA card. 26 // You can NOT drive any physical vga card with it. 27 // 28 28 // ============================================================================================ 29 // 29 // 30 30 // This file contains code ripped from : 31 // - rombios.c of plex86 31 // - rombios.c of plex86 32 32 // 33 33 // This VGA Bios contains fonts from : 34 34 // - fntcol16.zip (c) by Joseph Gil avalable at : 35 35 // ftp://ftp.simtel.net/pub/simtelnet/msdos/screen/fntcol16.zip 36 // These fonts are public domain 36 // These fonts are public domain 37 37 // 38 38 // This VGA Bios is based on information taken from : … … 143 143 144 144 vgabios_entry_point: 145 145 146 146 jmp vgabios_init_func 147 147 … … 201 201 .byte 0x00 202 202 #endif 203 203 204 204 205 205 ;; ============================================================================================ … … 216 216 call init_bios_area 217 217 218 #ifdef VBE 218 #ifdef VBE 219 219 ;; init vbe functions 220 call vbe_init 220 call vbe_init 221 221 #endif 222 222 … … 241 241 call _display_info 242 242 243 #ifdef VBE 243 #ifdef VBE 244 244 ;; show vbe info 245 call vbe_display_info 245 call vbe_display_info 246 246 #endif 247 247 … … 257 257 mov ax,#0x0003 258 258 int #0x10 259 #endif 259 #endif 260 260 #endif /* VBOX */ 261 261 … … 394 394 395 395 /* 396 * Boot time harware inits 396 * Boot time harware inits 397 397 */ 398 398 ASM_START … … 419 419 420 420 msg_vga_init: 421 .ascii " InnoTek VirtualBox Version "421 .ascii "innotek VirtualBox Version " 422 422 .ascii VBOX_VERSION_STRING 423 423 .ascii " VGA BIOS" … … 427 427 // -------------------------------------------------------------------------------------------- 428 428 /* 429 * Boot time bios area inits 429 * Boot time bios area inits 430 430 */ 431 431 ASM_START … … 450 450 mov [bx], al 451 451 452 ;; Clear the screen 452 ;; Clear the screen 453 453 mov bx, # BIOSMEM_VIDEO_CTL 454 454 mov al, #0x60 … … 498 498 mov si,#vgabios_version 499 499 call _display_string 500 500 501 501 ;;mov si,#vgabios_copyright 502 502 ;;call _display_string … … 523 523 xor al,al 524 524 cld 525 repne 525 repne 526 526 scasb 527 527 not cx … … 532 532 mov bx,#0x0000 533 533 int #0x10 534 534 535 535 pop cx 536 536 mov ax,#0x1301 … … 566 566 biosfn_set_video_mode(GET_AL()); 567 567 switch(GET_AL()&0x7F) 568 {case 6: 568 {case 6: 569 569 SET_AL(0x3F); 570 570 break; … … 676 676 #endif 677 677 } 678 678 679 679 break; 680 680 case 0x12: … … 725 725 break; 726 726 727 #ifdef VBE 727 #ifdef VBE 728 728 case 0x4f: 729 729 if (vbe_has_vbe_display()) { … … 766 766 #ifdef DEBUG 767 767 unknown(); 768 #endif 768 #endif 769 769 // function failed 770 770 AX=0x100; … … 786 786 787 787 // ============================================================================================ 788 // 788 // 789 789 // BIOS functions 790 // 790 // 791 791 // ============================================================================================ 792 792 793 static void biosfn_set_video_mode(mode) Bit8u mode; 793 static void biosfn_set_video_mode(mode) Bit8u mode; 794 794 {// mode: Bit 7 is 1 if no clear screen 795 795 … … 800 800 Bit8u modeset_ctl,video_ctl,vga_switches; 801 801 Bit16u crtc_addr; 802 802 803 803 #ifdef VBE 804 if (vbe_has_vbe_display()) { 804 if (vbe_has_vbe_display()) { 805 805 dispi_set_enable(VBE_DISPI_DISABLED); 806 806 } 807 807 #endif // def VBE 808 808 809 809 // The real mode 810 810 mode=mode&0x7f; … … 823 823 theight=vga_modes[line].theight; 824 824 cheight=vga_modes[line].cheight; 825 825 826 826 // Read the bios vga control 827 827 video_ctl=read_byte(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL); … … 899 899 } 900 900 901 // Set CRTC address VGA or MDA 901 // Set CRTC address VGA or MDA 902 902 crtc_addr=vga_modes[line].memmodel==MTEXT?VGAREG_MDA_CRTC_ADDRESS:VGAREG_VGA_CRTC_ADDRESS; 903 903 … … 959 959 write_byte(BIOSMEM_SEG,BIOSMEM_CURRENT_MSR,0x00); // Unavailable on vanilla vga, but... 960 960 write_byte(BIOSMEM_SEG,BIOSMEM_CURRENT_PAL,0x00); // Unavailable on vanilla vga, but... 961 961 962 962 // Set cursor shape 963 963 if(vga_modes[line].class==TEXT) … … 975 975 // Write the fonts in memory 976 976 if(vga_modes[line].class==TEXT) 977 { 977 { 978 978 ASM_START 979 979 ;; copy and activate 8x16 font … … 1012 1012 1013 1013 // -------------------------------------------------------------------------------------------- 1014 static void biosfn_set_cursor_shape (CH,CL) 1015 Bit8u CH;Bit8u CL; 1014 static void biosfn_set_cursor_shape (CH,CL) 1015 Bit8u CH;Bit8u CL; 1016 1016 {Bit16u cheight,curs,crtc_addr; 1017 1017 Bit8u modeset_ctl; … … 1047 1047 1048 1048 // -------------------------------------------------------------------------------------------- 1049 static void biosfn_set_cursor_pos (page, cursor) 1049 static void biosfn_set_cursor_pos (page, cursor) 1050 1050 Bit8u page;Bit16u cursor; 1051 1051 { … … 1068 1068 1069 1069 xcurs=cursor&0x00ff;ycurs=(cursor&0xff00)>>8; 1070 1070 1071 1071 // Calculate the address knowing nbcols nbrows and page num 1072 1072 address=SCREEN_IO_START(nbcols,nbrows,page)+xcurs+ycurs*nbcols; 1073 1073 1074 1074 // CRTC regs 0x0e and 0x0f 1075 1075 crtc_addr=read_word(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS); … … 1082 1082 1083 1083 // -------------------------------------------------------------------------------------------- 1084 static void biosfn_get_cursor_pos (page,shape, pos) 1084 static void biosfn_get_cursor_pos (page,shape, pos) 1085 1085 Bit8u page;Bit16u *shape;Bit16u *pos; 1086 1086 { … … 1098 1098 1099 1099 // -------------------------------------------------------------------------------------------- 1100 static void biosfn_set_active_page (page) 1100 static void biosfn_set_active_page (page) 1101 1101 Bit8u page; 1102 1102 { … … 1112 1112 if(line==0xFF)return; 1113 1113 1114 // Get pos curs pos for the right page 1114 // Get pos curs pos for the right page 1115 1115 biosfn_get_cursor_pos(page,&dummy,&cursor); 1116 1116 … … 1120 1120 nbcols=read_word(BIOSMEM_SEG,BIOSMEM_NB_COLS); 1121 1121 nbrows=read_byte(BIOSMEM_SEG,BIOSMEM_NB_ROWS)+1; 1122 1122 1123 1123 // Calculate the address knowing nbcols nbrows and page num 1124 1124 address=SCREEN_MEM_START(nbcols,nbrows,page); … … 1365 1365 1366 1366 // -------------------------------------------------------------------------------------------- 1367 static void biosfn_read_char_attr (page,car) 1367 static void biosfn_read_char_attr (page,car) 1368 1368 Bit8u page;Bit16u *car; 1369 1369 {Bit16u ss=get_SS(); … … 1566 1566 1567 1567 // -------------------------------------------------------------------------------------------- 1568 static void biosfn_write_char_attr (car,page,attr,count) 1568 static void biosfn_write_char_attr (car,page,attr,count) 1569 1569 Bit8u car;Bit8u page;Bit8u attr;Bit16u count; 1570 1570 { … … 1897 1897 1898 1898 // -------------------------------------------------------------------------------------------- 1899 static void biosfn_write_teletype (car, page, attr, flag) 1899 static void biosfn_write_teletype (car, page, attr, flag) 1900 1900 Bit8u car;Bit8u page;Bit8u attr;Bit8u flag; 1901 1901 {// flag = WITH_ATTR / NO_ATTR … … 1953 1953 if(vga_modes[line].class==TEXT) 1954 1954 { 1955 // Compute the address 1955 // Compute the address 1956 1956 address=SCREEN_MEM_START(nbcols,nbrows,page)+(xcurs+ycurs*nbcols)*2; 1957 1957 1958 // Write the char 1958 // Write the char 1959 1959 write_byte(vga_modes[line].sstart,address,car); 1960 1960 … … 2007 2007 ycurs-=1; 2008 2008 } 2009 2009 2010 2010 // Set the cursor for the page 2011 2011 cursor=ycurs; cursor<<=8; cursor+=xcurs; … … 2509 2509 2510 2510 // -------------------------------------------------------------------------------------------- 2511 static void biosfn_perform_gray_scale_summing (start,count) 2511 static void biosfn_perform_gray_scale_summing (start,count) 2512 2512 Bit16u start;Bit16u count; 2513 2513 {Bit8u r,g,b; … … 2518 2518 outb(VGAREG_ACTL_ADDRESS,0x00); 2519 2519 2520 for( index = 0; index < count; index++ ) 2520 for( index = 0; index < count; index++ ) 2521 2521 { 2522 2522 // set read address and switch to read mode … … 2531 2531 2532 2532 if(i>0x3f)i=0x3f; 2533 2533 2534 2534 // set write address and switch to write mode 2535 2535 outb(VGAREG_DAC_WRITE_ADDRESS,start); … … 2539 2539 outb( VGAREG_DAC_DATA, i&0xff ); 2540 2540 start++; 2541 } 2541 } 2542 2542 inb(VGAREG_ACTL_RESET); 2543 2543 outb(VGAREG_ACTL_ADDRESS,0x20); … … 2754 2754 } 2755 2755 // -------------------------------------------------------------------------------------------- 2756 static void biosfn_get_font_info (BH,ES,BP,CX,DX) 2756 static void biosfn_get_font_info (BH,ES,BP,CX,DX) 2757 2757 Bit8u BH;Bit16u *ES;Bit16u *BP;Bit16u *CX;Bit16u *DX; 2758 2758 {Bit16u ss=get_SS(); 2759 2759 2760 2760 switch(BH) 2761 2761 {case 0x00: … … 3011 3011 3012 3012 // -------------------------------------------------------------------------------------------- 3013 static void biosfn_write_string (flag,page,attr,count,row,col,seg,offset) 3013 static void biosfn_write_string (flag,page,attr,count,row,col,seg,offset) 3014 3014 Bit8u flag;Bit8u page;Bit8u attr;Bit16u count;Bit8u row;Bit8u col;Bit16u seg;Bit16u offset; 3015 3015 { … … 3028 3028 newcurs=row; newcurs<<=8; newcurs+=col; 3029 3029 biosfn_set_cursor_pos(page,newcurs); 3030 3030 3031 3031 while(count--!=0) 3032 3032 { … … 3037 3037 biosfn_write_teletype(car,page,attr,WITH_ATTR); 3038 3038 } 3039 3040 // Set back curs pos 3039 3040 // Set back curs pos 3041 3041 if((flag&0x01)==0) 3042 3042 biosfn_set_cursor_pos(page,oldcurs); … … 3099 3099 3100 3100 // -------------------------------------------------------------------------------------------- 3101 static void biosfn_read_state_info (BX,ES,DI) 3101 static void biosfn_read_state_info (BX,ES,DI) 3102 3102 Bit16u BX;Bit16u ES;Bit16u DI; 3103 3103 { … … 3109 3109 memcpyb(ES,DI+0x04,BIOSMEM_SEG,0x49,30); 3110 3110 memcpyb(ES,DI+0x22,BIOSMEM_SEG,0x84,3); 3111 3111 3112 3112 write_byte(ES,DI+0x25,read_byte(BIOSMEM_SEG,BIOSMEM_DCC_INDEX)); 3113 3113 write_byte(ES,DI+0x26,0); … … 3120 3120 write_byte(ES,DI+0x31,3); 3121 3121 write_byte(ES,DI+0x32,0); 3122 3122 3123 3123 memsetb(ES,DI+0x33,0,13); 3124 3124 } … … 3149 3149 // 3150 3150 // ============================================================================================ 3151 3152 // -------------------------------------------------------------------------------------------- 3153 static Bit8u find_vga_entry(mode) 3151 3152 // -------------------------------------------------------------------------------------------- 3153 static Bit8u find_vga_entry(mode) 3154 3154 Bit8u mode; 3155 3155 { … … 3606 3606 // -------------------------------------------------------------------------------------------- 3607 3607 3608 ASM_START 3608 ASM_START 3609 3609 ;; DATA_SEG_DEFS_HERE 3610 3610 ASM_END
Note:
See TracChangeset
for help on using the changeset viewer.