From add2d6b5a3b4fc030bdcbbc8497c828d35980c2c Mon Sep 17 00:00:00 2001 From: Kelvin Sherlock Date: Sun, 17 Feb 2013 15:49:28 -0500 Subject: [PATCH] return the MPW exit status. --- bin/loader.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/bin/loader.cpp b/bin/loader.cpp index 5a747b5..18978c7 100644 --- a/bin/loader.cpp +++ b/bin/loader.cpp @@ -776,12 +776,18 @@ int main(int argc, char **argv) for (;;) { uint32_t pc = cpuGetPC(); - if (pc == 0x00000000) break; + if (pc == 0x00000000) + { + fprintf(stderr, "Exiting - PC = 0\n"); + exit(1); + } if (cpuGetStop()) break; cpuExecuteInstruction(); } - // return value in mpwblock + 0x0e? - exit(0); + uint32_t rv = MPW::ExitStatus(); + if (rv > 0xff) rv = 0xff; + + exit(rv); } \ No newline at end of file