Skip to content

Commit

Permalink
As in r4371 for writing characters, use real pointer with font data f…
Browse files Browse the repository at this point in the history
…or reading characters. Also ignore page number for modes with only one page, which fixes https://www.pouet.net/prod.php?which=65584

git-svn-id: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4474 ed541006-0bf7-43e9-8c4d-6fc63c346d47
  • Loading branch information
ripsaw8080 committed Apr 14, 2022
1 parent 0e0c57a commit d00cdb2
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/ints/int10_char.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ void INT10_SetCursorPos(Bit8u row,Bit8u col,Bit8u page) {

void ReadCharAttr(Bit16u col,Bit16u row,Bit8u page,Bit16u * result) {
/* Externally used by the mouse routine */
PhysPt fontdata;
RealPt fontdata;
Bit16u cols = real_readw(BIOSMEM_SEG,BIOSMEM_NB_COLS);
BIOS_CHEIGHT;
bool split_chr = false;
Expand All @@ -425,32 +425,33 @@ void ReadCharAttr(Bit16u col,Bit16u row,Bit8u page,Bit16u * result) {
switch (machine) {
case MCH_CGA:
case MCH_HERC:
fontdata=PhysMake(0xf000,0xfa6e);
fontdata=RealMake(0xf000,0xfa6e);
break;
case TANDY_ARCH_CASE:
fontdata=Real2Phys(RealGetVec(0x44));
fontdata=RealGetVec(0x44);
break;
default:
fontdata=Real2Phys(RealGetVec(0x43));
fontdata=RealGetVec(0x43);
break;
}
break;
default:
fontdata=Real2Phys(RealGetVec(0x43));
fontdata=RealGetVec(0x43);
break;
}

Bitu x=col*8,y=row*cheight*(cols/CurMode->twidth);

for (Bit16u chr=0;chr<256;chr++) {

if (chr==128 && split_chr) fontdata=Real2Phys(RealGetVec(0x1f));
if (chr==128 && split_chr) fontdata=RealGetVec(0x1f);

bool error=false;
Bit16u ty=(Bit16u)y;
for (Bit8u h=0;h<cheight;h++) {
Bit8u bitsel=128;
Bit8u bitline=mem_readb(fontdata++);
Bit8u bitline=mem_readb(Real2Phys(fontdata));
fontdata=RealMake(RealSeg(fontdata),RealOff(fontdata)+1);
Bit8u res=0;
Bit8u vidline=0;
Bit16u tx=(Bit16u)x;
Expand All @@ -464,7 +465,7 @@ void ReadCharAttr(Bit16u col,Bit16u row,Bit8u page,Bit16u * result) {
ty++;
if(bitline != vidline){
/* It's not character 'chr', move on to the next */
fontdata+=(cheight-h-1);
fontdata=RealMake(RealSeg(fontdata),RealOff(fontdata)+cheight-h-1);
error = true;
break;
}
Expand All @@ -479,6 +480,7 @@ void ReadCharAttr(Bit16u col,Bit16u row,Bit8u page,Bit16u * result) {
*result = 0;
}
void INT10_ReadCharAttr(Bit16u * result,Bit8u page) {
if(CurMode->ptotal==1) page=0;
if(page==0xFF) page=real_readb(BIOSMEM_SEG,BIOSMEM_CURRENT_PAGE);
Bit8u cur_row=CURSOR_POS_ROW(page);
Bit8u cur_col=CURSOR_POS_COL(page);
Expand Down

0 comments on commit d00cdb2

Please sign in to comment.