1
0
Fork 0

hercules updates from hal (fixes jet)

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3273
This commit is contained in:
Sebastian Strohhäcker 2009-01-25 12:00:52 +00:00
parent d25f384276
commit 70a150c2d6
5 changed files with 63 additions and 71 deletions

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: vga_misc.cpp,v 1.38 2009-01-11 18:22:59 c2woody Exp $ */
/* $Id: vga_misc.cpp,v 1.39 2009-01-25 12:00:49 c2woody Exp $ */
#include "dosbox.h"
#include "inout.h"
@ -31,54 +31,27 @@ void vga_write_p3d5(Bitu port,Bitu val,Bitu iolen);
Bitu vga_read_p3d5(Bitu port,Bitu iolen);
Bitu vga_read_p3da(Bitu port,Bitu iolen) {
vga.internal.attrindex=false;
vga.tandy.pcjr_flipflop=false;
Bit8u retval=0;
double timeInFrame = PIC_FullIndex()-vga.draw.delay.framestart;
vga.internal.attrindex=false;
vga.tandy.pcjr_flipflop=false;
vga.internal.attrindex=false;
vga.tandy.pcjr_flipflop=false;
if (machine!=MCH_HERC) {
// 3DAh (R): Status Register
// bit 0 Horizontal or Vertical blanking
// 3 Vertical sync
// 3DAh (R): Status Register
// bit 0 Horizontal or Vertical blanking
// 3 Vertical sync
if (timeInFrame >= vga.draw.delay.vrstart &&
timeInFrame <= vga.draw.delay.vrend)
retval |= 8;
if (timeInFrame >= vga.draw.delay.vdend) {
retval |= 1;
} else {
double timeInLine=fmod(timeInFrame,vga.draw.delay.htotal);
if (timeInLine >= vga.draw.delay.hblkstart &&
timeInLine <= vga.draw.delay.hblkend) {
retval |= 1;
}
}
if (timeInFrame >= vga.draw.delay.vrstart &&
timeInFrame <= vga.draw.delay.vrend)
retval |= 8;
if (timeInFrame >= vga.draw.delay.vdend) {
retval |= 1;
} else {
// 3BAh (R): Status Register
// bit 0 Horizontal sync
// 1 Light pen status (only some cards)
// 3 Video signal
// 4-6 000: Hercules
// 001: Hercules Plus
// 101: Hercules InColor
// 111: Unknown clone
// 7 Vertical sync inverted
retval=0x72; // Hercules ident; from a working card (Winbond W86855AF)
// Another known working card has 0x76 ("KeysoGood", full-length)
if (timeInFrame < vga.draw.delay.vrstart ||
timeInFrame > vga.draw.delay.vrend) retval |= 0x80;
double timeInLine=fmod(timeInFrame,vga.draw.delay.htotal);
if (timeInLine >= vga.draw.delay.hrstart &&
timeInLine <= vga.draw.delay.hrend) retval |= 0x1;
// 688 Attack sub checks bit 3 - as a workaround have the bit enabled
// if no sync active (corresponds to a completely white screen)
if ((retval&0x81)==0x80) retval |= 0x8;
if (timeInLine >= vga.draw.delay.hblkstart &&
timeInLine <= vga.draw.delay.hblkend) {
retval |= 1;
}
}
return retval;
}
@ -178,7 +151,5 @@ void VGA_SetupMisc(void) {
}
} else if (machine==MCH_CGA || IS_TANDY_ARCH) {
IO_RegisterReadHandler(0x3da,vga_read_p3da,IO_MB);
} else if (machine==MCH_HERC) {
IO_RegisterReadHandler(0x3ba,vga_read_p3da,IO_MB);
}
}

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: vga_other.cpp,v 1.24 2009-01-11 18:22:59 c2woody Exp $ */
/* $Id: vga_other.cpp,v 1.25 2009-01-25 12:00:51 c2woody Exp $ */
#include <string.h>
#include <math.h>
@ -24,6 +24,7 @@
#include "inout.h"
#include "vga.h"
#include "mem.h"
#include "pic.h"
#include "render.h"
#include "mapper.h"
@ -475,6 +476,33 @@ static void write_hercules(Bitu port,Bitu val,Bitu iolen) {
return 0;
} */
Bitu read_herc_status(Bitu port,Bitu iolen) {
// 3BAh (R): Status Register
// bit 0 Horizontal sync
// 1 Light pen status (only some cards)
// 3 Video signal
// 4-6 000: Hercules
// 001: Hercules Plus
// 101: Hercules InColor
// 111: Unknown clone
// 7 Vertical sync inverted
double timeInFrame = PIC_FullIndex()-vga.draw.delay.framestart;
Bit8u retval=0x72; // Hercules ident; from a working card (Winbond W86855AF)
// Another known working card has 0x76 ("KeysoGood", full-length)
if (timeInFrame < vga.draw.delay.vrstart ||
timeInFrame > vga.draw.delay.vrend) retval |= 0x80;
double timeInLine=fmod(timeInFrame,vga.draw.delay.htotal);
if (timeInLine >= vga.draw.delay.hrstart &&
timeInLine <= vga.draw.delay.hrend) retval |= 0x1;
// 688 Attack sub checks bit 3 - as a workaround have the bit enabled
// if no sync active (corresponds to a completely white screen)
if ((retval&0x81)==0x80) retval |= 0x8;
return retval;
}
void VGA_SetupOther(void) {
Bitu i;
@ -532,6 +560,7 @@ void VGA_SetupOther(void) {
vga.crtc.underline_location = 13;
IO_RegisterWriteHandler(0x3b8,write_hercules,IO_MB);
IO_RegisterWriteHandler(0x3bf,write_hercules,IO_MB);
IO_RegisterReadHandler(0x3ba,read_herc_status,IO_MB);
}
if (machine==MCH_CGA) {
Bitu base=0x3d0;

View file

@ -1,5 +1,5 @@
/*
* Copyright (C) 2002-2008 The DOSBox Team
* Copyright (C) 2002-2009 The DOSBox Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: int10.cpp,v 1.53 2008-10-05 14:44:52 qbix79 Exp $ */
/* $Id: int10.cpp,v 1.54 2009-01-25 12:00:52 c2woody Exp $ */
#include "dosbox.h"
#include "mem.h"
@ -442,7 +442,7 @@ graphics_chars:
for (ct=0; ct<entries; ct++) {
Bit16u dccentry=real_readw(RealSeg(dcctable),RealOff(dcctable)+0x04+ct*2);
if ((dccentry==reg_bx) || (dccentry==swpidx)) {
newidx=ct;
newidx=(Bit8u)ct;
break;
}
}
@ -473,7 +473,7 @@ graphics_chars:
Bitu ret=INT10_VideoState_GetSize(reg_cx);
if (ret) {
reg_al=0x1c;
reg_bx=ret;
reg_bx=(Bit16u)ret;
} else reg_al=0;
}
break;
@ -517,7 +517,7 @@ graphics_chars:
Bitu ret=INT10_VideoState_GetSize(reg_cx);
if (ret) {
reg_ah=0;
reg_bx=ret;
reg_bx=(Bit16u)ret;
} else reg_ah=1;
}
break;
@ -707,7 +707,7 @@ static void SetupTandyBios(void) {
}
}
void INT10_Init(Section* sec) {
void INT10_Init(Section* /*sec*/) {
INT10_InitVGA();
if (IS_TANDY_ARCH) SetupTandyBios();
/* Setup the INT 10 vector */
@ -719,5 +719,5 @@ void INT10_Init(Section* sec) {
INT10_Seg40Init();
INT10_SetupVESA();
INT10_SetupRomMemoryChecksum();//SetupVesa modifies the rom as well.
INT10_SetVideoMode(machine==MCH_HERC ? 0x7 : 0x3);
INT10_SetVideoMode(0x3);
}

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: int10_modes.cpp,v 1.84 2009-01-11 18:22:59 c2woody Exp $ */
/* $Id: int10_modes.cpp,v 1.85 2009-01-25 12:00:52 c2woody Exp $ */
#include <string.h>
@ -432,11 +432,6 @@ bool INT10_SetVideoMode_OTHER(Bitu mode,bool clearmem) {
}
break;
case MCH_HERC:
if (mode!=7) {
//Just the text memory, most games seem to use any random mode to clear the screen
for (i=0;i<16*1024;i++) real_writew(0xb000,i*2,0x0720);
return false;
}
CurMode=&Hercules_Mode;
break;
}
@ -504,11 +499,9 @@ bool INT10_SetVideoMode_OTHER(Bitu mode,bool clearmem) {
IO_WriteB(0x3b8,0x28); // TEXT mode and blinking characters
VGA_DAC_CombineColor(0,0);
VGA_DAC_CombineColor(8,0);
for ( i = 1; i < 8;i++) {
VGA_DAC_CombineColor(i,0x7);
VGA_DAC_CombineColor(i+8,0xf);
}
VGA_DAC_CombineColor(1,7);
real_writeb(BIOSMEM_SEG,BIOSMEM_CURRENT_MSR,0x29); // attribute controls blinking
break;
case MCH_CGA:
mode_control=mode_control_list[CurMode->mode];
@ -1210,7 +1203,8 @@ dac_text16:
case 0:real_writeb(BIOSMEM_SEG,BIOSMEM_CURRENT_MSR,0x2c);break;
case 1:real_writeb(BIOSMEM_SEG,BIOSMEM_CURRENT_MSR,0x28);break;
case 2:real_writeb(BIOSMEM_SEG,BIOSMEM_CURRENT_MSR,0x2d);break;
case 3:real_writeb(BIOSMEM_SEG,BIOSMEM_CURRENT_MSR,0x29);break;
case 3:
case 7:real_writeb(BIOSMEM_SEG,BIOSMEM_CURRENT_MSR,0x29);break;
}
break;
case M_LIN4:

View file

@ -16,7 +16,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
/* $Id: shell_cmds.cpp,v 1.85 2009-01-11 18:22:59 c2woody Exp $ */
/* $Id: shell_cmds.cpp,v 1.86 2009-01-25 12:00:52 c2woody Exp $ */
#include "dosbox.h"
#include "shell.h"
@ -167,9 +167,7 @@ void DOS_Shell::DoCommand(char * line) {
void DOS_Shell::CMD_CLS(char * args) {
HELP("CLS");
// 3 is not good for hercules as it 'forgets' to reset the cursor position
if (machine==MCH_HERC) reg_ax=0x0007;
else reg_ax=0x0003;
reg_ax=0x0003;
CALLBACK_RunRealInt(0x10);
}
@ -907,7 +905,7 @@ void DOS_Shell::CMD_SUBST (char * args) {
command.FindCommand(1,arg);
if( (arg.size()>1) && arg[1] !=':') throw(0);
temp_str[0]=toupper(args[0]);
temp_str[0]=(char)toupper(args[0]);
if(Drives[temp_str[0]-'A'] ) throw 0; //targetdrive in use
strcat(mountstring,temp_str);
strcat(mountstring," ");
@ -981,7 +979,7 @@ void DOS_Shell::CMD_CHOICE(char * args){
if (!rem || !*rem) rem = defchoice; /* No choices specified use YN */
ptr = rem;
Bit8u c;
if(!optS) while ((c = *ptr)) *ptr++ = toupper(c); /* When in no case-sensitive mode. make everything upcase */
if(!optS) while ((c = *ptr)) *ptr++ = (char)toupper(c); /* When in no case-sensitive mode. make everything upcase */
if(args && *args ) {
StripSpaces(args);
size_t argslen = strlen(args);
@ -1006,7 +1004,7 @@ void DOS_Shell::CMD_CHOICE(char * args){
do {
DOS_ReadFile (STDIN,&c,&n);
} while (!c || !(ptr = strchr(rem,(optS?c:toupper(c)))));
c = optS?c:toupper(c);
c = optS?c:(Bit8u)toupper(c);
DOS_WriteFile (STDOUT,&c, &n);
dos.return_code = (Bit8u)(ptr-rem+1);
}