From c86c3e5aa5cb847ab41a697d900e0a88137c939b Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 30 Dec 2018 11:24:02 -0500 Subject: [PATCH 1/2] Ensures that writing BIOS jump addresses doesn't wrap around to overwrite the main BIOS call. --- CPM for OS X/BDOS/BDOS.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CPM for OS X/BDOS/BDOS.m b/CPM for OS X/BDOS/BDOS.m index 196f3b0..d96e6bb 100644 --- a/CPM for OS X/BDOS/BDOS.m +++ b/CPM for OS X/BDOS/BDOS.m @@ -91,7 +91,7 @@ - (id)initWithContentsOfURL:(NSURL *)URL terminalView:(CPMTerminalView *)termina // configure the bios trapping to occur as late as it can while // still having room for a full BIOS jump table and obeying the // CP/M rule that it be 256-byte aligned - uint16_t biosAddress = 0xff00; + const uint16_t biosAddress = 0xff00; _processor.biosAddress = biosAddress; // we'll be the delegate, in order to trap all that stuff @@ -121,7 +121,7 @@ - (id)initWithContentsOfURL:(NSURL *)URL terminalView:(CPMTerminalView *)termina // to actual program code; some CP/M programs read the addresses and // use other means to get into the BIOS. So we need to set up appropriate // jump statments - for(int c = biosAddress; c < 65536; c += 3) + for(int c = biosAddress; c <= 65536 - 3; c += 3) { [_memory setValue:0xc3 atAddress:(uint16_t)c]; [_memory setValue:(uint8_t)(c&0xff) atAddress:(uint16_t)(c+1)]; From dfbe846cdf1a837502c9c9ca9a496b5fff6aa255 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 30 Dec 2018 11:24:38 -0500 Subject: [PATCH 2/2] Bumps version number, tracking bug fix. --- CPM for OS X/CPM for OS X-Info.plist | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CPM for OS X/CPM for OS X-Info.plist b/CPM for OS X/CPM for OS X-Info.plist index 53dc28c..4d1f68f 100644 --- a/CPM for OS X/CPM for OS X-Info.plist +++ b/CPM for OS X/CPM for OS X-Info.plist @@ -63,7 +63,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.7.0 + 0.7.1 CFBundleSignature ???? CFBundleVersion