mirror of
https://github.com/AppleWin/AppleWin.git
synced 2025-01-22 01:31:25 +00:00
Debugger: fixes to wrap 16-bit addr (was resulting in AppleWin debugger crashes)
This commit is contained in:
parent
c492004e8d
commit
f3b6b8665f
@ -705,13 +705,13 @@ bool _6502_GetTargets ( WORD nAddress, int *pTargetPartial_, int *pTargetPartial
|
||||
*pTargetPartial_ = nTarget16;
|
||||
*pTargetPartial2_ = nTarget16+1;
|
||||
if (bIncludeNextOpcodeAddress)
|
||||
*pTargetPointer_ = *(LPWORD)(mem + nTarget16);
|
||||
*pTargetPointer_ = mem[nTarget16] | (mem[(nTarget16+1)&0xFFFF]<<8);
|
||||
if (pTargetBytes_)
|
||||
*pTargetBytes_ = 2;
|
||||
break;
|
||||
|
||||
case AM_IZX: // Indexed (Zeropage Indirect, X)
|
||||
nTarget8 += regs.x;
|
||||
nTarget8 = (nTarget8 + regs.x) & 0xFF;
|
||||
*pTargetPartial_ = nTarget8;
|
||||
*pTargetPointer_ = *(LPWORD)(mem + nTarget8);
|
||||
if (pTargetBytes_)
|
||||
|
@ -1502,7 +1502,7 @@ int GetDisassemblyLine ( WORD nBaseAddress, DisasmLine_t & line_ )
|
||||
{
|
||||
nTarget = pData->nTargetAddress;
|
||||
} else {
|
||||
nTarget = *(LPWORD)(mem+nBaseAddress+1);
|
||||
nTarget = mem[(nBaseAddress+1)&0xFFFF] | (mem[(nBaseAddress+2)&0xFFFF]<<8);
|
||||
if (nOpbyte == 2)
|
||||
nTarget &= 0xFF;
|
||||
}
|
||||
@ -1742,7 +1742,7 @@ void FormatOpcodeBytes ( WORD nBaseAddress, DisasmLine_t & line_ )
|
||||
|
||||
for( int iByte = 0; iByte < nMaxOpBytes; iByte++ )
|
||||
{
|
||||
BYTE nMem = (unsigned)*(mem+nBaseAddress + iByte);
|
||||
BYTE nMem = mem[(nBaseAddress+iByte)&0xFFFF];
|
||||
sprintf( pDst, "%02X", nMem ); // sBytes+strlen(sBytes)
|
||||
pDst += 2;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user