some more ega updates (monitor, height control, text modes)
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3015
This commit is contained in:
parent
e9e734d8d8
commit
993f47a01c
4 changed files with 74 additions and 58 deletions
|
@ -16,6 +16,8 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: vga_attr.cpp,v 1.26 2007-10-13 16:34:06 c2woody Exp $ */
|
||||
|
||||
#include "dosbox.h"
|
||||
#include "inout.h"
|
||||
#include "vga.h"
|
||||
|
@ -27,11 +29,15 @@ void VGA_ATTR_SetPalette(Bit8u index,Bit8u val) {
|
|||
if (vga.attr.mode_control & 0x80) val = (val&0xf) | (vga.attr.color_select << 4);
|
||||
val &= 63;
|
||||
val |= (vga.attr.color_select & 0xc) << 4;
|
||||
if (GCC_UNLIKELY(!IS_VGA_ARCH)) {
|
||||
if (val&0x10) val|=0x38;
|
||||
else {
|
||||
val&=0x7;
|
||||
if (val==6) val=0x14;
|
||||
if (GCC_UNLIKELY(machine==MCH_EGA)) {
|
||||
if ((vga.crtc.vertical_total | ((vga.crtc.overflow & 1) << 8)) == 260) {
|
||||
// check for intensity bit
|
||||
if (val&0x10) val|=0x38;
|
||||
else {
|
||||
val&=0x7;
|
||||
// check for special brown
|
||||
if (val==6) val=0x14;
|
||||
}
|
||||
}
|
||||
}
|
||||
VGA_DAC_CombineColor(index,val);
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: vga_draw.cpp,v 1.86 2007-10-13 16:34:06 c2woody Exp $ */
|
||||
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include "dosbox.h"
|
||||
|
@ -790,7 +792,7 @@ void VGA_SetupDrawing(Bitu val) {
|
|||
if (vga.s3.pll.cmd & 0x10) clock/=2;
|
||||
|
||||
if (IS_VGA_ARCH) vga.draw.double_scan=(vga.crtc.maximum_scan_line&0x80)>0;
|
||||
else vga.draw.double_scan=(vga.seq.clocking_mode&0x08)>0; // not really correct...
|
||||
else vga.draw.double_scan=(vtotal==262);
|
||||
} else {
|
||||
htotal = vga.other.htotal + 1;
|
||||
hdend = vga.other.hdend;
|
||||
|
|
|
@ -16,6 +16,8 @@
|
|||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* $Id: vga_misc.cpp,v 1.35 2007-10-13 16:34:06 c2woody Exp $ */
|
||||
|
||||
#include "dosbox.h"
|
||||
#include "inout.h"
|
||||
#include "pic.h"
|
||||
|
@ -123,28 +125,26 @@ static Bitu read_p3cc(Bitu port,Bitu iolen) {
|
|||
return vga.misc_output;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Test 13: Hardware: General Registers
|
||||
Mode 00h, General -- Feat Ctrl: IBM=00h Current=FFh
|
||||
Mode 00h, General -- Input Status 0: IBM=70h Current=FFh
|
||||
.. & modes 1,2,3,4,5,6,d,e,10,11,12,13
|
||||
|
||||
following read handlers silence the above vgatest errors.
|
||||
|
||||
*/
|
||||
|
||||
// VGA feature control register
|
||||
static Bitu read_p3ca(Bitu port,Bitu iolen) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Bitu read_p3c8(Bitu port,Bitu iolen) {
|
||||
return 0x10;
|
||||
}
|
||||
|
||||
static Bitu read_p3c2(Bitu port,Bitu iolen) {
|
||||
Bitu retcode=0x70;
|
||||
if (GCC_UNLIKELY(machine==MCH_EGA)) {
|
||||
Bitu retcode=0x60;
|
||||
retcode |= (vga.draw.vret_triggered ? 0x80 : 0x00);
|
||||
vga.draw.vret_triggered=false;
|
||||
// ega colour monitor
|
||||
if ((((vga.misc_output>>2)&3)==0) || (((vga.misc_output>>2)&3)==3)) retcode|=0x10;
|
||||
return retcode;
|
||||
} else {
|
||||
return 0x70;
|
||||
}
|
||||
return retcode;
|
||||
}
|
||||
|
||||
void VGA_SetupMisc(void) {
|
||||
|
@ -155,6 +155,8 @@ void VGA_SetupMisc(void) {
|
|||
if (IS_VGA_ARCH) {
|
||||
IO_RegisterReadHandler(0x3ca,read_p3ca,IO_MB);
|
||||
IO_RegisterReadHandler(0x3cc,read_p3cc,IO_MB);
|
||||
} else {
|
||||
IO_RegisterReadHandler(0x3c8,read_p3c8,IO_MB);
|
||||
}
|
||||
} else if (machine==MCH_CGA || IS_TANDY_ARCH) {
|
||||
IO_RegisterReadHandler(0x3da,vga_read_p3da,IO_MB);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue