RGB card support: (#850)

. removed the precondition for enabling the extra RGB DHIRES modes
. changed IOUDIS soft-switch so that it's for //c only
This commit is contained in:
tomcw 2020-10-31 16:10:18 +00:00
parent e24436f7ec
commit fb0871672c
2 changed files with 16 additions and 27 deletions

View File

@ -94,8 +94,8 @@ MEMORY MANAGEMENT SOFT SWITCHES
$C009 W ALTZPON Enable aux memory from $0000-$01FF & avl BSR
$C00A W SLOTC3ROMOFF Enable main ROM from $C300-$C3FF
$C00B W SLOTC3ROMON Enable slot ROM from $C300-$C3FF
$C07E W IOUDIS [Enhanced //e] On: disable IOU access for addresses $C058 to $C05F; enable access to DHIRES switch
$C07F W IOUDIS [Enhanced //e] Off: enable IOU access for addresses $C058 to $C05F; disable access to DHIRES switch
$C07E W IOUDIS [//c] On: disable IOU access for addresses $C058 to $C05F; enable access to DHIRES switch
$C07F W IOUDIS [//c] Off: enable IOU access for addresses $C058 to $C05F; disable access to DHIRES switch
VIDEO SOFT SWITCHES
$C00C W 80COLOFF Turn off 80 column display
@ -130,8 +130,8 @@ SOFT SWITCH STATUS FLAGS
$C01D R7 HIRES 1=high resolution graphics 0=low resolution
$C01E R7 ALTCHARSET 1=alt character set on 0=alt char set off
$C01F R7 80COL 1=80 col display on 0=80 col display off
$C07E R7 RDIOUDIS [Enhanced //e] 1=IOUDIS off 0=IOUDIS on
$C07F R7 RDDHIRES [Enhanced //e] 1=DHIRES on 0=DHIRES off
$C07E R7 RDIOUDIS [//c] 1=IOUDIS off 0=IOUDIS on
$C07F R7 RDDHIRES [Enhanced //e? or //c] 1=DHIRES on 0=DHIRES off
*/
@ -596,7 +596,7 @@ static BYTE __stdcall IORead_C07x(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULONG
case 0xB: return IO_Null(pc, addr, bWrite, d, nExecutedCycles);
case 0xC: return IO_Null(pc, addr, bWrite, d, nExecutedCycles);
case 0xD: return IO_Null(pc, addr, bWrite, d, nExecutedCycles);
case 0xE: return IsEnhancedIIE() ? MemReadFloatingBus(SW_IOUDIS ? true : false, nExecutedCycles) // GH#636
case 0xE: return IS_APPLE2C() ? MemReadFloatingBus(SW_IOUDIS ? true : false, nExecutedCycles) // GH#636
: IO_Null(pc, addr, bWrite, d, nExecutedCycles);
case 0xF: return IsEnhancedIIEorIIC() ? MemReadFloatingBus(VideoGetSWDHIRES(), nExecutedCycles) // GH#636
: IO_Null(pc, addr, bWrite, d, nExecutedCycles);
@ -632,12 +632,12 @@ static BYTE __stdcall IOWrite_C07x(WORD pc, WORD addr, BYTE bWrite, BYTE d, ULON
case 0xB: return IO_Null(pc, addr, bWrite, d, nExecutedCycles);
case 0xC: return IO_Null(pc, addr, bWrite, d, nExecutedCycles);
case 0xD: return IO_Null(pc, addr, bWrite, d, nExecutedCycles);
case 0xE: if (IsEnhancedIIE())
case 0xE: if (IS_APPLE2C())
SetMemMode(memmode & ~MF_IOUDIS); // disable IOU access for addresses $C058 to $C05F; enable access to DHIRES switch
else
return IO_Null(pc, addr, bWrite, d, nExecutedCycles);
break;
case 0xF: if (IsEnhancedIIE())
case 0xF: if (IS_APPLE2C())
SetMemMode(memmode | MF_IOUDIS); // enable IOU access for addresses $C058 to $C05F; disable access to DHIRES switch
else
return IO_Null(pc, addr, bWrite, d, nExecutedCycles);

View File

@ -1097,7 +1097,9 @@ void UpdateText80ColorCell(int x, int y, uint16_t addr, bgra_t* pVideoAddress, u
UpdateDuochromeCell(2, 7, pVideoAddress, bits, 15, 0);
}
else
{
UpdateDuochromeCell(2, 7, pVideoAddress, bits, g_nRegularTextFG, g_nRegularTextBG);
}
}
//===========================================================================
@ -1210,11 +1212,10 @@ void VideoSwitchVideocardPalette(RGB_Videocard_e videocard, VideoType_e type)
//===========================================================================
static UINT g_rgbFlags = 0;
static UINT g_rgbMode = 0;
static WORD g_rgbPrevAN3Addr = 0;
static bool g_rgbSet80COL = false;
static bool g_rgbSet80COL = false; // unused from 1.29.16.0
static bool g_rgbInvertBit7 = false;
// Video7 RGB card:
@ -1223,13 +1224,6 @@ static bool g_rgbInvertBit7 = false;
// . NB. There's a final 5th AN3 transition to set DHGR mode
void RGB_SetVideoMode(WORD address)
{
if ((address & ~1) == 0x0C) // 0x0C or 0x0D? (80COL)
{
g_rgbSet80COL = true;
return;
}
if ((address & ~1) != 0x5E) // 0x5E or 0x5F? (DHIRES)
return;
@ -1246,16 +1240,11 @@ void RGB_SetVideoMode(WORD address)
// In Prince of Persia, in the game demo, the RGB card switches to BW DHIRES after the HGR animation with Jaffar.
// It's actually the same on real hardware (tested on IIc RGB adapter).
if (address == 0x5F)
if (address == 0x5F && g_rgbPrevAN3Addr == 0x5E)
{
if ((g_rgbPrevAN3Addr == 0x5E) && g_rgbSet80COL)
{
g_rgbFlags = (g_rgbFlags << 1) & 3;
g_rgbFlags |= ((g_uVideoMode & VF_80COL) ? 0 : 1); // clock in !80COL
g_rgbMode = g_rgbFlags; // latch F2,F1
}
g_rgbSet80COL = false;
g_rgbFlags = (g_rgbFlags << 1) & 3;
g_rgbFlags |= ((g_uVideoMode & VF_80COL) ? 0 : 1); // clock in !80COL
g_rgbMode = g_rgbFlags; // latch F2,F1
}
g_rgbPrevAN3Addr = address;
@ -1318,7 +1307,7 @@ void RGB_SaveSnapshot(YamlSaveHelper& yamlSaveHelper)
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_RGB_FLAGS, g_rgbFlags);
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_RGB_MODE, g_rgbMode);
yamlSaveHelper.SaveHexUint8(SS_YAML_KEY_RGB_PREVIOUS_AN3, g_rgbPrevAN3Addr);
yamlSaveHelper.SaveBool(SS_YAML_KEY_RGB_80COL_CHANGED, g_rgbSet80COL);
yamlSaveHelper.SaveBool(SS_YAML_KEY_RGB_80COL_CHANGED, false); // unused (todo: remove next time the parent card's version changes)
yamlSaveHelper.SaveBool(SS_YAML_KEY_RGB_INVERT_BIT7, g_rgbInvertBit7);
}
@ -1333,7 +1322,7 @@ void RGB_LoadSnapshot(YamlLoadHelper& yamlLoadHelper, UINT cardVersion)
if (cardVersion >= 3)
{
g_rgbSet80COL = yamlLoadHelper.LoadBool(SS_YAML_KEY_RGB_80COL_CHANGED);
yamlLoadHelper.LoadBool(SS_YAML_KEY_RGB_80COL_CHANGED); // Obsolete (so just consume)
g_rgbInvertBit7 = yamlLoadHelper.LoadBool(SS_YAML_KEY_RGB_INVERT_BIT7);
}