Use phys_write for access to rom memory.
Remove usage of HostPt while reading the fonts. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1115
This commit is contained in:
parent
e850ceff5c
commit
3820b14384
3 changed files with 20 additions and 18 deletions
|
@ -180,7 +180,6 @@ void INT10_SetActivePage(Bit8u page) {
|
|||
mem_address=page*CurMode->plength;
|
||||
/* Write the new page start */
|
||||
real_writew(BIOSMEM_SEG,BIOSMEM_CURRENT_START,mem_address);
|
||||
if (CurMode->mode<8) mem_address>>=1;
|
||||
|
||||
/* Write the new start address in vgahardware */
|
||||
IO_Write(real_readw(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS),0x0c);
|
||||
|
@ -278,7 +277,7 @@ void INT10_ReadCharAttr(Bit16u * result,Bit8u page) {
|
|||
|
||||
|
||||
static void WriteChar(Bit16u col,Bit16u row,Bit8u page,Bit8u chr,Bit8u attr,bool useattr) {
|
||||
Bit8u * fontdata;
|
||||
PhysPt fontdata;
|
||||
Bitu x,y;
|
||||
switch (CurMode->type) {
|
||||
case M_TEXT16:
|
||||
|
@ -295,14 +294,14 @@ static void WriteChar(Bit16u col,Bit16u row,Bit8u page,Bit8u chr,Bit8u attr,bool
|
|||
return;
|
||||
case M_CGA4:
|
||||
case M_CGA2:
|
||||
if (chr<128) fontdata=Real2Host(RealGetVec(0x43))+chr*8;
|
||||
if (chr<128) fontdata=Real2Phys(RealGetVec(0x43))+chr*8;
|
||||
else {
|
||||
chr-=128;
|
||||
fontdata=Real2Host(RealGetVec(0x1F))+(chr)*8;
|
||||
fontdata=Real2Phys(RealGetVec(0x1F))+(chr)*8;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
fontdata=Real2Host(RealGetVec(0x43))+chr*real_readw(0x40,BIOSMEM_CHAR_HEIGHT);
|
||||
fontdata=Real2Phys(RealGetVec(0x43))+chr*real_readw(0x40,BIOSMEM_CHAR_HEIGHT);
|
||||
break;
|
||||
}
|
||||
x=8*col;
|
||||
|
@ -310,7 +309,7 @@ static void WriteChar(Bit16u col,Bit16u row,Bit8u page,Bit8u chr,Bit8u attr,bool
|
|||
//TODO Check for out of bounds
|
||||
for (Bit8u h=0;h<CurMode->cheight;h++) {
|
||||
Bit8u bitsel=128;
|
||||
Bit8u bitline=*fontdata++;
|
||||
Bit8u bitline=mem_readb(fontdata);
|
||||
Bit16u tx=x;
|
||||
while (bitsel) {
|
||||
if (bitline&bitsel) INT10_PutPixel(tx,y,page,attr);
|
||||
|
|
|
@ -72,33 +72,35 @@ void INT10_LoadFont(PhysPt font,bool reload,Bitu count,Bitu offset,Bitu map,Bitu
|
|||
|
||||
|
||||
|
||||
|
||||
void INT10_SetupRomMemory(void) {
|
||||
/* This should fill up certain structures inside the Video Bios Rom Area */
|
||||
PhysPt rom_base=PhysMake(0xc000,0);
|
||||
Bitu i;
|
||||
int10.rom.used=2;
|
||||
real_writew(0xc000,0,0xaa55);
|
||||
phys_writew(rom_base+0,0xaa55);
|
||||
int10.rom.font_8_first=RealMake(0xC000,int10.rom.used);
|
||||
for (i=0;i<128*8;i++) {
|
||||
real_writeb(0xC000,int10.rom.used++,int10_font_08[i]);
|
||||
phys_writeb(rom_base+int10.rom.used++,int10_font_08[i]);
|
||||
}
|
||||
int10.rom.font_8_second=RealMake(0xC000,int10.rom.used);
|
||||
for (i=0;i<128*8;i++) {
|
||||
real_writeb(0xC000,int10.rom.used++,int10_font_08[i+128*8]);
|
||||
phys_writeb(rom_base+int10.rom.used++,int10_font_08[i+128*8]);
|
||||
}
|
||||
int10.rom.font_14=RealMake(0xC000,int10.rom.used);
|
||||
for (i=0;i<256*14;i++) {
|
||||
real_writeb(0xC000,int10.rom.used++,int10_font_14[i]);
|
||||
phys_writeb(rom_base+int10.rom.used++,int10_font_14[i]);
|
||||
}
|
||||
int10.rom.font_16=RealMake(0xC000,int10.rom.used);
|
||||
for (i=0;i<256*16;i++) {
|
||||
real_writeb(0xC000,int10.rom.used++,int10_font_16[i]);
|
||||
phys_writeb(rom_base+int10.rom.used++,int10_font_16[i]);
|
||||
}
|
||||
int10.rom.static_state=RealMake(0xC000,int10.rom.used);
|
||||
for (i=0;i<0x10;i++) {
|
||||
real_writeb(0xC000,int10.rom.used++,static_functionality[i]);
|
||||
phys_writeb(rom_base+int10.rom.used++,static_functionality[i]);
|
||||
}
|
||||
for (i=0;i<128*8;i++) {
|
||||
phys_writeb(PhysMake(0xf000,0xfa6e)+i,int10_font_08[i]);
|
||||
}
|
||||
MEM_BlockWrite(PhysMake(0xf000,0xfa6e),int10_font_08,128*8);
|
||||
RealSetVec(0x1F,int10.rom.font_8_second);
|
||||
};
|
||||
|
||||
|
|
|
@ -281,17 +281,18 @@ void INT10_SetupVESA(void) {
|
|||
//TODO Maybe add normal vga modes too, but only seems to complicate things
|
||||
while (ModeList[i].mode!=0xffff) {
|
||||
if (ModeList[i].mode>=0x100){
|
||||
real_writew(0xc000,int10.rom.used,ModeList[i].mode);
|
||||
phys_writew(PhysMake(0xc000,int10.rom.used),ModeList[i].mode);
|
||||
int10.rom.used+=2;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
real_writew(0xc000,int10.rom.used,0xffff);
|
||||
phys_writew(PhysMake(0xc000,int10.rom.used),0xffff);
|
||||
int10.rom.used+=2;
|
||||
int10.rom.oemstring=RealMake(0xc000,int10.rom.used);
|
||||
Bitu len=strlen(oemstring)+1;
|
||||
MEM_BlockWrite(PhysMake(0xc000,int10.rom.used),oemstring,len);
|
||||
int10.rom.used+=len;
|
||||
for (i=0;i<len;i++) {
|
||||
phys_writeb(0xc0000+i+int10.rom.used++,oemstring[i]);
|
||||
}
|
||||
callback.setwindow=CALLBACK_Allocate();
|
||||
CALLBACK_Setup(callback.setwindow,SetWindowPositionHandler,CB_RETF);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue