Fixed CDFJ+ issue if the first byte of the cartridge contained a value of FF_OFFSET thru FF_OFFSET + $23 (#879)

Updated Thumbulator's debug mode to allow run-time updating of the FF_OFFSET value.
This commit is contained in:
Darrell Spice, Jr 2022-02-24 00:59:29 -06:00 committed by GitHub
parent d658d72871
commit 37180e18df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 5 deletions

View File

@ -153,8 +153,9 @@ void CartridgeCDF::setInitialState()
// need to confirm with Chris
myMode = 0xFF;
myBankOffset = myLDAXYimmediateOperandAddress = myJMPoperandAddress = 0;
myBankOffset = myJMPoperandAddress = 0;
myFastJumpActive = myFastJumpStream = 0;
myLDAXYimmediateOperandAddress = LDAXY_OVERRIDE_INACTIVE;
CartridgeARM::setInitialState();
}
@ -290,7 +291,7 @@ uInt8 CartridgeCDF::peek(uInt16 address)
&& peekvalue <= myAmplitudeStream);
if (fastfetch)
{
myLDAXYimmediateOperandAddress = 0;
myLDAXYimmediateOperandAddress = LDAXY_OVERRIDE_INACTIVE;
if (myFastFetcherOffset)
peekvalue -= myRAM[myFastFetcherOffset]; // normalize peekvalue to 0 - 35
if (peekvalue == myAmplitudeStream)
@ -329,7 +330,7 @@ uInt8 CartridgeCDF::peek(uInt16 address)
return readFromDatastream(peekvalue);
}
}
myLDAXYimmediateOperandAddress = 0;
myLDAXYimmediateOperandAddress = LDAXY_OVERRIDE_INACTIVE;
// Switch banks if necessary
switch(address)

View File

@ -58,6 +58,9 @@ class System;
@authors: Darrell Spice Jr, Chris Walton, Fred Quimby, John Champeau
Thomas Jentzsch, Stephen Anthony, Bradford W. Mott
*/
#define LDAXY_OVERRIDE_INACTIVE 0xFFFF
class CartridgeCDF : public CartridgeARM
{
friend class CartridgeCDFWidget;
@ -341,7 +344,7 @@ class CartridgeCDF : public CartridgeARM
// set to address of #value if last byte peeked was A9 (LDA #),
// or for CDFJ+ variations if A0 (LDY #) or A2 (LDX #)
uInt16 myLDAXYimmediateOperandAddress{0};
uInt16 myLDAXYimmediateOperandAddress{LDAXY_OVERRIDE_INACTIVE};
// Some CDFJ+ drivers also override LDX # and/or LDY # for fast fetcher
// use. These flag if this has been done.

View File

@ -548,6 +548,11 @@ void Thumbulator::write32(uInt32 addr, uInt32 data)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Thumbulator::isProtected(uInt32 addr)
{
// Protected is within the driver RAM.
// For CDF variations parts of the driver RAM are reused to hold the
// datastream information, so is not protected.
// Additionally for CDFJ+ the Fast Fetcher offset is not write protected.
if (addr < 0x40000000) return false;
addr -= 0x40000000;
@ -562,9 +567,11 @@ bool Thumbulator::isProtected(uInt32 addr)
return (addr < 0x0800) && (addr > 0x0028) && !((addr >= 0x00a0) && (addr < (0x00a0 + 284)));
case ConfigureFor::CDFJ:
case ConfigureFor::CDFJplus:
return (addr < 0x0800) && (addr > 0x0028) && !((addr >= 0x0098) && (addr < (0x0098 + 292)));
case ConfigureFor::CDFJplus:
return (addr < 0x0800) && (addr > 0x0028) && !((addr >= 0x0098) && (addr < (0x0098 + 292))) && addr != 0x3E0;
case ConfigureFor::BUS:
return (addr < 0x06d8) && (addr > 0x0028);
}