Debugger:

. Improved break on FB or IO: account for slot empty (or not) & if expansion ROM enable
Memory:
. IORead_Cxxx(): Fix for Apple II support for when slot-3 is empty
. Apple II type was erroneously testing //e soft-switches
This commit is contained in:
tomcw 2017-03-10 22:00:01 +00:00
parent 16b81133e0
commit 3a2313c52e
4 changed files with 47 additions and 11 deletions

View File

@ -8540,9 +8540,7 @@ void DebugContinueStepping ()
g_bDebugBreakpointHit = BP_HIT_NONE; g_bDebugBreakpointHit = BP_HIT_NONE;
bool bPCIsFloatBusOrIO = (regs.pc >= 0xC000 && regs.pc <= 0xC0FF); // TODO: Determine $C100..CFFF - assume executable if ( MemIsAddrCodeMemory(regs.pc) )
if (!bPCIsFloatBusOrIO)
{ {
BYTE nOpcode = *(mem+regs.pc); BYTE nOpcode = *(mem+regs.pc);
@ -8555,7 +8553,7 @@ void DebugContinueStepping ()
} }
else else
{ {
g_bDebugBreakpointHit = BP_HIT_PC_READ_FLOATING_BUS_OR_IO_REG; g_bDebugBreakpointHit = BP_HIT_PC_READ_FLOATING_BUS_OR_IO_MEM;
} }
if (g_bDebugBreakpointHit) if (g_bDebugBreakpointHit)
@ -8588,8 +8586,8 @@ void DebugContinueStepping ()
pszStopReason = TEXT("Register matches value"); pszStopReason = TEXT("Register matches value");
else if (g_bDebugBreakpointHit & BP_HIT_MEM) else if (g_bDebugBreakpointHit & BP_HIT_MEM)
pszStopReason = TEXT("Memory accessed"); pszStopReason = TEXT("Memory accessed");
else if (g_bDebugBreakpointHit & BP_HIT_PC_READ_FLOATING_BUS_OR_IO_REG) else if (g_bDebugBreakpointHit & BP_HIT_PC_READ_FLOATING_BUS_OR_IO_MEM)
pszStopReason = TEXT("PC reads from floating bus or I/O register"); pszStopReason = TEXT("PC reads from floating bus or I/O memory");
else else
pszStopReason = TEXT("Unknown!"); pszStopReason = TEXT("Unknown!");

View File

@ -34,7 +34,7 @@
,BP_HIT_OPCODE = (1 << 1) ,BP_HIT_OPCODE = (1 << 1)
,BP_HIT_REG = (1 << 2) ,BP_HIT_REG = (1 << 2)
,BP_HIT_MEM = (1 << 3) ,BP_HIT_MEM = (1 << 3)
,BP_HIT_PC_READ_FLOATING_BUS_OR_IO_REG = (1 << 4) ,BP_HIT_PC_READ_FLOATING_BUS_OR_IO_MEM = (1 << 4)
}; };
extern int g_nBreakpoints; extern int g_nBreakpoints;

View File

@ -628,11 +628,14 @@ BYTE __stdcall IORead_Cxxx(WORD programcounter, WORD address, BYTE write, BYTE v
if (address >= APPLE_SLOT_BEGIN && address <= APPLE_SLOT_END) if (address >= APPLE_SLOT_BEGIN && address <= APPLE_SLOT_END)
{ {
// Fix for bug 18643 and bug 18886
const UINT uSlot = (address>>8)&0x7; const UINT uSlot = (address>>8)&0x7;
if ( (SW_SLOTCXROM) && // Peripheral (card) ROMs enabled in $C100..$C7FF const bool bPeripheralSlotRomEnabled = IS_APPLE2 ? true // A][
!(!SW_SLOTC3ROM && uSlot == 3) && // Internal C3 ROM disabled in $C300 when slot == 3 : // A//e or above
!IsCardInSlot(uSlot) ) // Slot is empty ( (SW_SLOTCXROM) && // Peripheral (card) ROMs enabled in $C100..$C7FF
!(!SW_SLOTC3ROM && uSlot == 3) ); // Internal C3 ROM disabled in $C300 when slot == 3
// Fix for bug 18643 and bug 18886
if (bPeripheralSlotRomEnabled && !IsCardInSlot(uSlot)) // Slot is empty
{ {
return IO_Null(programcounter, address, write, value, nCyclesLeft); return IO_Null(programcounter, address, write, value, nCyclesLeft);
} }
@ -1106,6 +1109,40 @@ LPBYTE MemGetCxRomPeripheral()
//=========================================================================== //===========================================================================
// Post:
// . true: code memory
// . false: I/O memory or floating bus
bool MemIsAddrCodeMemory(const USHORT addr)
{
if (addr < 0xC000 || addr > FIRMWARE_EXPANSION_END) // Assume all A][ types have at least 48K
return true;
if (addr < APPLE_SLOT_BEGIN) // [$C000..C0FF]
return false;
if (!IS_APPLE2 && !SW_SLOTCXROM) // [$C100..CFFF] //e or Enhanced //e internal ROM
return true;
if (!IS_APPLE2 && !SW_SLOTC3ROM && (addr >> 8) == 0xC3) // [$C300..C3FF] //e or Enhanced //e internal ROM
return true;
if (addr <= APPLE_SLOT_END) // [$C100..C7FF]
{
const UINT uSlot = (addr >> 8) & 0x7;
if (!IsCardInSlot(uSlot))
return false;
}
// [$C800..CFFF]
if (g_eExpansionRomType == eExpRomNull)
return false;
return true;
}
//===========================================================================
const UINT CxRomSize = 4*1024; const UINT CxRomSize = 4*1024;
const UINT Apple2RomSize = 12*1024; const UINT Apple2RomSize = 12*1024;
const UINT Apple2eRomSize = Apple2RomSize+CxRomSize; const UINT Apple2eRomSize = Apple2RomSize+CxRomSize;

View File

@ -44,6 +44,7 @@ LPBYTE MemGetAuxPtr(const WORD);
LPBYTE MemGetMainPtr(const WORD); LPBYTE MemGetMainPtr(const WORD);
LPBYTE MemGetBankPtr(const UINT nBank); LPBYTE MemGetBankPtr(const UINT nBank);
LPBYTE MemGetCxRomPeripheral(); LPBYTE MemGetCxRomPeripheral();
bool MemIsAddrCodeMemory(const USHORT addr);
void MemInitialize (); void MemInitialize ();
void MemInitializeROM(void); void MemInitializeROM(void);
void MemInitializeCustomF8ROM(void); void MemInitializeCustomF8ROM(void);