diff options
author | Chris Apers | 2004-12-20 17:13:26 +0000 |
---|---|---|
committer | Chris Apers | 2004-12-20 17:13:26 +0000 |
commit | 05efaf26185e8b7cba40045cc78f9c37525ea688 (patch) | |
tree | 3205a525a282b9dc0c04981f1a77e6874ccb9d13 /backends/PalmOS/Src | |
parent | effc4430b3d4e1a2a1c04eb363f1d5b783489c48 (diff) | |
download | scummvm-rg350-05efaf26185e8b7cba40045cc78f9c37525ea688.tar.gz scummvm-rg350-05efaf26185e8b7cba40045cc78f9c37525ea688.tar.bz2 scummvm-rg350-05efaf26185e8b7cba40045cc78f9c37525ea688.zip |
- Better ARM support
- Cleanup
svn-id: r16170
Diffstat (limited to 'backends/PalmOS/Src')
-rw-r--r-- | backends/PalmOS/Src/palm.h | 22 | ||||
-rw-r--r-- | backends/PalmOS/Src/palmgfx.cpp | 29 | ||||
-rw-r--r-- | backends/PalmOS/Src/palmrdr.cpp | 8 |
3 files changed, 41 insertions, 18 deletions
diff --git a/backends/PalmOS/Src/palm.h b/backends/PalmOS/Src/palm.h index 88c7d2a2a3..2ea9512f8e 100644 --- a/backends/PalmOS/Src/palm.h +++ b/backends/PalmOS/Src/palm.h @@ -26,6 +26,21 @@ #include <SonyClie.h> #include "common/system.h" #include "cdaudio.h" +//#include "arm/native.h" + +typedef struct { + void *proc; + void *param; + + void *handle; // sound handle + UInt32 size; // buffer size + UInt32 slot; + UInt32 active, // is the sound handler active + set, // is the buffer filled + wait; // do we need to wait for sound completion + void *dataP, // main buffer + *tmpP; // tmp buffer (convertion) +} SoundDataType; // OSD resource id #define kDrawKeyState 3000 @@ -76,6 +91,8 @@ public: // Update the dirty areas of the screen void updateScreen(); + void clearScreen(); + // Either show or hide the mouse cursor bool showMouse(bool visible); @@ -181,8 +198,6 @@ private: void updateScreen_wideLandscape(); void updateScreen_wideZodiac(); - void rumblePack(Boolean active); - void *ptrP[5]; // various ptr WinHandle _screenH, _offScreenH; @@ -302,6 +317,5 @@ Err HwrDisplayPalette(UInt8 operation, Int16 startIndex, // Sound void pcm2adpcm(Int16 *src, UInt8 *dst, UInt32 length); Err sndCallback(void* UserDataP, SndStreamRef stream, void* bufferP, UInt32 *bufferSizeP); -void ClearScreen(); -#endif
\ No newline at end of file +#endif diff --git a/backends/PalmOS/Src/palmgfx.cpp b/backends/PalmOS/Src/palmgfx.cpp index 66b4aff172..45843dce08 100644 --- a/backends/PalmOS/Src/palmgfx.cpp +++ b/backends/PalmOS/Src/palmgfx.cpp @@ -131,7 +131,6 @@ static void HotSwap16bitMode(Boolean swap) { if (OPTIONS_TST(kOptMode16Bit)) { WinScreenMode(winScreenModeSet, &width, &height, &depth, &color); - ClearScreen(); OPTIONS_SET(kOptDisableOnScrDisp); } } @@ -281,6 +280,7 @@ void OSystem_PALMOS::load_gfx_mode() { #ifndef DISABLE_TAPWAVE if (OPTIONS_TST(kOptDeviceZodiac)) { HotSwap16bitMode(true); + clearScreen(); _twBmpV3 = (void *)WinGetBitmap(_offScreenH); // TODO : change _screenP with the correct value (never used in this mode ?) @@ -291,10 +291,7 @@ void OSystem_PALMOS::load_gfx_mode() { { gVars->screenLocked = true; _screenP = WinScreenLock(winLockErase) + _screenOffset.addr; - - if (OPTIONS_TST(kOptDeviceARM)) - ARM(PNO_WIDE).pnoPtr = _PnoInit((OPTIONS_TST(kOptModeLandscape) ? RSC_WIDELANDSCAPE : RSC_WIDEPORTRAIT), &ARM(PNO_WIDE).pnoDesc); - + _renderer_proc = (OPTIONS_TST(kOptModeLandscape)) ? &OSystem_PALMOS::updateScreen_wideLandscape : &OSystem_PALMOS::updateScreen_widePortrait; @@ -350,14 +347,12 @@ void OSystem_PALMOS::unload_gfx_mode() { if (OPTIONS_TST(kOptDeviceZodiac)) { ZodiacRelease(ptrP); HotSwap16bitMode(false); + clearScreen(); } else #endif { WinScreenUnlock(); gVars->screenLocked = false; - - if (OPTIONS_TST(kOptDeviceARM) && ARM(PNO_WIDE).pnoPtr) - _PnoFree(&ARM(PNO_WIDE).pnoDesc, ARM(PNO_WIDE).pnoPtr); } // continue to GFX_BUFFERED @@ -427,7 +422,7 @@ void OSystem_PALMOS::hotswap_gfx_mode(int mode) { // restore offscreen WinPalette(winPaletteSet, 0, 256, _currentPalette); - ClearScreen(); + clearScreen(); copyRectToScreen(_tmpHotSwapP, _screenWidth, 0, 0, _screenWidth, _screenHeight); _modeChanged = false; @@ -530,13 +525,14 @@ void OSystem_PALMOS::copyRectToScreen(const byte *buf, int pitch, int x, int y, // if ARM ARM_CHECK_EXEC(w > 8 && h > 8) ARM_START(CopyRectangleType) + ARM_INIT(COMMON_COPYRECT) ARM_ADDM(dst) ARM_ADDM(buf) ARM_ADDM(pitch) ARM_ADDM(_offScreenPitch) ARM_ADDM(w) ARM_ADDM(h) - PNO_CALL(PNO_COPYRECT, ARM_DATA()) + ARM_CALL(ARM_COMMON, PNO_DATA()); ARM_END() ARM_CHECK_END() // if no ARM @@ -644,4 +640,15 @@ void OSystem_PALMOS::draw1BitGfx(UInt16 id, Int32 x, Int32 y, Boolean show) { MemPtrUnlock(bmTemp); DmReleaseResource(hTemp); } -}
\ No newline at end of file +} + +void OSystem_PALMOS::clearScreen() { + Coord w, h; + RectangleType r; + + WinSetDrawWindow(WinGetDisplayWindow()); + WinGetDisplayExtent(&w, &h); + RctSetRectangle(&r, 0, 0, w, h); + WinSetForeColor(RGBToColor(0,0,0)); + WinDrawRectangle(&r,0); +} diff --git a/backends/PalmOS/Src/palmrdr.cpp b/backends/PalmOS/Src/palmrdr.cpp index ef91c9ab29..ce325f6892 100644 --- a/backends/PalmOS/Src/palmrdr.cpp +++ b/backends/PalmOS/Src/palmrdr.cpp @@ -34,7 +34,7 @@ #include "arm/native.h" #include "arm/macros.h" -void OSystem_PALMOS::rumblePack(Boolean active) { +static void rumblePack(Boolean active) { if (!gVars->vibrator) return; @@ -123,9 +123,10 @@ void OSystem_PALMOS::updateScreen_widePortrait() { // update screen ARM_START(WideType) + ARM_INIT(COMMON_WPORTRAIT) ARM_ADDM(dst) ARM_ADDM(src) - PNO_CALL(PNO_WIDE, ARM_DATA()) + ARM_CALL(ARM_COMMON, PNO_DATA()) ARM_CONTINUE() { Coord x, y; @@ -185,9 +186,10 @@ void OSystem_PALMOS::updateScreen_wideLandscape() { // update screen ARM_START(WideType) + ARM_INIT(COMMON_WLANDSCAPE) ARM_ADDM(dst) ARM_ADDM(src) - PNO_CALL(PNO_WIDE, ARM_DATA()) + ARM_CALL(ARM_COMMON, PNO_DATA()) ARM_CONTINUE() { Coord x, y; |