mirror of
https://github.com/AppleWin/AppleWin.git
synced 2024-09-07 15:54:29 +00:00
Fix for step in debugger from reset (1st step would just do the CPU reset):
. Removed CPU reset processing from InternalCpuExecute(). This is now done in CpuReset(). Removed the now redundant regs.bRESET member. . CpuReset() now also clears regs.bJammed.
This commit is contained in:
parent
127c0c6079
commit
25dbca891b
@ -855,17 +855,6 @@ static DWORD InternalCpuExecute (DWORD totalcycles)
|
||||
nInternalCyclesLeft = (totalcycles<<8) - (cycles<<8);
|
||||
USHORT uExtraCycles = 0;
|
||||
|
||||
if (regs.bRESET)
|
||||
{
|
||||
regs.bRESET = 0;
|
||||
EF_TO_AF
|
||||
regs.ps = (regs.ps | AF_INTERRUPT) & ~AF_DECIMAL;
|
||||
regs.pc = * (WORD*) (mem+0xFFFC);
|
||||
regs.sp = 0x0100 | ((regs.sp - 3) & 0xFF);
|
||||
CYC(7);
|
||||
continue;
|
||||
}
|
||||
|
||||
BYTE iOpcode = *(mem+regs.pc);
|
||||
if (CheckDebugBreak( iOpcode ))
|
||||
break;
|
||||
@ -1172,17 +1161,6 @@ static DWORD InternalCpuExecute (DWORD totalcycles)
|
||||
nInternalCyclesLeft = (totalcycles<<8) - (cycles<<8);
|
||||
USHORT uExtraCycles = 0;
|
||||
|
||||
if (regs.bRESET)
|
||||
{
|
||||
regs.bRESET = 0;
|
||||
EF_TO_AF
|
||||
regs.ps = regs.ps | AF_INTERRUPT;
|
||||
regs.pc = * (WORD*) (mem+0xFFFC);
|
||||
regs.sp = 0x0100 | ((regs.sp - 3) & 0xFF);
|
||||
CYC(7);
|
||||
continue;
|
||||
}
|
||||
|
||||
BYTE iOpcode = *(mem+regs.pc);
|
||||
if (CheckDebugBreak( iOpcode ))
|
||||
break;
|
||||
@ -1614,9 +1592,7 @@ void CpuInitialize () {
|
||||
CpuDestroy();
|
||||
regs.a = regs.x = regs.y = regs.ps = 0xFF;
|
||||
regs.sp = 0x01FF;
|
||||
regs.pc=*(LPWORD)(mem+0xFFFC);
|
||||
regs.bRESET = 1;
|
||||
regs.bJammed = 0;
|
||||
CpuReset(); // Init's ps & pc. Updates sp
|
||||
|
||||
InitializeCriticalSection(&g_CriticalSection);
|
||||
g_bCritSectionValid = true;
|
||||
@ -1776,7 +1752,12 @@ void CpuNmiDeassert(eIRQSRC Device)
|
||||
//===========================================================================
|
||||
void CpuReset()
|
||||
{
|
||||
regs.bRESET = 1;
|
||||
// 7 cycles
|
||||
regs.ps = (regs.ps | AF_INTERRUPT) & ~AF_DECIMAL;
|
||||
regs.pc = * (WORD*) (mem+0xFFFC);
|
||||
regs.sp = 0x0100 | ((regs.sp - 3) & 0xFF);
|
||||
|
||||
regs.bJammed = 0;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -11,7 +11,6 @@ typedef struct _regsrec {
|
||||
BYTE ps; // processor status
|
||||
WORD pc; // program counter
|
||||
WORD sp; // stack pointer
|
||||
BYTE bRESET; // RESET asserted flag
|
||||
BYTE bJammed; // CPU has crashed (NMOS 6502 only)
|
||||
} regsrec, *regsptr;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user