diff options
author | Chris Apers | 2003-05-05 12:22:44 +0000 |
---|---|---|
committer | Chris Apers | 2003-05-05 12:22:44 +0000 |
commit | b1ff9cb1cde7a6a442d6217c83ff558c45f475c8 (patch) | |
tree | 09e66eacf49016de047d853c9f6e45312428433b /backends | |
parent | 15ba8da46bd3a803d0adf0fe70b648ffb1bfd8dd (diff) | |
download | scummvm-rg350-b1ff9cb1cde7a6a442d6217c83ff558c45f475c8.tar.gz scummvm-rg350-b1ff9cb1cde7a6a442d6217c83ff558c45f475c8.tar.bz2 scummvm-rg350-b1ff9cb1cde7a6a442d6217c83ff558c45f475c8.zip |
cleanup and add more ScummVM globals to PDB
svn-id: r7345
Diffstat (limited to 'backends')
-rw-r--r-- | backends/PalmOS/Src/palmstart.cpp | 50 | ||||
-rw-r--r-- | backends/PalmOS/Src/scumm_globals.h | 29 |
2 files changed, 35 insertions, 44 deletions
diff --git a/backends/PalmOS/Src/palmstart.cpp b/backends/PalmOS/Src/palmstart.cpp index 832c64c82d..ed1de9012d 100644 --- a/backends/PalmOS/Src/palmstart.cpp +++ b/backends/PalmOS/Src/palmstart.cpp @@ -128,6 +128,7 @@ static DmOpenRef _dbP = NULL; static UInt16 _lstIndex = 0; // last index static UInt8 __editMode__; static UInt16 sknLastOn = skinButtonNone; +static Boolean bStartScumm = false; GlobalsDataType *gVars; /*********************************************************************** @@ -185,11 +186,10 @@ static void GBInitAll() { IMuseDigital_initGlobals(); NewGui_initGlobals(); //Resource_initGlobals(); + Akos_initGlobals(); Codec47_initGlobals(); Gfx_initGlobals(); -#endif -#ifndef DISABLE_SIMON - Simon_initGlobals(); + Dialogs_initGlobals(); #endif } @@ -198,11 +198,10 @@ static void GBReleaseAll() { IMuseDigital_releaseGlobals(); NewGui_releaseGlobals(); //Resource_releaseGlobals(); + Akos_releaseGlobals(); Codec47_releaseGlobals(); Gfx_releaseGlobals(); -#endif -#ifndef DISABLE_SIMON - Simon_releaseGlobals(); + Dialogs_releaseGlobals(); #endif } @@ -2249,6 +2248,7 @@ static void StartScummVM() Boolean debug; UInt16 musicDriver = sysInvalidRefNum; // for launch call + bStartScumm = false; // UInt16 index = GamGetSelected(); /* if (index == dmMaxRecordIndex) { @@ -2258,7 +2258,7 @@ static void StartScummVM() } */ for(count = 0; count < MAX_ARG; count++) - argvP[count] = 0; + argvP[count] = NULL; if (index != dmMaxRecordIndex) { Char pathP[256]; @@ -2425,7 +2425,8 @@ static void StartScummVM() VFSFileOpen(gVars->volRefNum,"PALM/Programs/ScummVM/scumm.log",vfsModeWrite, &gVars->logFile); } - void *sndStateOnFuncP = 0, *sndStateOffFuncP = 0; + void *sndStateOnFuncP = NULL, + *sndStateOffFuncP = NULL; if (musicDriver == 1 || musicDriver == sysInvalidRefNum) { @@ -2434,15 +2435,15 @@ static void StartScummVM() FtrGet(sonySysFtrCreatorSystem, sonySysFtrNumSystemAOutSndStateOnHandlerP, (UInt32*) &sndStateOnFuncP); FtrGet(sonySysFtrCreatorSystem, sonySysFtrNumSystemAOutSndStateOffHandlerP, (UInt32*) &sndStateOffFuncP); + Pa1Lib_devHpVolume(gPrefs->volume.headphone, gPrefs->volume.headphone); + Pa1Lib_devSpVolume(gPrefs->volume.speaker); + // Pa1Lib_devEqVolume(gPrefs->volume.speaker); + if (sndStateOnFuncP && sndStateOffFuncP) { ((sndStateOnType)(sndStateOnFuncP))(aOutSndKindSp, gPrefs->volume.headphone, gPrefs->volume.headphone); ((sndStateOnType)(sndStateOnFuncP))(aOutSndKindHp, gPrefs->volume.speaker, gPrefs->volume.speaker); } - - Pa1Lib_devHpVolume(gPrefs->volume.headphone, gPrefs->volume.headphone); - Pa1Lib_devSpVolume(gPrefs->volume.speaker); - // Pa1Lib_devEqVolume(gPrefs->volume.speaker); } SavePrefs(); // free globals pref memory GBOpen(); @@ -2456,11 +2457,12 @@ static void StartScummVM() GBClose(); if (musicDriver == 1 || musicDriver == sysInvalidRefNum) { + Pa1Lib_Close(); + if (sndStateOnFuncP && sndStateOffFuncP) { ((sndStateOffType)(sndStateOffFuncP))(aOutSndKindSp); ((sndStateOffType)(sndStateOffFuncP))(aOutSndKindHp); } - Pa1Lib_Close(); } if (debug) @@ -2666,7 +2668,7 @@ static Boolean MainFormHandleEvent(EventPtr eventP) if (gPrefs->volRefNum == sysInvalidRefNum) FrmCustomAlert(FrmWarnAlert,"Please select/insert a memory card.", 0, 0); else - StartScummVM(); + bStartScumm = true; handled = true; break; @@ -2806,6 +2808,9 @@ static void AppEventLoop(void) do { EvtGetEvent(&event, evtNoWait); + if(bStartScumm) + StartScummVM(); + if (! SysHandleEvent(&event)) if (! MenuHandleEvent(0, &event, &error)) if (! AppHandleEvent(&event)) @@ -3085,30 +3090,23 @@ static Err AppStopCheckNotify() static void AppStop(void) { + WinEraseWindow(); + WinPalette(winPaletteSetToDefault, 0, 256, NULL); // Write the saved preferences / saved-state information. This data // will saved during a HotSync backup. -/* - StrCopy(prefs.skin.nameP,gPrefsskin.nameP); - prefs.skin.cardNo = _skin.cardNo; - prefs.skin.dbID = _skin.dbID; - - prefs.vibrator = iconState[IcnVibr].selected; - prefs.autoOff = iconState[IcnAOff].selected; - prefs.listPosition = ArrowManager.position; -*/ SavePrefs(); AppStopCheckNotify(); AppStopMathLib(); AppStopHRMode(); -/* + // Close all the open forms. -*/ FrmCloseAllForms(); + + FrmCloseAllForms(); GamCloseDatabase(); if (gVars) MemPtrFree(gVars); - WinPalette(winPaletteSetToDefault, 0, 256, NULL); } diff --git a/backends/PalmOS/Src/scumm_globals.h b/backends/PalmOS/Src/scumm_globals.h index 42713befb3..7bce3d5f02 100644 --- a/backends/PalmOS/Src/scumm_globals.h +++ b/backends/PalmOS/Src/scumm_globals.h @@ -28,20 +28,13 @@ #define GBVARS_FTSTATEMUSICTABLE_INDEX 5 #define GBVARS_FTSEQMUSICTABLE_INDEX 6 #define GBVARS_GUIFONT_INDEX 7 -#define GBVARS_OLD256MIDIHACK_INDEX 8 // fix me : sizeof is used on scummvm +#define GBVARS_DEFAULTSCALETABLE_INDEX 8 #define GBVARS_CODEC37TABLE_INDEX 9 #define GBVARS_CODEC47TABLE_INDEX 10 #define GBVARS_TRANSITIONEFFECTS_INDEX 11 - -#define GBVARS_SIMON1SETTINGS_INDEX 0 -#define GBVARS_SIMON1AMIGASETTINGS_INDEX 1 -#define GBVARS_SIMON1DEMOSETTINGS_INDEX 2 -#define GBVARS_SIMON2WINSETTINGS_INDEX 3 -#define GBVARS_SIMON2MACSETTINGS_INDEX 4 -#define GBVARS_SIMON2DOSSETTINGS_INDEX 5 -#define GBVARS_HEBREWVIDEOFONT_INDEX 6 -#define GBVARS_SPANISHVIDEOFONT_INDEX 7 -#define GBVARS_VIDEOFONT_INDEX 8 +#define GBVARS_STRINGMAPTABLEV7_INDEX 12 +#define GBVARS_STRINGMAPTABLEV6_INDEX 13 +#define GBVARS_STRINGMAPTABLEV5_INDEX 14 #define GBVARS_SCUMM 0 #define GBVARS_SIMON 1 @@ -56,17 +49,17 @@ void GBReleaseRecord(UInt16 index, UInt16 id); void IMuseDigital_initGlobals(); void IMuseDigital_releaseGlobals(); -void Simon_initGlobals(); -void Simon_releaseGlobals(); - void NewGui_initGlobals(); void NewGui_releaseGlobals(); -void Resource_initGlobals(); -void Resource_releaseGlobals(); - void Codec47_initGlobals(); void Codec47_releaseGlobals(); void Gfx_initGlobals(); -void Gfx_releaseGlobals();
\ No newline at end of file +void Gfx_releaseGlobals(); + +void Akos_initGlobals(); +void Akos_releaseGlobals(); + +void Dialogs_initGlobals(); +void Dialogs_releaseGlobals(); |