1
0
Fork 0

Add alternate font tables and associated loading logic in video BIOS, allowing correct gaps between "wide" characters (e.g. m,w,M,W,T,Z,0) in all VGA machine types.

Update all related BIOS memory values and CRTC registers when loading fonts, fixing quirks in some textmode programs like Inertia Player. Based in part on a patch by h-a-l-9000.

Improve support for MDA emulation in the vgaonly machine type, as it is the only way the video BIOS can make use of the 14-line alternate symbols.

Be compatible by setting the INT 43h vector to the first half of the 8-line font table for standard text modes. Fixes a few obscure games and demos that rely on this BIOS behavior.

Move VESA mode table and OEM string before font tables in the video ROM, which is a more compatible ordering and gives the data low address offsets that work around a bug in some programs such as the Abuse game and Molejo demo.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3932
This commit is contained in:
ripsaw8080 2015-08-28 14:37:25 +00:00
parent f66ff6e3d7
commit 1b7b92ed8a
5 changed files with 254 additions and 80 deletions

View file

@ -911,6 +911,8 @@ Bitu keyboard_layout::read_codepage_file(const char* codepage_file_name, Bit32s
for (Bitu i=0;i<256*16;i++) {
phys_writeb(font16pt+i,cpi_buf[font_data_start+i]);
}
// terminate alternate list to prevent loading
phys_writeb(Real2Phys(int10.rom.font_16_alternate),0);
font_changed=true;
} else if (font_height==0x0e) {
// 14x8 font
@ -918,6 +920,8 @@ Bitu keyboard_layout::read_codepage_file(const char* codepage_file_name, Bit32s
for (Bitu i=0;i<256*14;i++) {
phys_writeb(font14pt+i,cpi_buf[font_data_start+i]);
}
// terminate alternate list to prevent loading
phys_writeb(Real2Phys(int10.rom.font_14_alternate),0);
font_changed=true;
} else if (font_height==0x08) {
// 8x8 fonts

View file

@ -52,7 +52,7 @@ static Bitu INT10_Handler(void) {
switch (reg_ah) {
case 0x00: /* Set VideoMode */
Mouse_BeforeNewVideoMode(true);
INT10_SetVideoMode(reg_al);
INT10_SetVideoMode(reg_al);
Mouse_AfterNewVideoMode(true);
break;
case 0x01: /* Set TextMode Cursor Shape */
@ -210,15 +210,15 @@ static Bitu INT10_Handler(void) {
/* Textmode calls */
case 0x00: /* Load user font */
case 0x10:
INT10_LoadFont(SegPhys(es)+reg_bp,reg_al==0x10,reg_cx,reg_dx,reg_bl,reg_bh);
INT10_LoadFont(SegPhys(es)+reg_bp,reg_al==0x10,reg_cx,reg_dx,reg_bl&0x7f,reg_bh);
break;
case 0x01: /* Load 8x14 font */
case 0x11:
INT10_LoadFont(Real2Phys(int10.rom.font_14),reg_al==0x11,256,0,reg_bl,14);
INT10_LoadFont(Real2Phys(int10.rom.font_14),reg_al==0x11,256,0,reg_bl&0x7f,14);
break;
case 0x02: /* Load 8x8 font */
case 0x12:
INT10_LoadFont(Real2Phys(int10.rom.font_8_first),reg_al==0x12,256,0,reg_bl,8);
INT10_LoadFont(Real2Phys(int10.rom.font_8_first),reg_al==0x12,256,0,reg_bl&0x7f,8);
break;
case 0x03: /* Set Block Specifier */
IO_Write(0x3c4,0x3);IO_Write(0x3c5,reg_bl);
@ -226,7 +226,7 @@ static Bitu INT10_Handler(void) {
case 0x04: /* Load 8x16 font */
case 0x14:
if (!IS_VGA_ARCH) break;
INT10_LoadFont(Real2Phys(int10.rom.font_16),reg_al==0x14,256,0,reg_bl,16);
INT10_LoadFont(Real2Phys(int10.rom.font_16),reg_al==0x14,256,0,reg_bl&0x7f,16);
break;
/* Graphics mode calls */
case 0x20: /* Set User 8x8 Graphics characters */
@ -288,7 +288,6 @@ graphics_chars:
reg_bp=RealOff(int10.rom.font_8_second);
break;
case 0x05: /* alpha alternate 9x14 */
if (!IS_VGA_ARCH) break;
SegSet16(es,RealSeg(int10.rom.font_14_alternate));
reg_bp=RealOff(int10.rom.font_14_alternate);
break;
@ -542,8 +541,8 @@ graphics_chars:
break;
case 0x02: /* Set videomode */
Mouse_BeforeNewVideoMode(true);
reg_al=0x4f;
reg_ah=VESA_SetSVGAMode(reg_bx);
reg_al=0x4f;
reg_ah=VESA_SetSVGAMode(reg_bx);
Mouse_AfterNewVideoMode(true);
break;
case 0x03: /* Get videomode */
@ -764,7 +763,5 @@ void INT10_Init(Section* /*sec*/) {
//Init the 0x40 segment and init the datastructures in the the video rom area
INT10_SetupRomMemory();
INT10_Seg40Init();
INT10_SetupVESA();
INT10_SetupRomMemoryChecksum();//SetupVesa modifies the rom as well.
INT10_SetVideoMode(0x3);
}

View file

@ -99,6 +99,8 @@
extern Bit8u int10_font_08[256 * 8];
extern Bit8u int10_font_14[256 * 14];
extern Bit8u int10_font_16[256 * 16];
extern Bit8u int10_font_14_alternate[20 * 15 + 1];
extern Bit8u int10_font_16_alternate[19 * 17 + 1];
struct VideoModeBlock {
Bit16u mode;

View file

@ -47,55 +47,78 @@ static Bit16u map_offset[8]={
void INT10_LoadFont(PhysPt font,bool reload,Bitu count,Bitu offset,Bitu map,Bitu height) {
PhysPt ftwhere=PhysMake(0xa000,map_offset[map & 0x7]+(Bit16u)(offset*32));
IO_Write(0x3c4,0x2);IO_Write(0x3c5,0x4); //Enable plane 2
IO_Write(0x3ce,0x6);Bitu old_6=IO_Read(0x3cf);
IO_Write(0x3cf,0x0); //Disable odd/even and a0000 addressing
Bit16u base=real_readw(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS);
bool mono=(base==VGAREG_MDA_CRTC_ADDRESS);
//Put video adapter in planar mode
IO_Write(0x3c4,0x02);IO_Write(0x3c5,0x04); // select plane 2 for writing
IO_Write(0x3c4,0x04);IO_Write(0x3c5,0x07); // odd/even off in SEQ
IO_Write(0x3ce,0x04);IO_Write(0x3cf,0x02); // select plane 2 for reading
IO_Write(0x3ce,0x05);IO_Write(0x3cf,0x00); // write mode 0, odd/even off in GFX
IO_Write(0x3ce,0x06);IO_Write(0x3cf,0x04); // CPU memory window A0000-AFFFF
//Load character patterns
for (Bitu i=0;i<count;i++) {
MEM_BlockCopy(ftwhere,font,height);
ftwhere+=32;
MEM_BlockCopy(ftwhere+i*32,font,height);
font+=height;
}
IO_Write(0x3c4,0x2);IO_Write(0x3c5,0x3); //Enable textmode planes (0,1)
IO_Write(0x3ce,0x6);
if (IS_VGA_ARCH) IO_Write(0x3cf,(Bit8u)old_6); //odd/even and b8000 addressing
else IO_Write(0x3cf,0x0e);
//Load alternate character patterns
if (map & 0x80) {
while (Bitu chr=(Bitu)mem_readb(font++)) {
MEM_BlockCopy(ftwhere+chr*32,font,height);
font+=height;
}
}
//Return to normal text mode
IO_Write(0x3c4,0x02);IO_Write(0x3c5,0x03); // select planes 0&1 for writing
IO_Write(0x3c4,0x04);IO_Write(0x3c5,0x03); // odd/even on in SEQ
IO_Write(0x3ce,0x04);IO_Write(0x3cf,0x00); // select plane 0 for reading
IO_Write(0x3ce,0x05);IO_Write(0x3cf,0x10); // write mode 0, odd/even on in GFX
IO_Write(0x3ce,0x06);IO_Write(0x3cf,mono?0x0a:0x0e); // Bx000-BxFFF, odd/even on
/* Reload tables and registers with new values based on this height */
if (reload) {
//Max scanline
Bit16u base=real_readw(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS);
IO_Write(base,0x9);
IO_Write(base+1,(IO_Read(base+1) & 0xe0)|(height-1));
// Vertical display end bios says, but should stay the same?
// Not on EGA.
Bitu rows = CurMode->sheight/height;
if (machine==MCH_EGA) {
Bitu displayend = rows*height - 1;
IO_Write(base,0x12);
IO_Write(base+1,(Bit8u)(displayend & 0xff));
IO_Write(base,0x7);
// Note: IBM EGA registers can't be read
Bitu v_overflow = IO_Read(base+1) & ~0x2;
if (displayend & 0x100) v_overflow |= 0x2;
IO_Write(base+1,(Bit8u)v_overflow);
//Vertical display end
Bitu rows=CurMode->sheight/height;
Bitu vdend=rows*height*((CurMode->sheight==200)?2:1)-1;
IO_Write(base,0x12);
IO_Write(base+1,(Bit8u)vdend);
//Underline location
if (CurMode->mode==7) {
IO_Write(base,0x14);
IO_Write(base+1,(IO_Read(base+1) & ~0x1f)|(height-1));
}
//Rows setting in bios segment
real_writeb(BIOSMEM_SEG,BIOSMEM_NB_ROWS,rows-1);
real_writeb(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT,(Bit8u)height);
//TODO Reprogram cursor size?
//Page size
Bitu pagesize=rows*real_readb(BIOSMEM_SEG,BIOSMEM_NB_COLS)*2;
pagesize+=0x100; // bios adds extra on reload
real_writew(BIOSMEM_SEG,BIOSMEM_PAGE_SIZE,pagesize);
//Cursor shape
if (height>=14) height--; // move up one line on 14+ line fonts
INT10_SetCursorShape(height-2,height-1);
}
}
void INT10_ReloadFont(void) {
Bitu map=0;
switch(CurMode->cheight) {
case 8:
INT10_LoadFont(Real2Phys(int10.rom.font_8_first),true,256,0,0,8);
INT10_LoadFont(Real2Phys(int10.rom.font_8_first),false,256,0,map,8);
break;
case 14:
INT10_LoadFont(Real2Phys(int10.rom.font_14),true,256,0,0,14);
if (IS_VGA_ARCH && svgaCard==SVGA_None && CurMode->mode==7) map=0x80;
INT10_LoadFont(Real2Phys(int10.rom.font_14),false,256,0,map,14);
break;
case 16:
default:
INT10_LoadFont(Real2Phys(int10.rom.font_16),true,256,0,0,16);
if (IS_VGA_ARCH && svgaCard==SVGA_None) map=0x80;
INT10_LoadFont(Real2Phys(int10.rom.font_16),false,256,0,map,16);
break;
}
}
@ -118,6 +141,9 @@ void INT10_SetupRomMemory(void) {
}
int10.rom.used=0x100;
}
if (IS_VGA_ARCH && svgaCard==SVGA_S3Trio) INT10_SetupVESA();
int10.rom.font_8_first=RealMake(0xC000,int10.rom.used);
for (i=0;i<128*8;i++) {
phys_writeb(rom_base+int10.rom.used++,int10_font_08[i]);
@ -130,10 +156,18 @@ void INT10_SetupRomMemory(void) {
for (i=0;i<256*14;i++) {
phys_writeb(rom_base+int10.rom.used++,int10_font_14[i]);
}
int10.rom.font_14_alternate=RealMake(0xC000,int10.rom.used);
for (i=0;i<20*15+1;i++) {
phys_writeb(rom_base+int10.rom.used++,int10_font_14_alternate[i]);
}
int10.rom.font_16=RealMake(0xC000,int10.rom.used);
for (i=0;i<256*16;i++) {
phys_writeb(rom_base+int10.rom.used++,int10_font_16[i]);
}
int10.rom.font_16_alternate=RealMake(0xC000,int10.rom.used);
for (i=0;i<19*17+1;i++) {
phys_writeb(rom_base+int10.rom.used++,int10_font_16_alternate[i]);
}
int10.rom.static_state=RealMake(0xC000,int10.rom.used);
for (i=0;i<0x10;i++) {
phys_writeb(rom_base+int10.rom.used++,static_functionality[i]);
@ -142,9 +176,6 @@ void INT10_SetupRomMemory(void) {
phys_writeb(PhysMake(0xf000,0xfa6e)+i,int10_font_08[i]);
}
RealSetVec(0x1F,int10.rom.font_8_second);
int10.rom.font_14_alternate=RealMake(0xC000,int10.rom.used);
int10.rom.font_16_alternate=RealMake(0xC000,int10.rom.used);
phys_writeb(rom_base+int10.rom.used++,0x00); // end of table (empty)
if (IS_EGAVGA_ARCH) {
int10.rom.video_parameter_table=RealMake(0xC000,int10.rom.used);
@ -208,6 +239,7 @@ void INT10_SetupRomMemory(void) {
}
INT10_SetupBasicVideoParameterTable();
INT10_SetupRomMemoryChecksum();
if (IS_TANDY_ARCH) {
RealSetVec(0x44,int10.rom.font_8_first);
@ -220,11 +252,13 @@ void INT10_ReloadRomFonts(void) {
for (Bitu i=0;i<256*16;i++) {
phys_writeb(font16pt+i,int10_font_16[i]);
}
phys_writeb(Real2Phys(int10.rom.font_16_alternate),0x1d);
// 14x8 font
PhysPt font14pt=Real2Phys(int10.rom.font_14);
for (Bitu i=0;i<256*14;i++) {
phys_writeb(font14pt+i,int10_font_14[i]);
}
phys_writeb(Real2Phys(int10.rom.font_14_alternate),0x1d);
// 8x8 fonts
PhysPt font8pt=Real2Phys(int10.rom.font_8_first);
for (Bitu i=0;i<128*8;i++) {
@ -234,6 +268,7 @@ void INT10_ReloadRomFonts(void) {
for (Bitu i=0;i<128*8;i++) {
phys_writeb(font8pt+i,int10_font_08[i+128*8]);
}
INT10_SetupRomMemoryChecksum();
}
void INT10_SetupRomMemoryChecksum(void) {
@ -1019,8 +1054,8 @@ Bit8u int10_font_16[256 * 16] = {
0x60, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0xc0,
0xc0, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x66, 0xff,
0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x6c, 0xfe,
0x6c, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x38, 0x38, 0x7c,
0x7c, 0xfe, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xfe, 0xfe, 0x7c, 0x7c,
@ -1057,8 +1092,8 @@ Bit8u int10_font_16[256 * 16] = {
0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x02, 0x06, 0x0c, 0x18,
0x30, 0x60, 0xc0, 0x80, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3c, 0x66, 0xc3, 0xc3, 0xdb, 0xdb,
0xc3, 0xc3, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x38, 0x6c, 0xc6, 0xc6, 0xd6, 0xd6,
0xc6, 0xc6, 0x6c, 0x38, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x18, 0x38, 0x78, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x7e, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7c, 0xc6, 0x06, 0x0c, 0x18, 0x30,
@ -1115,8 +1150,8 @@ Bit8u int10_font_16[256 * 16] = {
0x6c, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xf0, 0x60, 0x60, 0x60, 0x60, 0x60,
0x60, 0x62, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc3, 0xe7, 0xff, 0xff, 0xdb, 0xc3,
0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc6, 0xee, 0xfe, 0xfe, 0xd6, 0xc6,
0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc6, 0xe6, 0xf6, 0xfe, 0xde, 0xce,
0xc6, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7c, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
@ -1129,20 +1164,20 @@ Bit8u int10_font_16[256 * 16] = {
0x66, 0x66, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x7c, 0xc6, 0xc6, 0x60, 0x38, 0x0c,
0x06, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xff, 0xdb, 0x99, 0x18, 0x18, 0x18,
0x00, 0x00, 0x7e, 0x7e, 0x5a, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3,
0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb,
0xdb, 0xff, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18,
0x3c, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18,
0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
0xc6, 0x6c, 0x38, 0x10, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xd6, 0xd6,
0xd6, 0xfe, 0xee, 0x6c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc6, 0xc6, 0x6c, 0x7c, 0x38, 0x38,
0x7c, 0x6c, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x66, 0x66, 0x66, 0x66, 0x3c, 0x18,
0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xff, 0xc3, 0x86, 0x0c, 0x18, 0x30,
0x60, 0xc1, 0xc3, 0xff, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xfe, 0xc6, 0x86, 0x0c, 0x18, 0x30,
0x60, 0xc2, 0xc6, 0xfe, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3c, 0x30, 0x30, 0x30, 0x30, 0x30,
0x30, 0x30, 0x30, 0x3c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x80, 0xc0, 0xe0, 0x70, 0x38,
@ -1179,8 +1214,8 @@ Bit8u int10_font_16[256 * 16] = {
0x78, 0x6c, 0x66, 0xe6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x38, 0x18, 0x18, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xff, 0xdb,
0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xec, 0xfe, 0xd6,
0xd6, 0xd6, 0xd6, 0xc6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x66, 0x66,
0x66, 0x66, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x7c, 0xc6, 0xc6,
@ -1197,12 +1232,12 @@ Bit8u int10_font_16[256 * 16] = {
0x30, 0x30, 0x36, 0x1c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0xcc, 0xcc,
0xcc, 0xcc, 0xcc, 0x76, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3,
0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3,
0xdb, 0xdb, 0xff, 0x66, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c,
0x18, 0x3c, 0x66, 0xc3, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x66, 0x66,
0x66, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xd6,
0xd6, 0xd6, 0xfe, 0x6c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0x6c, 0x38,
0x38, 0x38, 0x6c, 0xc6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc6, 0xc6, 0xc6,
0xc6, 0xc6, 0xc6, 0x7e, 0x06, 0x0c, 0xf8, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0xcc, 0x18,
@ -1251,8 +1286,8 @@ Bit8u int10_font_16[256 * 16] = {
0xfe, 0xc6, 0xc6, 0xc6, 0x00, 0x00, 0x00, 0x00,
0x18, 0x30, 0x60, 0x00, 0xfe, 0x66, 0x60, 0x7c,
0x60, 0x60, 0x66, 0xfe, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x3b, 0x1b,
0x7e, 0xd8, 0xdc, 0x77, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xcc, 0x76, 0x36,
0x7e, 0xd8, 0xd8, 0x6e, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x3e, 0x6c, 0xcc, 0xcc, 0xfe, 0xcc,
0xcc, 0xcc, 0xcc, 0xce, 0x00, 0x00, 0x00, 0x00,
0x00, 0x10, 0x38, 0x6c, 0x00, 0x7c, 0xc6, 0xc6,
@ -1271,14 +1306,14 @@ Bit8u int10_font_16[256 * 16] = {
0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
0x00, 0xc6, 0x00, 0xc6, 0xc6, 0xc6, 0xc6, 0xc6,
0xc6, 0xc6, 0xc6, 0x7c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x18, 0x18, 0x7e, 0xc3, 0xc0, 0xc0, 0xc0,
0xc3, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x18, 0x18, 0x3c, 0x66, 0x60, 0x60, 0x60,
0x66, 0x3c, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x38, 0x6c, 0x64, 0x60, 0xf0, 0x60, 0x60,
0x60, 0x60, 0xe6, 0xfc, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0xff, 0x18,
0xff, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0xfc, 0x66, 0x66, 0x7c, 0x62, 0x66, 0x6f,
0x66, 0x66, 0x66, 0xf3, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x66, 0x66, 0x3c, 0x18, 0x7e, 0x18,
0x7e, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0xf8, 0xcc, 0xcc, 0xf8, 0xc4, 0xcc, 0xde,
0xcc, 0xcc, 0xcc, 0xc6, 0x00, 0x00, 0x00, 0x00,
0x00, 0x0e, 0x1b, 0x18, 0x18, 0x18, 0x7e, 0x18,
0x18, 0x18, 0x18, 0x18, 0xd8, 0x70, 0x00, 0x00,
0x00, 0x18, 0x30, 0x60, 0x00, 0x78, 0x0c, 0x7c,
@ -1304,9 +1339,9 @@ Bit8u int10_font_16[256 * 16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x06,
0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30,
0x60, 0xce, 0x9b, 0x06, 0x0c, 0x1f, 0x00, 0x00,
0x60, 0xdc, 0x86, 0x0c, 0x18, 0x3e, 0x00, 0x00,
0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30,
0x66, 0xce, 0x96, 0x3e, 0x06, 0x06, 0x00, 0x00,
0x66, 0xce, 0x9e, 0x3e, 0x06, 0x06, 0x00, 0x00,
0x00, 0x00, 0x18, 0x18, 0x00, 0x18, 0x18, 0x18,
0x3c, 0x3c, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x6c, 0xd8,
@ -1474,3 +1509,128 @@ Bit8u int10_font_16[256 * 16] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
Bit8u int10_font_14_alternate[20 * 15 + 1] = {
0x1d,
0x00, 0x00, 0x00, 0x00, 0x24, 0x66, 0xff,
0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00,
0x22,
0x00, 0x63, 0x63, 0x63, 0x22, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x2b,
0x00, 0x00, 0x00, 0x18, 0x18, 0x18, 0xff,
0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
0x2d,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x4d,
0x00, 0x00, 0xc3, 0xe7, 0xff, 0xdb, 0xc3,
0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00,
0x54,
0x00, 0x00, 0xff, 0xdb, 0x99, 0x18, 0x18,
0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00,
0x56,
0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3,
0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00,
0x57,
0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb,
0xdb, 0xff, 0x66, 0x66, 0x00, 0x00, 0x00,
0x58,
0x00, 0x00, 0xc3, 0xc3, 0x66, 0x3c, 0x18,
0x3c, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00,
0x59,
0x00, 0x00, 0xc3, 0xc3, 0xc3, 0x66, 0x3c,
0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00,
0x5a,
0x00, 0x00, 0xff, 0xc3, 0x86, 0x0c, 0x18,
0x30, 0x61, 0xc3, 0xff, 0x00, 0x00, 0x00,
0x6d,
0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xff,
0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00,
0x76,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3,
0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00,
0x77,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3,
0xdb, 0xdb, 0xff, 0x66, 0x00, 0x00, 0x00,
0x91,
0x00, 0x00, 0x00, 0x00, 0x6e, 0x3b, 0x1b,
0x7e, 0xd8, 0xdc, 0x77, 0x00, 0x00, 0x00,
0x9b,
0x00, 0x18, 0x18, 0x7e, 0xc3, 0xc0, 0xc0,
0xc3, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00,
0x9d,
0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0xff,
0x18, 0xff, 0x18, 0x18, 0x00, 0x00, 0x00,
0x9e,
0x00, 0xfc, 0x66, 0x66, 0x7c, 0x62, 0x66,
0x6f, 0x66, 0x66, 0xf3, 0x00, 0x00, 0x00,
0xf1,
0x00, 0x00, 0x18, 0x18, 0x18, 0xff, 0x18,
0x18, 0x18, 0x00, 0xff, 0x00, 0x00, 0x00,
0xf6,
0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0xff,
0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
0x00
};
Bit8u int10_font_16_alternate[19 * 17 + 1] = {
0x1d,
0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x66, 0xff,
0x66, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x30,
0x00, 0x00, 0x3c, 0x66, 0xc3, 0xc3, 0xdb, 0xdb,
0xc3, 0xc3, 0x66, 0x3c, 0x00, 0x00, 0x00, 0x00,
0x4d,
0x00, 0x00, 0xc3, 0xe7, 0xff, 0xff, 0xdb, 0xc3,
0xc3, 0xc3, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00,
0x54,
0x00, 0x00, 0xff, 0xdb, 0x99, 0x18, 0x18, 0x18,
0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
0x56,
0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3,
0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
0x57,
0x00, 0x00, 0xc3, 0xc3, 0xc3, 0xc3, 0xc3, 0xdb,
0xdb, 0xff, 0x66, 0x66, 0x00, 0x00, 0x00, 0x00,
0x58,
0x00, 0x00, 0xc3, 0xc3, 0x66, 0x3c, 0x18, 0x18,
0x3c, 0x66, 0xc3, 0xc3, 0x00, 0x00, 0x00, 0x00,
0x59,
0x00, 0x00, 0xc3, 0xc3, 0xc3, 0x66, 0x3c, 0x18,
0x18, 0x18, 0x18, 0x3c, 0x00, 0x00, 0x00, 0x00,
0x5a,
0x00, 0x00, 0xff, 0xc3, 0x86, 0x0c, 0x18, 0x30,
0x60, 0xc1, 0xc3, 0xff, 0x00, 0x00, 0x00, 0x00,
0x6d,
0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0xff, 0xdb,
0xdb, 0xdb, 0xdb, 0xdb, 0x00, 0x00, 0x00, 0x00,
0x76,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3,
0xc3, 0x66, 0x3c, 0x18, 0x00, 0x00, 0x00, 0x00,
0x77,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0xc3, 0xc3,
0xdb, 0xdb, 0xff, 0x66, 0x00, 0x00, 0x00, 0x00,
0x78,
0x00, 0x00, 0x00, 0x00, 0x00, 0xc3, 0x66, 0x3c,
0x18, 0x3c, 0x66, 0xc3, 0x00, 0x00, 0x00, 0x00,
0x91,
0x00, 0x00, 0x00, 0x00, 0x00, 0x6e, 0x3b, 0x1b,
0x7e, 0xd8, 0xdc, 0x77, 0x00, 0x00, 0x00, 0x00,
0x9b,
0x00, 0x18, 0x18, 0x7e, 0xc3, 0xc0, 0xc0, 0xc0,
0xc3, 0x7e, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
0x9d,
0x00, 0x00, 0xc3, 0x66, 0x3c, 0x18, 0xff, 0x18,
0xff, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
0x9e,
0x00, 0xfc, 0x66, 0x66, 0x7c, 0x62, 0x66, 0x6f,
0x66, 0x66, 0x66, 0xf3, 0x00, 0x00, 0x00, 0x00,
0xab,
0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30,
0x60, 0xce, 0x9b, 0x06, 0x0c, 0x1f, 0x00, 0x00,
0xac,
0x00, 0xc0, 0xc0, 0xc2, 0xc6, 0xcc, 0x18, 0x30,
0x66, 0xce, 0x96, 0x3e, 0x06, 0x06, 0x00, 0x00,
0x00
};

View file

@ -145,7 +145,8 @@ VideoModeBlock ModeList_VGA_Text_350lines[]={
{ 0x000 ,M_TEXT ,320 ,350 ,40 ,25 ,8 ,14 ,8 ,0xB8000 ,0x0800 ,50 ,449 ,40 ,350 ,_EGA_HALF_CLOCK },
{ 0x001 ,M_TEXT ,320 ,350 ,40 ,25 ,8 ,14 ,8 ,0xB8000 ,0x0800 ,50 ,449 ,40 ,350 ,_EGA_HALF_CLOCK },
{ 0x002 ,M_TEXT ,640 ,350 ,80 ,25 ,8 ,14 ,8 ,0xB8000 ,0x1000 ,100 ,449 ,80 ,350 ,0 },
{ 0x003 ,M_TEXT ,640 ,350 ,80 ,25 ,8 ,14 ,8 ,0xB8000 ,0x1000 ,100 ,449 ,80 ,350 ,0 }
{ 0x003 ,M_TEXT ,640 ,350 ,80 ,25 ,8 ,14 ,8 ,0xB8000 ,0x1000 ,100 ,449 ,80 ,350 ,0 },
{ 0x007 ,M_TEXT ,720 ,350 ,80 ,25 ,9 ,14 ,8 ,0xB0000 ,0x1000 ,100 ,449 ,80 ,350 ,0 }
};
VideoModeBlock ModeList_VGA_Tseng[]={
@ -441,10 +442,14 @@ static void FinishSetMode(bool clearmem) {
// Set active page 0
INT10_SetActivePage(0);
/* Set some interrupt vectors */
switch (CurMode->cheight) {
case 8:RealSetVec(0x43,int10.rom.font_8_first);break;
case 14:RealSetVec(0x43,int10.rom.font_14);break;
case 16:RealSetVec(0x43,int10.rom.font_16);break;
if (CurMode->mode<=3 || CurMode->mode==7)
RealSetVec(0x43,int10.rom.font_8_first);
else {
switch (CurMode->cheight) {
case 8:RealSetVec(0x43,int10.rom.font_8_first);break;
case 14:RealSetVec(0x43,int10.rom.font_14);break;
case 16:RealSetVec(0x43,int10.rom.font_16);break;
}
}
}
@ -682,10 +687,14 @@ bool INT10_SetVideoMode(Bit16u mode) {
if ((modeset_ctl&0x90)==0x80) { // 200 lines emulation
if (CurMode->mode <= 3) {
CurMode = &ModeList_VGA_Text_200lines[CurMode->mode];
} else if (CurMode->mode == 7) {
CurMode = &ModeList_VGA_Text_350lines[4];
}
} else if ((modeset_ctl&0x90)==0x00) { // 350 lines emulation
if (CurMode->mode <= 3) {
CurMode = &ModeList_VGA_Text_350lines[CurMode->mode];
} else if (CurMode->mode == 7) {
CurMode = &ModeList_VGA_Text_350lines[4];
}
}
}
@ -897,7 +906,7 @@ bool INT10_SetVideoMode(Bit16u mode) {
switch (CurMode->type) {
case M_TEXT:
max_scanline|=CurMode->cheight-1;
underline=mono_mode ? 0x0f : 0x1f; // mode 7 uses a diff underline position
underline=mono_mode ? CurMode->cheight-1 : 0x1f; // mode 7 uses underline position
break;
case M_VGA:
underline=0x40;
@ -913,8 +922,10 @@ bool INT10_SetVideoMode(Bit16u mode) {
case M_CGA4:
max_scanline|=1;
break;
default:
if (CurMode->vdispend==350) underline=0x0f;
break;
}
if (CurMode->vdispend==350) underline=0x0f;
IO_Write(crtc_base,0x09);IO_Write(crtc_base+1,max_scanline);
IO_Write(crtc_base,0x14);IO_Write(crtc_base+1,underline);