From 9e2a8d3e533c56e2f24bcf1d284d3c870674813e Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sat, 13 Jul 2013 01:05:02 -0400 Subject: [PATCH] ResError should return the error on the stack (Pascal / Pascal IIgs) --- toolbox/rm.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/toolbox/rm.cpp b/toolbox/rm.cpp index 5b6c747..88c3560 100644 --- a/toolbox/rm.cpp +++ b/toolbox/rm.cpp @@ -317,9 +317,13 @@ namespace RM uint16_t ResError(uint16_t trap) { + uint32_t sp; + Log("%04x ResError()\n", trap); - return memoryReadWord(MacOS::ResErr); + sp = cpuGetAReg(7); + ToolReturn<2>(sp, memoryReadWord(MacOS::ResErr)); + return 0; } // SetResLoad (load: BOOLEAN);