diff options
Diffstat (limited to 'backends/PalmOS/Src/arm/PNOMain.cpp')
-rw-r--r-- | backends/PalmOS/Src/arm/PNOMain.cpp | 75 |
1 files changed, 33 insertions, 42 deletions
diff --git a/backends/PalmOS/Src/arm/PNOMain.cpp b/backends/PalmOS/Src/arm/PNOMain.cpp index a38682c5e1..54569b2502 100644 --- a/backends/PalmOS/Src/arm/PNOMain.cpp +++ b/backends/PalmOS/Src/arm/PNOMain.cpp @@ -5,56 +5,47 @@ // "ARMlet" name is now officially discouraged. Compare an // contrast to "PilotMain" for 68K applications. #define PNO_Main ARMlet_Main -// entry point -extern "C" -unsigned long PNO_Main(const void *emulStateP, void *userData68KP, Call68KFuncType *call68KFuncP); - -#ifndef WIN32 - -#pragma thumb off -asm void * __ARMlet_Take_Func_Addr__(void *f) -{ - sub r0, r0, r10 // 0 convert pointer to zero-based address - ldr r12, [pc, #8] // 4 load zero-based address of this routine plus offset into r12 - sub r12, pc, r12 // 8 compute start of PNO by subtracting this from PC - add r0, r0, r12 // 12 add PNO start to function pointer - bx lr // 16 return to caller - dcd __ARMlet_Take_Func_Addr__ + 16 // 20 -} -#pragma thumb reset -#else -#define __ARMlet_Take_Func_Addr__(x) x -#endif +// ------------------------ + +extern "C" +unsigned long PNO_Main( + const void *emulStateP, + void *userData68KP, + Call68KFuncType *call68KFuncP); unsigned long PNO_Main(const void *emulStateP, void *userData68KP, Call68KFuncType *call68KFuncP) { -/* const PnoProc call[] = { - (PnoProc)__ARMlet_Take_Func_Addr__(OSystem_PALMOS_update_screen__wide_portrait), - (PnoProc)__ARMlet_Take_Func_Addr__(OSystem_PALMOS_update_screen__wide_landscape), - //OSystem_PALMOS_copyRectToScreen - }; -*/ -#ifndef WIN32 + unsigned long retVal = 0; + +#ifdef COMPILE_PACE // needed before making any OS calls using the // PACEInterface library InitPACEInterface(emulStateP, call68KFuncP); -#else - global.call68KFuncP = call68KFuncP; - global.emulStateP = emulStateP; - global.userData68KP = userData68KP; #endif - UInt32 run = ByteSwap32(*(UInt32 *)userData68KP); +#ifdef COMPILE_PA1SND + ARMPa1SndPtr userData = (ARMPa1SndPtr)userData68KP; + pcm2adpcm ( (Int16 *)ReadUnaligned32(&(userData->srcP)), + (UInt8 *)ReadUnaligned32(&(userData->dstP)), + ReadUnaligned32(&(userData->length)) + ); +#endif + +#ifdef COMPILE_STREAMSND + retVal = (unsigned long)sndCallback; +#endif + +#ifdef COMPILE_OWIDELS + O_WideLandscape(userData68KP); +#endif - switch (run) { - case 0: - OSystem_PALMOS_update_screen__wide_portrait(userData68KP); - break; - case 1: - OSystem_PALMOS_update_screen__wide_landscape(userData68KP); - break; - } +#ifdef COMPILE_OWIDEPT + O_WidePortrait(userData68KP); +#endif + +#ifdef COMPILE_OCOPYRECT + O_CopyRectToScreen(userData68KP); +#endif - return 0; -// return call[run](userData68KP); + return retVal; } |