From 7196a85c36f44cbc54e66986e2e1003459d2577b Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 1 Sep 2013 22:27:09 -0400 Subject: [PATCH] support pstring macsbugs names --- bin/debugger.cpp | 5 +++-- bin/loader.cpp | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/debugger.cpp b/bin/debugger.cpp index 6e9c013..e7d010b 100644 --- a/bin/debugger.cpp +++ b/bin/debugger.cpp @@ -148,10 +148,12 @@ namespace { // check for MacsBug name after rts. std::string s; unsigned b = Debug::ReadByte(pc); - if (b > 0x80 && b < 0xa0) + if (b >= 0x80 && b <= 0x9f) { b -= 0x80; pc++; + if (!b) b = Debug::ReadByte(pc++); + s.reserve(b); for (unsigned i = 0; i < b; ++i) { @@ -159,7 +161,6 @@ namespace { } printf("%s\n", s.c_str()); } - // could also be in the form 0x80 \p string. } diff --git a/bin/loader.cpp b/bin/loader.cpp index ca924e2..2345242 100644 --- a/bin/loader.cpp +++ b/bin/loader.cpp @@ -520,10 +520,13 @@ void InstructionLogger() // check for MacsBug name after rts. std::string s; unsigned b = memoryReadByte(pc); - if (b > 0x80 && b < 0xa0) + if (b >= 0x80 && b <= 0x9f) { b -= 0x80; pc++; + + if (!b) b = memoryReadByte(pc++); + s.reserve(b); for (unsigned i = 0; i < b; ++i) {