aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Apers2004-12-10 15:29:34 +0000
committerChris Apers2004-12-10 15:29:34 +0000
commit7a194532209ce00480bcc11d09fa231e3d322bd3 (patch)
tree0aff2bc16736ace9889f4249825c2a823be360cf
parent7d160b2df6a65a4c11f7cdc301bb8c4192fa25a2 (diff)
downloadscummvm-rg350-7a194532209ce00480bcc11d09fa231e3d322bd3.tar.gz
scummvm-rg350-7a194532209ce00480bcc11d09fa231e3d322bd3.tar.bz2
scummvm-rg350-7a194532209ce00480bcc11d09fa231e3d322bd3.zip
New ARM call
svn-id: r16020
-rw-r--r--backends/PalmOS/Src/init_arm.cpp63
-rw-r--r--backends/PalmOS/Src/init_arm.h11
2 files changed, 20 insertions, 54 deletions
diff --git a/backends/PalmOS/Src/init_arm.cpp b/backends/PalmOS/Src/init_arm.cpp
index ca98b21a40..77aea25cee 100644
--- a/backends/PalmOS/Src/init_arm.cpp
+++ b/backends/PalmOS/Src/init_arm.cpp
@@ -2,56 +2,31 @@
#include "globals.h"
#include "init_arm.h"
-void ARMInit() {
- // init global ARM only
- MemSet(gVars->arm, sizeof(gVars->arm), 0);
- ARM(PNO_COPYRECT ).pnoPtr = _PnoInit(RSC_COPYRECT, &ARM(PNO_COPYRECT).pnoDesc);
- ARM(PNO_COSTUMEPROC3).pnoPtr = _PceInit(RSC_COSTUMEPROC3);
- ARM(PNO_DRAWSTRIP ).pnoPtr = _PceInit(RSC_DRAWSTRIP);
- ARM(PNO_BLIT ).pnoPtr = _PnoInit(RSC_BLIT, &ARM(PNO_BLIT).pnoDesc);
-}
-
-void ARMRelease() {
- _PnoFree(&ARM(PNO_BLIT ).pnoDesc, ARM(PNO_BLIT).pnoPtr);
- _PceFree(ARM(PNO_DRAWSTRIP ).pnoPtr);
- _PceFree(ARM(PNO_COSTUMEPROC3 ).pnoPtr);
- _PnoFree(&ARM(PNO_COPYRECT ).pnoDesc, ARM(PNO_COPYRECT).pnoPtr);
-}
-
-MemPtr _PceInit(DmResID resID) {
+static void PnoInit(DmResID resID,PNOInitType *pnoP) {
+ // Load and allocate PNO
MemHandle armH = DmGetResource('ARMC', resID);
- NativeFuncType *armP = (NativeFuncType *)MemHandleLock(armH);
-
- return armP;
-}
-
-UInt32 _PceCall(void *armP, void *userDataP) {
- return PceNativeCall((NativeFuncType *)armP, userDataP);
-}
-
-void _PceFree(void *armP) {
- MemHandle armH = MemPtrRecoverHandle(armP);
-
+ MemPtr armP = MemHandleLock(armH);
+ PnoLoad(&pnoP->pnoDesc, armP);
MemPtrUnlock(armP);
DmReleaseResource(armH);
-}
+
+ // Init PNO
+ PnoEntryHeader *header = (PnoEntryHeader *)ALIGN_4BYTE(pnoP->headerBuffer);
+ pnoP->alignedHeader = header;
-MemPtr _PnoInit(DmResID resID, PnoDescriptor *pnoP) {
- MemHandle armH = DmGetResource('ARMC', resID);
- MemPtr armP = MemHandleLock(armH);
- PnoLoad(pnoP, armP);
-
- return armP;
+ header->r10Value = pnoP->pnoDesc.r10Value;
+ header->pnoMainAddress = pnoP->pnoDesc.pnoMainAddress;
}
-UInt32 _PnoCall(PnoDescriptor *pnoP, void *userDataP) {
- return PnoCall(pnoP, userDataP);
+void ARMInit() {
+ // init global ARM only
+ MemSet(gVars->arm, sizeof(gVars->arm), 0);
+ PnoInit(RSC_ARMCOMMON, &ARM(ARM_COMMON));
+ PnoInit(RSC_ARMENGINE, &ARM(ARM_ENGINE));
}
-void _PnoFree(PnoDescriptor *pnoP, MemPtr armP) {
- MemHandle armH = MemPtrRecoverHandle(armP);
+void ARMRelease() {
+ PnoUnload(&ARM(ARM_ENGINE).pnoDesc);
+ PnoUnload(&ARM(ARM_COMMON).pnoDesc);
+}
- PnoUnload(pnoP);
- MemPtrUnlock(armP);
- DmReleaseResource(armH);
-} \ No newline at end of file
diff --git a/backends/PalmOS/Src/init_arm.h b/backends/PalmOS/Src/init_arm.h
index 04ffbfc52d..348405035d 100644
--- a/backends/PalmOS/Src/init_arm.h
+++ b/backends/PalmOS/Src/init_arm.h
@@ -4,13 +4,4 @@
void ARMInit();
void ARMRelease();
-// calls
-MemPtr _PceInit(DmResID resID);
-UInt32 _PceCall(void *armP, void *userDataP);
-void _PceFree(void *armP);
-
-MemPtr _PnoInit(DmResID resID, PnoDescriptor *pnoP);
-UInt32 _PnoCall(PnoDescriptor *pnoP, void *userDataP);
-void _PnoFree(PnoDescriptor *pnoP, MemPtr armP);
-
-#endif \ No newline at end of file
+#endif