diff --git a/toolbox/mm.cpp b/toolbox/mm.cpp index 80c16b4..e654b28 100644 --- a/toolbox/mm.cpp +++ b/toolbox/mm.cpp @@ -553,4 +553,29 @@ namespace MM return 0; } + + #pragma mark - + uint32_t StripAddress(uint16_t trap) + { + /* + * on entry: + * d0 Address to strip + * + * on exit: + * D0 Address that has been stripped. + * + */ + + // TODO -- in 32-bit mode, this is a nop. + // have a --24 / --32 flag? + + uint32_t address = cpuGetDReg(0); + + Log("%04x StripAddress(%08x)\n", trap, address); + + address &= 0x00ffffff; + return address; + } + + } \ No newline at end of file diff --git a/toolbox/mm.h b/toolbox/mm.h index b15d2d0..27d10e4 100644 --- a/toolbox/mm.h +++ b/toolbox/mm.h @@ -52,6 +52,8 @@ namespace MM uint16_t MoveHHi(uint16_t trap); + uint32_t StripAddress(uint16_t trap); + } diff --git a/toolbox/toolbox.cpp b/toolbox/toolbox.cpp index c4a38ea..1a25797 100644 --- a/toolbox/toolbox.cpp +++ b/toolbox/toolbox.cpp @@ -101,6 +101,10 @@ namespace ToolBox { d0 = MM::CompactMem(trap); break; + case 0xa055: + d0 = MM::StripAddress(trap); + break; + // MoveHHi (h: Handle); case 0xa064: d0 = MM::MoveHHi(trap);