1
0
Fork 0

add possibility to emulate older vesa version to work around some buggy games (fixes Supreme Warrior)

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3153
This commit is contained in:
Sebastian Strohhäcker 2008-05-10 17:33:28 +00:00
parent 3a57da9aed
commit caa9317946
5 changed files with 32 additions and 18 deletions

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: int10.cpp,v 1.51 2008-03-31 14:43:34 c2woody Exp $ */
/* $Id: int10.cpp,v 1.52 2008-05-10 17:33:28 c2woody Exp $ */
#include "dosbox.h"
#include "mem.h"
@ -587,6 +587,10 @@ graphics_chars:
}
break;
case 0x0a: /* Get Pmode Interface */
if (int10.vesa_oldvbe) {
reg_ax=0x014f;
break;
}
switch (reg_bl) {
case 0x00:
reg_edi=RealOff(int10.rom.pmode_interface);

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: int10.h,v 1.35 2008-03-14 18:16:34 c2woody Exp $ */
/* $Id: int10.h,v 1.36 2008-05-10 17:33:28 c2woody Exp $ */
#include "vga.h"
@ -141,6 +141,7 @@ typedef struct {
} rom;
Bitu vesa_setmode;
bool vesa_nolfb;
bool vesa_oldvbe;
} Int10Data;
extern Int10Data int10;

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: int10_modes.cpp,v 1.77 2008-02-03 20:43:14 c2woody Exp $ */
/* $Id: int10_modes.cpp,v 1.78 2008-05-10 17:33:28 c2woody Exp $ */
#include <string.h>
@ -330,14 +330,17 @@ VideoModeBlock * CurMode;
static bool SetCurMode(VideoModeBlock modeblock[],Bitu mode) {
Bitu i=0;
while ( modeblock[i].mode!=0xffff) {
if ( modeblock[i].mode==mode) goto foundmode;
i++;
while (modeblock[i].mode!=0xffff) {
if (modeblock[i].mode!=mode) i++;
else {
if ((!int10.vesa_oldvbe) || (ModeList_VGA[i].mode<0x120)) {
CurMode=&modeblock[i];
return true;
}
return false;
}
}
return false;
foundmode:
CurMode=&modeblock[i];
return true;
}

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: int10_vesa.cpp,v 1.35 2008-02-08 21:25:57 c2woody Exp $ */
/* $Id: int10_vesa.cpp,v 1.36 2008-05-10 17:33:28 c2woody Exp $ */
#include <string.h>
#include <stddef.h>
@ -91,15 +91,16 @@ Bit8u VESA_GetSVGAInformation(Bit16u seg,Bit16u off) {
Bitu i;
bool vbe2=false;Bit16u vbe2_pos=256+off;
Bitu id=mem_readd(buffer);
if ((id==0x56424532)||(id==0x32454256)) vbe2=true;
if (((id==0x56424532)||(id==0x32454256)) && (!int10.vesa_oldvbe)) vbe2=true;
if (vbe2) {
for (i=0;i<0x200;i++) mem_writeb(buffer+i,0);
} else {
for (i=0;i<0x100;i++) mem_writeb(buffer+i,0);
}
/* Fill common data */
MEM_BlockWrite(buffer,(void *)"VESA",4); //Identification
mem_writew(buffer+0x04,0x200); //Vesa version 0x200
MEM_BlockWrite(buffer,(void *)"VESA",4); //Identification
if (!int10.vesa_oldvbe) mem_writew(buffer+0x04,0x200); //Vesa version 2.0
else mem_writew(buffer+0x04,0x102); //Vesa version 1.2
if (vbe2) {
mem_writed(buffer+0x06,RealMake(seg,vbe2_pos));
for (i=0;i<sizeof(string_oem);i++) real_writeb(seg,vbe2_pos++,string_oem[i]);
@ -137,6 +138,7 @@ Bit8u VESA_GetSVGAModeInformation(Bit16u mode,Bit16u seg,Bit16u off) {
}
return 0x01;
foundit:
if ((int10.vesa_oldvbe) && (ModeList_VGA[i].mode>=0x120)) return 0x01;
VideoModeBlock * mblock=&ModeList_VGA[i];
switch (mblock->type) {
case M_LIN4:
@ -472,8 +474,10 @@ void INT10_SetupVESA(void) {
if (svga.accepts_mode(ModeList_VGA[i].mode)) canuse_mode=true;
}
if (ModeList_VGA[i].mode>=0x100 && canuse_mode) {
phys_writew(PhysMake(0xc000,int10.rom.used),ModeList_VGA[i].mode);
int10.rom.used+=2;
if ((!int10.vesa_oldvbe) || (ModeList_VGA[i].mode<0x120)) {
phys_writew(PhysMake(0xc000,int10.rom.used),ModeList_VGA[i].mode);
int10.rom.used+=2;
}
}
i++;
}