diff options
author | Chris Apers | 2003-08-18 10:59:21 +0000 |
---|---|---|
committer | Chris Apers | 2003-08-18 10:59:21 +0000 |
commit | a47e80cb55af9baff82c86c9e9751e876c83a915 (patch) | |
tree | de1d21ac1613bac022aebda8ba23fdcee4c907b9 /scumm | |
parent | 3c5f641f482ea799f59dcd3759d06bde1f57cff8 (diff) | |
download | scummvm-rg350-a47e80cb55af9baff82c86c9e9751e876c83a915.tar.gz scummvm-rg350-a47e80cb55af9baff82c86c9e9751e876c83a915.tar.bz2 scummvm-rg350-a47e80cb55af9baff82c86c9e9751e876c83a915.zip |
Updated globals access for PalmOS
svn-id: r9759
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/akos.cpp | 17 | ||||
-rw-r--r-- | scumm/bundle.cpp | 18 | ||||
-rw-r--r-- | scumm/charset.cpp | 33 | ||||
-rw-r--r-- | scumm/costume.cpp | 17 | ||||
-rw-r--r-- | scumm/dialogs.cpp | 25 | ||||
-rw-r--r-- | scumm/gfx.cpp | 15 | ||||
-rw-r--r-- | scumm/imuse_digi.cpp | 41 | ||||
-rw-r--r-- | scumm/smush/codec47.cpp | 16 |
8 files changed, 125 insertions, 57 deletions
diff --git a/scumm/akos.cpp b/scumm/akos.cpp index c9f1ed2078..c79f285d74 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -1366,11 +1366,14 @@ void Scumm::akos_queCommand(byte cmd, Actor *a, int param_1, int param_2) { } #ifdef __PALM_OS__ -#include "scumm_globals.h" // init globals -void Akos_initGlobals() { - GSETPTR(defaultScaleTable, GBVARS_DEFAULTSCALETABLE_INDEX, byte, GBVARS_SCUMM) -} -void Akos_releaseGlobals() { - GRELEASEPTR(GBVARS_DEFAULTSCALETABLE_INDEX, GBVARS_SCUMM) -} +#include "scumm_globals.h" + +_GINIT(Akos) +_GSETPTR(defaultScaleTable, GBVARS_DEFAULTSCALETABLE_INDEX, byte, GBVARS_SCUMM) +_GEND + +_GRELEASE(Akos) +_GRELEASEPTR(GBVARS_DEFAULTSCALETABLE_INDEX, GBVARS_SCUMM) +_GEND + #endif diff --git a/scumm/bundle.cpp b/scumm/bundle.cpp index 329929a4a9..f866ea0a98 100644 --- a/scumm/bundle.cpp +++ b/scumm/bundle.cpp @@ -23,6 +23,9 @@ #include "scumm/scumm.h" #include "scumm/bundle.h" +#ifdef __PALM_OS__ +static const int16 *imcTable; +#else static const int16 imcTable[] = { 0x0007, 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x0010, 0x0011, 0x0013, 0x0015, 0x0017, 0x0019, 0x001C, 0x001F, 0x0022, 0x0025, 0x0029, 0x002D, @@ -34,6 +37,7 @@ static const int16 imcTable[] = { 0x1706, 0x1954, 0x1BDC, 0x1EA5, 0x21B6, 0x2515, 0x28CA, 0x2CDF, 0x315B, 0x364B, 0x3BB9, 0x41B2, 0x4844, 0x4F7E, 0x5771, 0x602F, 0x69CE, 0x7462, 0x7FFF }; +#endif static const byte imxOtherTable[6][128] = { { @@ -91,6 +95,7 @@ const byte imxShortTable[] = { 0, 0, 1, 3, 7, 15, 31, 63 }; + Bundle::Bundle() { _compVoiceTable = NULL; _compMusicTable = NULL; @@ -938,3 +943,16 @@ int32 Bundle::decompressCodec(int32 codec, byte *comp_input, byte *comp_output, return output_size; } + +#ifdef __PALM_OS__ +#include "scumm_globals.h" + +_GINIT(Bundle) +_GSETPTR(imcTable, GBVARS_IMCTABLE_INDEX, int16, GBVARS_SCUMM) +_GEND + +_GRELEASE(Bundle) +_GRELEASEPTR(GBVARS_IMCTABLE_INDEX, GBVARS_SCUMM) +_GEND + +#endif diff --git a/scumm/charset.cpp b/scumm/charset.cpp index 040c166929..a51074d8cf 100644 --- a/scumm/charset.cpp +++ b/scumm/charset.cpp @@ -1301,19 +1301,22 @@ void CharsetRendererNut::printChar(int chr) { } #ifdef __PALM_OS__ -#include "scumm_globals.h" // init globals -void Charset_initGlobals() { - GSETPTR(germanCharsetDataV2, GBVARS_GERMANCHARSETDATAV2_INDEX, byte, GBVARS_SCUMM) - GSETPTR(frenchCharsetDataV2, GBVARS_FRENCHCHARSETDATAV2_INDEX, byte, GBVARS_SCUMM) - GSETPTR(englishCharsetDataV2, GBVARS_ENGLISHCHARSETDATAV2_INDEX, byte, GBVARS_SCUMM) - GSETPTR(italianCharsetDataV2, GBVARS_ITALIANCHARSETDATAV2_INDEX, byte, GBVARS_SCUMM) - GSETPTR(spanishCharsetDataV2, GBVARS_SPANISHCHARSETDATAV2_INDEX, byte, GBVARS_SCUMM) -} -void Charset_releaseGlobals() { - GRELEASEPTR(GBVARS_GERMANCHARSETDATAV2_INDEX, GBVARS_SCUMM) - GRELEASEPTR(GBVARS_FRENCHCHARSETDATAV2_INDEX, GBVARS_SCUMM) - GRELEASEPTR(GBVARS_ENGLISHCHARSETDATAV2_INDEX, GBVARS_SCUMM) - GRELEASEPTR(GBVARS_ITALIANCHARSETDATAV2_INDEX, GBVARS_SCUMM) - GRELEASEPTR(GBVARS_SPANISHCHARSETDATAV2_INDEX, GBVARS_SCUMM) -} +#include "scumm_globals.h" + +_GINIT(Charset) +_GSETPTR(germanCharsetDataV2, GBVARS_GERMANCHARSETDATAV2_INDEX, byte, GBVARS_SCUMM) +_GSETPTR(frenchCharsetDataV2, GBVARS_FRENCHCHARSETDATAV2_INDEX, byte, GBVARS_SCUMM) +_GSETPTR(englishCharsetDataV2, GBVARS_ENGLISHCHARSETDATAV2_INDEX, byte, GBVARS_SCUMM) +_GSETPTR(italianCharsetDataV2, GBVARS_ITALIANCHARSETDATAV2_INDEX, byte, GBVARS_SCUMM) +_GSETPTR(spanishCharsetDataV2, GBVARS_SPANISHCHARSETDATAV2_INDEX, byte, GBVARS_SCUMM) +_GEND + +_GRELEASE(Charset) +_GRELEASEPTR(GBVARS_GERMANCHARSETDATAV2_INDEX, GBVARS_SCUMM) +_GRELEASEPTR(GBVARS_FRENCHCHARSETDATAV2_INDEX, GBVARS_SCUMM) +_GRELEASEPTR(GBVARS_ENGLISHCHARSETDATAV2_INDEX, GBVARS_SCUMM) +_GRELEASEPTR(GBVARS_ITALIANCHARSETDATAV2_INDEX, GBVARS_SCUMM) +_GRELEASEPTR(GBVARS_SPANISHCHARSETDATAV2_INDEX, GBVARS_SCUMM) +_GEND + #endif diff --git a/scumm/costume.cpp b/scumm/costume.cpp index f19be6dc08..cf10e252b8 100644 --- a/scumm/costume.cpp +++ b/scumm/costume.cpp @@ -28,6 +28,9 @@ const byte revBitMask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 }; +#ifdef __PALM_OS__ +const byte *cost_scaleTable; +#else const byte cost_scaleTable[256] = { 0xFF, 0xFD, 0x7D, 0xBD, 0x3D, 0xDD, 0x5D, 0x9D, 0x1D, 0xED, 0x6D, 0xAD, 0x2D, 0xCD, 0x4D, 0x8D, @@ -62,6 +65,7 @@ const byte cost_scaleTable[256] = { 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE }; +#endif byte CostumeRenderer::mainRoutine(int xmoveCur, int ymoveCur) { int i, skip; @@ -844,3 +848,16 @@ bool Scumm::isCostumeInUse(int cost) const { return false; } + +#ifdef __PALM_OS__ +#include "scumm_globals.h" + +_GINIT(Costume) +_GSETPTR(cost_scaleTable, GBVARS_COSTSCALETABLE_INDEX, byte, GBVARS_SCUMM) +_GEND + +_GRELEASE(Costume) +_GRELEASEPTR(GBVARS_COSTSCALETABLE_INDEX, GBVARS_SCUMM) +_GEND + +#endif diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp index ba2b72d258..ebc90249b8 100644 --- a/scumm/dialogs.cpp +++ b/scumm/dialogs.cpp @@ -789,15 +789,18 @@ void KeysDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) { #endif #ifdef __PALM_OS__ -#include "scumm_globals.h" // init globals -void Dialogs_initGlobals() { - GSETPTR(string_map_table_v7, GBVARS_STRINGMAPTABLEV7_INDEX, ResString, GBVARS_SCUMM) - GSETPTR(string_map_table_v6, GBVARS_STRINGMAPTABLEV6_INDEX, ResString, GBVARS_SCUMM) - GSETPTR(string_map_table_v5, GBVARS_STRINGMAPTABLEV5_INDEX, ResString, GBVARS_SCUMM) -} -void Dialogs_releaseGlobals() { - GRELEASEPTR(GBVARS_STRINGMAPTABLEV7_INDEX, GBVARS_SCUMM) - GRELEASEPTR(GBVARS_STRINGMAPTABLEV6_INDEX, GBVARS_SCUMM) - GRELEASEPTR(GBVARS_STRINGMAPTABLEV5_INDEX, GBVARS_SCUMM) -} +#include "scumm_globals.h" + +_GINIT(Dialogs) +_GSETPTR(string_map_table_v7, GBVARS_STRINGMAPTABLEV7_INDEX, ResString, GBVARS_SCUMM) +_GSETPTR(string_map_table_v6, GBVARS_STRINGMAPTABLEV6_INDEX, ResString, GBVARS_SCUMM) +_GSETPTR(string_map_table_v5, GBVARS_STRINGMAPTABLEV5_INDEX, ResString, GBVARS_SCUMM) +_GEND + +_GRELEASE(Dialogs) +_GRELEASEPTR(GBVARS_STRINGMAPTABLEV7_INDEX, GBVARS_SCUMM) +_GRELEASEPTR(GBVARS_STRINGMAPTABLEV6_INDEX, GBVARS_SCUMM) +_GRELEASEPTR(GBVARS_STRINGMAPTABLEV5_INDEX, GBVARS_SCUMM) +_GEND + #endif diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index cb3afd8ded..2ed343bd54 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -3602,9 +3602,14 @@ void Scumm::makeCursorColorTransparent(int a) { #ifdef __PALM_OS__ -#include "scumm_globals.h" // init globals -void Gfx_initGlobals() { - GSETPTR(transitionEffects, GBVARS_TRANSITIONEFFECTS_INDEX, TransitionEffect, GBVARS_SCUMM) -} -void Gfx_releaseGlobals() { GRELEASEPTR(GBVARS_TRANSITIONEFFECTS_INDEX, GBVARS_SCUMM)} +#include "scumm_globals.h" + +_GINIT(Gfx) +_GSETPTR(transitionEffects, GBVARS_TRANSITIONEFFECTS_INDEX, TransitionEffect, GBVARS_SCUMM) +_GEND + +_GRELEASE(Gfx) +_GRELEASEPTR(GBVARS_TRANSITIONEFFECTS_INDEX, GBVARS_SCUMM) +_GEND + #endif diff --git a/scumm/imuse_digi.cpp b/scumm/imuse_digi.cpp index 114a2cf0e9..90f9f82334 100644 --- a/scumm/imuse_digi.cpp +++ b/scumm/imuse_digi.cpp @@ -1242,23 +1242,26 @@ int IMuseDigital::getSoundStatus(int sound) { #ifdef __PALM_OS__ -#include "scumm_globals.h" // init globals -void IMuseDigital_initGlobals() { - GSETPTR(_digStateMusicMap, GBVARS_DIGSTATEMUSICMAP_INDEX, imuse_music_map , GBVARS_SCUMM) - GSETPTR(_digStateMusicTable, GBVARS_DIGSTATEMUSICTABLE_INDEX, imuse_music_table , GBVARS_SCUMM) - GSETPTR(_comiStateMusicTable, GBVARS_COMISTATEMUSICTABLE_INDEX, imuse_music_table , GBVARS_SCUMM) - GSETPTR(_comiSeqMusicTable, GBVARS_COMISEQMUSICTABLE_INDEX, imuse_music_table , GBVARS_SCUMM) - GSETPTR(_digSeqMusicTable, GBVARS_DIGSEQMUSICTABLE_INDEX, imuse_music_table , GBVARS_SCUMM) - GSETPTR(_ftStateMusicTable, GBVARS_FTSTATEMUSICTABLE_INDEX, imuse_ft_music_table, GBVARS_SCUMM) - GSETPTR(_ftSeqMusicTable, GBVARS_FTSEQMUSICTABLE_INDEX, imuse_ft_music_table, GBVARS_SCUMM) -} -void IMuseDigital_releaseGlobals() { - GRELEASEPTR(GBVARS_DIGSTATEMUSICMAP_INDEX , GBVARS_SCUMM) - GRELEASEPTR(GBVARS_DIGSTATEMUSICTABLE_INDEX , GBVARS_SCUMM) - GRELEASEPTR(GBVARS_COMISTATEMUSICTABLE_INDEX , GBVARS_SCUMM) - GRELEASEPTR(GBVARS_COMISEQMUSICTABLE_INDEX , GBVARS_SCUMM) - GRELEASEPTR(GBVARS_DIGSEQMUSICTABLE_INDEX , GBVARS_SCUMM) - GRELEASEPTR(GBVARS_FTSTATEMUSICTABLE_INDEX , GBVARS_SCUMM) - GRELEASEPTR(GBVARS_FTSEQMUSICTABLE_INDEX , GBVARS_SCUMM) -} +#include "scumm_globals.h" + +_GINIT(IMuseDigital) +_GSETPTR(_digStateMusicMap, GBVARS_DIGSTATEMUSICMAP_INDEX, imuse_music_map , GBVARS_SCUMM) +_GSETPTR(_digStateMusicTable, GBVARS_DIGSTATEMUSICTABLE_INDEX, imuse_music_table , GBVARS_SCUMM) +_GSETPTR(_comiStateMusicTable, GBVARS_COMISTATEMUSICTABLE_INDEX, imuse_music_table , GBVARS_SCUMM) +_GSETPTR(_comiSeqMusicTable, GBVARS_COMISEQMUSICTABLE_INDEX, imuse_music_table , GBVARS_SCUMM) +_GSETPTR(_digSeqMusicTable, GBVARS_DIGSEQMUSICTABLE_INDEX, imuse_music_table , GBVARS_SCUMM) +_GSETPTR(_ftStateMusicTable, GBVARS_FTSTATEMUSICTABLE_INDEX, imuse_ft_music_table, GBVARS_SCUMM) +_GSETPTR(_ftSeqMusicTable, GBVARS_FTSEQMUSICTABLE_INDEX, imuse_ft_music_table, GBVARS_SCUMM) +_GEND + +_GRELEASE(IMuseDigital) +_GRELEASEPTR(GBVARS_DIGSTATEMUSICMAP_INDEX , GBVARS_SCUMM) +_GRELEASEPTR(GBVARS_DIGSTATEMUSICTABLE_INDEX , GBVARS_SCUMM) +_GRELEASEPTR(GBVARS_COMISTATEMUSICTABLE_INDEX , GBVARS_SCUMM) +_GRELEASEPTR(GBVARS_COMISEQMUSICTABLE_INDEX , GBVARS_SCUMM) +_GRELEASEPTR(GBVARS_DIGSEQMUSICTABLE_INDEX , GBVARS_SCUMM) +_GRELEASEPTR(GBVARS_FTSTATEMUSICTABLE_INDEX , GBVARS_SCUMM) +_GRELEASEPTR(GBVARS_FTSEQMUSICTABLE_INDEX , GBVARS_SCUMM) +_GEND + #endif diff --git a/scumm/smush/codec47.cpp b/scumm/smush/codec47.cpp index 4083528635..cacd1bd937 100644 --- a/scumm/smush/codec47.cpp +++ b/scumm/smush/codec47.cpp @@ -82,6 +82,9 @@ static int8 codec47_table_big2[] = { 0, 0, 0, 0, 1, 3, 4, 6, 7, 7, 7, 7, 6, 4, 3, 1, }; +#ifdef __PALM_OS__ +static int8 *codec47_table; +#else static int8 codec47_table[] = { 0, 0, -1, -43, 6, -43, -9, -42, 13, -41, -16, -40, 19, -39, -23, -36, 26, -34, -2, -33, @@ -135,6 +138,7 @@ static int8 codec47_table[] = { 23, 36, -19, 39, 16, 40, -13, 41, 9, 42, -6, 43, 1, 43, 0, 0, 0, 0, 0, 0 }; +#endif void Codec47Decoder::makeTablesInterpolation(int param) { int32 variable1, variable2; @@ -612,3 +616,15 @@ bool Codec47Decoder::decode(byte *dst, const byte *src) { return true; } +#ifdef __PALM_OS__ +#include "scumm_globals.h" + +_GINIT(Codec47) +_GSETPTR(codec47_table, GBVARS_CODEC47TABLE_INDEX, int8, GBVARS_SCUMM) +_GEND + +_GRELEASE(Codec47) +_GRELEASEPTR(GBVARS_CODEC47TABLE_INDEX, GBVARS_SCUMM) +_GEND + +#endif |