aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--backends/PalmOS/Rsc/builderrsc.h2
-rw-r--r--base/engine.cpp27
-rw-r--r--common/scummsys.h6
-rw-r--r--queen/display.cpp13
-rw-r--r--queen/resource.cpp6
-rw-r--r--scumm/debugger.cpp6
-rw-r--r--scumm/resource.cpp8
-rw-r--r--scumm/scumm.cpp7
-rw-r--r--simon/charset.cpp6
-rw-r--r--sword1/control.cpp6
10 files changed, 20 insertions, 67 deletions
diff --git a/backends/PalmOS/Rsc/builderrsc.h b/backends/PalmOS/Rsc/builderrsc.h
index e61b908669..ae91f3b924 100644
--- a/backends/PalmOS/Rsc/builderrsc.h
+++ b/backends/PalmOS/Rsc/builderrsc.h
@@ -3,7 +3,7 @@
// Header generated by Constructor for Palm OS (R) 1.9.1
//
-// Generated at 16:09:56 on jeudi 27 novembre 2003
+// Generated at 17:44:44 on mardi 16 mars 2004
//
// Generated for file: Builder.rsrc
//
diff --git a/base/engine.cpp b/base/engine.cpp
index e1a1ca4207..a75ff7d1b5 100644
--- a/base/engine.cpp
+++ b/base/engine.cpp
@@ -99,13 +99,8 @@ const char *Engine::getGameDataPath() const {
}
void NORETURN CDECL error(const char *s, ...) {
-#ifdef __PALM_OS__
- char buf_input[256]; // 1024 is too big overflow the stack
- char buf_output[256];
-#else
- char buf_input[1024];
- char buf_output[1024];
-#endif
+ char buf_input[STRINGBUFLEN];
+ char buf_output[STRINGBUFLEN];
va_list va;
va_start(va, s);
@@ -152,11 +147,7 @@ void NORETURN CDECL error(const char *s, ...) {
}
void CDECL warning(const char *s, ...) {
-#ifdef __PALM_OS__
- char buf[256]; // 1024 is too big overflow the stack
-#else
- char buf[1024];
-#endif
+ char buf[STRINGBUFLEN];
va_list va;
va_start(va, s);
@@ -183,11 +174,7 @@ void CDECL warning(const char *s, ...) {
}
void CDECL debug(int level, const char *s, ...) {
-#ifdef __PALM_OS__
- char buf[256]; // 1024 is too big overflow the stack
-#else
- char buf[1024];
-#endif
+ char buf[STRINGBUFLEN];
va_list va;
if (level > g_debugLevel)
@@ -215,11 +202,7 @@ void CDECL debug(int level, const char *s, ...) {
}
void CDECL debug(const char *s, ...) {
-#ifdef __PALM_OS__
- char buf[256]; // 1024 is too big overflow the stack
-#else
- char buf[1024];
-#endif
+ char buf[STRINGBUFLEN];
va_list va;
va_start(va, s);
diff --git a/common/scummsys.h b/common/scummsys.h
index e0c118fb4b..b3d0ec2dde 100644
--- a/common/scummsys.h
+++ b/common/scummsys.h
@@ -169,6 +169,8 @@
#include "globals.h"
#include "extend.h"
+ #define STRINGBUFLEN 256
+
#define __PALM_OS__
#define scumm_stricmp stricmp
#define scumm_strnicmp strnicmp
@@ -440,6 +442,10 @@ FORCEINLINE uint32 READ_BE_UINT24(const void *ptr) {
typedef int16 OverlayColor;
#endif
+#ifndef STRINGBUFLEN
+#define STRINGBUFLEN 1024
+#endif
+
/*
#if !defined(__PALM_OS__)
// Initialized operator new
diff --git a/queen/display.cpp b/queen/display.cpp
index fa1d71bf56..e0cddac165 100644
--- a/queen/display.cpp
+++ b/queen/display.cpp
@@ -28,6 +28,7 @@
#include "queen/resource.h"
#if defined(__PALM_OS__)
+#include "init_arm.h"
#include "arm/native.h"
#include "arm/macros.h"
#endif
@@ -52,18 +53,12 @@ Display::Display(QueenEngine *vm, OSystem *system)
initFont();
-#ifndef __PALM_OS__
_screenBuf = new uint8[SCREEN_W * SCREEN_H];
_panelBuf = new uint8[PANEL_W * PANEL_H];
_backdropBuf = new uint8[BACKDROP_W * BACKDROP_H];
memset(_screenBuf, 0, SCREEN_W * SCREEN_H);
memset(_panelBuf, 0, PANEL_W * PANEL_H);
memset(_backdropBuf, 0, BACKDROP_W * BACKDROP_H);
-#else
- _screenBuf = (uint8 *)calloc(SCREEN_W * SCREEN_H, sizeof(uint8));
- _panelBuf = (uint8 *)calloc(PANEL_W * PANEL_H, sizeof(uint8));
- _backdropBuf = (uint8 *)calloc(BACKDROP_W * BACKDROP_H, sizeof(uint8));
-#endif
_fullRefresh = 1;
_dirtyBlocksWidth = SCREEN_W / D_BLOCK_W;
@@ -85,15 +80,9 @@ Display::Display(QueenEngine *vm, OSystem *system)
}
Display::~Display() {
-#ifndef __PALM_OS__
delete[] _backdropBuf;
delete[] _panelBuf;
delete[] _screenBuf;
-#else
- free(_backdropBuf);
- free(_panelBuf);
- free(_screenBuf);
-#endif
delete[] _pal.room;
delete[] _pal.screen;
diff --git a/queen/resource.cpp b/queen/resource.cpp
index 5d8f170782..47e02dc89f 100644
--- a/queen/resource.cpp
+++ b/queen/resource.cpp
@@ -105,15 +105,13 @@ uint8 *Resource::loadFile(const char *filename, uint32 skipBytes, uint32 *size,
*size = sz;
}
byte *dstBuf;
-#ifndef __PALM_OS__
+
if (useMalloc) {
dstBuf = (byte *)malloc(sz);
} else {
dstBuf = new byte[sz];
}
-#else
- dstBuf = (byte *)calloc(sz, sizeof(byte));
-#endif
+
_resourceFile->seek(re->offset + skipBytes);
_resourceFile->read(dstBuf, sz);
return dstBuf;
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp
index 1d77d2bbe4..1abc6832ea 100644
--- a/scumm/debugger.cpp
+++ b/scumm/debugger.cpp
@@ -40,11 +40,7 @@ extern uint16 g_debugLevel;
namespace Scumm {
void CDECL debugC(int channel, const char *s, ...) {
-#ifdef __PALM_OS__
- char buf[256]; // 1024 is too big overflow the stack
-#else
- char buf[1024];
-#endif
+ char buf[STRINGBUFLEN];
va_list va;
// FIXME: Still spew all debug at -d9, for crashes in startup etc.
diff --git a/scumm/resource.cpp b/scumm/resource.cpp
index 54d967c280..724073b094 100644
--- a/scumm/resource.cpp
+++ b/scumm/resource.cpp
@@ -424,21 +424,13 @@ void ScummEngine::askForDisk(const char *filename, int disknum) {
result = displayMessage("Quit", buf);
if (!result) {
-#ifdef __PALM_OS__
error("Cannot find file: '%s'", filename);
-#else
- _system->quit();
-#endif
}
} else {
sprintf(buf, "Cannot find file: '%s'", filename);
InfoDialog dialog(this, (char*)buf);
runDialog(dialog);
-#ifdef __PALM_OS__
error("Cannot find file: '%s'", filename);
-#else
- _system->quit();
-#endif
}
}
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index 9207f19431..e880b47a0f 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -635,6 +635,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
_switchRoomEffect2 = 0;
_switchRoomEffect = 0;
_scrollBuffer = NULL;
+
_doEffect = false;
memset(&_flashlight, 0, sizeof(_flashlight));
_roomStrips = 0;
@@ -2482,11 +2483,7 @@ void ScummEngine::confirmrestartDialog() {
}
char ScummEngine::displayMessage(const char *altButton, const char *message, ...) {
-#ifdef __PALM_OS__
- char buf[256]; // 1024 is too big overflow the stack
-#else
- char buf[1024];
-#endif
+ char buf[STRINGBUFLEN];
va_list va;
va_start(va, message);
diff --git a/simon/charset.cpp b/simon/charset.cpp
index bb34a8bbe3..0323324431 100644
--- a/simon/charset.cpp
+++ b/simon/charset.cpp
@@ -218,11 +218,7 @@ void SimonEngine::render_string(uint vga_sprite_id, uint color, uint width, uint
}
void SimonEngine::showMessageFormat(const char *s, ...) {
-#ifndef __PALM_OS__
- char buf[1024];
-#else
- char buf[256];
-#endif
+ char buf[STRINGBUFLEN];
char *str;
va_list va;
diff --git a/sword1/control.cpp b/sword1/control.cpp
index 996c4bff63..eddb799e2f 100644
--- a/sword1/control.cpp
+++ b/sword1/control.cpp
@@ -698,11 +698,7 @@ void Control::readSavegameDescriptions(void) {
}
int Control::displayMessage(const char *altButton, const char *message, ...) {
-#ifdef __PALM_OS__
- char buf[256]; // 1024 is too big overflow the stack
-#else
- char buf[1024];
-#endif
+ char buf[STRINGBUFLEN];
va_list va;
va_start(va, message);