aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorChris Apers2003-11-12 16:00:11 +0000
committerChris Apers2003-11-12 16:00:11 +0000
commitde1e3baf41f60df4afe1d3b7eef2eb2fca00f3a2 (patch)
treeed16ba1c98374b58a51c1f6af57a4c34a409d94d /simon
parent0be0f0122693ae442a42a1139cf8512ad30327f0 (diff)
downloadscummvm-rg350-de1e3baf41f60df4afe1d3b7eef2eb2fca00f3a2.tar.gz
scummvm-rg350-de1e3baf41f60df4afe1d3b7eef2eb2fca00f3a2.tar.bz2
scummvm-rg350-de1e3baf41f60df4afe1d3b7eef2eb2fca00f3a2.zip
Preliminary support of Simon games on PalmOS
svn-id: r11269
Diffstat (limited to 'simon')
-rw-r--r--simon/charset.cpp39
-rw-r--r--simon/intern.h10
-rw-r--r--simon/simon.cpp63
3 files changed, 103 insertions, 9 deletions
diff --git a/simon/charset.cpp b/simon/charset.cpp
index a026235a3b..9592320f2a 100644
--- a/simon/charset.cpp
+++ b/simon/charset.cpp
@@ -285,6 +285,14 @@ void SimonEngine::video_putchar_newline(FillOrCopyStruct *fcs) {
fcs->textRow++;
}
+#ifdef __PALM_OS__
+static const byte *french_video_font;
+static const byte *german_video_font;
+static const byte *hebrew_video_font;
+static const byte *italian_video_font;
+static const byte *spanish_video_font;
+static const byte *video_font;
+#else
static const byte french_video_font[] = {
0, 0, 0, 0, 0, 0, 0, 0,
32, 112, 112, 32, 32, 0, 32, 0,
@@ -890,6 +898,7 @@ static const byte video_font[] = {
252, 252, 252, 252, 252, 252, 252, 252,
240, 240, 240, 240, 240, 240, 240, 240,
};
+#endif
void SimonEngine::video_putchar_drawchar(FillOrCopyStruct *fcs, uint x, uint y, byte chr) {
const byte *src;
@@ -934,3 +943,33 @@ void SimonEngine::video_putchar_drawchar(FillOrCopyStruct *fcs, uint x, uint y,
}
} // End of namespace Simon
+
+static const byte *french_video_font;
+static const byte *german_video_font;
+static const byte *hebrew_video_font;
+static const byte *italian_video_font;
+static const byte *spanish_video_font;
+static const byte *video_font;
+
+#ifdef __PALM_OS__
+#include "scumm_globals.h"
+
+_GINIT(Simon_Charset)
+_GSETPTR(Simon::french_video_font, GBVARS_FRENCHVIDEOFONT_INDEX, byte, GBVARS_SIMON)
+_GSETPTR(Simon::german_video_font, GBVARS_GERMANVIDEOFONT_INDEX, byte, GBVARS_SIMON)
+_GSETPTR(Simon::hebrew_video_font, GBVARS_HEBREWVIDEOFONT_INDEX, byte, GBVARS_SIMON)
+_GSETPTR(Simon::italian_video_font, GBVARS_ITALIANVIDEOFONT_INDEX, byte, GBVARS_SIMON)
+_GSETPTR(Simon::spanish_video_font, GBVARS_SPANISHVIDEOFONT_INDEX, byte, GBVARS_SIMON)
+_GSETPTR(Simon::video_font, GBVARS_VIDEOFONT_INDEX, byte, GBVARS_SIMON)
+_GEND
+
+_GRELEASE(Simon_Charset)
+_GRELEASEPTR(GBVARS_FRENCHVIDEOFONT_INDEX, GBVARS_SIMON)
+_GRELEASEPTR(GBVARS_GERMANVIDEOFONT_INDEX, GBVARS_SIMON)
+_GRELEASEPTR(GBVARS_HEBREWVIDEOFONT_INDEX, GBVARS_SIMON)
+_GRELEASEPTR(GBVARS_ITALIANVIDEOFONT_INDEX, GBVARS_SIMON)
+_GRELEASEPTR(GBVARS_SPANISHVIDEOFONT_INDEX, GBVARS_SIMON)
+_GRELEASEPTR(GBVARS_VIDEOFONT_INDEX, GBVARS_SIMON)
+_GEND
+
+#endif
diff --git a/simon/intern.h b/simon/intern.h
index b47b78ca14..be0ffbe564 100644
--- a/simon/intern.h
+++ b/simon/intern.h
@@ -127,6 +127,7 @@ struct GameSpecificSettings {
uint TABLES_MEM_SIZE;
uint MUSIC_INDEX_BASE;
uint SOUND_INDEX_BASE;
+#ifndef __PALM_OS__
const char *gme_filename;
const char *wav_filename;
const char *voc_filename;
@@ -134,6 +135,15 @@ struct GameSpecificSettings {
const char *voc_effects_filename;
const char *mp3_effects_filename;
const char *gamepc_filename;
+ #else
+ const char gme_filename[12];
+ const char wav_filename[12];
+ const char voc_filename[12];
+ const char mp3_filename[12];
+ const char voc_effects_filename[12];
+ const char mp3_effects_filename[12];
+ const char gamepc_filename[12];
+ #endif
};
} // End of namespace Simon
diff --git a/simon/simon.cpp b/simon/simon.cpp
index 55c9c0209c..fa60da5b0d 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -106,6 +106,17 @@ REGISTER_PLUGIN("Simon the Sorcerer", Engine_SIMON_gameList, Engine_SIMON_create
namespace Simon {
+#ifdef __PALM_OS__
+#define PTR(a) a
+static const GameSpecificSettings *simon1_settings;
+static const GameSpecificSettings *simon1acorn_settings;
+static const GameSpecificSettings *simon1amiga_settings;
+static const GameSpecificSettings *simon1demo_settings;
+static const GameSpecificSettings *simon2win_settings;
+static const GameSpecificSettings *simon2mac_settings;
+static const GameSpecificSettings *simon2dos_settings;
+#else
+#define PTR(a) &a;
static const GameSpecificSettings simon1_settings = {
1, // VGA_DELAY_BASE
1576 / 4, // TABLE_INDEX_BASE
@@ -231,7 +242,7 @@ static const GameSpecificSettings simon2dos_settings = {
"", // mp3_effects_filename
"GAME32", // gamepc_filename
};
-
+#endif
SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
: Engine(syst), midi (syst) {
@@ -242,19 +253,19 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
_game = (byte)detector->_game.features;
if (_game & GF_MAC)
- gss = &simon2mac_settings;
+ gss = PTR(simon2mac_settings);
else if ((_game & GF_SIMON2) && (_game & GF_TALKIE))
- gss = &simon2win_settings;
+ gss = PTR(simon2win_settings);
else if (_game & GF_SIMON2)
- gss = &simon2dos_settings;
+ gss = PTR(simon2dos_settings);
else if (_game & GF_ACORN)
- gss =&simon1acorn_settings;
+ gss =PTR(simon1acorn_settings);
else if (_game & GF_AMIGA)
- gss = &simon1amiga_settings;
+ gss = PTR(simon1amiga_settings);
else if (_game & GF_DEMO)
- gss = &simon1demo_settings;
+ gss = PTR(simon1demo_settings);
else
- gss = &simon1_settings;
+ gss = PTR(simon1_settings);
_key_pressed = 0;
@@ -3498,6 +3509,10 @@ void SimonEngine::processSpecialKeys() {
_key_pressed = 0;
}
+#ifdef __PALM_OS__
+static const byte *_simon1_cursor;
+static const byte **_simon2_cursors;
+#else
static const byte _simon1_cursor[256] = {
0xe1,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
0xe1,0xe1,0xe0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
@@ -3688,7 +3703,8 @@ static const byte _simon2_cursors[10][256] = {
0xff,0xff,0xff,0xff,0xff,0xe5,0xe9,0xec,0xe9,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xe5,0xe8,0xe9,0xe8,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,0xff,0xff,0xe5,0xe5,0xe5,0xff,0xff,0xff,0xff,0xff,0xff,0xff },
-};
+};
+#endif
void SimonEngine::draw_mouse_pointer() {
if (_game & GF_SIMON2)
@@ -5130,3 +5146,32 @@ byte SimonEngine::getByte() {
}
} // End of namespace Simon
+
+#ifdef __PALM_OS__
+#include "scumm_globals.h"
+
+_GINIT(Simon_Simon)
+_GSETPTR(Simon::simon1_settings, GBVARS_SIMON1SETTINGS_INDEX, Simon::GameSpecificSettings, GBVARS_SIMON)
+_GSETPTR(Simon::simon1acorn_settings, GBVARS_SIMON1ACORNSETTINGS_INDEX, Simon::GameSpecificSettings, GBVARS_SIMON)
+_GSETPTR(Simon::simon1amiga_settings, GBVARS_SIMON1AMIGASETTINGS_INDEX, Simon::GameSpecificSettings, GBVARS_SIMON)
+_GSETPTR(Simon::simon1demo_settings, GBVARS_SIMON1DEMOSETTINGS_INDEX, Simon::GameSpecificSettings, GBVARS_SIMON)
+_GSETPTR(Simon::simon2win_settings, GBVARS_SIMON2WINSETTINGS_INDEX, Simon::GameSpecificSettings, GBVARS_SIMON)
+_GSETPTR(Simon::simon2mac_settings, GBVARS_SIMON2MACSETTINGS_INDEX, Simon::GameSpecificSettings, GBVARS_SIMON)
+_GSETPTR(Simon::simon2dos_settings, GBVARS_SIMON2DOSSETTINGS_INDEX, Simon::GameSpecificSettings, GBVARS_SIMON)
+_GSETPTR(Simon::_simon1_cursor, GBVARS_SIMON1CURSOR_INDEX, byte, GBVARS_SIMON)
+_GSETPTR(Simon::_simon2_cursors, GBVARS_SIMON2CURSORS_INDEX, const byte*, GBVARS_SIMON)
+_GEND
+
+_GRELEASE(Simon_Simon)
+_GRELEASEPTR(GBVARS_SIMON1SETTINGS_INDEX, GBVARS_SIMON)
+_GRELEASEPTR(GBVARS_SIMON1ACORNSETTINGS_INDEX, GBVARS_SIMON)
+_GRELEASEPTR(GBVARS_SIMON1AMIGASETTINGS_INDEX, GBVARS_SIMON)
+_GRELEASEPTR(GBVARS_SIMON1DEMOSETTINGS_INDEX, GBVARS_SIMON)
+_GRELEASEPTR(GBVARS_SIMON2WINSETTINGS_INDEX, GBVARS_SIMON)
+_GRELEASEPTR(GBVARS_SIMON2MACSETTINGS_INDEX, GBVARS_SIMON)
+_GRELEASEPTR(GBVARS_SIMON2DOSSETTINGS_INDEX, GBVARS_SIMON)
+_GRELEASEPTR(GBVARS_SIMON1CURSOR_INDEX, GBVARS_SIMON)
+_GRELEASEPTR(GBVARS_SIMON2CURSORS_INDEX, GBVARS_SIMON)
+_GEND
+
+#endif