aboutsummaryrefslogtreecommitdiff
path: root/backends/PalmOS/Src
diff options
context:
space:
mode:
authorChris Apers2004-05-25 13:12:25 +0000
committerChris Apers2004-05-25 13:12:25 +0000
commit85575a51b02c35bdcac9030011d5622dfb8f16ae (patch)
treef9dadf810c57e76612302d3acfc949ce7f54facc /backends/PalmOS/Src
parentaecff97a43fed276afe25ff5e8251a8cff5513ab (diff)
downloadscummvm-rg350-85575a51b02c35bdcac9030011d5622dfb8f16ae.tar.gz
scummvm-rg350-85575a51b02c35bdcac9030011d5622dfb8f16ae.tar.bz2
scummvm-rg350-85575a51b02c35bdcac9030011d5622dfb8f16ae.zip
Moved DrawStatus here, revamped ARM call functions
svn-id: r13860
Diffstat (limited to 'backends/PalmOS/Src')
-rw-r--r--backends/PalmOS/Src/extend.cpp74
1 files changed, 50 insertions, 24 deletions
diff --git a/backends/PalmOS/Src/extend.cpp b/backends/PalmOS/Src/extend.cpp
index 5b7cf20933..12676b8789 100644
--- a/backends/PalmOS/Src/extend.cpp
+++ b/backends/PalmOS/Src/extend.cpp
@@ -27,6 +27,8 @@
#include "globals.h"
#include "starterrsc.h"
+#include "armnative.h"
+
const Char *SCUMMVM_SAVEPATH = "/PALM/Programs/ScummVM/Saved/";
void PalmFatalError(const Char *err) {
@@ -43,6 +45,27 @@ void PalmFatalError(const Char *err) {
SysReset();
}
+
+void DrawStatus(Boolean show) {
+ if (OPTIONS_TST(kOptDisableOnScrDisp))
+ return;
+
+ UInt8 x,y;
+ UInt8 *screen = (UInt8 *)(BmpGetBits(WinGetBitmap(WinGetDisplayWindow())));
+ UInt8 color = (show? gVars->indicator.on : gVars->indicator.off);
+
+ if (gVars->screenLocked)
+ screen = (screen == gVars->flipping.pageAddr1) ? gVars->flipping.pageAddr2 : gVars->flipping.pageAddr1;
+
+ screen += gVars->screenPitch + 1;
+ for(y=0; y < 4; y++) {
+ for(x=0; x < 4; x++)
+ screen[x] = color;
+
+ screen += gVars->screenPitch;
+ }
+}
+
UInt16 StrReplace(Char *ioStr, UInt16 inMaxLen, const Char *inParamStr, const Char *fndParamStr) {
Char *found;
Boolean quit = false;
@@ -78,39 +101,42 @@ UInt16 StrReplace(Char *ioStr, UInt16 inMaxLen, const Char *inParamStr, const Ch
return occurences;
}
-/*
-UInt32 PceNativeRsrcCall(DmResID resID, void *userDataP) {
- PnoDescriptor pno;
-
+
+MemPtr _PceInit(DmResID resID) {
MemHandle armH = DmGetResource('ARMC', resID);
- MemPtr pnoPtr = MemHandleLock(armH);
+ NativeFuncType *armP = (NativeFuncType *)MemHandleLock(armH);
-// UInt32 result = PceNativeCall((NativeFuncType*)armP, userDataP);
- PnoLoad(&pno, pnoPtr);
- UInt32 result = PnoCall(&pno, userDataP);
- PnoUnload(&pno);
+ return armP;
+}
- MemHandleUnlock(armH);
- DmReleaseResource(armH);
+UInt32 _PceCall(void *armP, void *userDataP) {
+ return PceNativeCall((NativeFuncType *)armP, userDataP);
+}
+
+void _PceFree(void *armP) {
+ MemHandle armH = MemPtrRecoverHandle(armP);
- return result;
-}*/
-UInt32 PceNativeRsrcCall(PnoDescriptor *pno, void *userDataP) {
- return PnoCall(pno, userDataP);;
+ MemPtrUnlock(armP);
+ DmReleaseResource(armH);
}
-MemPtr PceNativeCallInit(DmResID resID, PnoDescriptor *pno) {
+MemPtr _PnoInit(DmResID resID, PnoDescriptor *pnoP) {
MemHandle armH = DmGetResource('ARMC', resID);
- MemPtr pnoPtr = MemHandleLock(armH);
- PnoLoad(pno, pnoPtr);
+ MemPtr armP = MemHandleLock(armH);
+ PnoLoad(pnoP, armP);
+
+ return armP;
+}
- return pnoPtr;
+UInt32 _PnoCall(PnoDescriptor *pnoP, void *userDataP) {
+ return PnoCall(pnoP, userDataP);;
}
-void PceNativeCallRelease(PnoDescriptor *pno, MemPtr ptr) {
- MemHandle h = MemPtrRecoverHandle(ptr);
+void _PnoFree(PnoDescriptor *pnoP, MemPtr armP) {
+ MemHandle armH = MemPtrRecoverHandle(armP);
- PnoUnload(pno);
- MemPtrUnlock(ptr);
- DmReleaseResource(h);
+ PnoUnload(pnoP);
+ MemPtrUnlock(armP);
+ DmReleaseResource(armH);
}
+