My opionion about dosbox is major for dosgame play,
But If dosbox can perfectly simulate a real pc(real mode)
in every aspect , It is more great !
After I try a while , I find the soultion to fix this problem.
If anyone interesting What game is relative this issue,I had 2 chinese chess game
below is code chage in int10_char.cpp
void WriteChar(Bit16u col,Bit16u row,Bit8u page,Bit8u chr,Bit8u attr,bool useattr) {
/* Externally used by the mouse routine */
PhysPt fontdata;
Bitu x,y;
Bit8u cheight = real_readb(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT);
switch (CurMode->type) {
case M_TEXT:
{
// Compute the address
Bit16u address=page*real_readw(BIOSMEM_SEG,BIOSMEM_PAGE_SIZE);
address+=(row*real_readw(BIOSMEM_SEG,BIOSMEM_NB_COLS)+col)*2;
// Write the char
PhysPt where = CurMode->pstart+address;
mem_writeb(where,chr);
if (useattr) {
mem_writeb(where+1,attr);
}
}
return;
case M_CGA4:
case M_CGA2:
case M_TANDY16:
if (chr<128) fontdata=Real2Phys(RealGetVec(0x43))+chr*cheight;
else {
chr-=128;
fontdata=Real2Phys(RealGetVec(0x1F))+(chr)*cheight;
}
break;
default:
fontdata=Real2Phys(RealGetVec(0x43))+chr*cheight;
break;
}
if(GCC_UNLIKELY(!useattr)) { //Set attribute(color) to a sensible value
static bool warned_use = false;
if(GCC_UNLIKELY(!warned_use)){
LOG(LOG_INT10,LOG_ERROR)("writechar used without attribute in non-textmode");
warned_use = true;
}
switch(CurMode->type) {
case M_CGA4:
case M_CGA2:
// attr = 0x1; // ***delete***
break;
case M_TANDY16:
case M_EGA16:
default:
attr = 0xf;
break;
}
}
x=8*col;
y=cheight*row;Bit8u xor_mask=(CurMode->type == M_VGA) ? 0x0 : 0x80;
//TODO Check for out of bounds
if (CurMode->type==M_EGA16) {
/* enable all planes for EGA modes (Ultima 1 colour bug) */
/* might be put into INT10_PutPixel but different vga bios
implementations have different opinions about this */
IO_Write(0x3c4,0x2);IO_Write(0x3c5,0xf);
}
for (Bit8u h=0;h<cheight;h++) {
Bit8u bitsel=128;
Bit8u bitline=mem_readb(fontdata++);
Bit16u tx=x;
while (bitsel) {
switch (CurMode->type) { // ****new add***
case M_CGA4:
case M_CGA2:
if(attr & xor_mask)
{
if(bitline&bitsel) INT10_PutPixel(tx,y,page,0x81);
}
else
{
if(bitline&bitsel) INT10_PutPixel(tx,y,page,attr&1);
else INT10_PutPixel(tx,y,page,0 );
}
break;
default:
if (bitline&bitsel) INT10_PutPixel(tx,y,page,attr);
else INT10_PutPixel(tx,y,page,attr & xor_mask);
break;
}
tx++;
bitsel>>=1;
}
y++;
}
}[code][/code]