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