diff --git a/tools/palm/muExpansionDriver/traps.c b/tools/palm/muExpansionDriver/traps.c index 330718c..5dcd8b6 100644 --- a/tools/palm/muExpansionDriver/traps.c +++ b/tools/palm/muExpansionDriver/traps.c @@ -13,22 +13,19 @@ /*functions in this file are called directly by the Palm OS trap dispatch, this means they can be called when the app isnt loaded and the globals are just a random data buffer*/ -#if 0 -static const SECTION(".text") ALIGN(2) uint32_t armExitFunc[] = {0x0000A0E3, 0xBBBBBBF7};/*ARM asm blob*/ -static const SECTION(".text") ALIGN(2) uint32_t armCall68kFunc[] = {0x0100A0E3, 0xBBBBBBF7, 0x0EF0A0E1};/*ARM asm blob*/ -static const SECTION(".text") ALIGN(2) uint8_t m68kCallWithBlobFunc[] = {0x4E, 0x56, 0x00, 0x00, 0x48, 0xE7, 0x60, 0x70, 0x26, 0x6E, 0x00, 0x08, 0x22, 0x6E, 0x00, 0x0C, 0x22, 0x2E, 0x00, 0x10, 0x34, 0x2E, 0x00, 0x14, 0x24, 0x4F, 0x95, 0xC1, 0xBF, 0xCA, 0x67, 0x00, 0x00, 0x0C, 0x34, 0x91, 0x54, 0x89, 0x54, 0x8A, 0x4E, 0xF8, 0x10, 0x4E, 0x9F, 0xC1, 0x4E, 0x93, 0xDF, 0xC1, 0x4A, 0x42, 0x67, 0x00, 0x00, 0x04, 0x20, 0x08, 0x4C, 0xDF, 0x0E, 0x06, 0x4E, 0x5E, 0x4E, 0x75};/*m68k asm blob*/ -#endif - UInt32 emuPceNativeCall(NativeFuncType* nativeFuncP, void* userDataP){ -#if 0 - /*thes arnt set as "static" because the globals dont work here*/ - static const SECTION(".text") ALIGN(2) uint32_t armExitFunc[] = {0x0000A0E3, 0xBBBBBBF7};/*ARM asm blob*/ - static const SECTION(".text") ALIGN(2) uint32_t armCall68kFunc[] = {0x0100A0E3, 0xBBBBBBF7, 0x0EF0A0E1};/*ARM asm blob*/ - static const SECTION(".text") ALIGN(2) uint8_t m68kCallWithBlobFunc[] = {0x4E, 0x56, 0x00, 0x00, 0x48, 0xE7, 0x60, 0x70, 0x26, 0x6E, 0x00, 0x08, 0x22, 0x6E, 0x00, 0x0C, 0x22, 0x2E, 0x00, 0x10, 0x34, 0x2E, 0x00, 0x14, 0x24, 0x4F, 0x95, 0xC1, 0xBF, 0xCA, 0x67, 0x00, 0x00, 0x0C, 0x34, 0x91, 0x54, 0x89, 0x54, 0x8A, 0x4E, 0xF8, 0x10, 0x4E, 0x9F, 0xC1, 0x4E, 0x93, 0xDF, 0xC1, 0x4A, 0x42, 0x67, 0x00, 0x00, 0x04, 0x20, 0x08, 0x4C, 0xDF, 0x0E, 0x06, 0x4E, 0x5E, 0x4E, 0x75};/*m68k asm blob*/ -#endif + /*these arnt set as "static" because the globals dont work here*/ const ALIGN(2) uint32_t armExitFunc[] = {0x0000A0E3, 0xBBBBBBF7};/*ARM asm blob*/ const ALIGN(2) uint32_t armCall68kFunc[] = {0x0100A0E3, 0xBBBBBBF7, 0x0EF0A0E1};/*ARM asm blob*/ - const ALIGN(2) uint8_t m68kCallWithBlobFunc[] = {0x4E, 0x56, 0x00, 0x00, 0x48, 0xE7, 0x60, 0x70, 0x26, 0x6E, 0x00, 0x08, 0x22, 0x6E, 0x00, 0x0C, 0x22, 0x2E, 0x00, 0x10, 0x34, 0x2E, 0x00, 0x14, 0x24, 0x4F, 0x95, 0xC1, 0xBF, 0xCA, 0x67, 0x00, 0x00, 0x0C, 0x34, 0x91, 0x54, 0x89, 0x54, 0x8A, 0x4E, 0xF8, 0x10, 0x4E, 0x9F, 0xC1, 0x4E, 0x93, 0xDF, 0xC1, 0x4A, 0x42, 0x67, 0x00, 0x00, 0x04, 0x20, 0x08, 0x4C, 0xDF, 0x0E, 0x06, 0x4E, 0x5E, 0x4E, 0x75};/*m68k asm blob*/ + const ALIGN(2) uint8_t m68kCallWithBlobFunc[] = { + 0x4e, 0x56, 0x00, 0x00, 0x48, 0xe7, 0x60, 0x70, 0x26, 0x6e, 0x00, 0x08, + 0x22, 0x6e, 0x00, 0x0c, 0x22, 0x2e, 0x00, 0x10, 0x34, 0x2e, 0x00, 0x14, + 0x24, 0x4f, 0x95, 0xc1, 0xbf, 0xca, 0x67, 0x00, 0x00, 0x0a, 0x34, 0x91, + 0x54, 0x89, 0x54, 0x8a, 0x60, 0xf2, 0x9f, 0xc1, 0x4e, 0x93, 0xdf, 0xc1, + 0x4a, 0x42, 0x67, 0x00, 0x00, 0x04, 0x20, 0x08, 0x4c, 0xdf, 0x0e, 0x06, + 0x4e, 0x5e, 0x4e, 0x75 + + };/*m68k asm blob*/ uint32_t oldArmRegisters[5]; uint32_t returnValue; @@ -81,7 +78,8 @@ UInt32 emuPceNativeCall(NativeFuncType* nativeFuncP, void* userDataP){ debugLog("Stack byte:0x%02X\n", ((uint8_t*)stackBlob)[index]); } */ - debugLog("Called 68k function:0x%08lX\n", function); + /*debugLog("Called 68k function:0x%08lX\n", function);*/ + debugLog("ARM calling 68k function:0x%08lX, stackBlob:0x%08lX, stackBlobSize:0x%08lX, wantA0:%d\n", function, stackBlob, stackBlobSizeAndWantA0 & ~kPceNativeWantA0, !!(stackBlobSizeAndWantA0 & kPceNativeWantA0)); /*API call, convert to address first*/ if(function <= kPceNativeTrapNoMask)