1
0
Fork 0

Add support for M_TANDY16 to GetPixel(). Fixes text and mouse pointer drawing in Tandy graphics modes.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3883
This commit is contained in:
ripsaw8080 2015-01-06 17:54:58 +00:00
parent 5fef7164a5
commit 7acd780244

View file

@ -200,6 +200,26 @@ void INT10_GetPixel(Bit16u x,Bit16u y,Bit8u page,Bit8u * color) {
*color=(val>>(((7-(x&7))))) & 1 ;
}
break;
case M_TANDY16:
{
bool is_32k = (real_readb(BIOSMEM_SEG, BIOSMEM_CURRENT_MODE) >= 9)?true:false;
Bit16u segment, offset;
if (is_32k) {
if (machine==MCH_PCJR) {
Bitu cpupage = (real_readb(BIOSMEM_SEG, BIOSMEM_CRTCPU_PAGE) >> 3) & 0x7;
segment = cpupage << 10;
} else segment = 0xb800;
offset = (y >> 2) * (CurMode->swidth >> 1) + (x>>1);
offset += (8*1024) * (y & 3);
} else {
segment = 0xb800;
offset = (y >> 1) * (CurMode->swidth >> 1) + (x>>1);
offset += (8*1024) * (y & 1);
}
Bit8u val=real_readb(segment,offset);
*color=(val>>((x&1)?0:4)) & 0xf;
}
break;
case M_EGA:
{
/* Calculate where the pixel is in video memory */