aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Apers2003-12-02 11:17:21 +0000
committerChris Apers2003-12-02 11:17:21 +0000
commitcf682ed8f7fb4325897b1692f40bbb9d073ed70e (patch)
tree646eb985337633087f79b1829931b7ea49e5dc8f
parent182285508d04ac581bd5255c8df17db6a30b6ef0 (diff)
downloadscummvm-rg350-cf682ed8f7fb4325897b1692f40bbb9d073ed70e.tar.gz
scummvm-rg350-cf682ed8f7fb4325897b1692f40bbb9d073ed70e.tar.bz2
scummvm-rg350-cf682ed8f7fb4325897b1692f40bbb9d073ed70e.zip
Added memory auto-configuration on PalmOS for better speed and compatibility
svn-id: r11472
-rw-r--r--scumm/scummvm.cpp12
-rw-r--r--simon/simon.cpp16
2 files changed, 21 insertions, 7 deletions
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index be19c99993..9e2c327f0a 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -55,6 +55,10 @@
#include "sound/mididrv.h"
#include "sound/mixer.h"
+#ifndef __PALM_OS__
+#include "globals.h"
+#endif
+
#ifdef MACOSX
#include <sys/types.h>
#include <sys/stat.h>
@@ -856,10 +860,10 @@ void ScummEngine::go() {
void ScummEngine::launch() {
#ifdef __PALM_OS__
- // revert to old value (450000) and make ScummVM works again in some devices with same problem as below.
- // 2500000 is too big and make ScummVM crashes : MemMove to NULL or immediate exit if try to allocate
- // memory with new operator
- _maxHeapThreshold = 450000;
+ if (_features & GF_NEW_COSTUMES)
+ _maxHeapThreshold = gVars->memory[kMemScummNewCostGames];
+ else
+ _maxHeapThreshold = gVars->memory[kMemScummOldCostGames];
#else
// Since the new costumes are very big, we increase the heap limit, to avoid having
// to constantly reload stuff from the data files.
diff --git a/simon/simon.cpp b/simon/simon.cpp
index e8d4fff924..2e65b2e91e 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -38,15 +38,17 @@
#include <errno.h>
#include <time.h>
-extern uint16 _debugLevel;
+#ifdef __PALM_OS__
+#include "globals.h"
+#endif
#ifdef _WIN32_WCE
-
extern bool toolbar_drawn;
extern bool draw_keyboard;
-
#endif
+extern uint16 _debugLevel;
+
static const GameSettings simon_settings[] = {
// Simon the Sorcerer 1 & 2 (not SCUMM games)
{"simon1acorn", "Simon the Sorcerer 1 (Acorn)", MDT_ADLIB | MDT_NATIVE, GAME_SIMON1ACORN, "DATA"},
@@ -201,7 +203,11 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
TABLE_INDEX_BASE = 1580 / 4;
TEXT_INDEX_BASE = 1500 / 4;
NUM_VIDEO_OP_CODES = 75;
+#ifndef __PALM_OS__
VGA_MEM_SIZE = 2000000;
+#else
+ VGA_MEM_SIZE = gVars->memory[kMemSimon2Games];
+#endif
TABLES_MEM_SIZE = 100000;
MUSIC_INDEX_BASE = 1128 / 4;
SOUND_INDEX_BASE = 1660 / 4;
@@ -210,7 +216,11 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
TABLE_INDEX_BASE = 1576 / 4;
TEXT_INDEX_BASE = 1460 / 4;
NUM_VIDEO_OP_CODES = 64;
+#ifndef __PALM_OS__
VGA_MEM_SIZE = 1000000;
+#else
+ VGA_MEM_SIZE = gVars->memory[kMemSimon1Games];
+#endif
TABLES_MEM_SIZE = 50000;
MUSIC_INDEX_BASE = 1316 / 4;
SOUND_INDEX_BASE = 0;