diff options
author | Eugene Sandulenko | 2005-07-30 21:11:48 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2005-07-30 21:11:48 +0000 |
commit | 6b4484472b79dc7ea7d1ce545a28fba7d3b7696f (patch) | |
tree | c44c4e61f18ddd537f7082cb48869cf33d422fbd /backends/PalmOS | |
parent | 86ab70b149e5cd00cf54f2e41896e2c4e16795e4 (diff) | |
download | scummvm-rg350-6b4484472b79dc7ea7d1ce545a28fba7d3b7696f.tar.gz scummvm-rg350-6b4484472b79dc7ea7d1ce545a28fba7d3b7696f.tar.bz2 scummvm-rg350-6b4484472b79dc7ea7d1ce545a28fba7d3b7696f.zip |
Remove trailing whitespaces.
svn-id: r18604
Diffstat (limited to 'backends/PalmOS')
71 files changed, 496 insertions, 496 deletions
diff --git a/backends/PalmOS/Src/app.cpp b/backends/PalmOS/Src/app.cpp index de6d91ac32..029f65351a 100644 --- a/backends/PalmOS/Src/app.cpp +++ b/backends/PalmOS/Src/app.cpp @@ -65,7 +65,7 @@ static Err AppStartCheckNotify() { UInt32 romVersion; Err err; - err = FtrGet(sysFtrCreator, sysFtrNumNotifyMgrVersion, &romVersion); + err = FtrGet(sysFtrCreator, sysFtrNumNotifyMgrVersion, &romVersion); if (!err) { UInt16 cardNo; LocalID dbID; @@ -111,13 +111,13 @@ static Err AppStartLoadSkin() { if (err) FrmCustomAlert(FrmWarnAlert,"No skin found.\nScummVM will start in direct mode.",0,0); //FrmCustomAlert(FrmErrorAlert,"No skin found.\nPlease install a skin and restart ScummVM.",0,0); - + return err; } static Err AppStartCheckMathLib() { Err e = MathlibInit(); - + switch (e) { case errNone: break; @@ -128,7 +128,7 @@ static Err AppStartCheckMathLib() { FrmCustomAlert(FrmErrorAlert,"Can't open MathLib !",0,0); break; } - + return e; } @@ -143,7 +143,7 @@ void WinScreenGetPitch() { WinScreenGetAttribute(winScreenRowBytes, &(gVars->screenPitch)); if (OPTIONS_TST(kOptMode16Bit)) gVars->screenPitch /= 2; // this value is used only in-game and in 8bit mode, so if we are in 16Bit 8bit = 16bit/2 - + // FIXME : hack for TT3 simulator (and real ?) return 28 on landscape mode if (gVars->screenPitch < gVars->screenFullWidth) gVars->screenPitch = gVars->screenFullWidth; @@ -175,12 +175,12 @@ void PINGetScreenDimensions() { gVars->screenFullHeight = y << 1; OPTIONS_SET(kOptModeWide); - + if (curOrientation == sysOrientationLandscape || curOrientation == sysOrientationReverseLandscape ) OPTIONS_SET(kOptModeLandscape); - + StatShow(); PINSetInputAreaState(pinInputAreaOpen); PINSetInputTriggerState(pinInputTriggerDisabled); @@ -208,7 +208,7 @@ static void AppStartCheckScreenSize() { SilkLibResizeDispWin(slkRefNum, silkResizeMax); HRWinGetWindowExtent(gVars->HRrefNum, &gVars->screenFullWidth, &gVars->screenFullHeight); SilkLibResizeDispWin(slkRefNum, silkResizeNormal); - SilkLibDisableResize(slkRefNum); + SilkLibDisableResize(slkRefNum); } else { VskSetState(slkRefNum, vskStateEnable, (gVars->slkVersion == vskVersionNum2 ? vskResizeVertically : vskResizeHorizontally)); @@ -218,7 +218,7 @@ static void AppStartCheckScreenSize() { VskSetState(slkRefNum, vskStateEnable, vskResizeDisable); OPTIONS_SET((version == vskVersionNum3 ? kOptModeLandscape : kOptNone)); } - + OPTIONS_SET(kOptModeWide); // Tapwave Zodiac and other DIA API compatible devices @@ -226,7 +226,7 @@ static void AppStartCheckScreenSize() { } else { PINGetScreenDimensions(); } - + WinScreenGetPitch(); } @@ -261,7 +261,7 @@ static void AppStartSetMemory() { min(kMemScummNewCostGames, 2500000); min(kMemSimon1Games, 1000000); min(kMemSimon2Games, 2000000); - + } #undef threshold @@ -352,7 +352,7 @@ Err AppStart(void) { gPrefs->debug = false; gPrefs->exitLauncher = true; gPrefs->stdPalette = OPTIONS_TST(kOptDeviceOS5); - + } else { PrefGetAppPreferences(appFileCreator, appPrefID, gPrefs, &dataSize, true); } @@ -362,7 +362,7 @@ Err AppStart(void) { error = AppStartCheckHRmode(); if (error) return (error); - + // error = AppStartLoadSkin(); // if (error) return (error); bDirectMode = (AppStartLoadSkin() != errNone); @@ -410,8 +410,8 @@ static Err AppStopCheckNotify() { UInt32 romVersion; Err err; - - err = FtrGet(sysFtrCreator, sysFtrNumNotifyMgrVersion, &romVersion); + + err = FtrGet(sysFtrCreator, sysFtrNumNotifyMgrVersion, &romVersion); if (!err) { UInt16 cardNo; LocalID dbID; @@ -424,7 +424,7 @@ static Err AppStopCheckNotify() SysNotifyUnregister(cardNo, dbID, sysNotifyDisplayResizedEvent, sysNotifyNormalPriority); } } - + return err; } @@ -437,7 +437,7 @@ void AppStop(void) { // Close and move Game list database GamCloseDatabase(false); - // Write the saved preferences / saved-state information. This data + // Write the saved preferences / saved-state information. This data // will saved during a HotSync backup. SavePrefs(); diff --git a/backends/PalmOS/Src/args.cpp b/backends/PalmOS/Src/args.cpp index 5441485067..d05f509dae 100644 --- a/backends/PalmOS/Src/args.cpp +++ b/backends/PalmOS/Src/args.cpp @@ -17,7 +17,7 @@ void ArgsAdd(Char **argvP, const Char *argP, const Char *parmP, UInt8 *countArgP UInt16 len2 = 0; UInt16 len1 = StrLen(argP); - if (len1 > 0) { + if (len1 > 0) { if (parmP) len2 = StrLen(parmP); @@ -25,7 +25,7 @@ void ArgsAdd(Char **argvP, const Char *argP, const Char *parmP, UInt8 *countArgP newArg = MemHandleNew(len1 + len2 + 1); // +1 = NULL CHAR *argvP = (Char *)MemHandleLock(newArg); StrCopy(*argvP, argP); - + if (parmP) StrCat(*argvP, parmP); } @@ -44,7 +44,7 @@ void ArgsFree(Char **argvP) { MemHandleUnlock(oldH); MemHandleFree(oldH); } - + oldH = MemPtrRecoverHandle(argvP); MemHandleUnlock(oldH); MemHandleFree(oldH); diff --git a/backends/PalmOS/Src/arm/PNOMain.cpp b/backends/PalmOS/Src/arm/PNOMain.cpp index 87175335ab..0104f87b5a 100644 --- a/backends/PalmOS/Src/arm/PNOMain.cpp +++ b/backends/PalmOS/Src/arm/PNOMain.cpp @@ -10,8 +10,8 @@ extern "C" unsigned long PNO_Main( - const void *emulStateP, - void *userData68KP, + const void *emulStateP, + void *userData68KP, Call68KFuncType *call68KFuncP); unsigned long PNO_Main(const void *emulStateP, void *userData68KP, Call68KFuncType *call68KFuncP) { @@ -41,7 +41,7 @@ unsigned long PNO_Main(const void *emulStateP, void *userData68KP, Call68KFuncTy #endif }; - // needed before making any OS calls using the + // needed before making any OS calls using the // PACEInterface library InitPACEInterface(emulStateP, call68KFuncP); diff --git a/backends/PalmOS/Src/arm/blit.cpp b/backends/PalmOS/Src/arm/blit.cpp index 674b4dd365..a03035209b 100644 --- a/backends/PalmOS/Src/arm/blit.cpp +++ b/backends/PalmOS/Src/arm/blit.cpp @@ -47,6 +47,6 @@ UInt32 Display_blit(void *userData68KP) { dstBuf += dstPitch; } } - + return 0; } diff --git a/backends/PalmOS/Src/arm/copyrectangle.cpp b/backends/PalmOS/Src/arm/copyrectangle.cpp index ede630c976..0cdb93158d 100644 --- a/backends/PalmOS/Src/arm/copyrectangle.cpp +++ b/backends/PalmOS/Src/arm/copyrectangle.cpp @@ -23,6 +23,6 @@ UInt32 OSystem_CopyRectToScreen(void *userData68KP) { buf += pitch; } while (--h); } - + return 0; } diff --git a/backends/PalmOS/Src/arm/decompressrle0.cpp b/backends/PalmOS/Src/arm/decompressrle0.cpp index d6ac2d6c80..2ad28385e6 100755 --- a/backends/PalmOS/Src/arm/decompressrle0.cpp +++ b/backends/PalmOS/Src/arm/decompressrle0.cpp @@ -22,6 +22,6 @@ UInt32 Screen_decompressRLE0(void *userData68KP) { dest += skip; } } - + return 0; } diff --git a/backends/PalmOS/Src/arm/decompressrle7.cpp b/backends/PalmOS/Src/arm/decompressrle7.cpp index 49976d6a95..6674b50861 100755 --- a/backends/PalmOS/Src/arm/decompressrle7.cpp +++ b/backends/PalmOS/Src/arm/decompressrle7.cpp @@ -22,6 +22,6 @@ UInt32 Screen_decompressRLE7(void *userData68KP) { dest += code; } } - + return 0; } diff --git a/backends/PalmOS/Src/arm/drawsprite.cpp b/backends/PalmOS/Src/arm/drawsprite.cpp index 3c368c17ef..f662f2176a 100755 --- a/backends/PalmOS/Src/arm/drawsprite.cpp +++ b/backends/PalmOS/Src/arm/drawsprite.cpp @@ -21,6 +21,6 @@ UInt32 Screen_drawSprite(void *userData68KP) { sprData += sprPitch; dest += _scrnSizeX; } - + return 0; } diff --git a/backends/PalmOS/Src/arm/drawstrip.cpp b/backends/PalmOS/Src/arm/drawstrip.cpp index 6d8d178fb8..18e9138e15 100644 --- a/backends/PalmOS/Src/arm/drawstrip.cpp +++ b/backends/PalmOS/Src/arm/drawstrip.cpp @@ -21,7 +21,7 @@ UInt32 Gdi_drawStripToScreen(void *userData68KP) { // Compose the text over the game graphics for (int h = 0; h < height; ++h) { for (int w = 0; w < width; ++w) { - if (text[w] == CHARSET_MASK_TRANSPARENCY) + if (text[w] == CHARSET_MASK_TRANSPARENCY) dst[w] = src[w]; else dst[w] = text[w]; @@ -30,6 +30,6 @@ UInt32 Gdi_drawStripToScreen(void *userData68KP) { dst += _vm_screenWidth; text += _textSurface_pitch; } - + return 0; } diff --git a/backends/PalmOS/Src/arm/fastshrink.cpp b/backends/PalmOS/Src/arm/fastshrink.cpp index b46843e793..be5e385516 100755 --- a/backends/PalmOS/Src/arm/fastshrink.cpp +++ b/backends/PalmOS/Src/arm/fastshrink.cpp @@ -49,6 +49,6 @@ UInt32 Screen_fastShrink(void *userData68KP) { xCnt += 2; } } - + return 0; } diff --git a/backends/PalmOS/Src/arm/macros.h b/backends/PalmOS/Src/arm/macros.h index 8157e5301f..df996b7376 100644 --- a/backends/PalmOS/Src/arm/macros.h +++ b/backends/PalmOS/Src/arm/macros.h @@ -1,5 +1,5 @@ #ifndef __MACROS_H__ -#define __MACROS_H__ +#define __MACROS_H__ #ifndef DISABLE_ARM // macros for ARM calls @@ -14,7 +14,7 @@ #define ARM_ADDM(member) dataARM.member = member; #define ARM_ADDV(member, var) dataARM.member = var; #define ARM_INIT(id) PnoType pno = { id, &dataARM }; - + #define ARM_GETM(member) member = dataARM.member; #define ARM_GETV(member, var) var = dataARM.member; @@ -33,7 +33,7 @@ #define ARM_CALL_VALUE(rsc, data, var) ARM(rsc).alignedHeader->userDataP = (UInt32)data; \ var = PceNativeCall(ARM(rsc).pnoDesc.entry, ARM(rsc).alignedHeader); - + #else // no ARM = empty definition #define ARM_START(TYPE) @@ -68,7 +68,7 @@ #define GET_XPTR(var, dst, src, TYPE) \ dst.var = (TYPE *)ReadUnaligned32(&src->var); - + #define GET_X32(var, dst, src) \ dst.var = ReadUnaligned32(&src->var); diff --git a/backends/PalmOS/Src/arm/native.h b/backends/PalmOS/Src/arm/native.h index d3f0cb8465..714d49c366 100644 --- a/backends/PalmOS/Src/arm/native.h +++ b/backends/PalmOS/Src/arm/native.h @@ -96,7 +96,7 @@ typedef struct { typedef struct { void *v1; // struct v1 * - + const byte *_srcptr; int _height; @@ -118,11 +118,11 @@ typedef struct { typedef struct { int width; int height; - + const byte *src; byte *dst; const byte *text; - + int _vm_screenWidth; uint16 vs_pitch; uint16 _textSurface_pitch; diff --git a/backends/PalmOS/Src/arm/proc3.cpp b/backends/PalmOS/Src/arm/proc3.cpp index c566ae31cd..0f7e087b76 100644 --- a/backends/PalmOS/Src/arm/proc3.cpp +++ b/backends/PalmOS/Src/arm/proc3.cpp @@ -11,7 +11,7 @@ UInt32 CostumeRenderer_proc3(void *userData68KP) { // import variables V1Type v1; - + SETPTRV (V1CodecType * , v1, v1comp ) SETPTR (const byte * ,_srcptr ) @@ -27,7 +27,7 @@ UInt32 CostumeRenderer_proc3(void *userData68KP) { SETPTR (byte * ,_shadow_table ) SETPTR (byte * ,_palette ) SET8 (byte ,_shadow_mode ) - + MSETPTR (const byte * ,scaletable ) MSET8 (byte ,mask ) MSET8 (byte ,shr ) diff --git a/backends/PalmOS/Src/arm/renderparallax.cpp b/backends/PalmOS/Src/arm/renderparallax.cpp index 8c710d7c2e..09e47076d7 100755 --- a/backends/PalmOS/Src/arm/renderparallax.cpp +++ b/backends/PalmOS/Src/arm/renderparallax.cpp @@ -71,6 +71,6 @@ UInt32 Screen_renderParallax(void *userData68KP) { } } } - + return 0; } diff --git a/backends/PalmOS/Src/arm/screendraw.cpp b/backends/PalmOS/Src/arm/screendraw.cpp index 75495d3daf..846b1a4ffd 100755 --- a/backends/PalmOS/Src/arm/screendraw.cpp +++ b/backends/PalmOS/Src/arm/screendraw.cpp @@ -19,6 +19,6 @@ UInt32 Screen_draw(void *userData68KP) { dest++; src++; } - + return 0; } diff --git a/backends/PalmOS/Src/arm/widelandscape.cpp b/backends/PalmOS/Src/arm/widelandscape.cpp index c1b47d2cc9..917dd42228 100644 --- a/backends/PalmOS/Src/arm/widelandscape.cpp +++ b/backends/PalmOS/Src/arm/widelandscape.cpp @@ -24,7 +24,7 @@ UInt32 OSystem_updateScreen_wideLandscape(void *userData68KP) { MemMove(dst, dst - 480, 480); dst += 480; } - + return 0; } diff --git a/backends/PalmOS/Src/arm/wideportrait.cpp b/backends/PalmOS/Src/arm/wideportrait.cpp index 7ee0af034a..32134d5824 100644 --- a/backends/PalmOS/Src/arm/wideportrait.cpp +++ b/backends/PalmOS/Src/arm/wideportrait.cpp @@ -38,6 +38,6 @@ UInt32 OSystem_updateScreen_widePortrait(void *userData68KP) { MemMove(dst, dst - WIDE_PITCH, 300); // 300 = 200 x 1.5 dst += WIDE_PITCH; } - + return 0; } diff --git a/backends/PalmOS/Src/builder/enum_globals.h b/backends/PalmOS/Src/builder/enum_globals.h index 08761bf181..a83a366cb4 100644 --- a/backends/PalmOS/Src/builder/enum_globals.h +++ b/backends/PalmOS/Src/builder/enum_globals.h @@ -5,7 +5,7 @@ enum { GBVARS_GUIFONT_INDEX = 0, GBVARS_FONTBITS_INDEX -}; +}; // Scumm enum { @@ -56,7 +56,7 @@ enum { GBVARS_SPANISHVIDEOFONT_INDEX, GBVARS_VIDEOFONT_INDEX, GBVARS_SIMON1CURSOR_INDEX -// GBVARS_SIMON2CURSORS_INDEX +// GBVARS_SIMON2CURSORS_INDEX }; // Queen enum { diff --git a/backends/PalmOS/Src/cd_default.cpp b/backends/PalmOS/Src/cd_default.cpp index 233f27687b..ba0a2e1b2b 100644 --- a/backends/PalmOS/Src/cd_default.cpp +++ b/backends/PalmOS/Src/cd_default.cpp @@ -54,7 +54,7 @@ void DefaultCDPlayer::update() { // not fully played if (_sys->getMillis() < _defTrackEndFrame) return; - + if (_defLoops == 0) return; @@ -77,14 +77,14 @@ void DefaultCDPlayer::stop() { /* Stop CD Audio in 1/10th of a second */ void DefaultCDPlayer::play(int track, int num_loops, int start_frame, int duration) { if (!num_loops && !start_frame) return; - + UInt32 fullLength; - + _defLoops = num_loops; start_frame = TO_MSECS(start_frame); duration = TO_MSECS(duration); - // frame in milli-seconds + // frame in milli-seconds _defStopTime = 0; fullLength = start_frame + gVars->CD.defaultTrackLength * 1000; @@ -96,7 +96,7 @@ void DefaultCDPlayer::play(int track, int num_loops, int start_frame, int durati } else { _defTrackLength = fullLength; } - + // try to play the track _defTrackEndFrame = _sys->getMillis() + _defTrackLength; } diff --git a/backends/PalmOS/Src/cd_default.h b/backends/PalmOS/Src/cd_default.h index 1f8c324fdb..095ff25bbe 100644 --- a/backends/PalmOS/Src/cd_default.h +++ b/backends/PalmOS/Src/cd_default.h @@ -19,30 +19,30 @@ * $Header$ * */ - + #ifndef CD_DEFAULT_H #define CD_DEFAULT_H - + #include "cdaudio.h" - + class DefaultCDPlayer : public CDAudio { public: DefaultCDPlayer(OSystem *sys); bool init(); void release(); - + bool poll(); void update(); void play(int track, int num_loops, int start_frame, int duration); void stop(); - + private: OSystem *_sys; - + // cdrom UInt16 _defLoops; UInt32 _defStopTime, _defTrackEndFrame, _defTrackLength; }; - + #endif
\ No newline at end of file diff --git a/backends/PalmOS/Src/cd_msa.cpp b/backends/PalmOS/Src/cd_msa.cpp index a5eeacb507..a91cd5eb9f 100644 --- a/backends/PalmOS/Src/cd_msa.cpp +++ b/backends/PalmOS/Src/cd_msa.cpp @@ -47,7 +47,7 @@ bool MsaCDPlayer::init() { if (!(error = FtrGet(sonySysFtrCreator, sonySysFtrNumSysInfoP, (UInt32*)&sonySysFtrSysInfoP))) { // not found with audio adapter ?! - //if (sonySysFtrSysInfoP->libr & sonySysFtrSysInfoLibrMsa) { + //if (sonySysFtrSysInfoP->libr & sonySysFtrSysInfoLibrMsa) { if ((error = SysLibFind(sonySysLibNameMsa, &_msaRefNum))) if (error == sysErrLibNotFound) error = SysLibLoad(sonySysFileTMsaLib, sonySysFileCMsaLib, &_msaRefNum); @@ -57,11 +57,11 @@ bool MsaCDPlayer::init() { // this doesn't work the same way on build-in MP3 device and external MP3 devices if (!error) { //MsaLibClose(_msaRefNum, msaLibOpenModeAlbum); // close the lib if we previously let it open (?) Need to add Notify for sonySysNotifyMsaEnforceOpenEvent just in case ... - error = MsaLibOpen(_msaRefNum, msaLibOpenModeAlbum); + error = MsaLibOpen(_msaRefNum, msaLibOpenModeAlbum); //if (error == msaErrAlreadyOpen) // error = MsaLibEnforceOpen(_msaRefNum, msaLibOpenModeAlbum, appFileCreator); - + //error = (error != msaErrStillOpen) ? error : errNone; } //} @@ -147,7 +147,7 @@ void MsaCDPlayer::update() { } MsaStop(_msaRefNum, true); - + if (_msaLoops == 0) return; @@ -185,13 +185,13 @@ void MsaCDPlayer::play(int track, int num_loops, int start_frame, int duration) if (!num_loops && !start_frame) return; - + _msaTrack = track + gVars->CD.firstTrack - 1; // first track >= 1 ?, not 0 (0=album) _msaLoops = num_loops; _msaStartFrame = TO_MSECS(start_frame); _msaDuration = TO_MSECS(duration); - Err e; + Err e; MemHandle trackH; // stop current play if any @@ -206,19 +206,19 @@ void MsaCDPlayer::play(int track, int num_loops, int start_frame, int duration) MsaTime msaTime; MsaTrackInfo *trackP; UInt32 SU, fullLength; - + // FIXME (?) : this enable MsaSuToTime to return the right value in some cases MsaPlay(_msaRefNum, _msaTrack, 0, msa_PBRATE_SP); MsaStop(_msaRefNum, true); - - // get the msa time - trackP = (MsaTrackInfo *)MemHandleLock(trackH); + + // get the msa time + trackP = (MsaTrackInfo *)MemHandleLock(trackH); MsaSuToTime(_msaRefNum, trackP->totalsu, &msaTime); SU = trackP->totalsu; MemPtrUnlock(trackP); MemHandleFree(trackH); - - // MSA frame in milli-seconds + + // MSA frame in milli-seconds fullLength = FROM_MIN(msaTime.minute); fullLength += FROM_SEC(msaTime.second); fullLength += msaTime.frame; @@ -231,7 +231,7 @@ void MsaCDPlayer::play(int track, int num_loops, int start_frame, int duration) } else { _msaTrackLength = fullLength; } - + // try to play the track if (start_frame == 0 && duration == 0) { MsaPlay(_msaRefNum, _msaTrack, 0, msa_PBRATE_SP); @@ -241,7 +241,7 @@ void MsaCDPlayer::play(int track, int num_loops, int start_frame, int duration) _msaTrackStartSu = (UInt32) ((float)(_msaStartFrame) / ((float)fullLength / (float)SU)); _msaTrackEndSu = (UInt32) ((float)(_msaTrackLength) / ((float)fullLength / (float)SU)); _msaTrackEndSu += _msaTrackStartSu; - + if (_msaTrackEndSu > SU) _msaTrackEndSu = SU; diff --git a/backends/PalmOS/Src/cd_msa.h b/backends/PalmOS/Src/cd_msa.h index 5dbb54bfae..10606f8753 100644 --- a/backends/PalmOS/Src/cd_msa.h +++ b/backends/PalmOS/Src/cd_msa.h @@ -19,30 +19,30 @@ * $Header$ * */ - + #ifndef CD_MSA_H #define CD_MSA_H - + #include "cdaudio.h" - + class MsaCDPlayer : public CDAudio { public: MsaCDPlayer(OSystem *sys); bool init(); void release(); - + bool poll(); void update(); void play(int track, int num_loops, int start_frame, int duration); void stop(); - + private: void initInternal(); - + OSystem *_sys; UInt16 _msaRefNum; - + // cdrom AlbumInfoType _msaAlbum; UInt16 _msaLoops; @@ -57,5 +57,5 @@ UInt32 _msaTrackLength; }; - + #endif
\ No newline at end of file diff --git a/backends/PalmOS/Src/cd_pockettunes.cpp b/backends/PalmOS/Src/cd_pockettunes.cpp index de620275f2..08f2807dbd 100644 --- a/backends/PalmOS/Src/cd_pockettunes.cpp +++ b/backends/PalmOS/Src/cd_pockettunes.cpp @@ -49,7 +49,7 @@ UInt32 PckTunesCDPlayer::getStatus() { EventType e; UInt32 status; - + PocketTunesAction *pAction = (PocketTunesAction*)MemPtrNew (sizeof(PocketTunesAction)); if (!pAction) return kPtunesStopped; @@ -60,9 +60,9 @@ UInt32 PckTunesCDPlayer::getStatus() { status = pAction->data.getStatusAction.status; else status = kPtunesStopped; - + MemPtrFree(pAction); - return status; + return status; } UInt32 PckTunesCDPlayer::getPosition(UInt32 deflt) { @@ -78,7 +78,7 @@ UInt32 PckTunesCDPlayer::getPosition(UInt32 deflt) { pAction->action = kPocketTunesActionGetValue; pAction->data.getValueAction.which = kPtunesValueSongPosition; - + EvtGetEvent(&e, evtNoWait); if (PocketTunesCallSynch(pAction) == errNone) value = pAction->data.getValueAction.value; @@ -112,22 +112,22 @@ UInt32 PckTunesCDPlayer::getDuration() { EventType e; UInt32 value; - + PocketTunesAction *pAction = (PocketTunesAction*)MemPtrNew (sizeof(PocketTunesAction)); if (!pAction) return gVars->CD.defaultTrackLength; pAction->action = kPocketTunesActionGetValue; pAction->data.getValueAction.which = kPtunesValueSongDuration; - + EvtGetEvent(&e, evtNoWait); if (PocketTunesCallSynch(pAction) == errNone) value = pAction->data.getValueAction.value; else value = gVars->CD.defaultTrackLength; - + MemPtrFree(pAction); - return value; + return value; } bool PckTunesCDPlayer::poll() { @@ -186,7 +186,7 @@ void PckTunesCDPlayer::play(int track, int num_loops, int start_frame, int durat EventType e; Char nameP[256], fileP[100]; Char *ext[] = { "mp3", "ogg" }; - + // if (duration > 0) // duration += 5; @@ -197,9 +197,9 @@ void PckTunesCDPlayer::play(int track, int num_loops, int start_frame, int durat // stop current play if any VFSVolumeGetLabel(gVars->volRefNum, nameP, 256); - + StrPrintF(fileP, "/Palm/Programs/ScummVM/Audio/%s_%03ld.%s", gameP, (track + gVars->CD.firstTrack - 1), ext[gVars->CD.format]); - + if (PocketTunesOpenFile(nameP, fileP, 0) == errNone) { EvtGetEvent(&e, evtNoWait); PocketTunesPauseIfPlaying(); diff --git a/backends/PalmOS/Src/cd_pockettunes.h b/backends/PalmOS/Src/cd_pockettunes.h index be42ff46a6..34273f4696 100644 --- a/backends/PalmOS/Src/cd_pockettunes.h +++ b/backends/PalmOS/Src/cd_pockettunes.h @@ -19,39 +19,39 @@ * $Header$ * */ - + #ifndef CD_POCKETTUNES_H #define CD_POCKETTUNES_H - + #include "cdaudio.h" #include "pockettunes.h" - + class PckTunesCDPlayer : public CDAudio { public: PckTunesCDPlayer(OSystem *sys); bool init(); void release(); - + bool poll(); void update(); void play(int track, int num_loops, int start_frame, int duration); void stop(); - + private: OSystem *_sys; Char gameP[15]; - + UInt32 getStatus(); void setPosition(UInt32 value); UInt32 getDuration(); UInt32 getPosition(UInt32 deft); - + Boolean _isPlaying; // cdrom UInt16 _pckLoops, _pckTrack; UInt32 _pckTrackStartFrame, _pckTrackEndFrame; UInt32 _pckStopTime, _pckTrackDuration; }; - + #endif
\ No newline at end of file diff --git a/backends/PalmOS/Src/cdaudio.h b/backends/PalmOS/Src/cdaudio.h index 9a4a2e3353..10c34b64d0 100644 --- a/backends/PalmOS/Src/cdaudio.h +++ b/backends/PalmOS/Src/cdaudio.h @@ -19,7 +19,7 @@ * $Header$ * */ - + #ifndef CDAUDIO_H #define CDAUDIO_H @@ -34,7 +34,7 @@ #define FROM_SEC(secs) ((UInt32)((secs) * 1000)) class CDAudio { -public: +public: CDAudio() { _isInitialized = false; _volumeLevel = 100; @@ -42,7 +42,7 @@ public: virtual bool init() = 0; virtual void release() = 0; - + // OSystem functions virtual bool poll() = 0; virtual void play(int track, int num_loops, int start_frame, int duration) = 0; diff --git a/backends/PalmOS/Src/extend.cpp b/backends/PalmOS/Src/extend.cpp index 0f2efebd2b..b1d53f2fc4 100644 --- a/backends/PalmOS/Src/extend.cpp +++ b/backends/PalmOS/Src/extend.cpp @@ -19,7 +19,7 @@ * $Header$ * */ - + #include <PalmOS.h> #include <string.h> @@ -36,7 +36,7 @@ void PalmFatalError(const Char *err) { // unlock to show the alert box if (gVars->screenLocked) WinScreenUnlock(); - + if (OPTIONS_TST(kOptModeHiDensity)) WinSetCoordinateSystem(kCoordinatesStandard); @@ -78,10 +78,10 @@ UInt16 StrReplace(Char *ioStr, UInt16 inMaxLen, const Char *inParamStr, const Ch UInt16 l2 = 0; UInt16 l3 = StrLen(ioStr); UInt16 next = 0; - + if (inParamStr) l2 = StrLen(inParamStr); // can be null to know how many occur. - + while (((found = StrStr(ioStr+next, fndParamStr)) != NULL) && (!quit)) { occurences++; newLength = (StrLen(ioStr) - l1 + l2); @@ -98,7 +98,7 @@ UInt16 StrReplace(Char *ioStr, UInt16 inMaxLen, const Char *inParamStr, const Ch } else next = found - ioStr + l1; } - + if (inParamStr) ioStr[l3 + l2*occurences - l1*occurences] = 0; diff --git a/backends/PalmOS/Src/forms/formCards.cpp b/backends/PalmOS/Src/forms/formCards.cpp index 5afcaa41ea..c4d1e2cdf6 100644 --- a/backends/PalmOS/Src/forms/formCards.cpp +++ b/backends/PalmOS/Src/forms/formCards.cpp @@ -57,13 +57,13 @@ static UInt16 CardSlotFormInit(Boolean display, Boolean bDraw) { if (err || StrLen(labelP) == 0) { // if no label try to retreive card type VolumeInfoType volInfo; err = VFSVolumeInfo(volRefNum, &volInfo); - + if (!err) { ExpCardInfoType info; err = ExpCardInfo(volInfo.slotRefNum, &info); StrCopy(labelP, info.deviceClassStr); } - + if (err) // if err default name StrPrintF(labelP,"Other Card %ld", other++); } @@ -72,7 +72,7 @@ static UInt16 CardSlotFormInit(Boolean display, Boolean bDraw) { cards = MemHandleNew(sizeof(CardInfoType)); else MemHandleResize(cards, MemHandleSize(cards) + sizeof(CardInfoType)); - + cardsInfo = (CardInfoType *)MemHandleLock(cards); cardsInfo[counter].volRefNum = volRefNum; StrCopy(cardsInfo[counter].nameP, labelP); @@ -87,7 +87,7 @@ static UInt16 CardSlotFormInit(Boolean display, Boolean bDraw) { ControlType *cck1P, *cck2P, *cck3P; UInt16 index; Int16 selected = -1; - + CardInfoType *cardsInfo; MemHandle items = NULL; @@ -108,7 +108,7 @@ static UInt16 CardSlotFormInit(Boolean display, Boolean bDraw) { itemsText = (Char **)MemHandleLock(items); itemsText[index] = cardsInfo[index].nameP; MemHandleUnlock(items); - + if (cardsInfo[index].volRefNum == gPrefs->card.volRefNum) selected = index; } @@ -168,7 +168,7 @@ static void CardSlotFormExit(Boolean bSave) { cardsInfo = (CardInfoType *)itemsList; cards = MemPtrRecoverHandle(cardsInfo); items = MemPtrRecoverHandle(itemsText); - + itemsText = NULL; itemsList = NULL; } else { @@ -239,7 +239,7 @@ Boolean CardSlotFormHandleEvent(EventPtr eventP) { Boolean handled = false; switch (eventP->eType) { - + case frmOpenEvent: CardSlotFormInit(true, true); handled = true; @@ -260,7 +260,7 @@ Boolean CardSlotFormHandleEvent(EventPtr eventP) { case CardSlotCancelButton: CardSlotFormExit(false); break; - + case CardSlotMoveCheckbox: CardSlotFromShowHideOptions(); break; @@ -271,13 +271,13 @@ Boolean CardSlotFormHandleEvent(EventPtr eventP) { default: break; } - + return handled; } UInt16 parseCards() { UInt16 volRefNum = CardSlotFormInit(false, false); CardSlotFormExit(false); - + return volRefNum; } diff --git a/backends/PalmOS/Src/forms/formEditGame.cpp b/backends/PalmOS/Src/forms/formEditGame.cpp index 47e1857160..bcd44c1502 100644 --- a/backends/PalmOS/Src/forms/formEditGame.cpp +++ b/backends/PalmOS/Src/forms/formEditGame.cpp @@ -33,7 +33,7 @@ static void GameTabInit(GameInfoType *gameInfoP) { nameP = (Char *)MemHandleLock(nameH); pathP = (Char *)MemHandleLock(pathH); gameP = (Char *)MemHandleLock(gameH); - + if (gameInfoP) { LstSetSelection(list1P, gameInfoP->engine); StrCopy(nameP, gameInfoP->nameP); @@ -102,7 +102,7 @@ static Err GameTabSave(GameInfoType *gameInfoP) { StrCat(gameInfoP->pathP, "/"); } - + return errNone; } @@ -110,7 +110,7 @@ static void DisplayInit(GameInfoType *gameInfoP) { ListType *list1P; list1P = (ListType *)GetObjectPtr(TabGameDisplayGfxListList); - + if (gameInfoP) { LstSetSelection(list1P, gameInfoP->gfxMode); CtlSetValue((ControlType *)GetObjectPtr(TabGameDisplayFilterCheckbox), gameInfoP->filter); @@ -129,7 +129,7 @@ static void DisplayInit(GameInfoType *gameInfoP) { static Err DisplaySave(GameInfoType *gameInfoP) { ListType *list1P; - ControlType *cck6P, *cck7P, *cck8P; + ControlType *cck6P, *cck7P, *cck8P; FormType *frmP = FrmGetActiveForm(); @@ -137,7 +137,7 @@ static Err DisplaySave(GameInfoType *gameInfoP) { cck6P = (ControlType *)GetObjectPtr(TabGameDisplayFilterCheckbox); cck7P = (ControlType *)GetObjectPtr(TabGameDisplayFullscreenCheckbox); cck8P = (ControlType *)GetObjectPtr(TabGameDisplayAspectRatioCheckbox); - + if (!gameInfoP) { } else { gameInfoP->gfxMode = LstGetSelection(list1P); @@ -145,7 +145,7 @@ static Err DisplaySave(GameInfoType *gameInfoP) { gameInfoP->fullscreen = CtlGetValue(cck7P); gameInfoP->aspectRatio = CtlGetValue(cck8P); } - + return errNone; } @@ -213,7 +213,7 @@ static void OptionsInit(GameInfoType *gameInfoP) { static Err OptionsSave(GameInfoType *gameInfoP) { FieldType *fld4P, *fld5P, *fld6P; - ControlType *cck1P, *cck2P, *cck3P, *cck4P, *cck5P; + ControlType *cck1P, *cck2P, *cck3P, *cck4P, *cck5P; ListType *list2P, *list3P; FormType *frmP = FrmGetActiveForm(); @@ -247,7 +247,7 @@ static Err OptionsSave(GameInfoType *gameInfoP) { } else { gameInfoP->language = LstGetSelection(list2P); gameInfoP->platform = LstGetSelection(list3P); - + gameInfoP->autoLoad = CtlGetValue(cck1P); gameInfoP->bootParam = CtlGetValue(cck2P); gameInfoP->setPlatform = CtlGetValue(cck3P); @@ -258,7 +258,7 @@ static Err OptionsSave(GameInfoType *gameInfoP) { gameInfoP->bootValue = StrAToI(FldGetTextPtr(fld5P)); gameInfoP->talkValue = StrAToI(FldGetTextPtr(fld6P)); } - + return errNone; } @@ -323,19 +323,19 @@ static void GameManSave(UInt16 index) { newGameInfo.version = curItemVersion; newGameInfo.icnID = 0xFFFF; newGameInfo.selected = true; - + // default sound data newGameInfo.musicInfo.volume.master = 192; newGameInfo.musicInfo.volume.music = 192; newGameInfo.musicInfo.volume.sfx = 192; newGameInfo.musicInfo.volume.speech = 192; newGameInfo.musicInfo.volume.audiocd = 50; - + newGameInfo.musicInfo.sound.tempo = 100; newGameInfo.musicInfo.sound.defaultTrackLength = 10; newGameInfo.musicInfo.sound.firstTrack = 1; } - + GameTabSave(&newGameInfo); DisplaySave(&newGameInfo); OptionsSave(&newGameInfo); @@ -349,14 +349,14 @@ static void GameManSave(UInt16 index) { { RectangleType rArea; UInt16 posIndex, maxView; - + // get the sorted index index = GamGetSelected(); // if new item is out of the list bounds, change current list pos SknGetListBounds(&rArea, NULL); maxView = rArea.extent.y / sknInfoListItemSize; posIndex = gPrefs->listPosition; - + // if out of the current list position if (!(index >= posIndex && index < (posIndex + maxView))) gPrefs->listPosition = index; // this value is corrected in SknUpdateList if needed @@ -373,7 +373,7 @@ static void GameManSave(UInt16 index) { * FUNCTION: EditGameFormInit * FUNCTION: EditGameFormHandleEvent * - * DESCRIPTION: + * DESCRIPTION: * * REVISION HISTORY: * @@ -451,7 +451,7 @@ Boolean EditGameFormHandleEvent(EventPtr eventP) { TabDeleteTabs(myTabP); FrmReturnToMain(); break; - + case GameEditDeleteButton: EditGameFormDelete(false); break; @@ -482,6 +482,6 @@ Boolean EditGameFormHandleEvent(EventPtr eventP) { default: break; } - + return handled; } diff --git a/backends/PalmOS/Src/forms/formMisc.cpp b/backends/PalmOS/Src/forms/formMisc.cpp index 7622a56185..d720d7bc11 100644 --- a/backends/PalmOS/Src/forms/formMisc.cpp +++ b/backends/PalmOS/Src/forms/formMisc.cpp @@ -29,7 +29,7 @@ static Boolean ScummVMTabSave() { FormPtr frmP; fld1P = (FieldType *)GetObjectPtr(TabScummVMDebugLevelField); - + cckP[3] = (ControlType *)GetObjectPtr(TabScummVMDebugCheckbox); cckP[6] = (ControlType *)GetObjectPtr(TabScummVMDemoCheckbox); cckP[9] = (ControlType *)GetObjectPtr(TabScummVMCopyProtectionCheckbox); @@ -49,7 +49,7 @@ static Boolean ScummVMTabSave() { gPrefs->altIntro = CtlGetValue(cckP[10]); gPrefs->debugLevel = StrAToI(FldGetTextPtr(fld1P)); - + return true; } @@ -125,7 +125,7 @@ static void PalmOSTabInit() { static void MiscFormSave() { PalmOSTabSave(); if (!ScummVMTabSave()) return; - + TabDeleteTabs(myTabP); FrmReturnToMain(); } @@ -176,7 +176,7 @@ Boolean MiscFormHandleEvent(EventPtr eventP) { case (MiscForm + 2) : lastTab = (eventP->data.ctlSelect.controlID - MiscForm - 1); TabSetActive(frmP, myTabP, lastTab); - + #ifndef DISABLE_LIGHTSPEED if (!LS_Installed()) #endif @@ -210,6 +210,6 @@ Boolean MiscFormHandleEvent(EventPtr eventP) { default: break; } - + return handled; } diff --git a/backends/PalmOS/Src/forms/formSkins.cpp b/backends/PalmOS/Src/forms/formSkins.cpp index 3eddfe79ad..b4c1e222d0 100644 --- a/backends/PalmOS/Src/forms/formSkins.cpp +++ b/backends/PalmOS/Src/forms/formSkins.cpp @@ -27,7 +27,7 @@ static void SkinsFormInit(Boolean bDraw) { Char nameP[32]; itemsText = NULL; - + // parse and save skins Err err = DmGetNextDatabaseByTypeCreator(true, &stateInfo, 'skin', appFileCreator, false, &cardNo, &dbID); while (!err && dbID) { @@ -38,14 +38,14 @@ static void SkinsFormInit(Boolean bDraw) { skins = MemHandleNew(sizeof(SkinInfoType)); else MemHandleResize(skins, MemHandleSize(skins) + sizeof(SkinInfoType)); - + skinsInfo = (SkinInfoType *)MemHandleLock(skins); StrCopy(skinsInfo[numSkins].nameP, nameP); skinsInfo[numSkins].cardNo = cardNo; skinsInfo[numSkins].dbID = dbID; MemHandleUnlock(skins); numSkins++; - } + } err = DmGetNextDatabaseByTypeCreator(false, &stateInfo, 'skin', appFileCreator, false, &cardNo, &dbID); } @@ -69,7 +69,7 @@ static void SkinsFormInit(Boolean bDraw) { itemsText = (Char **)MemHandleLock(items); itemsText[index] = skinsInfo[index].nameP; MemHandleUnlock(items); - + if ( gPrefs->skin.cardNo == skinsInfo[index].cardNo && gPrefs->skin.dbID == skinsInfo[index].dbID && StrCompare(gPrefs->skin.nameP, skinsInfo[index].nameP) == 0) @@ -106,7 +106,7 @@ static void SkinsFormExit(Boolean bSave) { listP = (ListType *)GetObjectPtr(SkinsSkinList); selected = LstGetSelection(listP); - + if (bSave && selected == -1) { // may never occured... FrmCustomAlert(FrmWarnAlert, "You didn't select a skin.", 0, 0); return; @@ -115,24 +115,24 @@ static void SkinsFormExit(Boolean bSave) { skinsInfo = (SkinInfoType *)itemsList; skins = MemPtrRecoverHandle(skinsInfo); items = MemPtrRecoverHandle(itemsText); - + itemsText = NULL; itemsList = NULL; itemsType = ITEM_TYPE_UNKNOWN; if (bSave) { ControlType *cck1P; - + StrCopy(gPrefs->skin.nameP, skinsInfo[selected].nameP); gPrefs->skin.cardNo = skinsInfo[selected].cardNo; gPrefs->skin.dbID = skinsInfo[selected].dbID; - + /* DmOpenRef skinDB = SknOpenSkin(); UInt32 depth = SknGetDepth(skinDB); SknCloseSkin(skinDB); if (depth != 8 && depth != 16) depth = 8; - + if (depth == 16 && !OPTIONS_TST(kOptMode16Bit)) { FrmCustomAlert(FrmInfoAlert, "You can only use 8bit skin on your device.", 0, 0); gPrefs->skin.cardNo = cardNo; @@ -226,7 +226,7 @@ Boolean SkinsFormHandleEvent(EventPtr eventP) { Boolean handled = false; switch (eventP->eType) { - + case frmOpenEvent: SkinsFormInit(true); handled = true; @@ -247,11 +247,11 @@ Boolean SkinsFormHandleEvent(EventPtr eventP) { case SkinsCancelButton: SkinsFormExit(false); break; - + case SkinsBeamButton: SkinsFormBeam(); break; - + case SkinsDeleteButton: SkinsFormDelete(); break; @@ -262,6 +262,6 @@ Boolean SkinsFormHandleEvent(EventPtr eventP) { default: break; } - + return handled; } diff --git a/backends/PalmOS/Src/forms/forminfo.cpp b/backends/PalmOS/Src/forms/forminfo.cpp index b8ef6d573e..01f086ecbc 100644 --- a/backends/PalmOS/Src/forms/forminfo.cpp +++ b/backends/PalmOS/Src/forms/forminfo.cpp @@ -42,7 +42,7 @@ void GetMemory(UInt32* storageMemoryP, UInt32* dynamicMemoryP, UInt32 *storageFr UInt32 dynamicFree = 0; // Iterate through each card to support devices with multiple cards. - nCards = MemNumCards(); + nCards = MemNumCards(); for (cardNo = 0; cardNo < nCards; cardNo++) { // Iterate through the RAM heaps on a card (excludes ROM). @@ -51,7 +51,7 @@ void GetMemory(UInt32* storageMemoryP, UInt32* dynamicMemoryP, UInt32 *storageFr heapID = MemHeapID(cardNo, i); // Calculate the total memory and free memory of the heap. MemHeapFreeBytes(heapID, &free, &max); - + // If the heap is dynamic, increment the dynamic memory total. if (MemHeapDynamic(heapID)) { dynamicMemory += MemHeapSize(heapID); @@ -89,10 +89,10 @@ static void SystemTabDraw() { GetMemory(&sm, &dm, &sf, &df); stack = GetStackSize(); - + WinSetTextColor(UIColorGetTableEntryIndex(UIObjectForeground)); FntSetFont(stdFont); - + StrIToA(num, dm); x = 147 - FntCharsWidth(num, StrLen(num)) + 5; WinDrawChars(num, StrLen(num), x, 12 + 30); @@ -182,6 +182,6 @@ Boolean InfoFormHandleEvent(EventPtr eventP) { default: break; } - + return handled; } diff --git a/backends/PalmOS/Src/forms/formmain.cpp b/backends/PalmOS/Src/forms/formmain.cpp index cb8d875eb3..0ffeeccb15 100644 --- a/backends/PalmOS/Src/forms/formmain.cpp +++ b/backends/PalmOS/Src/forms/formmain.cpp @@ -25,7 +25,7 @@ static Err BeamMe() { err = SendDatabase(0, dbID, "ScummVM.prc", "\nPlay your favorite LucasArts games"); else err = DmGetLastErr(); - + return err; } @@ -90,7 +90,7 @@ static Boolean MainFormDoCommand(UInt16 command) FrmPopupForm(InfoForm); handled = true; break; - + case MainGamesMusicSound: FrmPopupForm(MusicForm); handled = true; @@ -115,7 +115,7 @@ static Boolean MainFormDoCommand(UInt16 command) * * FUNCTION: MainFormHandleEvent * - * DESCRIPTION: This routine is the event handler for the + * DESCRIPTION: This routine is the event handler for the * "MainForm" of this application. * * PARAMETERS: eventP - a pointer to an EventType structure @@ -136,7 +136,7 @@ static Boolean PenDownRepeat() { if (penDown && sknLastOn) { RectangleType r; DmOpenRef skinDBP; - + skinDBP = SknOpenSkin(); SknGetObjectBounds(skinDBP, sknLastOn, &r); @@ -145,14 +145,14 @@ static Boolean PenDownRepeat() { SknSetState(skinDBP, sknLastOn, sknStateSelected); SknShowObject(skinDBP, sknLastOn); } - + switch (sknLastOn) { case skinSliderUpArrow: case skinSliderDownArrow: handled = SknProcessArrowAction(sknLastOn); break; } - + } else { if (SknGetState(skinDBP, sknLastOn) != sknStateNormal) { SknSetState(skinDBP, sknLastOn, sknStateNormal); @@ -162,7 +162,7 @@ static Boolean PenDownRepeat() { SknCloseSkin(skinDBP); } - + return handled; } @@ -173,7 +173,7 @@ Boolean MainFormHandleEvent(EventPtr eventP) FormPtr frmP; Coord x,y; DmOpenRef skinDBP; - + switch (eventP->eType) { case frmUpdateEvent: { @@ -216,11 +216,11 @@ Boolean MainFormHandleEvent(EventPtr eventP) //gPrefs->card.volRefNum = parseCards(true); FrmPopupForm(CardSlotForm); break; - + case MainAboutButton: FrmPopupForm(InfoForm); break; - + // case MainListTypeSelTrigger: // FrmList(eventP, MainListTypeList); // break; @@ -232,7 +232,7 @@ Boolean MainFormHandleEvent(EventPtr eventP) x = eventP->screenX; y = eventP->screenY; lastIndex = dmMaxRecordIndex; // enable select/unselect list item - + if (sknLastOn != skinButtonNone) { RectangleType r; skinDBP = SknOpenSkin(); @@ -240,7 +240,7 @@ Boolean MainFormHandleEvent(EventPtr eventP) SknSetState(skinDBP, sknLastOn, sknStateNormal); SknShowObject(skinDBP, sknLastOn); SknCloseSkin(skinDBP); - + if (RctPtInRectangle(x*2, y*2, &r)) { switch (sknLastOn) { case skinButtonGameAdd: @@ -297,7 +297,7 @@ Boolean MainFormHandleEvent(EventPtr eventP) case skinButtonGameDelete: case skinButtonGameAudio: SknSetState(skinDBP, sknLastOn, sknStateSelected); - SknShowObject(skinDBP, sknLastOn); + SknShowObject(skinDBP, sknLastOn); if (gPrefs->soundClick) SndPlaySystemSound(sndClick); handled = true; @@ -309,7 +309,7 @@ Boolean MainFormHandleEvent(EventPtr eventP) SknSelect(x, y); } break; - + case keyDownEvent: if ( (eventP->data.keyDown.chr >= 'a' && eventP->data.keyDown.chr <= 'z') || (eventP->data.keyDown.chr >= 'A' && eventP->data.keyDown.chr <= 'Z')) { @@ -319,7 +319,7 @@ Boolean MainFormHandleEvent(EventPtr eventP) } } break; - + default: handled = PenDownRepeat(); } diff --git a/backends/PalmOS/Src/forms/formmusic.cpp b/backends/PalmOS/Src/forms/formmusic.cpp index 9a1670fd62..b1c43191b6 100644 --- a/backends/PalmOS/Src/forms/formmusic.cpp +++ b/backends/PalmOS/Src/forms/formmusic.cpp @@ -19,7 +19,7 @@ static Boolean MusicTabSave() { FieldType *fld1P; UInt16 tempo; FormPtr frmP; - + frmP = FrmGetActiveForm(); cck1P = (ControlType *)GetObjectPtr(TabMusicMusicCheckbox); @@ -40,7 +40,7 @@ static Boolean MusicTabSave() { musicInfoP->sound.drvMusic = LstGetSelection(list1P); musicInfoP->sound.tempo = tempo; - + return true; } @@ -87,7 +87,7 @@ static void SoundTabSave() { static void SoundTabInit() { ControlType *cck1P; ListType *list1P; - + cck1P = (ControlType *)GetObjectPtr(TabSoundSoundCheckbox); list1P = (ListType *)GetObjectPtr(TabSoundRateList); @@ -103,7 +103,7 @@ static Boolean AudioCDTabSave() { ListType *list1P, *list2P; UInt16 firstTrack; FormPtr frmP; - + frmP = FrmGetActiveForm(); cck3P = (ControlType *)GetObjectPtr(TabAudioCDMP3Checkbox); @@ -111,7 +111,7 @@ static Boolean AudioCDTabSave() { fld3P = (FieldType *)GetObjectPtr(TabAudioCDFirstTrackField); list1P = (ListType *)GetObjectPtr(TabAudioCDDriverList); list2P = (ListType *)GetObjectPtr(TabAudioCDFormatList); - + firstTrack = StrAToI(FldGetTextPtr(fld3P)); if (firstTrack < 1 || firstTrack > 999) { TabSetActive(frmP, myTabP, 2); @@ -127,7 +127,7 @@ static Boolean AudioCDTabSave() { musicInfoP->sound.defaultTrackLength = StrAToI(FldGetTextPtr(fld2P)); musicInfoP->sound.firstTrack = firstTrack; - + return true; } @@ -168,13 +168,13 @@ static void AudioCDTabInit() { // Volume static void VolumeTabSave() { SliderControlType *slid1P, *slid2P, *slid3P, *slid4P, *slid5P; - + slid1P = (SliderControlType *)GetObjectPtr(TabVolumeMasterSliderControl); slid2P = (SliderControlType *)GetObjectPtr(TabVolumeMusicSliderControl); slid3P = (SliderControlType *)GetObjectPtr(TabVolumeSfxSliderControl); slid4P = (SliderControlType *)GetObjectPtr(TabVolumeSpeechSliderControl); slid5P = (SliderControlType *)GetObjectPtr(TabVolumeAudioCDSliderControl); - + CtlGetSliderValues ((ControlType *)slid1P, 0, 0, 0, &musicInfoP->volume.master); CtlGetSliderValues ((ControlType *)slid2P, 0, 0, 0, &musicInfoP->volume.music); CtlGetSliderValues ((ControlType *)slid3P, 0, 0, 0, &musicInfoP->volume.sfx); @@ -185,7 +185,7 @@ static void VolumeTabSave() { static void VolumeTabInit() { SliderControlType *slid1P, *slid2P, *slid3P, *slid4P, *slid5P; UInt16 value; - + slid1P = (SliderControlType *)GetObjectPtr(TabVolumeMasterSliderControl); slid2P = (SliderControlType *)GetObjectPtr(TabVolumeMusicSliderControl); slid3P = (SliderControlType *)GetObjectPtr(TabVolumeSfxSliderControl); @@ -238,7 +238,7 @@ static void MusicFormInit(UInt16 index) { recordH = DmQueryRecord(gameDB, index); gameInfoP = (GameInfoType *)MemHandleLock(recordH); - + if (!gameInfoP) { FrmCustomAlert(FrmErrorAlert, "An error occured.",0,0); return; @@ -280,7 +280,7 @@ Boolean MusicFormHandleEvent(EventPtr eventP) { MusicFormInit(GamGetSelected()); handled = true; break; - + case ctlSelectEvent: switch (eventP->data.ctlSelect.controlID) { @@ -291,14 +291,14 @@ Boolean MusicFormHandleEvent(EventPtr eventP) { lastTab = (eventP->data.ctlSelect.controlID - MusicForm - 1); TabSetActive(frmP, myTabP, lastTab); break; - + case TabMusicDriverPopTrigger: FrmList(eventP, TabMusicDriverList); FrmHideObject(frmP, FrmGetObjectIndex(frmP, TabMusicDriverList)); - + if (!OPTIONS_TST(kOptDeviceZodiac) && !OPTIONS_TST(kOptSonyPa1LibAPI)) { ListType *list1P = (ListType *)GetObjectPtr(TabMusicDriverList); - + if (LstGetSelection(list1P) == 1) { FrmCustomAlert(FrmInfoAlert, "There is no built-in MIDI support on your device.", 0, 0); LstSetSelection(list1P, 0); @@ -310,7 +310,7 @@ Boolean MusicFormHandleEvent(EventPtr eventP) { case TabSoundRatePopTrigger: FrmList(eventP, TabSoundRateList); FrmHideObject(frmP, FrmGetObjectIndex(frmP, TabSoundRateList)); - + if (!OPTIONS_TST(kOptPalmSoundAPI)) { ListType *list1P = (ListType *)GetObjectPtr(TabSoundRateList); @@ -358,6 +358,6 @@ Boolean MusicFormHandleEvent(EventPtr eventP) { default: break; } - + return handled; } diff --git a/backends/PalmOS/Src/forms/formtabs.cpp b/backends/PalmOS/Src/forms/formtabs.cpp index 9c62f37542..b24a3f829f 100644 --- a/backends/PalmOS/Src/forms/formtabs.cpp +++ b/backends/PalmOS/Src/forms/formtabs.cpp @@ -11,15 +11,15 @@ TabType *TabNewTabs(UInt16 cnt) { newP->count = 0; newP->width = 0; newP->tabs = new TabDataType[cnt]; - + return newP; } void TabDeleteTabs(TabType *tabP) { UInt16 cnt, num; num = MemPtrSize(tabP->tabs) / sizeof(TabDataType); - - for (cnt = 0; cnt < num; cnt++) + + for (cnt = 0; cnt < num; cnt++) FrmDeleteForm(tabP->tabs[cnt].srcP); delete tabP->tabs; @@ -34,14 +34,14 @@ Err TabAddContent(FormType **frmP, TabType *tabP, const Char *nameP, UInt16 rscI Coord x, y, w, h; UInt16 id; RectangleType r; - + dstP = (void **)frmP; srcP = FrmInitForm(rscID); objNum = FrmGetNumberOfObjects(srcP); // save tab data - + // it's required to keep to source forms active // while the tab form is not close for list data ptr (items text) // TODO : fix this ! @@ -61,7 +61,7 @@ Err TabAddContent(FormType **frmP, TabType *tabP, const Char *nameP, UInt16 rscI ControlType *addP = CtlNewControl(dstP, (FrmGetFormId(*frmP) + tabP->count), buttonCtl, nameP, x, y, w, h, stdFont, 0, true); CtlGlueSetFrameStyle(addP, noButtonFrame); tabP->width += w + 1; - + // create tab content for (cnt = 0; cnt < objNum; cnt++) { objP = FrmGetObjectPtr(srcP, cnt); @@ -86,7 +86,7 @@ Err TabAddContent(FormType **frmP, TabType *tabP, const Char *nameP, UInt16 rscI UInt16 items = LstGetNumberOfItems((ListType *)objP); UInt16 trigger = id - 1; trigger = (FrmGetObjectIndex((FormType *)*dstP, trigger) != frmInvalidObjectId) ? trigger : 0; - + LstNewList(dstP, id, x, y, w, h, font, visible, trigger); newP = (ListType *)FrmGetObjectPtr((FormType *)*dstP, FrmGetObjectIndex((FormType *)*dstP, id)); LstSetListChoices(newP, itemsP, items); @@ -174,25 +174,25 @@ void TabSetActive(FormType *frmP, TabType *tabP, UInt16 num) { // set tabs size for (cnt = 0; cnt < tabP->count; cnt++) { idx = FrmGetObjectIndex (frmP, (FrmGetFormId(frmP) + cnt + 1)); - + if (idx != frmInvalidObjectId) { FrmGetObjectBounds(frmP, idx, &r); r.topLeft.y = (num == cnt) ? 17 : 17; r.extent.y = (num == cnt) ? 12 : 11; FrmSetObjectBounds(frmP, idx, &r); - + if (num == cnt) { RGBColorType yellow = {0,255,192,0}; - + r.topLeft.y -= 1; WinSetForeColor(UIColorGetTableEntryIndex(UIObjectFrame)); - WinDrawRectangleFrame(simpleFrame, &r); + WinDrawRectangleFrame(simpleFrame, &r); WinSetForeColor(WinRGBToIndex(&yellow)); WinDrawLine(r.topLeft.x, r.topLeft.y, r.topLeft.x + r.extent.x - 1, r.topLeft.y); FrmShowObject(frmP, idx); } else { WinSetForeColor(UIColorGetTableEntryIndex(UIObjectFrame)); - WinDrawRectangleFrame(simpleFrame, &r); + WinDrawRectangleFrame(simpleFrame, &r); } } } diff --git a/backends/PalmOS/Src/games.cpp b/backends/PalmOS/Src/games.cpp index 1e0fc0cad4..af073d8b61 100644 --- a/backends/PalmOS/Src/games.cpp +++ b/backends/PalmOS/Src/games.cpp @@ -38,7 +38,7 @@ DmOpenRef gameDB = NULL; static Err GamUpdateList() { if (gameDB) { UInt16 numRecs = DmNumRecords(gameDB); - + if (numRecs > 0) { MemHandle tmpH; UInt32 version, size; @@ -57,7 +57,7 @@ static Err GamUpdateList() { GameInfoType gitCur; void *tmpP; FormPtr ofmP, frmP; - + // show dialog ofmP = FrmGetActiveForm(); frmP = FrmInitForm(ConvertForm); @@ -73,25 +73,25 @@ static Err GamUpdateList() { version == itemVersion_25) { for (index = 0; index < numRecs; index++) { - + // get old data tmpH = DmQueryRecord(gameDB, index); tmpP = MemHandleLock(tmpH); MemMove(&gitCur, tmpP, MemHandleSize(tmpH)); MemHandleUnlock(tmpH); - + if (version != itemVersion_30) { gitCur.musicInfo.volume.master = 192; gitCur.musicInfo.volume.music = 192; gitCur.musicInfo.volume.sfx = 192; gitCur.musicInfo.volume.speech = 192; gitCur.musicInfo.volume.audiocd = 50; - + gitCur.musicInfo.sound.tempo = 100; gitCur.musicInfo.sound.defaultTrackLength = 10; gitCur.musicInfo.sound.firstTrack = 1; } - + gitCur.engine = 0; // simply resize the old record @@ -100,13 +100,13 @@ static Err GamUpdateList() { DmWrite(tmpP, 0, &gitCur, sizeof(GameInfoType)); MemPtrUnlock(tmpP); } - + } else if (version == itemVersion_20) { // need conversion from V2 -> V2.7 GameInfoTypeV2 git0; for (index = 0; index < numRecs; index++) { - + // get old data tmpH = DmQueryRecord(gameDB, index); tmpP = MemHandleLock(tmpH); @@ -121,7 +121,7 @@ static Err GamUpdateList() { StrCopy(gitCur.pathP, git0.pathP); StrCopy(gitCur.gameP, git0.gameP); gitCur.gfxMode = git0.gfxMode; - + gitCur.autoLoad = git0.autoLoad; gitCur.bootParam = git0.bootParam; gitCur.setPlatform = git0.setPlatform; @@ -139,11 +139,11 @@ static Err GamUpdateList() { gitCur.musicInfo.volume.sfx = 192; gitCur.musicInfo.volume.speech = 192; gitCur.musicInfo.volume.audiocd = 50; - + gitCur.musicInfo.sound.tempo = 100; gitCur.musicInfo.sound.defaultTrackLength = 10; gitCur.musicInfo.sound.firstTrack = 1; - + gitCur.engine = 0; tmpH = DmResizeRecord(gameDB, index, sizeof(GameInfoType)); // TODO : check error on resize tmpH==NULL @@ -156,7 +156,7 @@ static Err GamUpdateList() { GameInfoTypeV0 git0; for (index = 0; index < numRecs; index++) { - + // get old data tmpH = DmQueryRecord(gameDB, index); tmpP = MemHandleLock(tmpH); @@ -171,7 +171,7 @@ static Err GamUpdateList() { StrCopy(gitCur.pathP, git0.pathP); StrCopy(gitCur.gameP, git0.gameP); gitCur.gfxMode = git0.gfxMode; - + gitCur.autoLoad = git0.autoLoad; gitCur.bootParam = git0.bootParam; gitCur.setPlatform = git0.amiga; // amiga become platform amiga/atari-st/machintosh @@ -189,11 +189,11 @@ static Err GamUpdateList() { gitCur.musicInfo.volume.sfx = 192; gitCur.musicInfo.volume.speech = 192; gitCur.musicInfo.volume.audiocd = 50; - + gitCur.musicInfo.sound.tempo = 100; gitCur.musicInfo.sound.defaultTrackLength = 10; gitCur.musicInfo.sound.firstTrack = 1; - + gitCur.engine = 0; tmpH = DmResizeRecord(gameDB, index, sizeof(GameInfoType)); // TODO : check error on resize tmpH==NULL @@ -207,10 +207,10 @@ static Err GamUpdateList() { FrmDeleteForm(frmP); if (ofmP) FrmReturnToForm(MainForm); - } + } } } - + return errNone; } @@ -223,7 +223,7 @@ Err GamOpenDatabase() { err = DmCreateDatabase(0, "ScummVM-Data", appFileCreator, 'DATA', false); if (!err) { gameDB = DmOpenDatabaseByTypeCreator( 'DATA', appFileCreator, dmModeReadWrite); - + if (!gameDB) err = DmGetLastErr(); } @@ -241,7 +241,7 @@ void GamImportDatabase() { if (gPrefs->card.volRefNum != sysInvalidRefNum && gPrefs->card.moveDB) { FileRef file; Err e; - + e = VFSFileOpen(gPrefs->card.volRefNum, "/Palm/Programs/ScummVM/listdata.pdb", vfsModeRead, &file); if (!e) { UInt16 oCardNo, nCardNo; @@ -254,7 +254,7 @@ void GamImportDatabase() { gPrefs->card.moveDB = false; return; } - + // get current db info and rename it DmOpenDatabaseInfo(gameDB, &oDbID, 0, 0, &oCardNo, 0); GamCloseDatabase(true); @@ -273,7 +273,7 @@ void GamCloseDatabase(Boolean ignoreCardParams) { if (gameDB) { LocalID dbID; UInt16 cardNo; - + DmOpenDatabaseInfo(gameDB, &dbID, 0, 0, &cardNo, 0); DmCloseDatabase(gameDB); @@ -309,13 +309,13 @@ void GamUnselect() { UInt16 index; index = GamGetSelected(); - + if (index != dmMaxRecordIndex) { Boolean newValue; - + recordH = DmGetRecord(gameDB, index); game = (GameInfoType *)MemHandleLock(recordH); - + newValue = false; DmWrite(game, OffsetOf(GameInfoType,selected), &newValue, sizeof(Boolean)); @@ -329,7 +329,7 @@ UInt16 GamGetSelected() { GameInfoType *game; Boolean selected; UInt16 index = DmNumRecords(gameDB)-1; - + while (index != (UInt16)-1) { record = DmQueryRecord(gameDB, index); game = (GameInfoType *)MemHandleLock(record); @@ -356,7 +356,7 @@ Boolean GamJumpTo(Char letter) { while (index < maxIndex) { record = DmGetRecord(gameDB, index); game = (GameInfoType *)MemHandleLock(record); - + if (tolower(game->nameP[0]) == tolower(letter)) { found = true; @@ -370,7 +370,7 @@ Boolean GamJumpTo(Char letter) { GamUnselect(); DmWrite(game, OffsetOf(GameInfoType,selected), &newValue, sizeof(Boolean)); - + if (index < gPrefs->listPosition || index >= (gPrefs->listPosition + maxView)) gPrefs->listPosition = index; } @@ -380,7 +380,7 @@ Boolean GamJumpTo(Char letter) { DmReleaseRecord (gameDB, index, 0); index++; - + if (found) return found; } diff --git a/backends/PalmOS/Src/games.h b/backends/PalmOS/Src/games.h index e07b263a8c..75984f3bb7 100644 --- a/backends/PalmOS/Src/games.h +++ b/backends/PalmOS/Src/games.h @@ -88,7 +88,7 @@ typedef struct { UInt16 speech; UInt16 audiocd; } volume; - + struct { // midi Boolean multiMidi; @@ -127,13 +127,13 @@ typedef struct { UInt16 talkValue; UInt8 platform; UInt8 language; // |- v2.5 - + Boolean filter; // v2.6 Boolean fullscreen; // | Boolean aspectRatio; // |- v2.7 - + MusicInfoType musicInfo;// v3.0 - + UInt8 engine; // |- v3.1 } GameInfoType; diff --git a/backends/PalmOS/Src/globals.h b/backends/PalmOS/Src/globals.h index 12dcefb9e3..e5a0d2f110 100644 --- a/backends/PalmOS/Src/globals.h +++ b/backends/PalmOS/Src/globals.h @@ -42,14 +42,14 @@ enum { kOpt5WayNavigator = 1 << 0x0A, kOptPalmSoundAPI = 1 << 0x0B, kOptSonyPa1LibAPI = 1 << 0x0C, - + kOptDeviceProcX86 = 1 << 0x1F // DEBUG only }; enum { kMemScummOldCostGames = 0, kMemScummNewCostGames, - kMemSimon1Games, + kMemSimon1Games, kMemSimon2Games, kMemGamesCount @@ -101,15 +101,15 @@ typedef struct { UInt8 *pageAddr1; UInt8 *pageAddr2; } flipping; - + struct { Boolean enable; UInt8 driver, format; UInt16 defaultTrackLength; UInt16 firstTrack; - UInt16 volume; + UInt16 volume; } CD; - + } GlobalsDataType, *GlobalsDataPtr; extern GlobalsDataPtr gVars; diff --git a/backends/PalmOS/Src/i_zodiac.cpp b/backends/PalmOS/Src/i_zodiac.cpp index f15d83516f..20b06aa61f 100644 --- a/backends/PalmOS/Src/i_zodiac.cpp +++ b/backends/PalmOS/Src/i_zodiac.cpp @@ -9,7 +9,7 @@ // _twBmpV3 = offscreen bitmap, must be set before this call Err ZodiacInit(void **ptrP, Int32 w, Int32 h) { Err e; - + TwGfxSurfaceInfoType surface = { sizeof(TwGfxSurfaceInfoType), w, h, w * 2, diff --git a/backends/PalmOS/Src/init_arm.cpp b/backends/PalmOS/Src/init_arm.cpp index 1770a489da..0f8483fad1 100644 --- a/backends/PalmOS/Src/init_arm.cpp +++ b/backends/PalmOS/Src/init_arm.cpp @@ -5,15 +5,15 @@ static void PnoInit(DmResID resID,PNOInitType *pnoP) { // Load and allocate PNO MemHandle armH = DmGetResource('ARMC', resID); - + if (armH) { MemPtr armP = MemHandleLock(armH); PnoLoad(&pnoP->pnoDesc, armP); MemPtrUnlock(armP); DmReleaseResource(armH); - + // Init PNO - PnoEntryHeader *header = (PnoEntryHeader *)ALIGN_4BYTE(pnoP->headerBuffer); + PnoEntryHeader *header = (PnoEntryHeader *)ALIGN_4BYTE(pnoP->headerBuffer); pnoP->alignedHeader = header; header->r10Value = pnoP->pnoDesc.r10Value; diff --git a/backends/PalmOS/Src/init_mathlib.cpp b/backends/PalmOS/Src/init_mathlib.cpp index 6fd4931236..9d71a056ed 100644 --- a/backends/PalmOS/Src/init_mathlib.cpp +++ b/backends/PalmOS/Src/init_mathlib.cpp @@ -23,7 +23,7 @@ void MathlibRelease() { if (MathLibRef != sysInvalidRefNum) { MathLibClose(MathLibRef, &useCount); - + if (!useCount) SysLibRemove(MathLibRef); } diff --git a/backends/PalmOS/Src/init_palmos.cpp b/backends/PalmOS/Src/init_palmos.cpp index 8bfcb08627..a2070aa1ca 100644 --- a/backends/PalmOS/Src/init_palmos.cpp +++ b/backends/PalmOS/Src/init_palmos.cpp @@ -7,7 +7,7 @@ static UInt16 autoOffDelay; void PalmInit(UInt8 init) { // set screen depth - UInt32 depth = 8; + UInt32 depth = 8; WinScreenMode(winScreenModeSet, NULL, NULL, &depth, NULL); if (init & INIT_AUTOOFF) { @@ -27,12 +27,12 @@ Err PalmHRInit(UInt32 depth) { UInt32 width = 320; UInt32 height = 320; Boolean color = true; - + e = WinScreenMode (winScreenModeSet, &width, &height, &depth, &color); if (!e) { UInt32 attr; - WinScreenGetAttribute(winScreenDensity, &attr); + WinScreenGetAttribute(winScreenDensity, &attr); e = (attr != kDensityDouble); } diff --git a/backends/PalmOS/Src/init_sony.cpp b/backends/PalmOS/Src/init_sony.cpp index bdf83e2cf1..499294c667 100644 --- a/backends/PalmOS/Src/init_sony.cpp +++ b/backends/PalmOS/Src/init_sony.cpp @@ -13,7 +13,7 @@ UInt16 SilkInit(UInt32 *retVersion) { if (sonySysFtrSysInfoP->libr & sonySysFtrSysInfoLibrSilk) { if ((e = SysLibFind(sonySysLibNameSilk, &slkRefNum))) - if (e == sysErrLibNotFound) + if (e == sysErrLibNotFound) e = SysLibLoad(sonySysFileTSilkLib, sonySysFileCSilkLib, &slkRefNum); if (!e) { @@ -37,7 +37,7 @@ UInt16 SilkInit(UInt32 *retVersion) { version = 0; slkRefNum = sysInvalidRefNum; } - + *retVersion = version; return slkRefNum; } @@ -66,12 +66,12 @@ UInt16 SonyHRInit(UInt32 depth) { } if (e) HRrefNum = sysInvalidRefNum; - + if (HRrefNum != sysInvalidRefNum) { UInt32 width = hrWidth; UInt32 height = hrHeight; Boolean color = true; - + e = HRWinScreenMode(HRrefNum, winScreenModeSet, &width, &height, &depth, &color); // error ? release and return an invalid reference number if (e) { diff --git a/backends/PalmOS/Src/launch.cpp b/backends/PalmOS/Src/launch.cpp index 3d24a803e7..36e7555941 100644 --- a/backends/PalmOS/Src/launch.cpp +++ b/backends/PalmOS/Src/launch.cpp @@ -52,11 +52,11 @@ void ModDelete() { static void ModSetStack(UInt32 newSize, UInt16 cardNo, LocalID dbID) { DmOpenRef dbRef = DmOpenDatabase(cardNo, dbID, dmModeReadWrite); - + if (dbRef) { MemHandle pref = DmGetResource('pref',0); UInt32 size = 0; - + if (pref) { SysAppPrefsType *data = (SysAppPrefsType *)MemHandleLock(pref); size = data->stackSize; @@ -71,7 +71,7 @@ static void ModSetStack(UInt32 newSize, UInt16 cardNo, LocalID dbID) { MemPtrUnlock(data); DmReleaseResource(pref); } - + DmCloseDatabase(dbRef); } } @@ -84,7 +84,7 @@ static Err ModImport(UInt16 volRefNum, UInt8 engine) { { "sword1" }, { "sky" } }; - + char filename[256]; UInt16 dum1; UInt32 dum2; @@ -147,10 +147,10 @@ Boolean StartScummVM() { FormPtr frmP = FrmInitForm(EngineForm); whichButton = FrmDoDialog(frmP); FrmDeleteForm(frmP); - + if (whichButton == EngineCancelButton) return false; - + engine = (whichButton - Engine0Button); } else { @@ -168,7 +168,7 @@ Boolean StartScummVM() { StrCopy(pathP,gameInfoP->pathP); else StrCat(pathP,gameInfoP->pathP); - + /* // path exists ? if (!checkPath(pathP)) { MemHandleUnlock(recordH); @@ -252,7 +252,7 @@ Boolean StartScummVM() { case 5: ArgsAdd(&argvP[argc], "--platform=", "windows", &argc); break; - } + } } // subtitles @@ -300,7 +300,7 @@ Boolean StartScummVM() { ArgsAdd(&argvP[argc], "-e", "towns", &argc); case 5: // AdLib ArgsAdd(&argvP[argc], "-e", "adlib", &argc); - } + } } else // NULL as default ArgsAdd(&argvP[argc], "-e", "null", &argc); @@ -347,13 +347,13 @@ Boolean StartScummVM() { StrIToA(num, gPrefs->debugLevel); ArgsAdd(&argvP[argc], "-d", num, &argc); } - + if (engine == ENGINE_QUEEN || engine == ENGINE_SKY) { // alternative intro ? if (gPrefs->altIntro) ArgsAdd(&argvP[argc], "--alt-intro", NULL, &argc); } - + if (engine == ENGINE_SCUMM) { // copy protection ? if (gPrefs->copyProtection) @@ -370,7 +370,7 @@ Boolean StartScummVM() { lightspeed= (gPrefs->lightspeed.enable ? gPrefs->lightspeed.mode : 255); toLauncher= (gPrefs->exitLauncher); - // gVars values + // gVars values // (gVars->HRrefNum defined in checkHRmode on Clié) gVars->screenLocked = false; gVars->volRefNum = gPrefs->card.volRefNum; @@ -379,7 +379,7 @@ Boolean StartScummVM() { // user params HWR_RSTALL(); - + if (!gPrefs->autoOff) HWR_SET(INIT_AUTOOFF); diff --git a/backends/PalmOS/Src/missing/_stdio.cpp b/backends/PalmOS/Src/missing/_stdio.cpp index f2ee63ac51..cd0e03a878 100644 --- a/backends/PalmOS/Src/missing/_stdio.cpp +++ b/backends/PalmOS/Src/missing/_stdio.cpp @@ -31,12 +31,12 @@ static void dummy(Boolean){}; void StdioInit(UInt16 volRefNum, const Char *output, LedProc ledProc) { gStdioVolRefNum = volRefNum; - + if (ledProc) gStdioLedProc = ledProc; else gStdioLedProc = dummy; - + VFSFileDelete(gStdioVolRefNum, output); VFSFileCreate(gStdioVolRefNum, output); VFSFileOpen (gStdioVolRefNum, output,vfsModeWrite, &gStdioOutput); @@ -48,7 +48,7 @@ void StdioRelease() { UInt16 fclose(FileRef *stream) { Err error = VFSFileClose(*stream); - + if (error == errNone) MemPtrFree(stream); @@ -89,7 +89,7 @@ Int16 fgetc(FileRef *stream) { UInt32 numBytesRead; Err e; Char c; - + e = VFSFileRead(*stream, 1, &c, &numBytesRead); return (int)(!e ? c : EOF); } @@ -102,14 +102,14 @@ Char *fgets(Char *s, UInt32 n, FileRef *stream) { if (error == errNone || error == vfsErrFileEOF) { UInt32 reset = 0; Char *endLine = StrChr(s, '\n'); - + if (endLine >= s) { reset = (endLine - s); s[reset] = 0; reset = numBytesRead - (reset + 1); VFSFileSeek(*stream, vfsOriginCurrent, -reset); } - + return s; } #ifdef _DEBUG_STDIO @@ -143,7 +143,7 @@ FileRef *fopen(const Char *filename, const Char *type) { Err err; UInt16 openMode; FileRef *fileRefP = (FileRef *)MemPtrNew(sizeof(FileRef *)); - + if (StrCompare(type,"r")==0) openMode = vfsModeRead; else if (StrCompare(type,"rb")==0) @@ -280,7 +280,7 @@ UInt32 ftell(FileRef *stream) { e = VFSFileTell(*stream,&filePos); if (e != errNone) return e; - + return filePos; } @@ -323,7 +323,7 @@ Int32 sprintf(Char* s, const Char* formatStr, ...) { va_start(va, formatStr); count = vsprintf(s, formatStr, va); va_end(va); - + return count; } @@ -335,7 +335,7 @@ Int32 snprintf(Char* s, UInt32 len, const Char* formatStr, ...) { va_start(va, formatStr); count = vsprintf(s, formatStr, va); va_end(va); - + return count; } @@ -354,11 +354,11 @@ static Char *StrIToBase(Char *s, Int32 i, UInt8 b) { Char o; Int16 c, n = 0; Int32 div, mod; - + do { div = i / b; mod = i % b; - + s[n++] = *(conv + mod); i = div; @@ -384,7 +384,7 @@ static Char *StrIToBase(Char *s, Int32 i, UInt8 b) { static void StrProcC_(Char *ioStr, UInt16 maxLen) { Char *found; Int16 length; - + while (found = StrStr(ioStr, "`c`")) { if (found[3] == 0) { // if next char is NULL length = maxLen - (found - ioStr + 2); @@ -398,10 +398,10 @@ static void StrProcXO(Char *ioStr, UInt16 maxLen, Char *tmp) { Char *found, *last, mod, fill; Int16 len, count, next; Int32 val; - + while (found = StrChr(ioStr, '`')) { last = StrChr(found + 1, '`'); - + if (!last) return; @@ -417,7 +417,7 @@ static void StrProcXO(Char *ioStr, UInt16 maxLen, Char *tmp) { // x and X always 8char on palmos ... o set to 8char (not supported on palmos) while (found[next] == '0' || found[next] == ' ') // WARNING : reduce size only (TODO ?) next++; - + // convert to base 8 if (mod == 'o') { StrNCopy(tmp, found + next, 8 - next); @@ -434,7 +434,7 @@ static void StrProcXO(Char *ioStr, UInt16 maxLen, Char *tmp) { if ((8 - next) > count) count = 8 - next; - + if (count == 0) count = 1; @@ -455,12 +455,12 @@ static void StrProcXO(Char *ioStr, UInt16 maxLen, Char *tmp) { Int32 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam) { Char format[256], result[256], tmp[32]; - + Char *found, *mod, *num; UInt32 next; Boolean zero; Int16 count, len; - + MemSet(format, sizeof(format), 'x'); MemSet(result, sizeof(result), 'y'); MemSet(tmp, sizeof(tmp), 'z'); @@ -470,7 +470,7 @@ Int32 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam) { while (found = StrChr(format + next, '%')) { mod = found + 1; - + if (*mod == '%') { // just a % ? mod++; @@ -479,7 +479,7 @@ Int32 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam) { *mod == '-' || *mod == ' ' ) // skip mod++; - + if (*mod == '0' || *mod == '.' ) { *mod++ = '0'; @@ -487,12 +487,12 @@ Int32 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam) { } else { zero = false; } - + num = mod; while ( *mod >= '0' && *mod <= '9' ) // search format char mod++; - + // get the numeric value if (num < mod) { StrNCopy(tmp, num, mod - num); @@ -514,19 +514,19 @@ Int32 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam) { } else { len = 0; - + switch (*mod) { case 'x': case 'X': case 'o': tmp[0] = '`'; tmp[1] = (zero) ? '0' : ' '; - tmp[2] = *mod; + tmp[2] = *mod; StrIToA(tmp + 3, count); len += StrLen(tmp); tmp[len++] = '`'; tmp[len] = 0; - + if (*mod == 'o') { // set as base 10 num and convert later *mod = 'd'; count = 8; // force 8char @@ -534,7 +534,7 @@ Int32 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam) { break; } - + StrNCopy(tmp + len, found, (num - found)); len += (num - found); @@ -542,12 +542,12 @@ Int32 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam) { StrIToA(tmp + len, count); len += StrLen(tmp + len); } - + if (*mod == 'd' || *mod == 'i' || *mod == 'x' || *mod == 'X' || - *mod == 'u' + *mod == 'u' ) { tmp[len++] = 'l'; } @@ -561,15 +561,15 @@ Int32 vsprintf(Char* s, const Char* formatStr, _Palm_va_list argParam) { StrNCopy(found, tmp, StrLen(tmp)); mod = found + StrLen(tmp); } - + next = (mod - format); } - + // Copy result in a temp buffer to process last formats StrVPrintF(result, format, argParam); StrProcC_(result, 256); StrProcXO(result, 256, tmp); StrCopy(s, result); - + return StrLen(s); } diff --git a/backends/PalmOS/Src/missing/_stdlib.cpp b/backends/PalmOS/Src/missing/_stdlib.cpp index b56740c3e3..e91f9eb93c 100644 --- a/backends/PalmOS/Src/missing/_stdlib.cpp +++ b/backends/PalmOS/Src/missing/_stdlib.cpp @@ -24,21 +24,21 @@ void *bsearch(const void *key, const void *base, UInt32 nmemb, UInt32 size, int (*compar)(const void *, const void *)) { Int32 position; - + if (SysBinarySearch(base, nmemb, size, (SearchFuncPtr)compar, key, 0, &position, true)) return (void *)((UInt32)base + size * position); - + return NULL; } long strtol(const char *s, char **endptr, int base) { // WARNING : only base = 10 supported long val = StrAToI(s); - + if (endptr) { Char str[maxStrIToALen]; StrIToA(str, val); - + if (StrNCompare(s, str, StrLen(str)) == 0) *endptr = (char *)s + StrLen(str); } @@ -65,18 +65,18 @@ Err free(MemPtr memP) { } MemPtr realloc(MemPtr oldP, UInt32 size) { - + if (oldP != NULL) if (MemPtrResize(oldP,size) == 0) return oldP; MemPtr newP = MemPtrNew(size); - + if (oldP!=NULL) { MemMove(newP,oldP,MemPtrSize(oldP)); MemPtrFree(oldP); - } + } return newP; } diff --git a/backends/PalmOS/Src/missing/_string.cpp b/backends/PalmOS/Src/missing/_string.cpp index 5cd967c0c3..06d5911433 100644 --- a/backends/PalmOS/Src/missing/_string.cpp +++ b/backends/PalmOS/Src/missing/_string.cpp @@ -27,14 +27,14 @@ void *memchr(const void *s, int c, UInt32 n) { for(chr = 0; chr < n;chr++,((UInt8 *)s)++) if ( *((UInt8 *)s) == c) return (void *)s; - + return NULL; } UInt32 strspn(const char *s1, const char *s2) { UInt32 chr = 0; - while ( chr < strlen(s1) && + while ( chr < strlen(s1) && strchr(s2, s1[chr]) ) chr++; @@ -88,13 +88,13 @@ Char *strtok(Char *str, const Char *sep) { Char *strpbrk(const Char *s1, const Char *s2) { Char *found; UInt32 n; - + for (n=0; n <= StrLen(s2); n++) { found = StrChr(s1, s2[n]); if (found) return found; } - + return NULL; } @@ -107,7 +107,7 @@ Char *strrchr(const Char *s, int c) { return (Char *)(s+chr); return NULL; -} +} Char *strdup(const Char *s1) { Char* buf = (Char *)MemPtrNew(StrLen(s1)+1); diff --git a/backends/PalmOS/Src/missing/_time.cpp b/backends/PalmOS/Src/missing/_time.cpp index 01bd96dc5e..14c3f4fe33 100644 --- a/backends/PalmOS/Src/missing/_time.cpp +++ b/backends/PalmOS/Src/missing/_time.cpp @@ -29,10 +29,10 @@ time_t time(time_t *tloc) { DateTimeType Epoch = {1, 0, 0, 1, 1, 1970, 0}; // form 1/1/1904 12AM to 1/1/1970 12AM secs -= TimDateTimeToSeconds (&Epoch); - + if (tloc) *tloc = secs; - + return (secs); } @@ -47,7 +47,7 @@ struct tm *localtime(const time_t *timer) { secs += TimDateTimeToSeconds(&Epoch); TimSecondsToDateTime (secs, &dt); - + tmDate.tm_sec = dt.second; tmDate.tm_min = dt.minute; tmDate.tm_hour = dt.hour; @@ -55,6 +55,6 @@ struct tm *localtime(const time_t *timer) { tmDate.tm_mon = dt.month - 1; tmDate.tm_year = dt.year - 1900; tmDate.tm_wday = dt.weekDay; - + return &tmDate; } diff --git a/backends/PalmOS/Src/missing/_unistd.cpp b/backends/PalmOS/Src/missing/_unistd.cpp index 4b777699cd..92e87595be 100644 --- a/backends/PalmOS/Src/missing/_unistd.cpp +++ b/backends/PalmOS/Src/missing/_unistd.cpp @@ -27,7 +27,7 @@ const Char *gUnistdCWD = NULL; // currently used only to retreive savepath Char *getcwd(Char *buf, UInt32 size) { Char *copy = buf; - + if (gUnistdCWD) { if (!copy) copy = (Char *)MemPtrNew(StrLen(gUnistdCWD)); // this may never occured diff --git a/backends/PalmOS/Src/missing/memory.h b/backends/PalmOS/Src/missing/memory.h index e892182f6c..8fba12584e 100644 --- a/backends/PalmOS/Src/missing/memory.h +++ b/backends/PalmOS/Src/missing/memory.h @@ -19,5 +19,5 @@ * $Header$ * */ - + #include "string.h"
\ No newline at end of file diff --git a/backends/PalmOS/Src/missing/stdio.h b/backends/PalmOS/Src/missing/stdio.h index c513d8b951..9bf269f0d6 100644 --- a/backends/PalmOS/Src/missing/stdio.h +++ b/backends/PalmOS/Src/missing/stdio.h @@ -43,8 +43,8 @@ typedef UInt32 size_t; #define vsnprintf(a,b,c,d) vsprintf(a,c,d) #define getc(a) fgetc(a) -#define SEEK_SET vfsOriginBeginning -#define SEEK_CUR vfsOriginCurrent +#define SEEK_SET vfsOriginBeginning +#define SEEK_CUR vfsOriginCurrent #define SEEK_END vfsOriginEnd UInt16 fclose (FileRef *stream); diff --git a/backends/PalmOS/Src/missing/unistd.h b/backends/PalmOS/Src/missing/unistd.h index d94635b7e9..ca43602c37 100644 --- a/backends/PalmOS/Src/missing/unistd.h +++ b/backends/PalmOS/Src/missing/unistd.h @@ -27,6 +27,6 @@ extern const Char *gUnistdCWD; -Char *getcwd(Char *buf, UInt32 size); +Char *getcwd(Char *buf, UInt32 size); #endif
\ No newline at end of file diff --git a/backends/PalmOS/Src/modules.cpp b/backends/PalmOS/Src/modules.cpp index 9b8600a7e9..9357de5abc 100644 --- a/backends/PalmOS/Src/modules.cpp +++ b/backends/PalmOS/Src/modules.cpp @@ -34,7 +34,7 @@ void run(int argc, char *argv[]) { // create file for printf, warnings, etc... StdioInit(gVars->volRefNum, "/PALM/Programs/ScummVM/scumm.log", DrawStatus); gUnistdCWD = SCUMMVM_SAVEPATH; - + // init hardware if (HWR_INIT(INIT_PA1LIB)) Pa1libInit(); if (HWR_INIT(INIT_VIBRATOR)) gVars->vibrator = RumbleInit(); @@ -59,7 +59,7 @@ void run(int argc, char *argv[]) { if (HWR_INIT(INIT_ARM)) ARMRelease(); if (HWR_INIT(INIT_VIBRATOR)) RumbleRelease(); if (HWR_INIT(INIT_PA1LIB)) Pa1libRelease(); - + // close log file StdioRelease(); @@ -85,7 +85,7 @@ static UInt32 ModulesPalmMain(UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags) LocalID dbID; LaunchParamType *lp = (LaunchParamType *)cmdPBP; - + gVars = lp->gVars; argvP = lp->args.argv; @@ -105,7 +105,7 @@ static UInt32 ModulesPalmMain(UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags) // MemPtrSetOwner(gVars, ownerID); // ArgsSetOwner(argvP, ownerID); // will be freed by main(...) // MemPtrFree(lp); // will be freed by the system on exit - + run(lp->args.argc, argvP); cardNo = 0; diff --git a/backends/PalmOS/Src/modules.h b/backends/PalmOS/Src/modules.h index da89b7353b..d172ad11c2 100644 --- a/backends/PalmOS/Src/modules.h +++ b/backends/PalmOS/Src/modules.h @@ -15,7 +15,7 @@ typedef struct { UInt8 argc; Char **argv; } args; - + GlobalsDataPtr gVars; } LaunchParamType; diff --git a/backends/PalmOS/Src/palm.cpp b/backends/PalmOS/Src/palm.cpp index 0f32ae9e2b..171c369776 100644 --- a/backends/PalmOS/Src/palm.cpp +++ b/backends/PalmOS/Src/palm.cpp @@ -119,7 +119,7 @@ void OSystem_PALMOS::setWindowCaption(const char *caption) { // erase the screen WinEraseWindow(); - + if (_useHRmode) { y = 160 - (h >> 1) - 10; HRFntSetFont(gVars->HRrefNum,hrTinyBoldFont); @@ -140,7 +140,7 @@ void OSystem_PALMOS::setWindowCaption(const char *caption) { size = 2; h = (h - 2) / 2 + 2; } - + BitmapTypeV3 *bmp2P; BitmapType *bmp1P = BmpCreate(320, (h << 1), 8, NULL, &e); WinHandle tmpH = WinCreateBitmapWindow(bmp1P, &e); @@ -206,7 +206,7 @@ void OSystem_PALMOS::quit() { free(_currentPalette); free(_mouseBackupP); free(_mouseDataP); - + if (_cdPlayer) { _cdPlayer->release(); _cdPlayer = NULL; @@ -224,9 +224,9 @@ OSystem_PALMOS::OSystem_PALMOS() { _paletteDirtyStart = 0; _paletteDirtyEnd = 0; - + memset(&_sound, 0, sizeof(SoundDataType)); - + _currentPalette = NULL; _modeChanged = false; _gfxLoaded = false; @@ -234,7 +234,7 @@ OSystem_PALMOS::OSystem_PALMOS() { _lastKeyPressed = kLastKeyNone; _lastKeyRepeat = 100; _lastKeyModifier = MD_NONE; - + _useNumPad = false; _showBatLow = false; @@ -248,14 +248,14 @@ OSystem_PALMOS::OSystem_PALMOS() { _currentPalette = (RGBColorType*)calloc(sizeof(RGBColorType), 256); _mouseBackupP = (byte*)malloc(MAX_MOUSE_W * MAX_MOUSE_H); - + // overlay _tmpScreenP = NULL; _tmpBackupP = NULL; - + // HiRes _useHRmode = (gVars->HRrefNum != sysInvalidRefNum); - + // mouse emu // TODO : add UX50 arrow keys if (OPTIONS_TST(kOpt5WayNavigator)) { @@ -272,7 +272,7 @@ OSystem_PALMOS::OSystem_PALMOS() { _keyMouse.bitButLeft= keyBitHard3|0x00100000; // keyBitRockerCenter on TwKeys.h but conflict with palmnavigator.h } _keyMask = (_keyMouse.bitUp | _keyMouse.bitDown | _keyMouse.bitLeft | _keyMouse.bitRight | _keyMouse.bitButLeft); - + // enable cdrom ? _cdPlayer = NULL; if (gVars->CD.enable) { @@ -287,7 +287,7 @@ OSystem_PALMOS::OSystem_PALMOS() { _cdPlayer = new PckTunesCDPlayer(this); break; } - + if (_cdPlayer) { if (!_cdPlayer->init()) { _cdPlayer->release(); @@ -295,7 +295,7 @@ OSystem_PALMOS::OSystem_PALMOS() { } } } - + // sound memset(&_sound,0,sizeof(SoundDataType)); } diff --git a/backends/PalmOS/Src/palm.h b/backends/PalmOS/Src/palm.h index 490e0c3a7b..d8c3793c81 100644 --- a/backends/PalmOS/Src/palm.h +++ b/backends/PalmOS/Src/palm.h @@ -72,7 +72,7 @@ public: bool setGraphicsMode(int mode); int getGraphicsMode() const; int getDefaultGraphicsMode() const; - + int getOutputSampleRate() const; bool openCD(int drive); void setWindowCaption(const char *caption); // TODO : _inGame = true = don't set @@ -111,17 +111,17 @@ public: // Shaking is used in SCUMM. Set current shake position. void setShakePos(int shake_pos); - + // Get the number of milliseconds since the program was started. uint32 getMillis(); - + // Delay for a specified amount of milliseconds void delayMillis(uint msecs); - + // Get the next event. - // Returns true if an event was retrieved. + // Returns true if an event was retrieved. bool pollEvent(Event &event); - + void SimulateArrowKeys(Event &event, Int8 iHoriz, Int8 iVert); /** @name Sound */ @@ -133,14 +133,14 @@ public: * @param param an arbitrary parameter which is stored and passed to proc. */ bool setSoundCallback(SoundProc proc, void *param); - + /** * Remove any audio callback previously set via setSoundCallback, thus effectively * stopping all audio output immediately. * @see setSoundCallback */ void clearSoundCallback(); - //@} + //@} // Poll cdrom status // Returns true if cd audio is playing @@ -239,9 +239,9 @@ private: int _current_shake_pos; int _new_shake_pos; byte _mouseKeyColor; - + UInt32 _exit_delay; - + struct { uint32 duration, nextExpiry; bool active; @@ -258,10 +258,10 @@ private: void draw_mouse(); void undraw_mouse(); - + void sound_handler(); void timer_handler(UInt32 current_msecs); - + void getCoordinates(EventPtr event, Coord *x, Coord *y); void draw1BitGfx(UInt16 id, Int32 x, Int32 y, Boolean clear); @@ -283,12 +283,12 @@ private: enum { kLastKeyNone = 0, kLastKeyMouse = 1 << 0, - + kLastKeyCalc = 1 << 30, kLastKeyAny = 1 << 31 }; - + UInt32 _keyMask; struct { UInt32 bitUp; @@ -301,7 +301,7 @@ private: Int32 _lastKeyPressed; UInt32 _lastKeyRepeat; UInt8 _lastKeyModifier; - + Boolean _useNumPad; Boolean _useHRmode; @@ -311,7 +311,7 @@ private: void init_intern(); }; -Err HwrDisplayPalette(UInt8 operation, Int16 startIndex, +Err HwrDisplayPalette(UInt8 operation, Int16 startIndex, UInt16 paletteEntries, RGBColorType *tableP) SYS_TRAP(sysTrapHwrDisplayPalette); diff --git a/backends/PalmOS/Src/palmevt.cpp b/backends/PalmOS/Src/palmevt.cpp index c4539d2b35..98020cba35 100644 --- a/backends/PalmOS/Src/palmevt.cpp +++ b/backends/PalmOS/Src/palmevt.cpp @@ -75,7 +75,7 @@ void OSystem_PALMOS::getCoordinates(EventPtr event, Coord *x, Coord *y) { // wide landscape if (OPTIONS_TST(kOptModeLandscape)) { - // zodiac have mutliple ratio + // zodiac have mutliple ratio if (OPTIONS_TST(kOptDeviceZodiac)) { Int32 w,h; @@ -94,7 +94,7 @@ void OSystem_PALMOS::getCoordinates(EventPtr event, Coord *x, Coord *y) { // wide portrait, only for 320x200 } else { *y = ((event->screenX - _screenOffset.y) << 1) / 3; - *x = 320 - ((event->screenY - _screenOffset.x) << 1) / 3 - 1; + *x = 320 - ((event->screenY - _screenOffset.x) << 1) / 3 - 1; } // normal coord @@ -137,12 +137,12 @@ bool OSystem_PALMOS::pollEvent(Event &event) { sy = -1; else if (keyCurrentState & _keyMouse.bitDown) sy = +1; - + if (keyCurrentState & _keyMouse.bitLeft) sx = -1; else if (keyCurrentState & _keyMouse.bitRight) - sx = +1; - + sx = +1; + SimulateArrowKeys(event, sx, sy); updateScreen(); updateCD(); @@ -161,7 +161,7 @@ bool OSystem_PALMOS::pollEvent(Event &event) { if (ev.eType == keyDownEvent) { switch (ev.data.keyDown.chr) { - + // ESC key case vchrLaunch: _lastKeyPressed = kLastKeyNone; @@ -170,7 +170,7 @@ bool OSystem_PALMOS::pollEvent(Event &event) { event.kbd.ascii = 27; event.kbd.flags = 0; return true; - + // F5 = menu case vchrJogPushRepeat: case vchrMenu: @@ -204,7 +204,7 @@ bool OSystem_PALMOS::pollEvent(Event &event) { return true; case vchrJogPushedUp: - case vchrJogPushedDown: // hot swap gfx mode + case vchrJogPushedDown: // hot swap gfx mode if (_initMode == GFX_WIDE) hotswap_gfx_mode(_mode == GFX_WIDE ? GFX_NORMAL: GFX_WIDE); else @@ -238,7 +238,7 @@ bool OSystem_PALMOS::pollEvent(Event &event) { if (OPTIONS_TST(kOptPalmSoundAPI) && _sound.active) SndStreamPause(*((SndStreamRef *)_sound.handle), true); break; - + case vchrLateWakeup: // resume the sound thread if any if (OPTIONS_TST(kOptPalmSoundAPI) && _sound.active) @@ -265,7 +265,7 @@ bool OSystem_PALMOS::pollEvent(Event &event) { event.kbd.ascii = 27; event.kbd.flags = 0; return true; - + // F5 = menu case vchrHard3: _lastKeyPressed = kLastKeyNone; @@ -279,10 +279,10 @@ bool OSystem_PALMOS::pollEvent(Event &event) { } // prevent crash when alarm is raised - handled = ((ev.eType == keyDownEvent) && - (ev.data.keyDown.modifiers & commandKeyMask) && - ((ev.data.keyDown.chr == vchrAttnStateChanged) || - (ev.data.keyDown.chr == vchrAttnUnsnooze))); + handled = ((ev.eType == keyDownEvent) && + (ev.data.keyDown.modifiers & commandKeyMask) && + ((ev.data.keyDown.chr == vchrAttnStateChanged) || + (ev.data.keyDown.chr == vchrAttnUnsnooze))); // graffiti strokes, auto-off, etc... if (!handled) @@ -299,7 +299,7 @@ bool OSystem_PALMOS::pollEvent(Event &event) { if (ev.data.keyDown.chr == vchrCommand && (ev.data.keyDown.modifiers & commandKeyMask)) { _lastKeyModifier++; _lastKeyModifier %= 4; - + if (_lastKeyModifier) draw1BitGfx((kDrawKeyState + _lastKeyModifier - 1), 2, _screenHeight + 2, true); else @@ -312,14 +312,14 @@ bool OSystem_PALMOS::pollEvent(Event &event) { if (_lastKeyModifier == MD_CMD) b = KBD_CTRL|KBD_ALT; if (_lastKeyModifier == MD_ALT) b = KBD_ALT; if (_lastKeyModifier == MD_CTRL) b = KBD_CTRL; - + keycode = ev.data.keyDown.chr; - + // F1 -> F10 key if (keycode >= '0' && keycode <= '9' && b == (KBD_CTRL|KBD_ALT)) { keycode = keycode == '0' ? 324 : (315 + keycode - '1'); b = 0; - + } else if ((keycode == 'z' && b == KBD_CTRL) || (b == KBD_ALT && keycode == 'x')) { event.type = EVENT_QUIT; return true; @@ -343,12 +343,12 @@ bool OSystem_PALMOS::pollEvent(Event &event) { setFeatureState(kFeatureFullscreenMode, !_fullscreen); #endif } - + event.type = EVENT_KEYDOWN; event.kbd.keycode = keycode; event.kbd.ascii = keycode; //(keycode>='a' && keycode<='z' && (event.kbd.flags & KBD_SHIFT) ? keycode &~ 0x20 : keycode); event.kbd.flags = b; - + if (_lastKeyModifier) { _lastKeyModifier = MD_NONE; draw1BitGfx(kDrawKeyState, 2, getHeight() + 2, false); @@ -383,10 +383,10 @@ bool OSystem_PALMOS::pollEvent(Event &event) { if (y >= y2 && y < (y2 + 34) && x >= x2 && x < (x2 + 40)) { // numpad location UInt8 key = '1'; key += 9 - ( (3 - ((x - x2) / 13)) + (3 * ((y - y2) / 11)) ); - + _lastEvent = keyDownEvent; _lastKeyPressed = kLastKeyNone; - + event.type = EVENT_KEYDOWN; event.kbd.keycode = key; event.kbd.ascii = key; diff --git a/backends/PalmOS/Src/palmgfx.cpp b/backends/PalmOS/Src/palmgfx.cpp index 5248a2838a..4d7358c8ea 100644 --- a/backends/PalmOS/Src/palmgfx.cpp +++ b/backends/PalmOS/Src/palmgfx.cpp @@ -68,7 +68,7 @@ bool OSystem_PALMOS::setGraphicsMode(int mode) { case GFX_WIDE: _setMode = mode; break; - + default: warning("unknown gfx mode %d", mode); _setMode = GFX_NORMAL; @@ -103,10 +103,10 @@ void OSystem_PALMOS::initSize(uint w, uint h, int overlayScale) { SysSetOrientationTriggerState(sysOrientationTriggerDisabled); set_mouse_pos(200,150); - + unload_gfx_mode(); - // force WIDE mode for 640x480 games + // force WIDE mode for 640x480 games if (h == 480) _setMode = GFX_WIDE; @@ -145,14 +145,14 @@ void OSystem_PALMOS::load_gfx_mode() { // get the actual palette WinPalette(winPaletteGet, 0, 256, _currentPalette); - + // set only if _mode not changed const byte startupPalette[] = { 0 ,0 ,0 ,0, 0 ,0 ,171,0, 0 ,171, 0 ,0, 0 ,171,171,0, - 171 ,0 ,0 ,0, + 171 ,0 ,0 ,0, 171 ,0 ,171,0, 171 ,87 ,0 ,0, 171 ,171,171,0, @@ -267,7 +267,7 @@ void OSystem_PALMOS::load_gfx_mode() { _offScreenP = WinScreenLock(winLockErase) + _screenOffset.addr; _screenP = _offScreenP; _offScreenH = WinGetDisplayWindow(); - _screenH = _offScreenH; + _screenH = _offScreenH; _renderer_proc = &OSystem_PALMOS::updateScreen_flipping; break; case GFX_WIDE: @@ -287,11 +287,11 @@ void OSystem_PALMOS::load_gfx_mode() { _screenP = (byte *)(BmpGetBits(WinGetBitmap(_screenH))); _renderer_proc = &OSystem_PALMOS::updateScreen_wideZodiac; } else -#endif +#endif { gVars->screenLocked = true; _screenP = WinScreenLock(winLockErase) + _screenOffset.addr; - + _renderer_proc = (OPTIONS_TST(kOptModeLandscape)) ? &OSystem_PALMOS::updateScreen_wideLandscape : &OSystem_PALMOS::updateScreen_widePortrait; @@ -324,7 +324,7 @@ void OSystem_PALMOS::load_gfx_mode() { _gfxLoaded = true; } - + } void OSystem_PALMOS::unload_gfx_mode() { @@ -407,25 +407,25 @@ void OSystem_PALMOS::hotswap_gfx_mode(int mode) { DmWrite(dst, offset, src, _screenWidth); offset += _screenWidth; src += _offScreenPitch; - } while (--h); + } while (--h); _modeChanged = true; - + // reset offscreen pitch _offScreenPitch = gVars->screenPitch; // free old mode memory unload_gfx_mode(); - + // load new gfx mode _mode = mode; load_gfx_mode(); - + // restore offscreen WinPalette(winPaletteSet, 0, 256, _currentPalette); clearScreen(); copyRectToScreen(_tmpHotSwapP, _screenWidth, 0, 0, _screenWidth, _screenHeight); _modeChanged = false; - + // force palette update _paletteDirtyStart = 0; _paletteDirtyEnd = 256; @@ -483,7 +483,7 @@ byte OSystem_PALMOS::RGBToColor(uint8 r, uint8 g, uint8 b) { } } } - + return color; } @@ -549,7 +549,7 @@ void OSystem_PALMOS::copyRectToScreen(const byte *buf, int pitch, int x, int y, void OSystem_PALMOS::updateScreen() { // Check whether the palette was changed in the meantime and update the - // screen surface accordingly. + // screen surface accordingly. if (_paletteDirtyEnd != 0) { UInt8 oldCol; @@ -563,11 +563,11 @@ void OSystem_PALMOS::updateScreen() { oldCol = gVars->indicator.on; gVars->indicator.on = RGBToColor(0,255,0); - if (oldCol != gVars->indicator.on) { + if (oldCol != gVars->indicator.on) { // redraw if needed if (_lastKeyModifier) draw1BitGfx((kDrawKeyState + _lastKeyModifier - 1), 2, getHeight() + 2, true); - + if(_useNumPad) draw1BitGfx(kDrawNumPad, (getWidth() >> 1) - 32, getHeight() + 2, true); @@ -583,7 +583,7 @@ void OSystem_PALMOS::updateScreen() { byte *src = _tmpScreenP; byte *dst = _offScreenP; UInt16 h = _screenHeight; - + do { memcpy(dst, src, _screenWidth); dst += _offScreenPitch; @@ -600,7 +600,7 @@ void OSystem_PALMOS::draw1BitGfx(UInt16 id, Int32 x, Int32 y, Boolean show) { return; MemHandle hTemp = DmGetResource(bitmapRsc, id); - + if (hTemp) { BitmapType *bmTemp; UInt32 *bmData; @@ -619,12 +619,12 @@ void OSystem_PALMOS::draw1BitGfx(UInt16 id, Int32 x, Int32 y, Boolean show) { if (next) blocks++; - + for (ih = 0; ih < h; ih++) { // line for (ib = 0; ib < blocks; ib++) { // 32pix block next = w - (ib << 5); next = MIN(next, (Coord)32); - + for (iw = 0; iw < next; iw++) { // row *scr++ = ((*bmData & (1 << (31 - iw))) && show) ? diff --git a/backends/PalmOS/Src/palmmos.cpp b/backends/PalmOS/Src/palmmos.cpp index e50a1cd3cb..00c9d68cd6 100644 --- a/backends/PalmOS/Src/palmmos.cpp +++ b/backends/PalmOS/Src/palmmos.cpp @@ -26,7 +26,7 @@ bool OSystem_PALMOS::showMouse(bool visible) { if (_mouseVisible == visible) return visible; - + bool last = _mouseVisible; _mouseVisible = visible; @@ -133,7 +133,7 @@ void OSystem_PALMOS::draw_mouse() { } else { int offset = y * _screenWidth + x; dst = _tmpScreenP; - + while (h > 0) { width = w; while (width > 0) { diff --git a/backends/PalmOS/Src/palmovl.cpp b/backends/PalmOS/Src/palmovl.cpp index 80babec563..33cc93f041 100644 --- a/backends/PalmOS/Src/palmovl.cpp +++ b/backends/PalmOS/Src/palmovl.cpp @@ -35,7 +35,7 @@ void OSystem_PALMOS::showOverlay() { DmWrite(dst, offset, src, _screenWidth); offset += _screenWidth; src += _offScreenPitch; - } while (--h); + } while (--h); _overlayVisible = true; clearOverlay(); @@ -109,9 +109,9 @@ void OSystem_PALMOS::copyRectToOverlay(const byte *buf, int pitch, int x, int y, /* RectangleType mouse = {_mouseCurState.x, _mouseCurState.y, _mouseCurState.w, _mouseCurState.h}; RectangleType copy = {x, y, w, h}; RectangleType result; - + RctGetIntersection(&mouse, ©, &result); - + if (result.extent.x !=0 && result.extent.y !=0)*/ undraw_mouse(); } diff --git a/backends/PalmOS/Src/palmrdr.cpp b/backends/PalmOS/Src/palmrdr.cpp index fcebafb9f0..ea9c8a312b 100644 --- a/backends/PalmOS/Src/palmrdr.cpp +++ b/backends/PalmOS/Src/palmrdr.cpp @@ -84,10 +84,10 @@ void OSystem_PALMOS::updateScreen_wideZodiac() { // clear bottom RctSetRectangle(&r, 0, _screenOffset.y + h, 480, _current_shake_pos); WinFillRectangle(&r, 0); - + destRect.y += _new_shake_pos; _screenOffset.y += _new_shake_pos; - + rumblePack(_new_shake_pos >= 3); _current_shake_pos = _new_shake_pos; } @@ -95,7 +95,7 @@ void OSystem_PALMOS::updateScreen_wideZodiac() { // update screen WinSetDrawWindow(WinGetDisplayWindow()); e = TwGfxDrawPalmBitmap((TwGfxSurfaceType *)_twSrc, &destPoint, (BitmapPtr)_twBmpV3); - e = TwGfxStretchBlt2((TwGfxSurfaceType *)_twDst, &destRect, (TwGfxSurfaceType *)_twSrc, &srcRect, twGfxStretchFast| (gVars->filter ? twGfxStretchSmooth : 0)); + e = TwGfxStretchBlt2((TwGfxSurfaceType *)_twDst, &destRect, (TwGfxSurfaceType *)_twSrc, &srcRect, twGfxStretchFast| (gVars->filter ? twGfxStretchSmooth : 0)); } #endif @@ -114,13 +114,13 @@ void OSystem_PALMOS::updateScreen_widePortrait() { // clear bottom RctSetRectangle(&r, _screenOffset.y + 300, 0, _current_shake_pos, 480); WinFillRectangle(&r, 0); - + dst += _new_shake_pos; rumblePack(_new_shake_pos >= 3); _current_shake_pos = _new_shake_pos; } - + // update screen ARM_START(WideType) ARM_INIT(COMMON_WPORTRAIT) @@ -177,13 +177,13 @@ void OSystem_PALMOS::updateScreen_wideLandscape() { // clear bottom RctSetRectangle(&r, 0, _screenOffset.y + 300, 480, _current_shake_pos); WinFillRectangle(&r, 0); - + dst += _new_shake_pos * 480; rumblePack(_new_shake_pos >= 3); _current_shake_pos = _new_shake_pos; } - + // update screen ARM_START(WideType) ARM_INIT(COMMON_WLANDSCAPE) diff --git a/backends/PalmOS/Src/palmsave.cpp b/backends/PalmOS/Src/palmsave.cpp index 9c0ef08b79..e507f460f0 100644 --- a/backends/PalmOS/Src/palmsave.cpp +++ b/backends/PalmOS/Src/palmsave.cpp @@ -32,7 +32,7 @@ class PalmSaveFile : public Common::SaveFile { public: PalmSaveFile(const char *filename, bool saveOrLoad); ~PalmSaveFile(); - + bool isOpen() const { return file != NULL; } uint32 read(void *buf, uint32 size); @@ -56,15 +56,15 @@ PalmSaveFile::PalmSaveFile(const char *filename, bool saveOrLoad) { if (file) { if (saveOrLoad) { _readWriteData = (byte *)malloc(MAX_BLOCK); - + } else { // read : cache the whole file ::fseek(file, 0, SEEK_END); length = ::ftell(file); ::fseek(file, 0, SEEK_SET); - + _readWriteData = (byte *)malloc(length); - _readWritePos = 0; + _readWritePos = 0; if (_readWriteData) ::fread(_readWriteData, 1, length, file); @@ -76,7 +76,7 @@ PalmSaveFile::~PalmSaveFile() { if (file) { if (_needDump) ::fwrite(_readWriteData, _readWritePos, 1, file); - + if (_readWriteData) free(_readWriteData); diff --git a/backends/PalmOS/Src/palmsnd.cpp b/backends/PalmOS/Src/palmsnd.cpp index 40ab498e8a..989ff100c6 100644 --- a/backends/PalmOS/Src/palmsnd.cpp +++ b/backends/PalmOS/Src/palmsnd.cpp @@ -51,18 +51,18 @@ bool OSystem_PALMOS::setSoundCallback(SoundProc proc, void *param) { _sound.active = true; // always true when we call this function _sound.dataP = NULL; // required by sound_handler _sound.handle = NULL; - + if (ConfMan.hasKey("output_rate")) _samplesPerSec = ConfMan.getInt("output_rate"); else _samplesPerSec = 8000; // default value - + // try to create sound stream if (OPTIONS_TST(kOptPalmSoundAPI)) { void *sndFuncP; - + _sound.handle = MemPtrNew(sizeof(SndStreamRef)); - sndFuncP = sndCallback; + sndFuncP = sndCallback; Err e = SndStreamCreateExtended( (SndStreamRef *)_sound.handle, @@ -83,14 +83,14 @@ bool OSystem_PALMOS::setSoundCallback(SoundProc proc, void *param) { _sound.set = false; _sound.wait = true; success = (e == errNone); - + } else if (OPTIONS_TST(kOptSonyPa1LibAPI)) { static CallbackInfoType cbData; _sound.handle = MemPtrNew(sizeof(UInt8)); - + cbData.funcP = &ClieSoundCallback; cbData.dwUserData = (UInt32)&_sound; - + _sound.size = SND_BLOCK; _sound.set = false; _sound.wait = true; @@ -101,7 +101,7 @@ bool OSystem_PALMOS::setSoundCallback(SoundProc proc, void *param) { Pa1Lib_adpcmOpen(ADPCM_8_KHZ, (UInt8 *)_sound.tmpP, MemPtrSize(_sound.tmpP), &cbData, (UInt8 *)_sound.handle); } - // failed or not supported + // failed or not supported if (!success) { _sound.size = SND_BLOCK; _sound.set = false; @@ -125,7 +125,7 @@ void OSystem_PALMOS::clearSoundCallback() { free(_sound.tmpP); free(_sound.handle); } - + _sound.active = false; _sound.dataP = NULL; @@ -139,9 +139,9 @@ void OSystem_PALMOS::sound_handler() { if (!_sound.dataP) _sound.dataP = MemPtrNew(_sound.size); - + ((SoundProc)_sound.proc)(_sound.param, (byte *)_sound.dataP, _sound.size); - + if (OPTIONS_TST(kOptSonyPa1LibAPI)) { pcm2adpcm((Int16 *)_sound.dataP, (UInt8 *)_sound.tmpP, _sound.size); _sound.set = Pa1Lib_adpcmStart(*((UInt8 *)_sound.handle), ADPCM_MODE_NONCONTINUOUS_PB|ADPCM_MODE_INTERRUPT_MODE); @@ -174,7 +174,7 @@ void OSystem_PALMOS::playCD(int track, int num_loops, int start_frame, int durat bool OSystem_PALMOS::pollCD() { if (!_cdPlayer) return false; - + return _cdPlayer->poll(); } diff --git a/backends/PalmOS/Src/rumble.cpp b/backends/PalmOS/Src/rumble.cpp index c78e5878da..d70a1d315b 100644 --- a/backends/PalmOS/Src/rumble.cpp +++ b/backends/PalmOS/Src/rumble.cpp @@ -20,7 +20,7 @@ Boolean RumbleExists() { exists = true; TwDeviceClose(hRumble); } - + } else #endif { @@ -49,7 +49,7 @@ void RumbleRun(Boolean active) { } else { TwDeviceControl(hRumble, 'stop', 0, 0); } - + } else #endif { @@ -81,7 +81,7 @@ Boolean RumbleInit() { HwrVibrateAttributes(1, kHwrVibratePattern, &pattern); HwrVibrateAttributes(1, kHwrVibrateDelay, &delay); HwrVibrateAttributes(1, kHwrVibrateRepeatCount, &repeat); - + done = true; } } @@ -93,7 +93,7 @@ void RumbleRelease() { #ifndef DISABLE_TAPWAVE if (OPTIONS_TST(kOptDeviceZodiac)) { TwDeviceClose(hRumble); - + } else #endif { diff --git a/backends/PalmOS/Src/scumm_globals.cpp b/backends/PalmOS/Src/scumm_globals.cpp index 4fd440a778..a3fcb3d1c9 100644 --- a/backends/PalmOS/Src/scumm_globals.cpp +++ b/backends/PalmOS/Src/scumm_globals.cpp @@ -105,7 +105,7 @@ static DmOpenRef GlbOpenInternal(const Char *nameP) { if (dbID) { UInt32 dbType, dbCreator; Err e = DmDatabaseInfo(0, dbID, 0, 0, 0, 0, 0, 0, 0, 0, 0, &dbType, &dbCreator); - + if (!e && dbType == 'GLBS' && dbCreator == appFileCreator) return DmOpenDatabase(0, dbID, dmModeReadOnly); } diff --git a/backends/PalmOS/Src/skin.cpp b/backends/PalmOS/Src/skin.cpp index a149ac4bb6..62a2e77492 100644 --- a/backends/PalmOS/Src/skin.cpp +++ b/backends/PalmOS/Src/skin.cpp @@ -37,7 +37,7 @@ MemPtr SknScreenLock(WinLockInitType initMode) { if (!OPTIONS_TST(kOptDeviceZodiac)) { WinSetDrawWindow(WinGetDisplayWindow()); // WARNING : this doesn't work on < OS5 with 16bit mode - return WinScreenLock(initMode); + return WinScreenLock(initMode); } Err e; @@ -81,13 +81,13 @@ static void SknGetListColors(DmOpenRef skinDBP, UInt8 *text, UInt8 *selected, UI if (skinDBP) { colIndex = DmFindResource (skinDBP, sknColorsRsc, skinColors, NULL); - + if (colIndex != (UInt16)-1) { colH = DmGetResourceIndex(skinDBP, colIndex); - + if (colH) { colTemp = (UInt8 *)MemHandleLock(colH); - + *text = colTemp[0]; *selected = colTemp[1]; *background = colTemp[2]; @@ -113,7 +113,7 @@ static void SknCopyBits(DmOpenRef skinDBP, DmResID bitmapID, const RectangleType if (index != (UInt16)-1) { hTemp = DmGetResourceIndex(skinDBP,index); - + if (hTemp) { bmpTemp = (BitmapType *)MemHandleLock(hTemp); BmpGlueGetDimensions(bmpTemp, &bw, &bh, 0); @@ -129,7 +129,7 @@ static void SknCopyBits(DmOpenRef skinDBP, DmResID bitmapID, const RectangleType cw = srcRect->extent.x; ch = srcRect->extent.y; } - + if (ch) { WinGetClip(&old); if (gVars->HRrefNum != sysInvalidRefNum) { @@ -143,14 +143,14 @@ static void SknCopyBits(DmOpenRef skinDBP, DmResID bitmapID, const RectangleType } else { Err e; BitmapTypeV3 *bmp2P; - + // create an uncompressed version of the bitmap WinHandle win = WinCreateOffscreenWindow(bw, bh, screenFormat, &e); WinHandle old = WinGetDrawWindow(); WinSetDrawWindow(win); WinDrawBitmap(bmpTemp, 0, 0); WinSetDrawWindow(old); - + bmp2P = BmpCreateBitmapV3(WinGetBitmap(win), kDensityDouble, BmpGetBits(WinGetBitmap(win)), NULL); copy.topLeft.x = destX / 2; @@ -183,7 +183,7 @@ void SknApplySkin() { SknScreenLock(winLockCopy); skinDBP = SknOpenSkin(); - + if (gPrefs->card.volRefNum != sysInvalidRefNum) FrmShowObject(frmP, FrmGetObjectIndex (frmP, MainMSBitMap)); else @@ -198,7 +198,7 @@ void SknApplySkin() { SknCopyBits(skinDBP, skinBackgroundImageTop, 0, r.topLeft.x, r.topLeft.y); SknGetObjectBounds(skinDBP, skinBackgroundImageBottom, &r); SknCopyBits(skinDBP, skinBackgroundImageBottom, 0, r.topLeft.x, r.topLeft.y); - + for (UInt16 resID = 1100; resID <= 7000; resID += 100) { SknSetState(skinDBP, resID, sknStateNormal); SknShowObject(skinDBP, resID); @@ -217,30 +217,30 @@ void SknGetObjectBounds(DmOpenRef skinDBP, DmResID resID, RectangleType *rP) { UInt8 *strTemp; RctSetRectangle(rP, 0, 0, 0, 0); - + if (skinDBP) { bmpIndex = DmFindResource (skinDBP, bitmapRsc, resID, NULL); - + if (bmpIndex != (UInt16)-1) { // if bmp exists strIndex = DmFindResource (skinDBP, sknPosRsc, resID, NULL); - + if (strIndex != (UInt16)-1) { // if params exist hBmp = DmGetResourceIndex(skinDBP,bmpIndex); if (hBmp) { hStr = DmGetResourceIndex(skinDBP,strIndex); - + if (hStr) { // buttons : state|x|y|w/h slider|draw mode|x1/y1 keep|x2/y2 keep slider // list (160mode) : state|x|y|w|h| bmpTemp = (BitmapType *)MemHandleLock(hBmp); strTemp = (UInt8 *)MemHandleLock(hStr); - + BmpGlueGetDimensions(bmpTemp, &(rP->extent.x), &(rP->extent.y), 0); rP->topLeft.x = strTemp[sknInfoPosX] * 2; rP->topLeft.y = strTemp[sknInfoPosY] * 2; - - MemPtrUnlock(strTemp); + + MemPtrUnlock(strTemp); DmReleaseResource(hStr); } @@ -270,20 +270,20 @@ UInt8 SknSetState(DmOpenRef skinDBP, DmResID resID, UInt8 newState) { if (skinDBP) { index = DmFindResource (skinDBP, sknPosRsc, resID, NULL); - + if (index != (UInt16)-1) { hStr = DmGetResourceIndex(skinDBP, index); - + if (hStr) { strTemp = (UInt8 *)MemHandleLock(hStr); oldState = strTemp[sknInfoState]; - + if (oldState != newState) { DmWrite(strTemp, 0, &newState, 1); } - - MemPtrUnlock(strTemp); - DmReleaseResource(hStr); + + MemPtrUnlock(strTemp); + DmReleaseResource(hStr); } } } @@ -299,19 +299,19 @@ UInt8 SknGetDepth(DmOpenRef skinDBP) { if (skinDBP) { index = DmFindResource (skinDBP, sknDepthRsc, skinDepth, NULL); - + if (index != (UInt16)-1) { hStr = DmGetResourceIndex(skinDBP, index); - + if (hStr) { strTemp = (UInt8 *)MemHandleLock(hStr); depth = *strTemp; - MemPtrUnlock(strTemp); - DmReleaseResource(hStr); + MemPtrUnlock(strTemp); + DmReleaseResource(hStr); } } } - + return depth; } @@ -324,15 +324,15 @@ UInt8 SknGetState(DmOpenRef skinDBP, DmResID resID) { if (skinDBP) { index = DmFindResource (skinDBP, sknPosRsc, resID, NULL); - + if (index != (UInt16)-1) { hStr = DmGetResourceIndex(skinDBP, index); - + if (hStr) { strTemp = (UInt8 *)MemHandleLock(hStr); - oldState = strTemp[sknInfoState]; - MemPtrUnlock(strTemp); - DmReleaseResource(hStr); + oldState = strTemp[sknInfoState]; + MemPtrUnlock(strTemp); + DmReleaseResource(hStr); } } } @@ -358,7 +358,7 @@ void SknGetListBounds(RectangleType *rAreaP, RectangleType *rArea2xP) { skinDBP = DmOpenDatabase(gPrefs->skin.cardNo, gPrefs->skin.dbID, dmModeReadOnly); if (skinDBP) { strIndex = DmFindResource (skinDBP, sknPosRsc, skinList, NULL); - + if (strIndex != 0xFFFF) { // if params exist hStr = DmGetResourceIndex(skinDBP,strIndex); if (hStr) { @@ -368,7 +368,7 @@ void SknGetListBounds(RectangleType *rAreaP, RectangleType *rArea2xP) { y = strTemp[sknInfoPosY]; w = strTemp[sknInfoListWidth]; h = strTemp[sknInfoListSize] * sknInfoListItemSize; - + if (rAreaP) RctSetRectangle(rAreaP ,x, y, w, h); if (rArea2xP) @@ -376,7 +376,7 @@ void SknGetListBounds(RectangleType *rAreaP, RectangleType *rArea2xP) { MemHandleUnlock(hStr); DmReleaseResource(hStr); - + } } @@ -447,7 +447,7 @@ void SknUpdateList() { UInt8 txtColor, norColor, selColor, bkgColor; UInt16 x,y; - + SknScreenLock(winLockCopy); SknGetListBounds(&rArea, &rArea2x); @@ -461,7 +461,7 @@ void SknUpdateList() { x = rCopy.topLeft.x; y = rCopy.topLeft.y; rCopy.topLeft.x -= rField.topLeft.x; - rCopy.topLeft.y -= rField.topLeft.y; + rCopy.topLeft.y -= rField.topLeft.y; SknCopyBits(skinDBP, skinBackgroundImageTop, &rCopy, x, y); // copy bottom bg SknGetObjectBounds(skinDBP, skinBackgroundImageBottom, &rField); @@ -469,7 +469,7 @@ void SknUpdateList() { x = rCopy.topLeft.x; y = rCopy.topLeft.y; rCopy.topLeft.x -= rField.topLeft.x; - rCopy.topLeft.y -= rField.topLeft.y; + rCopy.topLeft.y -= rField.topLeft.y; SknCopyBits(skinDBP, skinBackgroundImageBottom, &rCopy, x, y); FntSetFont(stdFont); @@ -549,9 +549,9 @@ UInt16 SknCheckClick(DmOpenRef skinDBP, Coord mx, Coord my) { } } } - + } - + return 0; } @@ -572,7 +572,7 @@ void SknSelect(Coord x, Coord y) { if (index < DmNumRecords(gameDB)) { Boolean newValue; - + oldIndex = GamGetSelected(); if (oldIndex != index && oldIndex != dmMaxRecordIndex) @@ -586,7 +586,7 @@ void SknSelect(Coord x, Coord y) { MemHandleUnlock(record); DmReleaseRecord (gameDB, index, 0); - + lastIndex = index; SknUpdateList(); } diff --git a/backends/PalmOS/Src/skin.h b/backends/PalmOS/Src/skin.h index 693ace4a76..6854c90d8f 100644 --- a/backends/PalmOS/Src/skin.h +++ b/backends/PalmOS/Src/skin.h @@ -22,7 +22,7 @@ #ifndef __SKIN_H__ #define __SKIN_H__ -// skin +// skin #define sknInfoState 0 #define sknInfoPosX 1 #define sknInfoPosY 2 diff --git a/backends/PalmOS/Src/snd_pa1.cpp b/backends/PalmOS/Src/snd_pa1.cpp index d53d63b2a5..ca64825fe6 100644 --- a/backends/PalmOS/Src/snd_pa1.cpp +++ b/backends/PalmOS/Src/snd_pa1.cpp @@ -30,11 +30,11 @@ void pcm2adpcm(Int16 *src, UInt8 *dst, UInt32 length) { if (OPTIONS_TST(kOptDeviceARM)) { PnoDescriptor pno; ARMPa1SndType userData = {src, dst, length}; - + MemPtr armP = _PnoInit(ARM_PA1SND, &pno); _PnoCall(&pno, &userData); _PnoFree(&pno, armP); - + return; } */ @@ -49,7 +49,7 @@ void pcm2adpcm(Int16 *src, UInt8 *dst, UInt32 length) { signal = 0; step = 0x7F; length >>= 3; // 16bit stereo -> 4bit mono - + do { // high nibble @@ -58,14 +58,14 @@ void pcm2adpcm(Int16 *src, UInt8 *dst, UInt32 length) { src++; chan2 = ByteSwap16(*src); src++; - + diff = ((chan1 + chan2) >> 1) - signal; #else diff = ((*src++ + *src++) >> 1) - signal; #endif diff <<= 3; diff /= step; - + val = abs(diff) >> 1; if (val > 7) val = 7; @@ -85,7 +85,7 @@ void pcm2adpcm(Int16 *src, UInt8 *dst, UInt32 length) { src++; chan2 = ByteSwap16(*src); src++; - + diff = ((chan1 + chan2) >> 1) - signal; #else diff = ((*src++ + *src++) >> 1) - signal; diff --git a/backends/PalmOS/Src/snd_stream.cpp b/backends/PalmOS/Src/snd_stream.cpp index c9e969aa7d..976137305d 100644 --- a/backends/PalmOS/Src/snd_stream.cpp +++ b/backends/PalmOS/Src/snd_stream.cpp @@ -16,7 +16,7 @@ Err sndCallback(void* UserDataP, SndStreamRef stream, void* bufferP, UInt32 *buf *dst++ = READ_LE_UINT32(src++); *dst++ = READ_LE_UINT32(src++); } - snd->set = false; + snd->set = false; } else { snd->size = size; diff --git a/backends/PalmOS/Src/start.cpp b/backends/PalmOS/Src/start.cpp index 80d79915b4..74daa3fe7b 100644 --- a/backends/PalmOS/Src/start.cpp +++ b/backends/PalmOS/Src/start.cpp @@ -104,9 +104,9 @@ Err SendDatabase (UInt16 cardNo, LocalID dbID, Char *nameP, Char *descriptionP) * minimum requirement. * * PARAMETERS: requiredVersion - minimum rom version required - * (see sysFtrNumROMVersion in SystemMgr.h + * (see sysFtrNumROMVersion in SystemMgr.h * for format) - * launchFlags - flags that indicate if the application + * launchFlags - flags that indicate if the application * UI is initialized. * * RETURNED: error code or zero if rom is compatible @@ -127,8 +127,8 @@ static Err RomVersionCompatible(UInt32 requiredVersion, UInt16 launchFlags) (sysAppLaunchFlagNewGlobals | sysAppLaunchFlagUIApp)) { FrmAlert (RomIncompatibleAlert); - - // Palm OS 1.0 will continuously relaunch this app unless we switch to + + // Palm OS 1.0 will continuously relaunch this app unless we switch to // another safe one. if (romVersion <= kPalmOS10Version) { @@ -220,7 +220,7 @@ static Boolean AppHandleEvent(EventPtr eventP) } return true; } - + return false; } @@ -228,7 +228,7 @@ static Boolean AppHandleEvent(EventPtr eventP) * * FUNCTION: AppEventLoop * - * DESCRIPTION: This routine is the event loop for the application. + * DESCRIPTION: This routine is the event loop for the application. * * PARAMETERS: nothing * @@ -263,8 +263,8 @@ static void AppEventLoop(void) * * DESCRIPTION: This is the main entry point for the application. * - * PARAMETERS: cmd - word value specifying the launch code. - * cmdPB - pointer to a structure that is associated with the launch code. + * PARAMETERS: cmd - word value specifying the launch code. + * cmdPB - pointer to a structure that is associated with the launch code. * launchFlags - word value providing extra information about the launch. * * RETURNED: Result of launch @@ -295,7 +295,7 @@ static void AppLaunchCmdNotify(UInt16 LaunchFlags, SysNotifyParamType * pData) } } break; - + case sysNotifyVolumeUnmountedEvent: if (gPrefs) { CardSlotFormUpdate(); @@ -350,9 +350,9 @@ static UInt32 ScummVMPalmMain(UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags) #endif break; - case sysAppLaunchCmdNormalLaunch: + case sysAppLaunchCmdNormalLaunch: error = AppStart(); - if (error) + if (error) goto end; if (!bDirectMode) { @@ -380,8 +380,8 @@ end: * * DESCRIPTION: This is the main entry point for the application. * - * PARAMETERS: cmd - word value specifying the launch code. - * cmdPB - pointer to a structure that is associated with the launch code. + * PARAMETERS: cmd - word value specifying the launch code. + * cmdPB - pointer to a structure that is associated with the launch code. * launchFlags - word value providing extra information about the launch. * RETURNED: Result of launch * diff --git a/backends/PalmOS/Src/start.h b/backends/PalmOS/Src/start.h index 7743f72f87..3a76517cd0 100644 --- a/backends/PalmOS/Src/start.h +++ b/backends/PalmOS/Src/start.h @@ -19,7 +19,7 @@ * $Header$ * */ - + #ifndef __START_H__ #define __START_H__ @@ -33,7 +33,7 @@ typedef struct { //skin params SkinInfoType skin; // card where is located the skin - Boolean soundClick; + Boolean soundClick; // Boolean vibrator; Boolean autoOff; @@ -56,7 +56,7 @@ typedef struct { Boolean copyProtection; Boolean arm; Boolean altIntro; - + struct { Boolean enable; UInt8 mode; diff --git a/backends/PalmOS/Src/vibrate.h b/backends/PalmOS/Src/vibrate.h index 73b8a6104a..37604be5b7 100644 --- a/backends/PalmOS/Src/vibrate.h +++ b/backends/PalmOS/Src/vibrate.h @@ -24,7 +24,7 @@ Err HwrVibrateAttributes(Boolean set, UInt32 setting, void *value) SYS_TRAP(sysTrapHwrVibrateAttributes); /* to determine whether the vibrator is supported on a specific device, you -** need to make sure that you are running on PalmOS 4.x (so that the +** need to make sure that you are running on PalmOS 4.x (so that the ** trap exists), that the attention manager exists and you need to check ** whether HwrVibrateAttributes(0, 1, &active) returns an error code of ** 0. ('active' is a Boolean). @@ -42,14 +42,14 @@ Err HwrVibrateAttributes(Boolean set, UInt32 setting, void *value) ** value is in ticks (1/100 seconds) */ #define kHwrVibrateRate 2 -/* *value points to a UInt32, specifying the pattern of vibrating +/* *value points to a UInt32, specifying the pattern of vibrating ** ** example: ** 0xFFFFFFFF stay on, no vibrating ** 0x0F0F0F0F vibrate four times in equal intervals ** 0xAAAAAAAA vibrate really fast (not recommended) ** 0x0F0F0000 vibrate twice, then pause -*/ +*/ #define kHwrVibratePattern 3 /* *value points to a UInt16, specifying the delay between two |