Changeset 94355 in vbox
- Timestamp:
- Mar 24, 2022 1:21:38 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/BIOS/vgabios.c
r94316 r94355 900 900 }; 901 901 902 /* Convert index in vga_modes[] to index in video_param_table[] for 200-line (CGA) text modes. */ 903 static int8_t line_to_vpti_200[8] = { 904 0x00, 0x01, 0x02, 0x03, -1, -1, -1, 0x07 905 }; 906 907 /* Same for 350-line (EGA) text modes. */ 908 static int8_t line_to_vpti_350[8] = { 909 0x13, 0x14, 0x15, 0x16, -1, -1, -1, 0x07 910 }; 911 912 /* Same for 400-line (VGA) text modes. */ 913 static int8_t line_to_vpti_400[8] = { 914 0x17, 0x17, 0x18, 0x18, -1, -1, -1, 0x19 915 }; 916 917 int find_vpti(uint8_t line) 918 { 919 int idx; 920 uint8_t mctl; 921 922 if (vga_modes[line].class == TEXT) { 923 mctl = read_byte(BIOSMEM_SEG, BIOSMEM_MODESET_CTL); 924 if (mctl & 0x10) 925 idx = line_to_vpti_400[line]; 926 else if (mctl & 0x80) 927 idx = line_to_vpti_200[line]; 928 else 929 idx = line_to_vpti_350[line]; 930 } else 931 idx = line_to_vpti[line]; 932 933 return idx; 934 } 935 902 936 static void biosfn_load_text_user_pat(uint8_t AL, uint16_t ES, uint16_t BP, uint16_t CX, uint16_t DX, uint8_t BL, uint8_t BH); 903 937 … … 942 976 save_area = (void __far *)read_dword(BIOSMEM_SEG, BIOSMEM_VS_POINTER); 943 977 944 vpti =line_to_vpti[line];945 vpt = save_area[0];978 vpti = find_vpti(line); 979 vpt = save_area[0]; 946 980 vpt += vpti; 947 981 … … 1088 1122 write_byte(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL,(0x60|noclearmem)); 1089 1123 write_byte(BIOSMEM_SEG,BIOSMEM_SWITCHES,0xF9); 1090 write_byte(BIOSMEM_SEG,BIOSMEM_MODESET_CTL,read_byte(BIOSMEM_SEG,BIOSMEM_MODESET_CTL)&0x7f);1091 1124 1092 1125 // FIXME We nearly have the good tables. to be reworked … … 1118 1151 cso_txt __far *ovr = save_area[2]; 1119 1152 1120 biosfn_load_text_8_16_pat(0x04, 0); /* Load 8x16 font into page 0. */ 1153 switch (vpt->cheight) { 1154 case 8: 1155 biosfn_load_text_user_pat(0, 0xC000, (uint16_t)vgafont8, 256, 0, 0, vpt->cheight); 1156 break; 1157 case 14: 1158 biosfn_load_text_user_pat(0, 0xC000, (uint16_t)vgafont14, 256, 0, 0, vpt->cheight); 1159 break; 1160 default: 1161 biosfn_load_text_user_pat(0, 0xC000, (uint16_t)vgafont16, 256, 0, 0, vpt->cheight); 1162 } 1121 1163 if (ovr) 1122 1164 { … … 2060 2102 #endif 2061 2103 } 2104 // -------------------------------------------------------------------------------------------- 2105 static void biosfn_set_txt_lines(uint8_t AL) 2106 { 2107 uint8_t mctl; 2108 2109 /* Read byte at 40:89. */ 2110 mctl = read_byte(BIOSMEM_SEG, BIOSMEM_MODESET_CTL); 2111 mctl = mctl & 0x6F; /* Clear 400/200 line flags. */ 2112 2113 switch (AL) /* AL was already validated to be in 0-2 range. */ 2114 { 2115 case 0: /* 200 lines. */ 2116 mctl |= 0x80; 2117 break; 2118 case 2: /* 400 lines. */ 2119 mctl |= 0x10; 2120 break; 2121 } 2122 write_byte(BIOSMEM_SEG, BIOSMEM_MODESET_CTL, mctl); 2123 } 2062 2124 2063 2125 // -------------------------------------------------------------------------------------------- … … 2636 2698 biosfn_alternate_prtsc(); 2637 2699 break; 2700 case 0x30: 2701 if (GET_AL() <= 2) { 2702 biosfn_set_txt_lines(GET_AL()); 2703 SET_AL(0x12); 2704 } 2705 break; 2638 2706 case 0x34: /* CGA text cursor emulation control. */ 2639 2707 if (GET_AL() < 2) {
Note:
See TracChangeset
for help on using the changeset viewer.