Add final (slightly modified and extended) part of patch 1295927 (vga accuracy) from keith. Add (modified) bug/patch 1241142(ansi emulation updates) from moe. Add fix suggested by vasyl to fix MyChess. Corrected some missing parts in these patches. (Missing update nbrows in dev_con.h). Implemented a writebuffer to workaround the CR/LF issue. Let's hope everything still works
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@2333
This commit is contained in:
parent
06d4ae4b3b
commit
0b4350c79d
7 changed files with 66 additions and 36 deletions
|
@ -46,6 +46,7 @@ static Bitu INT10_Handler(void) {
|
|||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (reg_ah) {
|
||||
case 0x00: /* Set VideoMode */
|
||||
INT10_SetVideoMode(reg_al);
|
||||
|
@ -279,6 +280,14 @@ graphics_chars:
|
|||
reg_cx=real_readb(BIOSMEM_SEG,BIOSMEM_SWITCHES) & 0x0F;
|
||||
break;
|
||||
}
|
||||
case 0x34: /* ALTERNATE FUNCTION SELECT (VGA) - CURSOR EMULATION */
|
||||
{
|
||||
// bit 0: 0=enable, 1=disable
|
||||
Bit8u temp = real_readb(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL) & 0xfe;
|
||||
real_writeb(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL,temp|reg_al);
|
||||
reg_al=0x12;
|
||||
break;
|
||||
}
|
||||
case 0x36: /* VGA Refresh control */
|
||||
/*
|
||||
Call disables/enables the vga from outputting video,
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
#define VGAMEM_MTEXT 0xB000
|
||||
|
||||
#define BIOS_NCOLS Bit16u ncols=real_readw(BIOSMEM_SEG,BIOSMEM_NB_COLS);
|
||||
#define BIOS_NROWS Bit16u nrows=real_readb(BIOSMEM_SEG,BIOSMEM_NB_ROWS)+1;
|
||||
#define BIOS_NROWS Bit16u nrows=real_readb(BIOSMEM_SEG,BIOSMEM_NB_ROWS);
|
||||
|
||||
extern Bit8u int10_font_08[256 * 8];
|
||||
extern Bit8u int10_font_14[256 * 14];
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: int10_char.cpp,v 1.37 2005-09-01 14:31:40 qbix79 Exp $ */
|
||||
/* $Id: int10_char.cpp,v 1.38 2005-10-02 10:12:31 qbix79 Exp $ */
|
||||
|
||||
/* Character displaying moving functions */
|
||||
|
||||
|
@ -309,11 +309,12 @@ void INT10_SetCursorShape(Bit8u first,Bit8u last) {
|
|||
goto dowrite;
|
||||
}
|
||||
/* Check if we need to convert CGA Bios cursor values */
|
||||
if (!(real_readb(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL) & 0x1)) {
|
||||
if (!(real_readb(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL) & 0x1)) { // set by int10 fun12 sub34
|
||||
// if (CurMode->mode>0x3) goto dowrite; //Only mode 0-3 are text modes on cga
|
||||
if ((first & 0xe0) || (last & 0xe0)) goto dowrite;
|
||||
Bit8u cheight=real_readb(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT)-1;
|
||||
/* Creative routine i based of the original ibmvga bios */
|
||||
|
||||
if (last<first) {
|
||||
if (!last) goto dowrite;
|
||||
first=last;
|
||||
|
@ -331,8 +332,9 @@ void INT10_SetCursorShape(Bit8u first,Bit8u last) {
|
|||
} else {
|
||||
first=(first-last)+cheight;
|
||||
last=cheight;
|
||||
if (cheight>0xc) {
|
||||
first--;
|
||||
|
||||
if (cheight>0xc) { // vgatest sets 15 15 2x where only one should be decremented to 14 14
|
||||
first--; // implementing int10 fun12 sub34 fixed this.
|
||||
last--;
|
||||
}
|
||||
}
|
||||
|
@ -537,7 +539,7 @@ void INT10_TeletypeOutputAttr(Bit8u chr,Bit8u attr,bool useattr) {
|
|||
cur_col=0;
|
||||
break;
|
||||
case '\n':
|
||||
cur_col=0;
|
||||
// cur_col=0; //Seems to break an old chess game
|
||||
cur_row++;
|
||||
break;
|
||||
case '\t':
|
||||
|
|
|
@ -66,7 +66,7 @@ void INT10_LoadFont(PhysPt font,bool reload,Bitu count,Bitu offset,Bitu map,Bitu
|
|||
IO_Write(base+1,(IO_Read(base+1) & 0xe0)|(height-1));
|
||||
//Vertical display end bios says, but should stay the same?
|
||||
//Rows setting in bios segment
|
||||
real_writeb(BIOSMEM_SEG,BIOSMEM_NB_ROWS,(CurMode->sheight/height)-1);
|
||||
real_writeb(BIOSMEM_SEG,BIOSMEM_NB_ROWS,(CurMode->sheight/height));
|
||||
real_writeb(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT,height);
|
||||
//TODO Reprogram cursor size?
|
||||
}
|
||||
|
|
|
@ -223,7 +223,7 @@ static void FinishSetMode(bool clearmem) {
|
|||
real_writew(BIOSMEM_SEG,BIOSMEM_NB_COLS,CurMode->twidth);
|
||||
real_writew(BIOSMEM_SEG,BIOSMEM_PAGE_SIZE,CurMode->plength);
|
||||
real_writew(BIOSMEM_SEG,BIOSMEM_CRTC_ADDRESS,((CurMode->mode==7 )|| (CurMode->mode==0x0f)) ? 0x3b4 : 0x3d4);
|
||||
real_writeb(BIOSMEM_SEG,BIOSMEM_NB_ROWS,CurMode->theight-1);
|
||||
real_writeb(BIOSMEM_SEG,BIOSMEM_NB_ROWS,CurMode->theight);
|
||||
real_writew(BIOSMEM_SEG,BIOSMEM_CHAR_HEIGHT,CurMode->cheight);
|
||||
real_writeb(BIOSMEM_SEG,BIOSMEM_VIDEO_CTL,(0x60|(clearmem?0:0x80)));
|
||||
real_writeb(BIOSMEM_SEG,BIOSMEM_SWITCHES,0x09);
|
||||
|
@ -487,12 +487,6 @@ bool INT10_SetVideoMode(Bitu mode) {
|
|||
overflow|=((CurMode->vtotal-2) & 0x200) >> 4;
|
||||
ver_overflow|=((CurMode->vtotal-2) & 0x400) >> 10;
|
||||
|
||||
/*
|
||||
These aren't exactly accurate i think,
|
||||
Should be more like a certain percentage based on vertical total
|
||||
So you get same sized borders, but okay :)
|
||||
*/
|
||||
|
||||
Bitu vretrace;
|
||||
switch (CurMode->vdispend) {
|
||||
case 400: vretrace=CurMode->vdispend+12;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue