Setup the Tandy CRT/CPU page register
Add the Tandy set CRT/CPU page functions Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1840
This commit is contained in:
parent
35b0cc060c
commit
319cae5940
3 changed files with 29 additions and 4 deletions
|
@ -72,7 +72,26 @@ static Bitu INT10_Handler(void) {
|
|||
reg_ah=0;
|
||||
break;
|
||||
case 0x05: /* Set Active Page */
|
||||
if (reg_al & 0x80) LOG(LOG_INT10,LOG_NORMAL)("Tandy set CRT/CPU Page Func %x",reg_al);
|
||||
if (reg_al & 0x80 && machine==MCH_TANDY) {
|
||||
Bit8u crtcpu=real_readb(BIOSMEM_SEG, BIOSMEM_CRTCPU_PAGE);
|
||||
switch (reg_al) {
|
||||
case 0x80:
|
||||
reg_bh=crtcpu & 7;
|
||||
reg_bl=(crtcpu >> 3) & 0x7;
|
||||
break;
|
||||
case 0x81:
|
||||
crtcpu=(crtcpu & 0xc7) | ((reg_bl & 7) << 3);
|
||||
break;
|
||||
case 0x82:
|
||||
crtcpu=(crtcpu & 0xf8) | (reg_bh & 7);
|
||||
break;
|
||||
case 0x83:
|
||||
crtcpu=(crtcpu & 0xc0) | (reg_bh & 7) | ((reg_bl & 7) << 3);
|
||||
break;
|
||||
}
|
||||
IO_WriteB(0x3df,crtcpu);
|
||||
real_writeb(BIOSMEM_SEG, BIOSMEM_CRTCPU_PAGE,crtcpu);
|
||||
}
|
||||
else INT10_SetActivePage(reg_al);
|
||||
break;
|
||||
case 0x06: /* Scroll Up */
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#define BIOSMEM_SWITCHES 0x88
|
||||
#define BIOSMEM_MODESET_CTL 0x89
|
||||
#define BIOSMEM_DCC_INDEX 0x8A
|
||||
#define BIOSMEM_CRTCPU_PAGE 0x8A
|
||||
#define BIOSMEM_VS_POINTER 0xA8
|
||||
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ static void FinishSetMode(bool clearmem) {
|
|||
real_writeb(BIOSMEM_SEG,BIOSMEM_MODESET_CTL,real_readb(BIOSMEM_SEG,BIOSMEM_MODESET_CTL)&0x7f);
|
||||
|
||||
// FIXME We nearly have the good tables. to be reworked
|
||||
real_writeb(BIOSMEM_SEG,BIOSMEM_DCC_INDEX,0x08); // 8 is VGA should be ok for now
|
||||
if (machine==MCH_VGA) real_writeb(BIOSMEM_SEG,BIOSMEM_DCC_INDEX,0x08); // 8 is VGA should be ok for now
|
||||
real_writew(BIOSMEM_SEG,BIOSMEM_VS_POINTER,0x00);
|
||||
real_writew(BIOSMEM_SEG,BIOSMEM_VS_POINTER+2,0x00);
|
||||
|
||||
|
@ -246,7 +246,7 @@ bool INT10_SetVideoMode_OTHER(Bitu mode,bool clearmem) {
|
|||
//Vertical sync position
|
||||
IO_WriteW(crtc_base,0x07 | (CurMode->vdispend+1) << 8);
|
||||
//Maximum scanline
|
||||
Bit8u scanline;
|
||||
Bit8u scanline,crtpage;
|
||||
switch(CurMode->type) {
|
||||
case M_TEXT:
|
||||
if (machine==MCH_HERC) scanline=14;
|
||||
|
@ -296,13 +296,18 @@ bool INT10_SetVideoMode_OTHER(Bitu mode,bool clearmem) {
|
|||
IO_WriteB(0x3da,0x2);IO_WriteB(0x3de,0x0); //block border
|
||||
IO_WriteB(0x3da,0x3); //Tandy color overrides?
|
||||
switch (CurMode->mode) {
|
||||
case 0x8: case 0x9:
|
||||
case 0x8:
|
||||
IO_WriteB(0x3de,0x14);break;
|
||||
case 0x9:
|
||||
IO_WriteB(0x3de,0x14);break;
|
||||
case 0xa:
|
||||
IO_WriteB(0x3de,0x0c);break;
|
||||
default:
|
||||
IO_WriteB(0x3de,0x0);break;
|
||||
}
|
||||
crtpage=(CurMode->mode>=0x9) ? 0xf6 : 0x3f;
|
||||
IO_WriteB(0x3df,crtpage);
|
||||
real_writeb(BIOSMEM_SEG,BIOSMEM_CRTCPU_PAGE,crtpage);
|
||||
mode_control=mode_control_list[CurMode->mode];
|
||||
if (CurMode->mode == 0x6 || CurMode->mode==0xa) color_select=0x3f;
|
||||
else color_select=0x30;
|
||||
|
|
Loading…
Add table
Reference in a new issue