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:
parent
3a57da9aed
commit
caa9317946
5 changed files with 32 additions and 18 deletions
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: dosbox.cpp,v 1.134 2008-04-29 08:24:16 qbix79 Exp $ */
|
||||
/* $Id: dosbox.cpp,v 1.135 2008-05-10 17:33:27 c2woody Exp $ */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
@ -279,9 +279,10 @@ static void DOSBOX_RealInit(Section * sec) {
|
|||
}
|
||||
|
||||
std::string mtype(section->Get_string("machine"));
|
||||
svgaCard = SVGA_S3Trio;
|
||||
svgaCard = SVGA_None;
|
||||
machine = MCH_VGA;
|
||||
int10.vesa_nolfb = false;
|
||||
int10.vesa_oldvbe = false;
|
||||
if (mtype == "cga") { machine = MCH_CGA; }
|
||||
else if (mtype == "tandy") { machine = MCH_TANDY; }
|
||||
else if (mtype == "pcjr") { machine = MCH_PCJR; }
|
||||
|
@ -290,6 +291,7 @@ static void DOSBOX_RealInit(Section * sec) {
|
|||
// else if (mtype == "vga") { svgaCard = SVGA_S3Trio; }
|
||||
else if (mtype == "svga_s3") { svgaCard = SVGA_S3Trio; }
|
||||
else if (mtype == "vesa_nolfb") { svgaCard = SVGA_S3Trio; int10.vesa_nolfb = true;}
|
||||
else if (mtype == "vesa_oldvbe") { svgaCard = SVGA_S3Trio; int10.vesa_oldvbe = true;}
|
||||
else if (mtype == "svga_et4000") { svgaCard = SVGA_TsengET4K; }
|
||||
else if (mtype == "svga_et3000") { svgaCard = SVGA_TsengET3K; }
|
||||
// else if (mtype == "vga_pvga1a") { svgaCard = SVGA_ParadisePVGA1A; }
|
||||
|
@ -324,7 +326,7 @@ void DOSBOX_Init(void) {
|
|||
const char* machines[] = {
|
||||
"hercules", "cga", "tandy", "pcjr", "ega",
|
||||
"vgaonly", "svga_s3", "svga_et3000", "svga_et4000",
|
||||
"svga_paradise", "vesa_nolfb", 0 };
|
||||
"svga_paradise", "vesa_nolfb", "vesa_oldvbe", 0 };
|
||||
secprop=control->AddSection_prop("dosbox",&DOSBOX_RealInit);
|
||||
Pstring = secprop->Add_string("language",Property::Changeable::Always,"");
|
||||
Pstring->Set_help("Select another language 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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue