aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/agos/midiparser_s1d.cpp38
-rw-r--r--engines/cine/anim.cpp60
-rw-r--r--engines/cine/cine.cpp13
-rw-r--r--engines/cine/cine.h2
-rw-r--r--engines/cine/console.cpp2
-rw-r--r--engines/cine/gfx.cpp87
-rw-r--r--engines/cine/gfx.h3
-rw-r--r--engines/cine/main_loop.cpp28
-rw-r--r--engines/cine/object.cpp2
-rw-r--r--engines/cine/pal.cpp3
-rw-r--r--engines/cine/part.cpp2
-rw-r--r--engines/cine/saveload.cpp2
-rw-r--r--engines/cine/saveload.h2
-rw-r--r--engines/cine/script_fw.cpp1584
-rw-r--r--engines/cine/sound.cpp8
-rw-r--r--engines/cine/texte.cpp2
-rw-r--r--engines/cine/texte.h2
-rw-r--r--engines/cine/various.cpp218
-rw-r--r--engines/parallaction/sound_br.cpp26
-rw-r--r--engines/sci/sound/midiparser_sci.cpp80
-rw-r--r--engines/sci/sound/midiparser_sci.h2
-rw-r--r--engines/scumm/midiparser_ro.cpp16
-rw-r--r--engines/tony/custom.cpp813
-rw-r--r--engines/tony/custom.h18
-rw-r--r--engines/tony/font.cpp59
-rw-r--r--engines/tony/game.cpp1
-rw-r--r--engines/tony/gfxengine.cpp33
-rw-r--r--engines/tony/mpal/mpal.cpp28
-rw-r--r--engines/wintermute/readme.txt155
29 files changed, 1536 insertions, 1753 deletions
diff --git a/engines/agos/midiparser_s1d.cpp b/engines/agos/midiparser_s1d.cpp
index 9ca87436fc..54f0e9e03b 100644
--- a/engines/agos/midiparser_s1d.cpp
+++ b/engines/agos/midiparser_s1d.cpp
@@ -35,7 +35,7 @@ namespace AGOS {
class MidiParser_S1D : public MidiParser {
private:
byte *_data;
- bool _no_delta;
+ bool _noDelta;
struct Loop {
uint16 timer;
@@ -49,7 +49,7 @@ protected:
void resetTracking();
public:
- MidiParser_S1D() : _data(0), _no_delta(false) {}
+ MidiParser_S1D() : _data(0), _noDelta(false) {}
bool loadMusic(byte *data, uint32 size);
};
@@ -75,14 +75,14 @@ void MidiParser_S1D::chainEvent(EventInfo &info) {
}
void MidiParser_S1D::parseNextEvent(EventInfo &info) {
- info.start = _position._play_pos;
+ info.start = _position._playPos;
info.length = 0;
- info.delta = _no_delta ? 0 : readVLQ2(_position._play_pos);
- _no_delta = false;
+ info.delta = _noDelta ? 0 : readVLQ2(_position._playPos);
+ _noDelta = false;
- info.event = *_position._play_pos++;
+ info.event = *_position._playPos++;
if (!(info.event & 0x80)) {
- _no_delta = true;
+ _noDelta = true;
info.event |= 0x80;
}
@@ -94,34 +94,34 @@ void MidiParser_S1D::parseNextEvent(EventInfo &info) {
} else {
switch (info.command()) {
case 0x8: // note off
- info.basic.param1 = *_position._play_pos++;
+ info.basic.param1 = *_position._playPos++;
info.basic.param2 = 0;
break;
case 0x9: // note on
- info.basic.param1 = *_position._play_pos++;
- info.basic.param2 = *_position._play_pos++;
+ info.basic.param1 = *_position._playPos++;
+ info.basic.param2 = *_position._playPos++;
break;
case 0xA: { // loop control
// In case the stop mode(?) is set to 0x80 this will stop the
// track over here.
- const int16 loopIterations = int8(*_position._play_pos++);
+ const int16 loopIterations = int8(*_position._playPos++);
if (!loopIterations) {
- _loops[info.channel()].start = _position._play_pos;
+ _loops[info.channel()].start = _position._playPos;
} else {
if (!_loops[info.channel()].timer) {
if (_loops[info.channel()].start) {
_loops[info.channel()].timer = uint16(loopIterations);
- _loops[info.channel()].end = _position._play_pos;
+ _loops[info.channel()].end = _position._playPos;
// Go to the start of the loop
- _position._play_pos = _loops[info.channel()].start;
+ _position._playPos = _loops[info.channel()].start;
}
} else {
if (_loops[info.channel()].timer)
- _position._play_pos = _loops[info.channel()].start;
+ _position._playPos = _loops[info.channel()].start;
--_loops[info.channel()].timer;
}
}
@@ -141,13 +141,13 @@ void MidiParser_S1D::parseNextEvent(EventInfo &info) {
break;
case 0xC: // program change
- info.basic.param1 = *_position._play_pos++;
+ info.basic.param1 = *_position._playPos++;
info.basic.param2 = 0;
break;
case 0xD: // jump to loop end
if (_loops[info.channel()].end)
- _position._play_pos = _loops[info.channel()].end;
+ _position._playPos = _loops[info.channel()].end;
// We need to read the next midi event here. Since we can not
// safely pass this event to the MIDI event processing.
@@ -178,7 +178,7 @@ bool MidiParser_S1D::loadMusic(byte *data, uint32 size) {
pos += 1;
// And now we're at the actual data. Only one track.
- _num_tracks = 1;
+ _numTracks = 1;
_data = pos;
_tracks[0] = pos;
@@ -194,7 +194,7 @@ bool MidiParser_S1D::loadMusic(byte *data, uint32 size) {
void MidiParser_S1D::resetTracking() {
MidiParser::resetTracking();
// The first event never contains any delta.
- _no_delta = true;
+ _noDelta = true;
memset(_loops, 0, sizeof(_loops));
}
diff --git a/engines/cine/anim.cpp b/engines/cine/anim.cpp
index 60168831a1..9b2103687d 100644
--- a/engines/cine/anim.cpp
+++ b/engines/cine/anim.cpp
@@ -202,13 +202,13 @@ AnimData::AnimData(const AnimData &src) : _width(src._width),
if (src._data) {
_data = new byte[_size];
assert(_data);
- memcpy(_data, src._data, _size*sizeof(byte));
+ memcpy(_data, src._data, _size * sizeof(byte));
}
if (src._mask) {
_mask = new byte[_size];
assert(_mask);
- memcpy(_mask, src._mask, _size*sizeof(byte));
+ memcpy(_mask, src._mask, _size * sizeof(byte));
}
memset(_name, 0, sizeof(_name));
@@ -272,8 +272,7 @@ byte AnimData::getColor(int x, int y) {
* @param transparent Transparent color (for ANIM_MASKSPRITE)
*/
void AnimData::load(byte *d, int type, uint16 w, uint16 h, int16 file,
- int16 frame, const char *n, byte transparent) {
-
+ int16 frame, const char *n, byte transparent) {
assert(d);
if (_data) {
@@ -299,7 +298,7 @@ void AnimData::load(byte *d, int type, uint16 w, uint16 h, int16 file,
_size = w * h;
_data = new byte[_size];
assert(_data);
- memcpy(_data, d, _size*sizeof(byte));
+ memcpy(_data, d, _size * sizeof(byte));
break;
case ANIM_MASK:
@@ -546,9 +545,10 @@ int loadSpl(const char *resourceName, int16 idx) {
* Load 1bpp mask
* @param resourceName Mask filename
* @param idx Target index in animDataTable (-1 if any empty space will do)
+ * @param frameIndex frame of animation to load (-1 for all frames)
* @return The number of the animDataTable entry after the loaded mask (-1 if error)
*/
-int loadMsk(const char *resourceName, int16 idx) {
+int loadMsk(const char *resourceName, int16 idx, int16 frameIndex) {
int16 foundFileIdx = findFileInBundle(resourceName);
if (foundFileIdx < 0) {
return -1;
@@ -563,9 +563,18 @@ int loadMsk(const char *resourceName, int16 idx) {
loadAnimHeader(animHeader, readS);
ptr = dataPtr + 0x16;
+ int16 startFrame = 0;
+ int16 endFrame = animHeader.numFrames;
+
+ if (frameIndex >= 0) {
+ startFrame = frameIndex;
+ endFrame = frameIndex + 1;
+ ptr += frameIndex * animHeader.frameWidth * animHeader.frameHeight;
+ }
+
entry = idx < 0 ? emptyAnimSpace() : idx;
assert(entry >= 0);
- for (int16 i = 0; i < animHeader.numFrames; i++, entry++) {
+ for (int16 i = startFrame; i < endFrame; i++, entry++) {
g_cine->_animDataTable[entry].load(ptr, ANIM_MASK, animHeader.frameWidth, animHeader.frameHeight, foundFileIdx, i, currentPartName);
ptr += animHeader.frameWidth * animHeader.frameHeight;
}
@@ -578,9 +587,10 @@ int loadMsk(const char *resourceName, int16 idx) {
* Load animation
* @param resourceName Animation filename
* @param idx Target index in animDataTable (-1 if any empty space will do)
+ * @param frameIndex frame of animation to load (-1 for all frames)
* @return The number of the animDataTable entry after the loaded animation (-1 if error)
*/
-int loadAni(const char *resourceName, int16 idx) {
+int loadAni(const char *resourceName, int16 idx, int16 frameIndex) {
int16 foundFileIdx = findFileInBundle(resourceName);
if (foundFileIdx < 0) {
return -1;
@@ -596,6 +606,15 @@ int loadAni(const char *resourceName, int16 idx) {
loadAnimHeader(animHeader, readS);
ptr = dataPtr + 0x16;
+ int16 startFrame = 0;
+ int16 endFrame = animHeader.numFrames;
+
+ if (frameIndex >= 0) {
+ startFrame = frameIndex;
+ endFrame = frameIndex + 1;
+ ptr += frameIndex * animHeader.frameWidth * animHeader.frameHeight;
+ }
+
transparentColor = getAnimTransparentColor(resourceName);
// TODO: Merge this special case hack into getAnimTransparentColor somehow.
@@ -609,7 +628,7 @@ int loadAni(const char *resourceName, int16 idx) {
entry = idx < 0 ? emptyAnimSpace() : idx;
assert(entry >= 0);
- for (int16 i = 0; i < animHeader.numFrames; i++, entry++) {
+ for (int16 i = startFrame; i < endFrame; i++, entry++) {
// special case transparency handling
if (!strcmp(resourceName, "L2202.ANI")) {
transparentColor = i < 2 ? 0 : 7;
@@ -669,13 +688,13 @@ void convert8BBP2(byte *dest, byte *source, int16 width, int16 height) {
*(source + k) <<= 1;
if (k > 0 + m)
color <<= 1;
- } // end k
+ } // end k
*(dest++) = color;
- } // end i
- } // end m
+ } // end i
+ } // end m
source += 0x10;
- } // end j
+ } // end j
}
/**
@@ -685,7 +704,7 @@ void convert8BBP2(byte *dest, byte *source, int16 width, int16 height) {
* @param frameIndex frame of animation to load (-1 for all frames)
* @return The number of the animDataTable entry after the loaded image set (-1 if error)
*/
-int loadSet(const char *resourceName, int16 idx, int16 frameIndex =-1 ) {
+int loadSet(const char *resourceName, int16 idx, int16 frameIndex = -1) {
AnimHeader2Struct header2;
uint16 numSpriteInAnim;
int16 foundFileIdx = findFileInBundle(resourceName);
@@ -712,10 +731,9 @@ int loadSet(const char *resourceName, int16 idx, int16 frameIndex =-1 ) {
int16 startFrame = 0;
int16 endFrame = numSpriteInAnim;
- if(frameIndex>=0)
- {
+ if (frameIndex >= 0) {
startFrame = frameIndex;
- endFrame = frameIndex+1;
+ endFrame = frameIndex + 1;
ptr += 0x10 * frameIndex;
}
@@ -766,7 +784,7 @@ int loadSeq(const char *resourceName, int16 idx) {
byte *dataPtr = readBundleFile(foundFileIdx);
int entry = idx < 0 ? emptyAnimSpace() : idx;
- g_cine->_animDataTable[entry].load(dataPtr+0x16, ANIM_RAW, g_cine->_partBuffer[foundFileIdx].unpackedSize-0x16, 1, foundFileIdx, 0, currentPartName);
+ g_cine->_animDataTable[entry].load(dataPtr + 0x16, ANIM_RAW, g_cine->_partBuffer[foundFileIdx].unpackedSize - 0x16, 1, foundFileIdx, 0, currentPartName);
free(dataPtr);
return entry + 1;
}
@@ -783,11 +801,11 @@ int loadResource(const char *resourceName, int16 idx, int16 frameIndex) {
if (strstr(resourceName, ".SPL")) {
result = loadSpl(resourceName, idx);
} else if (strstr(resourceName, ".MSK")) {
- result = loadMsk(resourceName, idx);
+ result = loadMsk(resourceName, idx, frameIndex);
} else if (strstr(resourceName, ".ANI")) {
- result = loadAni(resourceName, idx);
+ result = loadAni(resourceName, idx, frameIndex);
} else if (strstr(resourceName, ".ANM")) {
- result = loadAni(resourceName, idx);
+ result = loadAni(resourceName, idx, frameIndex);
} else if (strstr(resourceName, ".SET")) {
result = loadSet(resourceName, idx, frameIndex);
} else if (strstr(resourceName, ".SEQ")) {
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index bbe2cd4896..aa7221f733 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -189,7 +189,18 @@ void CineEngine::initialize() {
g_cine->_messageTable.clear();
resetObjectTable();
- disableSystemMenu = 1;
+ if (getGameType() == Cine::GType_OS) {
+ disableSystemMenu = 1;
+ } else {
+ // WORKAROUND: We do not save this variable in FW's savegames.
+ // Initializing this to 1, like we do it in the OS case, will
+ // cause the menu disabled when loading from the launcher or
+ // command line.
+ // A proper fix here would be to save this variable in FW's saves.
+ // Since it seems these are unversioned so far, there would be need
+ // to properly add versioning to them first.
+ disableSystemMenu = 0;
+ }
var8 = 0;
diff --git a/engines/cine/cine.h b/engines/cine/cine.h
index 55376dce29..47edf51c30 100644
--- a/engines/cine/cine.h
+++ b/engines/cine/cine.h
@@ -159,7 +159,7 @@ private:
bool _preLoad;
int _timerDelayMultiplier;
- public:
+public:
// TODO: These are pseudo-global vars
// They better belong to appropriate classes
Common::Array<AnimData> _animDataTable;
diff --git a/engines/cine/console.cpp b/engines/cine/console.cpp
index 0a24b2408a..4af28592e7 100644
--- a/engines/cine/console.cpp
+++ b/engines/cine/console.cpp
@@ -28,7 +28,7 @@ namespace Cine {
bool labyrinthCheat;
CineConsole::CineConsole(CineEngine *vm) : GUI::Debugger(), _vm(vm) {
- DCmd_Register("labyrinthCheat", WRAP_METHOD(CineConsole, Cmd_LabyrinthCheat));
+ DCmd_Register("labyrinthCheat", WRAP_METHOD(CineConsole, Cmd_LabyrinthCheat));
labyrinthCheat = false;
}
diff --git a/engines/cine/gfx.cpp b/engines/cine/gfx.cpp
index 7a988227f6..636c0cf8d9 100644
--- a/engines/cine/gfx.cpp
+++ b/engines/cine/gfx.cpp
@@ -113,7 +113,7 @@ FWRenderer::FWRenderer() : _background(NULL), _backupPal(), _cmd(""),
assert(_backBuffer);
memset(_backBuffer, 0, _screenSize);
- memset(_bgName, 0, sizeof (_bgName));
+ memset(_bgName, 0, sizeof(_bgName));
}
@@ -249,7 +249,7 @@ void FWRenderer::drawCommand() {
unsigned int i;
int x = 10, y = _cmdY;
- if(disableSystemMenu == 0) {
+ if (disableSystemMenu == 0) {
drawPlainBox(x, y, 301, 11, 0);
drawBorder(x - 1, y - 1, 302, 12, 2);
@@ -307,7 +307,7 @@ void FWRenderer::drawMessage(const char *str, int x, int y, int width, int color
i++;
line = fitLine(str + i, tw, words, cw);
- if ( str[i + line] != '\0' && str[i + line] != 0x7C && words) {
+ if (str[i + line] != '\0' && str[i + line] != 0x7C && words) {
space = (tw - cw) / words;
extraSpace = (tw - cw) % words;
} else {
@@ -471,6 +471,41 @@ int FWRenderer::drawChar(char character, int x, int y) {
return x;
}
+/**
+ * Clears the character glyph to black
+ * This function is called "undrawChar", because the original only applies
+ * this drawing after the original glyph has been drawn.
+ * Possible TODO: Find a better name.
+ * @param character Character to undraw
+ * @param x Character coordinate
+ * @param y Character coordinate
+ */
+int FWRenderer::undrawChar(char character, int x, int y) {
+ int width, idx;
+
+ if (character == ' ') {
+ x += 5;
+ } else if ((width = g_cine->_textHandler.fontParamTable[(unsigned char)character].characterWidth)) {
+ idx = g_cine->_textHandler.fontParamTable[(unsigned char)character].characterIdx;
+ const byte *sprite = g_cine->_textHandler.textTable[idx][FONT_DATA];
+ for (uint i = 0; i < FONT_HEIGHT; ++i) {
+ byte *dst = _backBuffer + (y + i) * 320 + x;
+ for (uint j = 0; j < FONT_WIDTH; ++j, ++dst) {
+ // The original does this based on whether bit 1 of the pixel
+ // is set. Since that's the only bit ever set in (FW) this
+ // check should be fine.
+ // TODO: Check how Operation Stealth Amiga works
+ if (*sprite++) {
+ *dst = 0;
+ }
+ }
+ }
+ x += width + 1;
+ }
+
+ return x;
+}
+
int FWRenderer::getStringWidth(const char *str) {
const char *p = str;
int width = 0;
@@ -969,20 +1004,29 @@ void SelectionMenu::drawMenu(FWRenderer &r, bool top) {
charX = x + 4;
if (i == _selection) {
+ int color;
+
if (isAmiga) {
- // The original Amiga version is using a different highlight color here,
- // but with our current code it is not possible to change the text color,
- // thus we can not use the Amiga's color, since otherwise the text
- // wouldn't be visible anymore.
- r.drawPlainBox(charX, lineY, _width - 8, FONT_HEIGHT, top ? r._messageBg/*2*/ : 18);
+ if (top) {
+ color = 2;
+ } else {
+ color = 18;
+ }
} else {
- r.drawPlainBox(charX, lineY, _width - 8, 9, 0);
+ color = 0;
}
+
+ r.drawPlainBox(x + 2, lineY - 1, _width - 3, 9, color);
}
const int size = _elements[i].size();
- for (int j = 0; j < size; ++j)
- charX = r.drawChar(_elements[i][j], charX, lineY);
+ for (int j = 0; j < size; ++j) {
+ if (isAmiga && i == _selection) {
+ charX = r.undrawChar(_elements[i][j], charX, lineY);
+ } else {
+ charX = r.drawChar(_elements[i][j], charX, lineY);
+ }
+ }
}
}
@@ -1244,6 +1288,7 @@ void OSRenderer::renderOverlay(const Common::List<overlay>::iterator &it) {
sprite = &g_cine->_animDataTable[g_cine->_objectTable[it->objIdx].frame];
drawSprite(&(*it), sprite->data(), sprite->_realWidth, sprite->_height, _backBuffer, g_cine->_objectTable[it->objIdx].x, g_cine->_objectTable[it->objIdx].y, g_cine->_objectTable[it->objIdx].part, sprite->_bpp);
break;
+
// game message
case 2:
if (it->objIdx >= g_cine->_messageTable.size()) {
@@ -1300,7 +1345,7 @@ void OSRenderer::renderOverlay(const Common::List<overlay>::iterator &it) {
height = obj->costume;
drawPlainBox(obj->x, obj->y, width, height, color);
debug(5, "renderOverlay: type=%d, x=%d, y=%d, width=%d, height=%d, color=%d",
- it->type, obj->x, obj->y, width, height, color);
+ it->type, obj->x, obj->y, width, height, color);
break;
// something else
@@ -1424,7 +1469,7 @@ void OSRenderer::selectBg(unsigned int idx) {
if (_bgTable[idx].bg) {
assert(_bgTable[idx].pal.isValid() && !(_bgTable[idx].pal.empty()));
- _currentBg = idx;
+ _currentBg = idx;
} else
warning("OSRenderer::selectBg(%d) - attempt to select null background", idx);
reloadPalette();
@@ -1750,23 +1795,23 @@ void OSRenderer::drawSprite(overlay *overlayPtr, const byte *spritePtr, int16 wi
// draw the mask based on next objects in the list
Common::List<overlay>::iterator it;
- for (it = g_cine->_overlayList.begin(); it != g_cine->_overlayList.end(); ++it) {
- if(&(*it) == overlayPtr) {
+ for (it = g_cine->_overlayList.begin(); it != g_cine->_overlayList.end(); ++it) {
+ if (&(*it) == overlayPtr) {
break;
}
}
- while(it != g_cine->_overlayList.end()) {
+ while (it != g_cine->_overlayList.end()) {
overlay *pCurrentOverlay = &(*it);
if ((pCurrentOverlay->type == 5) || ((pCurrentOverlay->type == 21) && (pCurrentOverlay->x == overlayPtr->objIdx))) {
AnimData *sprite = &g_cine->_animDataTable[g_cine->_objectTable[it->objIdx].frame];
if (pMask == NULL) {
- pMask = new byte[width*height];
+ pMask = new byte[width * height];
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
- byte spriteColor= spritePtr[width * i + j];
+ byte spriteColor = spritePtr[width * i + j];
pMask[width * i + j] = spriteColor;
}
}
@@ -1777,7 +1822,7 @@ void OSRenderer::drawSprite(overlay *overlayPtr, const byte *spritePtr, int16 wi
int inMaskX = (g_cine->_objectTable[it->objIdx].x + i) - x;
int inMaskY = (g_cine->_objectTable[it->objIdx].y + j) - y;
- if (inMaskX >=0 && inMaskX < width) {
+ if (inMaskX >= 0 && inMaskX < width) {
if (inMaskY >= 0 && inMaskY < height) {
if (sprite->_bpp == 1) {
if (!sprite->getColor(i, j)) {
@@ -1793,7 +1838,7 @@ void OSRenderer::drawSprite(overlay *overlayPtr, const byte *spritePtr, int16 wi
}
// now, draw with the mask we created
- if(pMask) {
+ if (pMask) {
spritePtr = pMask;
}
@@ -1808,7 +1853,7 @@ void OSRenderer::drawSprite(overlay *overlayPtr, const byte *spritePtr, int16 wi
destPtr += i * 320;
for (int j = 0; j < width; j++) {
- byte color= *(spritePtr++);
+ byte color = *(spritePtr++);
if ((transparentColor != color) && x + j >= 0 && x + j < 320 && i + y >= 0 && i + y < 200) {
*(destPtr++) = color;
} else {
diff --git a/engines/cine/gfx.h b/engines/cine/gfx.h
index 3434cf9fc2..8b8843fd72 100644
--- a/engines/cine/gfx.h
+++ b/engines/cine/gfx.h
@@ -152,6 +152,7 @@ protected:
void drawBorder(int x, int y, int width, int height, byte color);
void drawDoubleBorder(int x, int y, int width, int height, byte color);
virtual int drawChar(char character, int x, int y);
+ virtual int undrawChar(char character, int x, int y);
void drawLine(int x, int y, int width, int height, byte color);
void remaskSprite(byte *mask, Common::List<overlay>::iterator it);
virtual void drawBackground();
@@ -287,7 +288,7 @@ byte gfxGetColor(int16 x, int16 y, const byte *ptr, int16 width);
void gfxResetRawPage(byte *pageRaw);
void gfxConvertSpriteToRaw(byte *dst, const byte *src, uint16 w, uint16 h);
-void gfxCopyRawPage(byte *source, byte * dest);
+void gfxCopyRawPage(byte *source, byte *dest);
void gfxFlipRawPage(byte *frontBuffer);
void drawSpriteRaw(const byte *spritePtr, const byte *maskPtr, int16 width, int16 height, byte *page, int16 x, int16 y);
void gfxDrawPlainBoxRaw(int16 x1, int16 y1, int16 x2, int16 y2, byte color, byte *page);
diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp
index f13f38a45e..c3eb78edb5 100644
--- a/engines/cine/main_loop.cpp
+++ b/engines/cine/main_loop.cpp
@@ -180,19 +180,19 @@ static void processEvent(Common::Event &event) {
case Common::KEYCODE_F11:
renderer->showCollisionPage(false);
break;
- case Common::KEYCODE_KP5: // Emulated left mouse button click
- case Common::KEYCODE_LEFT: // Left
- case Common::KEYCODE_KP4: // Left
+ case Common::KEYCODE_KP5: // Emulated left mouse button click
+ case Common::KEYCODE_LEFT: // Left
+ case Common::KEYCODE_KP4: // Left
case Common::KEYCODE_RIGHT: // Right
- case Common::KEYCODE_KP6: // Right
- case Common::KEYCODE_UP: // Up
- case Common::KEYCODE_KP8: // Up
- case Common::KEYCODE_DOWN: // Down
- case Common::KEYCODE_KP2: // Down
- case Common::KEYCODE_KP9: // Up & Right
- case Common::KEYCODE_KP7: // Up & Left
- case Common::KEYCODE_KP1: // Down & Left
- case Common::KEYCODE_KP3: // Down & Right
+ case Common::KEYCODE_KP6: // Right
+ case Common::KEYCODE_UP: // Up
+ case Common::KEYCODE_KP8: // Up
+ case Common::KEYCODE_DOWN: // Down
+ case Common::KEYCODE_KP2: // Down
+ case Common::KEYCODE_KP9: // Up & Right
+ case Common::KEYCODE_KP7: // Up & Left
+ case Common::KEYCODE_KP1: // Down & Left
+ case Common::KEYCODE_KP3: // Down & Right
// Stop ego movement made with keyboard when releasing a known key
moveUsingKeyboard(0, 0);
break;
@@ -434,9 +434,9 @@ void CineEngine::mainLoop(int bootScriptIdx) {
hideMouse();
g_sound->stopMusic();
- // if (g_cine->getGameType() == Cine::GType_OS) {
+ //if (g_cine->getGameType() == Cine::GType_OS) {
// freeUnkList();
- // }
+ //}
closePart();
}
diff --git a/engines/cine/object.cpp b/engines/cine/object.cpp
index afd95c04b0..a75828abb1 100644
--- a/engines/cine/object.cpp
+++ b/engines/cine/object.cpp
@@ -59,7 +59,7 @@ void loadObject(char *pObjectName) {
assert(numEntry <= NUM_MAX_OBJECT);
for (i = 0; i < numEntry; i++) {
- if (g_cine->_objectTable[i].costume != -2 && g_cine->_objectTable[i].costume != -3) { // flag is keep ?
+ if (g_cine->_objectTable[i].costume != -2 && g_cine->_objectTable[i].costume != -3) { // flag is keep?
Common::MemoryReadStream readS(ptr, entrySize);
g_cine->_objectTable[i].x = readS.readSint16BE();
diff --git a/engines/cine/pal.cpp b/engines/cine/pal.cpp
index 779c279ea1..10077ecdc9 100644
--- a/engines/cine/pal.cpp
+++ b/engines/cine/pal.cpp
@@ -92,7 +92,8 @@ void loadRelatedPalette(const char *fileName) {
paletteIndex = findPaletteFromName(localName);
if (paletteIndex == -1) {
- for (i = 0; i < 16; i++) { // generate default palette
+ // generate default palette
+ for (i = 0; i < 16; i++) {
paletteBuffer1[i] = paletteBuffer2[i] = (i << 4) + i;
}
} else {
diff --git a/engines/cine/part.cpp b/engines/cine/part.cpp
index 03cb743b46..813cbe50af 100644
--- a/engines/cine/part.cpp
+++ b/engines/cine/part.cpp
@@ -263,7 +263,7 @@ byte *readBundleSoundFile(const char *entryName, uint32 *size) {
/** Rotate byte value to the left by n bits */
byte rolByte(byte value, uint n) {
n %= 8;
- return (byte) ((value << n) | (value >> (8 - n)));
+ return (byte)((value << n) | (value >> (8 - n)));
}
byte *readFile(const char *filename, bool crypted) {
diff --git a/engines/cine/saveload.cpp b/engines/cine/saveload.cpp
index 20952eea52..51d2c1f6be 100644
--- a/engines/cine/saveload.cpp
+++ b/engines/cine/saveload.cpp
@@ -1002,7 +1002,7 @@ void loadResourcesFromSave(Common::SeekableReadStream &fHandle, enum CineSaveGam
const int entrySize = ((saveGameFormat == ANIMSIZE_23) ? 23 : 30);
const int fileStartPos = fHandle.pos();
- for(int resourceIndex=0; resourceIndex<NUM_MAX_ANIMDATA; resourceIndex++) {
+ for (int resourceIndex = 0; resourceIndex < NUM_MAX_ANIMDATA; resourceIndex++) {
// Seek to the start of the current animation's entry
fHandle.seek(fileStartPos + resourceIndex * entrySize);
// Read in the current animation entry
diff --git a/engines/cine/saveload.h b/engines/cine/saveload.h
index 49c9c0cef7..fd661904af 100644
--- a/engines/cine/saveload.h
+++ b/engines/cine/saveload.h
@@ -68,7 +68,7 @@ enum CineSaveGameFormat {
};
/** Identifier for the temporary Operation Stealth savegame format. */
-static const uint32 TEMP_OS_FORMAT_ID = MKTAG('T','E','M','P');
+static const uint32 TEMP_OS_FORMAT_ID = MKTAG('T', 'E', 'M', 'P');
/** The current version number of Operation Stealth's savegame format. */
static const uint32 CURRENT_OS_SAVE_VER = 1;
diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp
index 9cbe3c3fab..885a43f2f5 100644
--- a/engines/cine/script_fw.cpp
+++ b/engines/cine/script_fw.cpp
@@ -352,7 +352,7 @@ void ScriptVars::load(Common::SeekableReadStream &fHandle, unsigned int len) {
* Reset all values to 0
*/
void ScriptVars::reset() {
- memset( _vars, 0, _size * sizeof(int16));
+ memset(_vars, 0, _size * sizeof(int16));
}
/**
@@ -380,10 +380,10 @@ RawScript::RawScript(const FWScriptInfo &info, const byte *data, uint16 s) :
* Copy constructor
*/
RawScript::RawScript(const RawScript &src) : _size(src._size),
- _data(new byte[_size+1]), _labels(src._labels) {
+ _data(new byte[_size + 1]), _labels(src._labels) {
assert(_data);
- memcpy(_data, src._data, _size+1);
+ memcpy(_data, src._data, _size + 1);
}
/**
@@ -398,7 +398,7 @@ RawScript::~RawScript() {
*/
RawScript &RawScript::operator=(const RawScript &src) {
assert(src._data);
- byte *tmp = new byte[src._size+1];
+ byte *tmp = new byte[src._size + 1];
assert(tmp);
_labels = src._labels;
@@ -443,14 +443,14 @@ int RawScript::getNextLabel(const FWScriptInfo &info, int offset) const {
pos += 2;
break;
case 'c': { // byte != 0 ? byte : word
- uint8 test = _data[pos];
+ uint8 test = _data[pos];
+ pos++;
+ if (test) {
pos++;
- if (test) {
- pos++;
- } else {
- pos += 2;
- }
+ } else {
+ pos += 2;
}
+ }
break;
case 'l': // label
return pos;
@@ -459,7 +459,7 @@ int RawScript::getNextLabel(const FWScriptInfo &info, int offset) const {
;
break;
case 'x': // exit script
- return -pos-1;
+ return -pos - 1;
}
}
}
@@ -498,9 +498,7 @@ void RawScript::computeLabels(const FWScriptInfo &info) {
*
* computeScriptStackFromScript replacement
*/
-uint16 RawScript::getLabel(const FWScriptInfo &info, byte index, uint16 offset)
- const {
-
+uint16 RawScript::getLabel(const FWScriptInfo &info, byte index, uint16 offset) const {
assert(_data);
int pos = offset;
@@ -519,7 +517,7 @@ uint16 RawScript::getLabel(const FWScriptInfo &info, byte index, uint16 offset)
*/
void RawScript::setData(const FWScriptInfo &info, const byte *data) {
assert(!_data); // this function should be called only once per instance
- _data = new byte[_size+1];
+ _data = new byte[_size + 1];
assert(data && _data);
memcpy(_data, data, _size * sizeof(byte));
@@ -553,7 +551,7 @@ byte RawScript::getByte(unsigned int pos) const {
* @return Word of bytecode
*/
uint16 RawScript::getWord(unsigned int pos) const {
- assert(_data && pos+1 < _size);
+ assert(_data && pos + 1 < _size);
return READ_BE_UINT16(_data + pos);
}
@@ -566,7 +564,7 @@ uint16 RawScript::getWord(unsigned int pos) const {
const char *RawScript::getString(unsigned int pos) const {
assert(_data && pos < _size);
- return (const char*)(_data+pos);
+ return (const char *)(_data + pos);
}
/**
@@ -580,8 +578,8 @@ const char *RawScript::getString(unsigned int pos) const {
* instance can be used. It leaves the instance in partially invalid state.
*/
RawObjectScript::RawObjectScript(uint16 s, uint16 p1, uint16 p2, uint16 p3)
- : RawScript(s), _runCount(0), _param1(p1), _param2(p2), _param3(p3)
-{ }
+ : RawScript(s), _runCount(0), _param1(p1), _param2(p2), _param3(p3) {
+}
/**
* Complete constructor
@@ -592,8 +590,9 @@ RawObjectScript::RawObjectScript(uint16 s, uint16 p1, uint16 p2, uint16 p3)
* @param p3 Third object script parameter
*/
RawObjectScript::RawObjectScript(const FWScriptInfo &info, const byte *data,
- uint16 s, uint16 p1, uint16 p2, uint16 p3) : RawScript(info, data, s),
- _runCount(0), _param1(p1), _param2(p2), _param3(p3) { }
+ uint16 s, uint16 p1, uint16 p2, uint16 p3)
+ : RawScript(info, data, s), _runCount(0), _param1(p1), _param2(p2), _param3(p3) {
+}
/**
* Contructor for global scripts
@@ -603,7 +602,8 @@ RawObjectScript::RawObjectScript(const FWScriptInfo &info, const byte *data,
FWScript::FWScript(const RawScript &script, int16 idx) : _script(script),
_pos(0), _line(0), _compare(0), _index(idx),
_labels(script.labels()), _localVars(LOCAL_VARS_SIZE),
- _globalVars(g_cine->_globalVars), _info(new FWScriptInfo) { }
+ _globalVars(g_cine->_globalVars), _info(new FWScriptInfo) {
+}
/**
* Copy constructor
@@ -611,25 +611,27 @@ FWScript::FWScript(const RawScript &script, int16 idx) : _script(script),
FWScript::FWScript(const FWScript &src) : _script(src._script), _pos(src._pos),
_line(src._line), _compare(src._compare), _index(src._index),
_labels(src._labels), _localVars(src._localVars),
- _globalVars(src._globalVars), _info(new FWScriptInfo) { }
+ _globalVars(src._globalVars), _info(new FWScriptInfo) {
+}
/**
* Contructor for global scripts in derived classes
* @param script Script bytecode reference
* @param idx Script bytecode index
*/
-FWScript::FWScript(const RawScript &script, int16 idx, FWScriptInfo *info) :
- _script(script), _pos(0), _line(0), _compare(0), _index(idx),
+FWScript::FWScript(const RawScript &script, int16 idx, FWScriptInfo *info)
+ : _script(script), _pos(0), _line(0), _compare(0), _index(idx),
_labels(script.labels()), _localVars(LOCAL_VARS_SIZE),
- _globalVars(g_cine->_globalVars), _info(info) { }
+ _globalVars(g_cine->_globalVars), _info(info) {
+}
/**
* Constructor for object scripts in derived classes
* @param script Script bytecode reference
* @param idx Script bytecode index
*/
-FWScript::FWScript(RawObjectScript &script, int16 idx, FWScriptInfo *info) :
- _script(script), _pos(0), _line(0), _compare(0), _index(idx),
+FWScript::FWScript(RawObjectScript &script, int16 idx, FWScriptInfo *info)
+ : _script(script), _pos(0), _line(0), _compare(0), _index(idx),
_labels(script.labels()), _localVars(LOCAL_VARS_SIZE),
_globalVars(g_cine->_globalVars), _info(info) {
@@ -639,8 +641,8 @@ FWScript::FWScript(RawObjectScript &script, int16 idx, FWScriptInfo *info) :
/**
* Copy constructor for derived classes
*/
-FWScript::FWScript(const FWScript &src, FWScriptInfo *info) :
- _script(src._script), _pos(src._pos), _line(src._line),
+FWScript::FWScript(const FWScript &src, FWScriptInfo *info)
+ : _script(src._script), _pos(src._pos), _line(src._line),
_compare(src._compare), _index(src._index), _labels(src._labels),
_localVars(src._localVars), _globalVars(src._globalVars), _info(info) { }
@@ -704,7 +706,7 @@ void FWScript::load(const ScriptVars &labels, const ScriptVars &local, uint16 co
int FWScript::execute() {
int ret = 0;
- if(_script._size) {
+ if (_script._size) {
while (!ret) {
_line = _pos;
byte opcode = getNextByte();
@@ -2074,1034 +2076,970 @@ void decompileScript(const byte *scriptPtr, uint16 scriptSize, uint16 scriptIdx)
strcpy(lineBuffer, "");
switch (opcode - 1) {
- case -1:
- {
- break;
- }
- case 0x0:
- {
- byte param1;
- byte param2;
- int16 param3;
+ case -1: {
+ break;
+ }
+ case 0x0: {
+ byte param1;
+ byte param2;
+ int16 param3;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
- position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- sprintf(lineBuffer, "obj[%d]%s = %d\n", param1, getObjPramName(param2), param3);
+ sprintf(lineBuffer, "obj[%d]%s = %d\n", param1, getObjPramName(param2), param3);
- break;
- }
- case 0x1:
- {
- byte param1;
- byte param2;
- byte param3;
+ break;
+ }
+ case 0x1: {
+ byte param1;
+ byte param2;
+ byte param3;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
- position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- param3 = *(localScriptPtr + position);
- position++;
+ param3 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "var[%d]=obj[%d]%s\n", param3, param1, getObjPramName(param2));
- break;
- }
+ sprintf(lineBuffer, "var[%d]=obj[%d]%s\n", param3, param1, getObjPramName(param2));
+ break;
+ }
case 0x2:
case 0x3:
case 0x4:
case 0x5:
- case 0x6:
- {
- byte param1;
- byte param2;
- int16 param3;
-
- param1 = *(localScriptPtr + position);
- position++;
-
- param2 = *(localScriptPtr + position);
- position++;
-
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
-
- if (opcode - 1 == 0x2) {
- sprintf(lineBuffer, "obj[%d]%s+=%d\n", param1, getObjPramName(param2), param3);
- } else if (opcode - 1 == 0x3) {
- sprintf(lineBuffer, "obj[%d]%s-=%d\n", param1, getObjPramName(param2), param3);
- } else if (opcode - 1 == 0x4) {
- sprintf(lineBuffer, "obj[%d]%s+=obj[%d]%s\n", param1, getObjPramName(param2), param3, getObjPramName(param2));
- } else if (opcode - 1 == 0x5) {
- sprintf(lineBuffer, "obj[%d]%s-=obj[%d]%s\n", param1, getObjPramName(param2), param3, getObjPramName(param2));
- } else if (opcode - 1 == 0x6) {
- sprintf(compareString1, "obj[%d]%s", param1, getObjPramName(param2));
- sprintf(compareString2, "%d", param3);
- }
- break;
+ case 0x6: {
+ byte param1;
+ byte param2;
+ int16 param3;
+
+ param1 = *(localScriptPtr + position);
+ position++;
+
+ param2 = *(localScriptPtr + position);
+ position++;
+
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
+
+ if (opcode - 1 == 0x2) {
+ sprintf(lineBuffer, "obj[%d]%s+=%d\n", param1, getObjPramName(param2), param3);
+ } else if (opcode - 1 == 0x3) {
+ sprintf(lineBuffer, "obj[%d]%s-=%d\n", param1, getObjPramName(param2), param3);
+ } else if (opcode - 1 == 0x4) {
+ sprintf(lineBuffer, "obj[%d]%s+=obj[%d]%s\n", param1, getObjPramName(param2), param3, getObjPramName(param2));
+ } else if (opcode - 1 == 0x5) {
+ sprintf(lineBuffer, "obj[%d]%s-=obj[%d]%s\n", param1, getObjPramName(param2), param3, getObjPramName(param2));
+ } else if (opcode - 1 == 0x6) {
+ sprintf(compareString1, "obj[%d]%s", param1, getObjPramName(param2));
+ sprintf(compareString2, "%d", param3);
}
+ break;
+ }
case 0x7:
- case 0x8:
- {
- byte param1;
- int16 param2;
- int16 param3;
- int16 param4;
- int16 param5;
+ case 0x8: {
+ byte param1;
+ int16 param2;
+ int16 param3;
+ int16 param4;
+ int16 param5;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param2 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param4 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param4 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param5 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param5 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- if (opcode - 1 == 0x7) {
- sprintf(lineBuffer, "setupObject(Idx:%d,X:%d,Y:%d,mask:%d,frame:%d)\n", param1, param2, param3, param4, param5);
- } else if (opcode - 1 == 0x8) {
- sprintf(lineBuffer, "checkCollision(%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5);
- }
- break;
+ if (opcode - 1 == 0x7) {
+ sprintf(lineBuffer, "setupObject(Idx:%d,X:%d,Y:%d,mask:%d,frame:%d)\n", param1, param2, param3, param4, param5);
+ } else if (opcode - 1 == 0x8) {
+ sprintf(lineBuffer, "checkCollision(%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5);
}
- case 0x9:
- {
- byte param1;
- int16 param2;
+ break;
+ }
+ case 0x9: {
+ byte param1;
+ int16 param2;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
- position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- if (param2) {
- byte param3;
-
- param3 = *(localScriptPtr + position);
- position++;
-
- if (param2 == 1) {
- sprintf(lineBuffer, "var[%d]=var[%d]\n", param1, param3);
- } else if (param2 == 2) {
- sprintf(lineBuffer, "var[%d]=globalVar[%d]\n", param1, param3);
- } else if (param2 == 3) {
- sprintf(lineBuffer, "var[%d]=mouse.X\n", param1);
- } else if (param2 == 4) {
- sprintf(lineBuffer, "var[%d]=mouse.Y\n", param1);
- } else if (param2 == 5) {
- sprintf(lineBuffer, "var[%d]=rand() mod %d\n", param1, param3);
- } else if (param2 == 8) {
- sprintf(lineBuffer, "var[%d]=file[%d].packedSize\n", param1, param3);
- } else if (param2 == 9) {
- sprintf(lineBuffer, "var[%d]=file[%d].unpackedSize\n", param1, param3);
- } else {
- error("decompileScript: 0x09: param2 = %d", param2);
- }
- } else {
- int16 param3;
+ if (param2) {
+ byte param3;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "var[%d]=%d\n", param1, param3);
+ if (param2 == 1) {
+ sprintf(lineBuffer, "var[%d]=var[%d]\n", param1, param3);
+ } else if (param2 == 2) {
+ sprintf(lineBuffer, "var[%d]=globalVar[%d]\n", param1, param3);
+ } else if (param2 == 3) {
+ sprintf(lineBuffer, "var[%d]=mouse.X\n", param1);
+ } else if (param2 == 4) {
+ sprintf(lineBuffer, "var[%d]=mouse.Y\n", param1);
+ } else if (param2 == 5) {
+ sprintf(lineBuffer, "var[%d]=rand() mod %d\n", param1, param3);
+ } else if (param2 == 8) {
+ sprintf(lineBuffer, "var[%d]=file[%d].packedSize\n", param1, param3);
+ } else if (param2 == 9) {
+ sprintf(lineBuffer, "var[%d]=file[%d].unpackedSize\n", param1, param3);
+ } else {
+ error("decompileScript: 0x09: param2 = %d", param2);
}
+ } else {
+ int16 param3;
- break;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
+
+ sprintf(lineBuffer, "var[%d]=%d\n", param1, param3);
}
+
+ break;
+ }
case 0xA:
case 0xB:
case 0xC:
- case 0xD:
- {
- byte param1;
- byte param2;
+ case 0xD: {
+ byte param1;
+ byte param2;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
+ param2 = *(localScriptPtr + position);
+ position++;
+
+ if (param2) {
+ byte param3;
+
+ param3 = *(localScriptPtr + position);
position++;
- if (param2) {
- byte param3;
+ if (opcode - 1 == 0xA) {
+ sprintf(lineBuffer, "var[%d]+=var[%d]\n", param1, param3);
+ } else if (opcode - 1 == 0xB) {
+ sprintf(lineBuffer, "var[%d]-=var[%d]\n", param1, param3);
+ } else if (opcode - 1 == 0xC) {
+ sprintf(lineBuffer, "var[%d]*=var[%d]\n", param1, param3);
+ } else if (opcode - 1 == 0xD) {
+ sprintf(lineBuffer, "var[%d]/=var[%d]\n", param1, param3);
+ }
+ } else {
+ int16 param3;
- param3 = *(localScriptPtr + position);
- position++;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- if (opcode - 1 == 0xA) {
- sprintf(lineBuffer, "var[%d]+=var[%d]\n", param1, param3);
- } else if (opcode - 1 == 0xB) {
- sprintf(lineBuffer, "var[%d]-=var[%d]\n", param1, param3);
- } else if (opcode - 1 == 0xC) {
- sprintf(lineBuffer, "var[%d]*=var[%d]\n", param1, param3);
- } else if (opcode - 1 == 0xD) {
- sprintf(lineBuffer, "var[%d]/=var[%d]\n", param1, param3);
- }
- } else {
- int16 param3;
-
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
-
- if (opcode - 1 == 0xA) {
- sprintf(lineBuffer, "var[%d]+=%d\n", param1, param3);
- } else if (opcode - 1 == 0xB) {
- sprintf(lineBuffer, "var[%d]-=%d\n", param1, param3);
- } else if (opcode - 1 == 0xC) {
- sprintf(lineBuffer, "var[%d]*=%d\n", param1, param3);
- } else if (opcode - 1 == 0xD) {
- sprintf(lineBuffer, "var[%d]/=%d\n", param1, param3);
- }
+ if (opcode - 1 == 0xA) {
+ sprintf(lineBuffer, "var[%d]+=%d\n", param1, param3);
+ } else if (opcode - 1 == 0xB) {
+ sprintf(lineBuffer, "var[%d]-=%d\n", param1, param3);
+ } else if (opcode - 1 == 0xC) {
+ sprintf(lineBuffer, "var[%d]*=%d\n", param1, param3);
+ } else if (opcode - 1 == 0xD) {
+ sprintf(lineBuffer, "var[%d]/=%d\n", param1, param3);
}
- break;
}
- case 0xE:
- {
- byte param1;
- byte param2;
+ break;
+ }
+ case 0xE: {
+ byte param1;
+ byte param2;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
- position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- if (param2) {
- byte param3;
+ if (param2) {
+ byte param3;
- param3 = *(localScriptPtr + position);
- position++;
+ param3 = *(localScriptPtr + position);
+ position++;
- if (param2 == 1) {
- sprintf(compareString1, "var[%d]", param1);
- sprintf(compareString2, "var[%d]", param3);
+ if (param2 == 1) {
+ sprintf(compareString1, "var[%d]", param1);
+ sprintf(compareString2, "var[%d]", param3);
- } else if (param2 == 2) {
- sprintf(compareString1, "var[%d]", param1);
- sprintf(compareString2, "globalVar[%d]", param3);
- } else {
- error("decompileScript: 0x0E: param2 = %d", param2);
- }
+ } else if (param2 == 2) {
+ sprintf(compareString1, "var[%d]", param1);
+ sprintf(compareString2, "globalVar[%d]", param3);
} else {
- int16 param3;
+ error("decompileScript: 0x0E: param2 = %d", param2);
+ }
+ } else {
+ int16 param3;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- sprintf(compareString1, "var[%d]", param1);
- sprintf(compareString2, "%d", param3);
- }
- break;
+ sprintf(compareString1, "var[%d]", param1);
+ sprintf(compareString2, "%d", param3);
}
- case 0xF:
- {
- byte param1;
- byte param2;
- byte param3;
+ break;
+ }
+ case 0xF: {
+ byte param1;
+ byte param2;
+ byte param3;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
- position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- param3 = *(localScriptPtr + position);
- position++;
+ param3 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "obj[%d]%s=var[%d]\n", param1, getObjPramName(param2), param3);
+ sprintf(lineBuffer, "obj[%d]%s=var[%d]\n", param1, getObjPramName(param2), param3);
- break;
- }
+ break;
+ }
case 0x13:
case 0x14:
case 0x15:
case 0x16:
case 0x17:
case 0x18:
- case 0x19:
- {
- byte param;
-
- param = *(localScriptPtr + position);
- position++;
-
- if (opcode - 1 == 0x13) {
- sprintf(lineBuffer, "loadMask0(%d)\n", param);
- } else if (opcode - 1 == 0x14) {
- sprintf(lineBuffer, "unloadMask0(%d)\n", param);
- } else if (opcode - 1 == 0x15) {
- sprintf(lineBuffer, "OP_15(%d)\n", param);
- } else if (opcode - 1 == 0x16) {
- sprintf(lineBuffer, "loadMask1(%d)\n", param);
- } else if (opcode - 1 == 0x17) {
- sprintf(lineBuffer, "unloadMask0(%d)\n", param);
- } else if (opcode - 1 == 0x18) {
- sprintf(lineBuffer, "loadMask4(%d)\n", param);
- } else if (opcode - 1 == 0x19) {
- sprintf(lineBuffer, "unloadMask4(%d)\n", param);
- }
- break;
+ case 0x19: {
+ byte param;
+
+ param = *(localScriptPtr + position);
+ position++;
+
+ if (opcode - 1 == 0x13) {
+ sprintf(lineBuffer, "loadMask0(%d)\n", param);
+ } else if (opcode - 1 == 0x14) {
+ sprintf(lineBuffer, "unloadMask0(%d)\n", param);
+ } else if (opcode - 1 == 0x15) {
+ sprintf(lineBuffer, "OP_15(%d)\n", param);
+ } else if (opcode - 1 == 0x16) {
+ sprintf(lineBuffer, "loadMask1(%d)\n", param);
+ } else if (opcode - 1 == 0x17) {
+ sprintf(lineBuffer, "unloadMask0(%d)\n", param);
+ } else if (opcode - 1 == 0x18) {
+ sprintf(lineBuffer, "loadMask4(%d)\n", param);
+ } else if (opcode - 1 == 0x19) {
+ sprintf(lineBuffer, "unloadMask4(%d)\n", param);
}
- case 0x1A:
- {
- byte param;
+ break;
+ }
+ case 0x1A: {
+ byte param;
- param = *(localScriptPtr + position);
- position++;
+ param = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "OP_1A(%d)\n", param);
+ sprintf(lineBuffer, "OP_1A(%d)\n", param);
- break;
- }
- case 0x1B:
- {
- sprintf(lineBuffer, "bgIncrustList.clear()\n");
- break;
- }
- case 0x1D:
- {
- byte param;
+ break;
+ }
+ case 0x1B: {
+ sprintf(lineBuffer, "bgIncrustList.clear()\n");
+ break;
+ }
+ case 0x1D: {
+ byte param;
- param = *(localScriptPtr + position);
- position++;
+ param = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "label(%d)\n", param);
+ sprintf(lineBuffer, "label(%d)\n", param);
- break;
- }
- case 0x1E:
- {
- byte param;
+ break;
+ }
+ case 0x1E: {
+ byte param;
- param = *(localScriptPtr + position);
- position++;
+ param = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "goto(%d)\n", param);
+ sprintf(lineBuffer, "goto(%d)\n", param);
- break;
- }
+ break;
+ }
// If cases
case 0x1F:
case 0x20:
case 0x21:
case 0x22:
case 0x23:
- case 0x24:
- {
- byte param;
-
- param = *(localScriptPtr + position);
- position++;
-
- if (opcode - 1 == 0x1F) {
- sprintf(lineBuffer, "if(%s>%s) goto(%d)\n", compareString1, compareString2, param);
- } else if (opcode - 1 == 0x20) {
- sprintf(lineBuffer, "if(%s>=%s) goto(%d)\n", compareString1, compareString2, param);
- } else if (opcode - 1 == 0x21) {
- sprintf(lineBuffer, "if(%s<%s) goto(%d)\n", compareString1, compareString2, param);
- } else if (opcode - 1 == 0x22) {
- sprintf(lineBuffer, "if(%s<=%s) goto(%d)\n", compareString1, compareString2, param);
- } else if (opcode - 1 == 0x23) {
- sprintf(lineBuffer, "if(%s==%s) goto(%d)\n", compareString1, compareString2, param);
- } else if (opcode - 1 == 0x24) {
- sprintf(lineBuffer, "if(%s!=%s) goto(%d)\n", compareString1, compareString2, param);
- }
- break;
+ case 0x24: {
+ byte param;
+
+ param = *(localScriptPtr + position);
+ position++;
+
+ if (opcode - 1 == 0x1F) {
+ sprintf(lineBuffer, "if(%s>%s) goto(%d)\n", compareString1, compareString2, param);
+ } else if (opcode - 1 == 0x20) {
+ sprintf(lineBuffer, "if(%s>=%s) goto(%d)\n", compareString1, compareString2, param);
+ } else if (opcode - 1 == 0x21) {
+ sprintf(lineBuffer, "if(%s<%s) goto(%d)\n", compareString1, compareString2, param);
+ } else if (opcode - 1 == 0x22) {
+ sprintf(lineBuffer, "if(%s<=%s) goto(%d)\n", compareString1, compareString2, param);
+ } else if (opcode - 1 == 0x23) {
+ sprintf(lineBuffer, "if(%s==%s) goto(%d)\n", compareString1, compareString2, param);
+ } else if (opcode - 1 == 0x24) {
+ sprintf(lineBuffer, "if(%s!=%s) goto(%d)\n", compareString1, compareString2, param);
}
- case 0x25:
- {
- byte param;
+ break;
+ }
+ case 0x25: {
+ byte param;
- param = *(localScriptPtr + position);
- position++;
+ param = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "removeLabel(%d)\n", param);
+ sprintf(lineBuffer, "removeLabel(%d)\n", param);
- break;
- }
- case 0x26:
- {
- byte param1;
- byte param2;
+ break;
+ }
+ case 0x26: {
+ byte param1;
+ byte param2;
- param1 = *(localScriptPtr + position);
- position++;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "loop(--var[%d]) -> label(%d)\n", param1, param2);
+ sprintf(lineBuffer, "loop(--var[%d]) -> label(%d)\n", param1, param2);
- break;
- }
+ break;
+ }
case 0x31:
- case 0x32:
- {
- byte param;
+ case 0x32: {
+ byte param;
- param = *(localScriptPtr + position);
- position++;
+ param = *(localScriptPtr + position);
+ position++;
- if (opcode - 1 == 0x31) {
- sprintf(lineBuffer, "startGlobalScript(%d)\n", param);
- } else if (opcode - 1 == 0x32) {
- sprintf(lineBuffer, "endGlobalScript(%d)\n", param);
- }
- break;
+ if (opcode - 1 == 0x31) {
+ sprintf(lineBuffer, "startGlobalScript(%d)\n", param);
+ } else if (opcode - 1 == 0x32) {
+ sprintf(lineBuffer, "endGlobalScript(%d)\n", param);
}
+ break;
+ }
case 0x3B:
case 0x3C:
case 0x3D:
- case OP_loadPart:
- {
- if (opcode - 1 == 0x3B) {
- sprintf(lineBuffer, "loadResource(%s)\n", localScriptPtr + position);
- } else if (opcode - 1 == 0x3C) {
- sprintf(lineBuffer, "loadBg(%s)\n", localScriptPtr + position);
- } else if (opcode - 1 == 0x3D) {
- sprintf(lineBuffer, "loadCt(%s)\n", localScriptPtr + position);
- } else if (opcode - 1 == OP_loadPart) {
- sprintf(lineBuffer, "loadPart(%s)\n", localScriptPtr + position);
- }
-
- position += strlen((const char *)localScriptPtr + position) + 1;
- break;
- }
- case 0x40:
- {
- sprintf(lineBuffer, "closePart()\n");
- break;
- }
- case OP_loadNewPrcName:
- {
- byte param;
+ case OP_loadPart: {
+ if (opcode - 1 == 0x3B) {
+ sprintf(lineBuffer, "loadResource(%s)\n", localScriptPtr + position);
+ } else if (opcode - 1 == 0x3C) {
+ sprintf(lineBuffer, "loadBg(%s)\n", localScriptPtr + position);
+ } else if (opcode - 1 == 0x3D) {
+ sprintf(lineBuffer, "loadCt(%s)\n", localScriptPtr + position);
+ } else if (opcode - 1 == OP_loadPart) {
+ sprintf(lineBuffer, "loadPart(%s)\n", localScriptPtr + position);
+ }
+
+ position += strlen((const char *)localScriptPtr + position) + 1;
+ break;
+ }
+ case 0x40: {
+ sprintf(lineBuffer, "closePart()\n");
+ break;
+ }
+ case OP_loadNewPrcName: {
+ byte param;
- param = *(localScriptPtr + position);
- position++;
+ param = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "loadPrc(%d,%s)\n", param, localScriptPtr + position);
+ sprintf(lineBuffer, "loadPrc(%d,%s)\n", param, localScriptPtr + position);
- position += strlen((const char *)localScriptPtr + position) + 1;
- break;
- }
- case OP_requestCheckPendingDataLoad: // nop
- {
- sprintf(lineBuffer, "requestCheckPendingDataLoad()\n");
- break;
- }
- case 0x45:
- {
- sprintf(lineBuffer, "blitAndFade()\n");
- break;
- }
- case 0x46:
- {
- sprintf(lineBuffer, "fadeToBlack()\n");
- break;
- }
- case 0x47:
- {
- byte param1;
- byte param2;
- int16 param3;
- int16 param4;
- int16 param5;
+ position += strlen((const char *)localScriptPtr + position) + 1;
+ break;
+ }
+ case OP_requestCheckPendingDataLoad: { // nop
+ sprintf(lineBuffer, "requestCheckPendingDataLoad()\n");
+ break;
+ }
+ case 0x45: {
+ sprintf(lineBuffer, "blitAndFade()\n");
+ break;
+ }
+ case 0x46: {
+ sprintf(lineBuffer, "fadeToBlack()\n");
+ break;
+ }
+ case 0x47: {
+ byte param1;
+ byte param2;
+ int16 param3;
+ int16 param4;
+ int16 param5;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
- position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param4 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param4 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param5 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param5 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- sprintf(lineBuffer, "transformPaletteRange(%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5);
+ sprintf(lineBuffer, "transformPaletteRange(%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5);
- break;
- }
- case 0x49:
- {
- byte param;
+ break;
+ }
+ case 0x49: {
+ byte param;
- param = *(localScriptPtr + position);
- position++;
+ param = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "setDefaultMenuBgColor(%d)\n", param);
+ sprintf(lineBuffer, "setDefaultMenuBgColor(%d)\n", param);
- break;
- }
- case 0x4F:
- {
- sprintf(lineBuffer, "break()\n");
- exitScript = 1;
- break;
- }
- case 0x50:
- {
- sprintf(lineBuffer, "endScript()\n\n");
- break;
- }
- case 0x51:
- {
- byte param1;
- int16 param2;
- int16 param3;
- int16 param4;
- int16 param5;
+ break;
+ }
+ case 0x4F: {
+ sprintf(lineBuffer, "break()\n");
+ exitScript = 1;
+ break;
+ }
+ case 0x50: {
+ sprintf(lineBuffer, "endScript()\n\n");
+ break;
+ }
+ case 0x51: {
+ byte param1;
+ int16 param2;
+ int16 param3;
+ int16 param4;
+ int16 param5;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param2 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param4 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param4 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param5 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param5 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- sprintf(lineBuffer, "message(%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5);
+ sprintf(lineBuffer, "message(%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5);
- break;
- }
+ break;
+ }
case 0x52:
- case 0x53:
- {
- byte param1;
- byte param2;
+ case 0x53: {
+ byte param1;
+ byte param2;
- param1 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
- position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- if (param2) {
- byte param3;
-
- param3 = *(localScriptPtr + position);
- position++;
-
- if (param2 == 1) {
- if (opcode - 1 == 0x52) {
- sprintf(lineBuffer, "globalVar[%d] = var[%d]\n", param1, param3);
- } else if (opcode - 1 == 0x53) {
- sprintf(compareString1, "globalVar[%d]", param1);
- sprintf(compareString2, "var[%d]", param3);
- }
- } else if (param2 == 2) {
- if (opcode - 1 == 0x52) {
- sprintf(lineBuffer, "globalVar[%d] = globalVar[%d]\n", param1, param3);
- } else if (opcode - 1 == 0x53) {
- sprintf(compareString1, "globalVar[%d]", param1);
- sprintf(compareString2, "globalVar[%d]", param3);
- }
- } else {
- if (opcode - 1 == 0x52) {
- error("decompileScript: 0x52: param2 = %d", param2);
- } else if (opcode - 1 == 0x53) {
- error("decompileScript: 0x53: param2 = %d", param2);
- }
- }
- } else {
- int16 param3;
+ if (param2) {
+ byte param3;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = *(localScriptPtr + position);
+ position++;
+ if (param2 == 1) {
if (opcode - 1 == 0x52) {
- sprintf(lineBuffer, "globalVar[%d] = %d\n", param1, param3);
+ sprintf(lineBuffer, "globalVar[%d] = var[%d]\n", param1, param3);
} else if (opcode - 1 == 0x53) {
sprintf(compareString1, "globalVar[%d]", param1);
- sprintf(compareString2, "%d", param3);
+ sprintf(compareString2, "var[%d]", param3);
+ }
+ } else if (param2 == 2) {
+ if (opcode - 1 == 0x52) {
+ sprintf(lineBuffer, "globalVar[%d] = globalVar[%d]\n", param1, param3);
+ } else if (opcode - 1 == 0x53) {
+ sprintf(compareString1, "globalVar[%d]", param1);
+ sprintf(compareString2, "globalVar[%d]", param3);
+ }
+ } else {
+ if (opcode - 1 == 0x52) {
+ error("decompileScript: 0x52: param2 = %d", param2);
+ } else if (opcode - 1 == 0x53) {
+ error("decompileScript: 0x53: param2 = %d", param2);
}
}
- break;
- }
- case 0x59:
- {
- sprintf(lineBuffer, "comment: %s\n", localScriptPtr + position);
+ } else {
+ int16 param3;
- position += strlen((const char *)localScriptPtr + position);
- break;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
+
+ if (opcode - 1 == 0x52) {
+ sprintf(lineBuffer, "globalVar[%d] = %d\n", param1, param3);
+ } else if (opcode - 1 == 0x53) {
+ sprintf(compareString1, "globalVar[%d]", param1);
+ sprintf(compareString2, "%d", param3);
+ }
}
- case 0x5A:
- {
- byte param1;
- byte param2;
+ break;
+ }
+ case 0x59: {
+ sprintf(lineBuffer, "comment: %s\n", localScriptPtr + position);
- param1 = *(localScriptPtr + position);
- position++;
+ position += strlen((const char *)localScriptPtr + position);
+ break;
+ }
+ case 0x5A: {
+ byte param1;
+ byte param2;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "freePartRang(%d,%d)\n", param1, param2);
+ param2 = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x5B:
- {
- sprintf(lineBuffer, "unloadAllMasks()\n");
- break;
- }
- case 0x65:
- {
- sprintf(lineBuffer, "setupTableUnk1()\n");
- break;
- }
- case 0x66:
- {
- byte param1;
- int16 param2;
+ sprintf(lineBuffer, "freePartRang(%d,%d)\n", param1, param2);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x5B: {
+ sprintf(lineBuffer, "unloadAllMasks()\n");
+ break;
+ }
+ case 0x65: {
+ sprintf(lineBuffer, "setupTableUnk1()\n");
+ break;
+ }
+ case 0x66: {
+ byte param1;
+ int16 param2;
- param2 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param1 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "tableUnk1[%d] = %d\n", param1, param2);
+ param2 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- break;
- }
- case 0x68:
- {
- byte param;
+ sprintf(lineBuffer, "tableUnk1[%d] = %d\n", param1, param2);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x68: {
+ byte param;
- sprintf(lineBuffer, "setPlayerCommandPosY(%d)\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x69:
- {
- sprintf(lineBuffer, "allowPlayerInput()\n");
- break;
- }
- case 0x6A:
- {
- sprintf(lineBuffer, "disallowPlayerInput()\n");
- break;
- }
- case 0x6B:
- {
- byte newDisk;
+ sprintf(lineBuffer, "setPlayerCommandPosY(%d)\n", param);
- newDisk = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x69: {
+ sprintf(lineBuffer, "allowPlayerInput()\n");
+ break;
+ }
+ case 0x6A: {
+ sprintf(lineBuffer, "disallowPlayerInput()\n");
+ break;
+ }
+ case 0x6B: {
+ byte newDisk;
- sprintf(lineBuffer, "changeDataDisk(%d)\n", newDisk);
+ newDisk = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x6D:
- {
- sprintf(lineBuffer, "loadDat(%s)\n", localScriptPtr + position);
+ sprintf(lineBuffer, "changeDataDisk(%d)\n", newDisk);
- position += strlen((const char *)localScriptPtr + position) + 1;
- break;
- }
- case 0x6E: // nop
- {
- sprintf(lineBuffer, "updateDat()\n");
- break;
- }
- case 0x6F:
- {
- sprintf(lineBuffer, "OP_6F() -> dat related\n");
- break;
- }
- case 0x70:
- {
- sprintf(lineBuffer, "stopSample()\n");
- break;
- }
- case 0x79:
- {
- byte param;
+ break;
+ }
+ case 0x6D: {
+ sprintf(lineBuffer, "loadDat(%s)\n", localScriptPtr + position);
- param = *(localScriptPtr + position);
- position++;
+ position += strlen((const char *)localScriptPtr + position) + 1;
+ break;
+ }
+ case 0x6E: { // nop
+ sprintf(lineBuffer, "updateDat()\n");
+ break;
+ }
+ case 0x6F: {
+ sprintf(lineBuffer, "OP_6F() -> dat related\n");
+ break;
+ }
+ case 0x70: {
+ sprintf(lineBuffer, "stopSample()\n");
+ break;
+ }
+ case 0x79: {
+ byte param;
- sprintf(lineBuffer, "disableSystemMenu(%d)\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x77:
- case 0x78:
- {
- byte param1;
- byte param2;
- int16 param3;
- byte param4;
- int16 param5;
- int16 param6;
+ sprintf(lineBuffer, "disableSystemMenu(%d)\n", param);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x77:
+ case 0x78: {
+ byte param1;
+ byte param2;
+ int16 param3;
+ byte param4;
+ int16 param5;
+ int16 param6;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param2 = *(localScriptPtr + position);
+ position++;
- param4 = *(localScriptPtr + position);
- position++;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param5 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param4 = *(localScriptPtr + position);
+ position++;
- param6 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param5 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- if (opcode - 1 == 0x77) {
- sprintf(lineBuffer, "playSample(%d,%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5, param6);
- } else if (opcode - 1 == 0x78) {
- sprintf(lineBuffer, "OP_78(%d,%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5, param6);
- }
+ param6 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- break;
+ if (opcode - 1 == 0x77) {
+ sprintf(lineBuffer, "playSample(%d,%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5, param6);
+ } else if (opcode - 1 == 0x78) {
+ sprintf(lineBuffer, "OP_78(%d,%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5, param6);
}
- case 0x7A:
- {
- byte param;
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x7A: {
+ byte param;
- sprintf(lineBuffer, "OP_7A(%d)\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x7B: // OS only
- {
- byte param;
+ sprintf(lineBuffer, "OP_7A(%d)\n", param);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x7B: { // OS only
+ byte param;
- sprintf(lineBuffer, "OP_7B(%d)\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x7F: // OS only
- {
- byte param1;
- byte param2;
- byte param3;
- byte param4;
- int16 param5;
- int16 param6;
- int16 param7;
+ sprintf(lineBuffer, "OP_7B(%d)\n", param);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x7F: { // OS only
+ byte param1;
+ byte param2;
+ byte param3;
+ byte param4;
+ int16 param5;
+ int16 param6;
+ int16 param7;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param3 = *(localScriptPtr + position);
- position++;
+ param2 = *(localScriptPtr + position);
+ position++;
- param4 = *(localScriptPtr + position);
- position++;
+ param3 = *(localScriptPtr + position);
+ position++;
- param5 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param4 = *(localScriptPtr + position);
+ position++;
- param6 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param5 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param7 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param6 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- sprintf(lineBuffer, "OP_7F(%d,%d,%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5, param6, param7);
+ param7 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- break;
- }
- case 0x80: // OS only
- {
- byte param1;
- byte param2;
+ sprintf(lineBuffer, "OP_7F(%d,%d,%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5, param6, param7);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x80: { // OS only
+ byte param1;
+ byte param2;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "OP_80(%d,%d)\n", param1, param2);
+ param2 = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x82: // OS only
- {
- byte param1;
- byte param2;
- uint16 param3;
- uint16 param4;
- byte param5;
+ sprintf(lineBuffer, "OP_80(%d,%d)\n", param1, param2);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x82: { // OS only
+ byte param1;
+ byte param2;
+ uint16 param3;
+ uint16 param4;
+ byte param5;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param2 = *(localScriptPtr + position);
+ position++;
- param4 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param5 = *(localScriptPtr + position);
- position++;
+ param4 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- sprintf(lineBuffer, "OP_82(%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5);
+ param5 = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x83: // OS only
- {
- byte param1;
- byte param2;
+ sprintf(lineBuffer, "OP_82(%d,%d,%d,%d,%d)\n", param1, param2, param3, param4, param5);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x83: { // OS only
+ byte param1;
+ byte param2;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "OP_83(%d,%d)\n", param1, param2);
+ param2 = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x89: // OS only
- {
- byte param;
+ sprintf(lineBuffer, "OP_83(%d,%d)\n", param1, param2);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x89: { // OS only
+ byte param;
- sprintf(lineBuffer, "if(%s!=%s) goto next label(%d)\n", compareString1, compareString2, param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x8B: // OS only
- {
- byte param;
+ sprintf(lineBuffer, "if(%s!=%s) goto next label(%d)\n", compareString1, compareString2, param);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x8B: { // OS only
+ byte param;
- sprintf(lineBuffer, "OP_8B(%d)\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x8C: // OS only
- {
- byte param;
+ sprintf(lineBuffer, "OP_8B(%d)\n", param);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x8C: { // OS only
+ byte param;
- sprintf(lineBuffer, "OP_8C(%d)\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x8D: // OS only
- {
- int16 param1;
- int16 param2;
- int16 param3;
- int16 param4;
- int16 param5;
- int16 param6;
- int16 param7;
- int16 param8;
+ sprintf(lineBuffer, "OP_8C(%d)\n", param);
- param1 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ break;
+ }
+ case 0x8D: { // OS only
+ int16 param1;
+ int16 param2;
+ int16 param3;
+ int16 param4;
+ int16 param5;
+ int16 param6;
+ int16 param7;
+ int16 param8;
- param2 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param1 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param3 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param2 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param4 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param3 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param5 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param4 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param6 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param5 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param7 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param6 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- param8 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ param7 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- sprintf(compareString1, "obj[%d]", param1);
- sprintf(compareString2, "{%d,%d,%d,%d,%d,%d,%d}", param2, param3, param4, param5, param6, param7, param8);
+ param8 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- break;
- }
- case 0x8E: // OS only
- {
- byte param1;
+ sprintf(compareString1, "obj[%d]", param1);
+ sprintf(compareString2, "{%d,%d,%d,%d,%d,%d,%d}", param2, param3, param4, param5, param6, param7, param8);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x8E: { // OS only
+ byte param1;
- sprintf(lineBuffer, "ADDBG(%d,%s)\n", param1, localScriptPtr + position);
+ param1 = *(localScriptPtr + position);
+ position++;
- position += strlen((const char *)localScriptPtr + position);
+ sprintf(lineBuffer, "ADDBG(%d,%s)\n", param1, localScriptPtr + position);
- break;
- }
- case 0x8F: // OS only
- {
- byte param;
+ position += strlen((const char *)localScriptPtr + position);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x8F: { // OS only
+ byte param;
- sprintf(lineBuffer, "OP_8F(%d)\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x90: // OS only
- {
- byte param1;
+ sprintf(lineBuffer, "OP_8F(%d)\n", param);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x90: { // OS only
+ byte param1;
- sprintf(lineBuffer, "loadABS(%d,%s)\n", param1, localScriptPtr + position);
+ param1 = *(localScriptPtr + position);
+ position++;
- position += strlen((const char *)localScriptPtr + position);
+ sprintf(lineBuffer, "loadABS(%d,%s)\n", param1, localScriptPtr + position);
- break;
- }
- case 0x91: // OS only
- {
- byte param;
+ position += strlen((const char *)localScriptPtr + position);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x91: { // OS only
+ byte param;
- sprintf(lineBuffer, "OP_91(%d)\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x9D: // OS only
- {
- byte param;
+ sprintf(lineBuffer, "OP_91(%d)\n", param);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x9D: { // OS only
+ byte param;
- sprintf(lineBuffer, "OP_9D(%d) -> flip img idx\n", param);
+ param = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0x9E: // OS only
- {
- byte param;
+ sprintf(lineBuffer, "OP_9D(%d) -> flip img idx\n", param);
- param = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0x9E: { // OS only
+ byte param;
- if (param) {
- byte param2;
+ param = *(localScriptPtr + position);
+ position++;
- param2 = *(localScriptPtr + position);
- position++;
+ if (param) {
+ byte param2;
- sprintf(lineBuffer, "OP_9E(%d,%d)\n", param, param2);
- } else {
- int16 param2;
+ param2 = *(localScriptPtr + position);
+ position++;
- param2 = READ_BE_UINT16(localScriptPtr + position);
- position += 2;
+ sprintf(lineBuffer, "OP_9E(%d,%d)\n", param, param2);
+ } else {
+ int16 param2;
- sprintf(lineBuffer, "OP_9E(%d,%d)\n", param, param2);
- }
+ param2 = READ_BE_UINT16(localScriptPtr + position);
+ position += 2;
- break;
+ sprintf(lineBuffer, "OP_9E(%d,%d)\n", param, param2);
}
- case 0xA0: // OS only
- {
- byte param1;
- byte param2;
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0xA0: { // OS only
+ byte param1;
+ byte param2;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "OP_A0(%d,%d)\n", param1, param2);
+ param2 = *(localScriptPtr + position);
+ position++;
- break;
- }
- case 0xA1: // OS only
- {
- byte param1;
- byte param2;
+ sprintf(lineBuffer, "OP_A0(%d,%d)\n", param1, param2);
- param1 = *(localScriptPtr + position);
- position++;
+ break;
+ }
+ case 0xA1: { // OS only
+ byte param1;
+ byte param2;
- param2 = *(localScriptPtr + position);
- position++;
+ param1 = *(localScriptPtr + position);
+ position++;
- sprintf(lineBuffer, "OP_A1(%d,%d)\n", param1, param2);
+ param2 = *(localScriptPtr + position);
+ position++;
- break;
- }
- default:
- {
- sprintf(lineBuffer, "Unsupported opcode %X in decompileScript\n\n", opcode - 1);
- position = scriptSize;
- break;
- }
+ sprintf(lineBuffer, "OP_A1(%d,%d)\n", param1, param2);
+
+ break;
+ }
+ default: {
+ sprintf(lineBuffer, "Unsupported opcode %X in decompileScript\n\n", opcode - 1);
+ position = scriptSize;
+ break;
+ }
}
- // printf(lineBuffer);
+ //printf(lineBuffer);
strcpy(decompileBuffer[decompileBufferPosition++], lineBuffer);
exitScript = 0;
diff --git a/engines/cine/sound.cpp b/engines/cine/sound.cpp
index 52e1cdac7e..b92c5374bd 100644
--- a/engines/cine/sound.cpp
+++ b/engines/cine/sound.cpp
@@ -153,7 +153,7 @@ const int AdLibSoundDriver::_freqTable[] = {
const int AdLibSoundDriver::_freqTableCount = ARRAYSIZE(_freqTable);
const int AdLibSoundDriver::_operatorsTable[] = {
- 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21
+ 0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13, 16, 17, 18, 19, 20, 21
};
const int AdLibSoundDriver::_operatorsTableCount = ARRAYSIZE(_operatorsTable);
@@ -614,7 +614,7 @@ void AdLibSoundDriverADL::playSample(const byte *data, int size, int channel, in
}
MidiSoundDriverH32::MidiSoundDriverH32(MidiDriver *output)
- : _output(output), _callback(0), _mutex() {
+ : _output(output), _callback(0), _mutex() {
}
MidiSoundDriverH32::~MidiSoundDriverH32() {
@@ -731,13 +731,13 @@ void MidiSoundDriverH32::selectInstrument(int channel, int timbreGroup, int timb
0x00, 0x00, 0x00, // offset
0x00, // Timbre group _ timbreGroup * 64 + timbreNumber should be the
0x00, // Timbre number / MT-32 instrument in case timbreGroup is 0 or 1.
- 0x18, // Key shift (= 0)
+ 0x18, // Key shift (= 0)
0x32, // Fine tune (= 0)
0x0C, // Bender Range
0x03, // Assign Mode
0x01, // Reverb Switch (= enabled)
0x00, // dummy
- 0x00, // Output level
+ 0x00, // Output level
0x07, // Panpot (= balanced)
0x00, // dummy
0x00, // dummy
diff --git a/engines/cine/texte.cpp b/engines/cine/texte.cpp
index 33ea569df7..998075c6ce 100644
--- a/engines/cine/texte.cpp
+++ b/engines/cine/texte.cpp
@@ -88,7 +88,7 @@ static const CharacterEntry fontParamTable_standard[NUM_FONT_CHARS] = {
{64, 3}, {65, 3}, { 0, 0}, { 0, 0}, {62, 2}, {74, 6}, {66, 1}, {67, 6},
{52, 6}, {53, 6}, {54, 6}, {55, 6}, {56, 6}, {57, 6}, {58, 6}, {59, 6},
{60, 6}, {61, 6}, {76, 3}, { 0, 0}, { 0, 0}, { 0, 0}, { 0, 0}, {75, 6},
- { 0, 0}, { 0, 6}, //a
+ { 0, 0}, { 0, 6}, //a
{ 1, 6}, { 2, 6}, { 3, 6}, { 4, 6}, { 5, 6}, { 6, 6},
{ 7, 6}, { 8, 3}, { 9, 6}, {10, 6}, {11, 6}, {12, 7}, {13, 6}, {14, 6},
{15, 6}, {16, 6}, {17, 6}, {18, 6}, {19, 6}, {20, 6}, {21, 6}, {22, 7},
diff --git a/engines/cine/texte.h b/engines/cine/texte.h
index dd4b7e06ee..185dc53bfd 100644
--- a/engines/cine/texte.h
+++ b/engines/cine/texte.h
@@ -46,7 +46,7 @@ struct CharacterEntry {
};
struct TextHandler {
- byte textTable[NUM_FONT_CHARS][2][FONT_WIDTH * FONT_HEIGHT];
+ byte textTable[NUM_FONT_CHARS][2][FONT_WIDTH *FONT_HEIGHT];
CharacterEntry fontParamTable[NUM_FONT_CHARS];
};
diff --git a/engines/cine/various.cpp b/engines/cine/various.cpp
index eccd71cf05..23f439a7a7 100644
--- a/engines/cine/various.cpp
+++ b/engines/cine/various.cpp
@@ -99,8 +99,7 @@ byte isInPause = 0;
* Bit on = mouse button down
* Bit off = mouse button up
*/
-enum MouseButtonState
-{
+enum MouseButtonState {
kLeftMouseButton = (1 << 0),
kRightMouseButton = (1 << 1)
};
@@ -271,7 +270,7 @@ int16 getObjectUnderCursor(uint16 x, uint16 y) {
} else if (it->type == 1 && gfxGetBit(xdif, ydif, g_cine->_animDataTable[frame].data(), g_cine->_animDataTable[frame]._width * 4)) {
return it->objIdx;
}
- } else if (it->type == 0) { // use generated mask
+ } else if (it->type == 0) { // use generated mask
if (gfxGetBit(xdif, ydif, g_cine->_animDataTable[frame].mask(), g_cine->_animDataTable[frame]._width)) {
return it->objIdx;
}
@@ -358,128 +357,122 @@ void CineEngine::makeSystemMenu() {
systemCommand = makeMenuChoice(systemMenu, numEntry, mouseX, mouseY, 140);
switch (systemCommand) {
- case 0: // Pause
- {
- renderer->drawString(otherMessages[2], 0);
- waitPlayerInput();
- break;
- }
- case 1: // Restart Game
- {
- getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
- if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
- _restartRequested = true;
- }
- break;
- }
- case 2: // Quit
- {
- getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
- if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
- quitGame();
- }
- break;
+ case 0: { // Pause
+ renderer->drawString(otherMessages[2], 0);
+ waitPlayerInput();
+ break;
+ }
+ case 1: { // Restart Game
+ getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
+ if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
+ _restartRequested = true;
}
- case 3: // Select save drive... change ?
- {
- break;
+ break;
+ }
+ case 2: { // Quit
+ getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
+ if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
+ quitGame();
}
- case 4: // load game
- {
- if (loadSaveDirectory()) {
+ break;
+ }
+ case 3: { // Select save drive... change ?
+ break;
+ }
+ case 4: { // load game
+ if (loadSaveDirectory()) {
// int16 selectedSave;
- getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
- selectedSave = makeMenuChoice(currentSaveName, 10, mouseX, mouseY + 8, 180);
+ getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
+ selectedSave = makeMenuChoice(currentSaveName, 10, mouseX, mouseY + 8, 180);
- if (selectedSave >= 0) {
- char saveNameBuffer[256];
- sprintf(saveNameBuffer, "%s.%1d", _targetName.c_str(), selectedSave);
+ if (selectedSave >= 0) {
+ char saveNameBuffer[256];
+ sprintf(saveNameBuffer, "%s.%1d", _targetName.c_str(), selectedSave);
- getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
- if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
- char loadString[256];
+ getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
+ if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
+ char loadString[256];
- sprintf(loadString, otherMessages[3], currentSaveName[selectedSave]);
- renderer->drawString(loadString, 0);
+ sprintf(loadString, otherMessages[3], currentSaveName[selectedSave]);
+ renderer->drawString(loadString, 0);
- makeLoad(saveNameBuffer);
- } else {
- renderer->drawString(otherMessages[4], 0);
- waitPlayerInput();
- checkDataDisk(-1);
- }
+ makeLoad(saveNameBuffer);
} else {
renderer->drawString(otherMessages[4], 0);
waitPlayerInput();
checkDataDisk(-1);
}
} else {
- renderer->drawString(otherMessages[5], 0);
+ renderer->drawString(otherMessages[4], 0);
waitPlayerInput();
checkDataDisk(-1);
}
- break;
+ } else {
+ renderer->drawString(otherMessages[5], 0);
+ waitPlayerInput();
+ checkDataDisk(-1);
}
- case 5: // Save game
- {
- loadSaveDirectory();
- selectedSave = makeMenuChoice(currentSaveName, 10, mouseX, mouseY + 8, 180);
+ break;
+ }
+ case 5: { // Save game
+ loadSaveDirectory();
+ selectedSave = makeMenuChoice(currentSaveName, 10, mouseX, mouseY + 8, 180);
- if (selectedSave >= 0) {
- char saveFileName[256];
- char saveName[20];
- saveName[0] = 0;
+ if (selectedSave >= 0) {
+ char saveFileName[256];
+ char saveName[20];
+ saveName[0] = 0;
- if (!makeTextEntryMenu(otherMessages[6], saveName, 20, 120))
- break;
+ if (!makeTextEntryMenu(otherMessages[6], saveName, 20, 120))
+ break;
- strncpy(currentSaveName[selectedSave], saveName, 20);
+ strncpy(currentSaveName[selectedSave], saveName, 20);
- sprintf(saveFileName, "%s.%1d", _targetName.c_str(), selectedSave);
+ sprintf(saveFileName, "%s.%1d", _targetName.c_str(), selectedSave);
- getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
- if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
- char saveString[256];
- Common::String tmp = Common::String::format("%s.dir", _targetName.c_str());
+ getMouseData(mouseUpdateStatus, (uint16 *)&mouseButton, (uint16 *)&mouseX, (uint16 *)&mouseY);
+ if (!makeMenuChoice(confirmMenu, 2, mouseX, mouseY + 8, 100)) {
+ char saveString[256];
+ Common::String tmp = Common::String::format("%s.dir", _targetName.c_str());
- Common::OutSaveFile *fHandle = _saveFileMan->openForSaving(tmp);
- if (!fHandle) {
- warning("Unable to open file %s for saving", tmp.c_str());
- break;
- }
+ Common::OutSaveFile *fHandle = _saveFileMan->openForSaving(tmp);
+ if (!fHandle) {
+ warning("Unable to open file %s for saving", tmp.c_str());
+ break;
+ }
- fHandle->write(currentSaveName, 200);
- delete fHandle;
+ fHandle->write(currentSaveName, 200);
+ delete fHandle;
- sprintf(saveString, otherMessages[3], currentSaveName[selectedSave]);
- renderer->drawString(saveString, 0);
+ sprintf(saveString, otherMessages[3], currentSaveName[selectedSave]);
+ renderer->drawString(saveString, 0);
- makeSave(saveFileName);
+ makeSave(saveFileName);
- checkDataDisk(-1);
- } else {
- renderer->drawString(otherMessages[4], 0);
- waitPlayerInput();
- checkDataDisk(-1);
- }
+ checkDataDisk(-1);
+ } else {
+ renderer->drawString(otherMessages[4], 0);
+ waitPlayerInput();
+ checkDataDisk(-1);
}
- break;
}
+ break;
+ }
}
inMenu = false;
}
}
-void drawMessageBox(int16 x, int16 y, int16 width, int16 currentY, int16 offset, int16 color, byte* page) {
- gfxDrawLine(x + offset, y + offset, x + width - offset, y + offset, color, page); // top
- gfxDrawLine(x + offset, currentY + 4 - offset, x + width - offset, currentY + 4 - offset, color, page); // bottom
- gfxDrawLine(x + offset, y + offset, x + offset, currentY + 4 - offset, color, page); // left
- gfxDrawLine(x + width - offset, y + offset, x + width - offset, currentY + 4 - offset, color, page); // right
+void drawMessageBox(int16 x, int16 y, int16 width, int16 currentY, int16 offset, int16 color, byte *page) {
+ gfxDrawLine(x + offset, y + offset, x + width - offset, y + offset, color, page); // top
+ gfxDrawLine(x + offset, currentY + 4 - offset, x + width - offset, currentY + 4 - offset, color, page); // bottom
+ gfxDrawLine(x + offset, y + offset, x + offset, currentY + 4 - offset, color, page); // left
+ gfxDrawLine(x + width - offset, y + offset, x + width - offset, currentY + 4 - offset, color, page); // right
}
-void drawDoubleMessageBox(int16 x, int16 y, int16 width, int16 currentY, int16 color, byte* page) {
+void drawDoubleMessageBox(int16 x, int16 y, int16 width, int16 currentY, int16 color, byte *page) {
drawMessageBox(x, y, width, currentY, 1, 0, page);
drawMessageBox(x, y, width, currentY, 0, color, page);
}
@@ -581,7 +574,7 @@ void makeCommandLine() {
g_cine->_commandBuffer = "";
}
- if ((playerCommand != -1) && (choiceResultTable[playerCommand] == 2)) { // need object selection ?
+ if ((playerCommand != -1) && (choiceResultTable[playerCommand] == 2)) { // need object selection?
int16 si;
getMouseData(mouseUpdateStatus, &dummyU16, &x, &y);
@@ -635,7 +628,7 @@ void makeCommandLine() {
}
if (g_cine->getGameType() == Cine::GType_OS && playerCommand != 2) {
- if (playerCommand != -1 && canUseOnObject != 0) { // call use on sub object
+ if (playerCommand != -1 && canUseOnObject != 0) { // call use on sub object
int16 si;
getMouseData(mouseUpdateStatus, &dummyU16, &x, &y);
@@ -742,11 +735,11 @@ int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X,
mainLoopSub6();
}
- if (menuVar4 && currentSelection > 0) { // go up
+ if (menuVar4 && currentSelection > 0) { // go up
currentSelection--;
}
- if (menuVar5) { // go down
+ if (menuVar5) { // go down
if (height - 1 > currentSelection) {
currentSelection++;
}
@@ -763,7 +756,7 @@ int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X,
}
}
- if (currentSelection != oldSelection) { // old != new
+ if (currentSelection != oldSelection) { // old != new
if (needMouseSave) {
hideMouse();
}
@@ -789,7 +782,7 @@ int16 makeMenuChoice(const CommandeType commandList[], uint16 height, uint16 X,
getMouseData(mouseUpdateStatus, &button, &dummyU16, &dummyU16);
} while (button && !g_cine->shouldQuit());
- if (var_4 == 2) { // recheck
+ if (var_4 == 2) { // recheck
if (!recheckValue)
return -1;
else
@@ -809,7 +802,7 @@ void makeActionMenu() {
getMouseData(mouseUpdateStatus, &mouseButton, &mouseX, &mouseY);
if (g_cine->getGameType() == Cine::GType_OS) {
- if(disableSystemMenu == 0) {
+ if (disableSystemMenu == 0) {
playerCommand = makeMenuChoice(defaultActionCommand, 6, mouseX, mouseY, 70, true);
}
@@ -818,7 +811,7 @@ void makeActionMenu() {
canUseOnObject = canUseOnItemTable[playerCommand];
}
} else {
- if(disableSystemMenu == 0) {
+ if (disableSystemMenu == 0) {
playerCommand = makeMenuChoice(defaultActionCommand, 6, mouseX, mouseY, 70);
}
}
@@ -1185,7 +1178,7 @@ void removeMessages() {
Common::List<overlay>::iterator it;
bool remove;
- for (it = g_cine->_overlayList.begin(); it != g_cine->_overlayList.end(); ) {
+ for (it = g_cine->_overlayList.begin(); it != g_cine->_overlayList.end();) {
if (g_cine->getGameType() == Cine::GType_OS) {
// NOTE: These are really removeOverlay calls that have been deferred.
// In Operation Stealth's disassembly elements are removed from the
@@ -1348,7 +1341,7 @@ void modifySeqListElement(uint16 objIdx, int16 var4Test, int16 param1, int16 par
}
void computeMove1(SeqListElement &element, int16 x, int16 y, int16 param1,
- int16 param2, int16 x2, int16 y2) {
+ int16 param2, int16 x2, int16 y2) {
element.var16 = 0;
element.var14 = 0;
@@ -1397,7 +1390,7 @@ uint16 addAni(uint16 param1, uint16 objIdx, const int8 *ptr, SeqListElement &ele
int16 di;
debug(5, "addAni: param1 = %d, objIdx = %d, ptr = %p, element.var8 = %d, element.var14 = %d param3 = %d",
- param1, objIdx, ptr, element.var8, element.var14, param3);
+ param1, objIdx, ptr, element.var8, element.var14, param3);
// In the original an error string is set and 0 is returned if the following doesn't hold
assert(ptr);
@@ -1413,16 +1406,16 @@ uint16 addAni(uint16 param1, uint16 objIdx, const int8 *ptr, SeqListElement &ele
di = (g_cine->_objectTable[objIdx].costume + 1) % (*ptrData);
++ptrData; // Jump over the just read byte
// Here ptr2 seems to be indexing a table of structs (8 bytes per struct):
- // struct {
- // int8 x; // 0 (Used with checkCollision)
- // int8 y; // 1 (Used with checkCollision)
- // int8 numZones; // 2 (Used with checkCollision)
- // int8 var3; // 3 (Not used in this function)
- // int8 xAdd; // 4 (Used with an object)
- // int8 yAdd; // 5 (Used with an object)
- // int8 maskAdd; // 6 (Used with an object)
- // int8 frameAdd; // 7 (Used with an object)
- // };
+ // struct {
+ // int8 x; // 0 (Used with checkCollision)
+ // int8 y; // 1 (Used with checkCollision)
+ // int8 numZones; // 2 (Used with checkCollision)
+ // int8 var3; // 3 (Not used in this function)
+ // int8 xAdd; // 4 (Used with an object)
+ // int8 yAdd; // 5 (Used with an object)
+ // int8 maskAdd; // 6 (Used with an object)
+ // int8 frameAdd; // 7 (Used with an object)
+ // };
ptr2 = ptrData + di * 8;
// We might probably safely discard the AND by 1 here because
@@ -1572,8 +1565,7 @@ void processSeqListElement(SeqListElement &element) {
var_4 = -1;
if ((element.var16 == 1
- && !addAni(3, element.objIdx, ptr1, element, 0, &var_4)) || (element.var16 == 2 && !addAni(2, element.objIdx, ptr1, element, 0,
- &var_4))) {
+ && !addAni(3, element.objIdx, ptr1, element, 0, &var_4)) || (element.var16 == 2 && !addAni(2, element.objIdx, ptr1, element, 0, &var_4))) {
if (element.varC == 255) {
g_cine->_globalVars[VAR_MOUSE_Y_POS] = 0;
}
@@ -1702,9 +1694,9 @@ bool makeTextEntryMenu(const char *messagePtr, char *inputString, int stringMaxL
}
break;
default:
- if (((keycode >= 'a') && (keycode <='z')) ||
- ((keycode >= '0') && (keycode <='9')) ||
- ((keycode >= 'A') && (keycode <='Z')) ||
+ if (((keycode >= 'a') && (keycode <= 'z')) ||
+ ((keycode >= '0') && (keycode <= '9')) ||
+ ((keycode >= 'A') && (keycode <= 'Z')) ||
(keycode == ' ')) {
if (inputLength < stringMaxLength - 1) {
ch[0] = keycode;
diff --git a/engines/parallaction/sound_br.cpp b/engines/parallaction/sound_br.cpp
index 0925e55309..fbafd36c9a 100644
--- a/engines/parallaction/sound_br.cpp
+++ b/engines/parallaction/sound_br.cpp
@@ -91,20 +91,20 @@ public:
};
void MidiParser_MSC::parseMetaEvent(EventInfo &info) {
- uint8 type = read1(_position._play_pos);
- uint8 len = read1(_position._play_pos);
+ uint8 type = read1(_position._playPos);
+ uint8 len = read1(_position._playPos);
info.ext.type = type;
info.length = len;
info.ext.data = 0;
if (type == 0x51) {
- info.ext.data = _position._play_pos;
+ info.ext.data = _position._playPos;
} else {
warning("unknown meta event 0x%02X", type);
info.ext.type = 0;
}
- _position._play_pos += len;
+ _position._playPos += len;
}
void MidiParser_MSC::parseMidiEvent(EventInfo &info) {
@@ -116,13 +116,13 @@ void MidiParser_MSC::parseMidiEvent(EventInfo &info) {
case 0xA:
case 0xB:
case 0xE:
- info.basic.param1 = read1(_position._play_pos);
- info.basic.param2 = read1(_position._play_pos);
+ info.basic.param1 = read1(_position._playPos);
+ info.basic.param2 = read1(_position._playPos);
break;
case 0xC:
case 0xD:
- info.basic.param1 = read1(_position._play_pos);
+ info.basic.param1 = read1(_position._playPos);
info.basic.param2 = 0;
break;
@@ -135,9 +135,9 @@ void MidiParser_MSC::parseMidiEvent(EventInfo &info) {
}
void MidiParser_MSC::parseNextEvent(EventInfo &info) {
- info.start = _position._play_pos;
+ info.start = _position._playPos;
- if (_position._play_pos >= _trackEnd) {
+ if (_position._playPos >= _trackEnd) {
// fake an end-of-track meta event
info.delta = 0;
info.event = 0xFF;
@@ -146,8 +146,8 @@ void MidiParser_MSC::parseNextEvent(EventInfo &info) {
return;
}
- info.delta = readVLQ(_position._play_pos);
- info.event = read1(_position._play_pos);
+ info.delta = readVLQ(_position._playPos);
+ info.event = read1(_position._playPos);
if (info.event == 0xFF) {
parseMetaEvent(info);
@@ -155,7 +155,7 @@ void MidiParser_MSC::parseNextEvent(EventInfo &info) {
}
if (info.event < 0x80) {
- _position._play_pos--;
+ _position._playPos--;
info.event = _lastEvent;
}
@@ -185,7 +185,7 @@ bool MidiParser_MSC::loadMusic(byte *data, uint32 size) {
_lastEvent = 0;
_trackEnd = data + size;
- _num_tracks = 1;
+ _numTracks = 1;
_tracks[0] = pos;
setTempo(500000);
diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp
index 422948f975..4e54797960 100644
--- a/engines/sci/sound/midiparser_sci.cpp
+++ b/engines/sci/sound/midiparser_sci.cpp
@@ -98,7 +98,7 @@ bool MidiParser_SCI::loadMusic(SoundResource::Track *track, MusicEntry *psnd, in
midiMixChannels();
}
- _num_tracks = 1;
+ _numTracks = 1;
_tracks[0] = _mixedData;
if (_pSnd)
setTrack(0);
@@ -144,7 +144,7 @@ byte *MidiParser_SCI::midiMixChannels() {
_mixedData = outData;
long ticker = 0;
byte channelNr, curDelta;
- byte midiCommand = 0, midiParam, global_prev = 0;
+ byte midiCommand = 0, midiParam, globalPrev = 0;
long newDelta;
SoundResource::Channel *channel;
@@ -190,13 +190,13 @@ byte *MidiParser_SCI::midiMixChannels() {
byte midiChannel = midiCommand & 0xF;
_channelUsed[midiChannel] = true;
- if (midiCommand != global_prev)
+ if (midiCommand != globalPrev)
*outData++ = midiCommand;
*outData++ = midiParam;
if (nMidiParams[(midiCommand >> 4) - 8] == 2)
*outData++ = channel->data[channel->curPos++];
channel->prev = midiCommand;
- global_prev = midiCommand;
+ globalPrev = midiCommand;
}
}
@@ -372,8 +372,8 @@ void MidiParser_SCI::unloadMusic() {
resetTracking();
allNotesOff();
}
- _num_tracks = 0;
- _active_track = 255;
+ _numTracks = 0;
+ _activeTrack = 255;
_resetOnPause = false;
if (_mixedData) {
@@ -454,26 +454,26 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) {
debugC(4, kDebugLevelSound, "signal %04x", _signalToSet);
}
- info.start = _position._play_pos;
+ info.start = _position._playPos;
info.delta = 0;
- while (*_position._play_pos == 0xF8) {
+ while (*_position._playPos == 0xF8) {
info.delta += 240;
- _position._play_pos++;
+ _position._playPos++;
}
- info.delta += *(_position._play_pos++);
+ info.delta += *(_position._playPos++);
// Process the next info.
- if ((_position._play_pos[0] & 0xF0) >= 0x80)
- info.event = *(_position._play_pos++);
+ if ((_position._playPos[0] & 0xF0) >= 0x80)
+ info.event = *(_position._playPos++);
else
- info.event = _position._running_status;
+ info.event = _position._runningStatus;
if (info.event < 0x80)
return;
- _position._running_status = info.event;
+ _position._runningStatus = info.event;
switch (info.command()) {
case 0xC:
- info.basic.param1 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
info.basic.param2 = 0;
if (info.channel() == 0xF) {// SCI special case
if (info.basic.param1 != kSetSignalLoop) {
@@ -488,23 +488,23 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) {
// in glitches (e.g. the intro of LB1 Amiga gets stuck - bug
// #3297883). Refer to MusicEntry::setSignal() in sound/music.cpp.
if (_soundVersion <= SCI_VERSION_0_LATE ||
- _position._play_tick || info.delta) {
+ _position._playTick || info.delta) {
_signalSet = true;
_signalToSet = info.basic.param1;
}
} else {
- _loopTick = _position._play_tick + info.delta;
+ _loopTick = _position._playTick + info.delta;
}
}
break;
case 0xD:
- info.basic.param1 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
info.basic.param2 = 0;
break;
case 0xB:
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
+ info.basic.param2 = *(_position._playPos++);
// Reference for some events:
// http://wiki.scummvm.org/index.php/SCI/Specifications/Sound/SCI0_Resource_Format#Status_Reference
@@ -588,8 +588,8 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) {
case 0x9:
case 0xA:
case 0xE:
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
+ info.basic.param2 = *(_position._playPos++);
if (info.command() == 0x9 && info.basic.param2 == 0)
info.event = info.channel() | 0x80;
info.length = 0;
@@ -598,12 +598,12 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) {
case 0xF: // System Common, Meta or SysEx event
switch (info.event & 0x0F) {
case 0x2: // Song Position Pointer
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
+ info.basic.param2 = *(_position._playPos++);
break;
case 0x3: // Song Select
- info.basic.param1 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
info.basic.param2 = 0;
break;
@@ -617,16 +617,16 @@ void MidiParser_SCI::parseNextEvent(EventInfo &info) {
break;
case 0x0: // SysEx
- info.length = readVLQ(_position._play_pos);
- info.ext.data = _position._play_pos;
- _position._play_pos += info.length;
+ info.length = readVLQ(_position._playPos);
+ info.ext.data = _position._playPos;
+ _position._playPos += info.length;
break;
case 0xF: // META event
- info.ext.type = *(_position._play_pos++);
- info.length = readVLQ(_position._play_pos);
- info.ext.data = _position._play_pos;
- _position._play_pos += info.length;
+ info.ext.type = *(_position._playPos++);
+ info.length = readVLQ(_position._playPos);
+ info.ext.data = _position._playPos;
+ _position._playPos += info.length;
if (info.ext.type == 0x2F) {// end of track reached
if (_pSnd->loop)
_pSnd->loop--;
@@ -677,21 +677,21 @@ void MidiParser_SCI::allNotesOff() {
// Turn off all active notes
for (i = 0; i < 128; ++i) {
for (j = 0; j < 16; ++j) {
- if ((_active_notes[i] & (1 << j)) && (_channelRemap[j] != -1)){
+ if ((_activeNotes[i] & (1 << j)) && (_channelRemap[j] != -1)){
sendToDriver(0x80 | j, i, 0);
}
}
}
// Turn off all hanging notes
- for (i = 0; i < ARRAYSIZE(_hanging_notes); i++) {
- byte midiChannel = _hanging_notes[i].channel;
- if ((_hanging_notes[i].time_left) && (_channelRemap[midiChannel] != -1)) {
- sendToDriver(0x80 | midiChannel, _hanging_notes[i].note, 0);
- _hanging_notes[i].time_left = 0;
+ for (i = 0; i < ARRAYSIZE(_hangingNotes); i++) {
+ byte midiChannel = _hangingNotes[i].channel;
+ if ((_hangingNotes[i].timeLeft) && (_channelRemap[midiChannel] != -1)) {
+ sendToDriver(0x80 | midiChannel, _hangingNotes[i].note, 0);
+ _hangingNotes[i].timeLeft = 0;
}
}
- _hanging_notes_count = 0;
+ _hangingNotesCount = 0;
// To be sure, send an "All Note Off" event (but not all MIDI devices
// support this...).
@@ -703,7 +703,7 @@ void MidiParser_SCI::allNotesOff() {
}
}
- memset(_active_notes, 0, sizeof(_active_notes));
+ memset(_activeNotes, 0, sizeof(_activeNotes));
}
void MidiParser_SCI::setMasterVolume(byte masterVolume) {
diff --git a/engines/sci/sound/midiparser_sci.h b/engines/sci/sound/midiparser_sci.h
index 82f34070a4..d3fd337644 100644
--- a/engines/sci/sound/midiparser_sci.h
+++ b/engines/sci/sound/midiparser_sci.h
@@ -65,7 +65,7 @@ public:
void setMasterVolume(byte masterVolume);
void setVolume(byte volume);
void stop() {
- _abort_parse = true;
+ _abortParse = true;
allNotesOff();
}
void pause() {
diff --git a/engines/scumm/midiparser_ro.cpp b/engines/scumm/midiparser_ro.cpp
index 1a31d1ca82..8549a9262d 100644
--- a/engines/scumm/midiparser_ro.cpp
+++ b/engines/scumm/midiparser_ro.cpp
@@ -62,13 +62,13 @@ void MidiParser_RO::parseNextEvent (EventInfo &info) {
info.delta = 0;
do {
- info.start = _position._play_pos;
- info.event = *(_position._play_pos++);
+ info.start = _position._playPos;
+ info.event = *(_position._playPos++);
if (info.command() == 0xA) {
++_lastMarkerCount;
info.event = 0xF0;
} else if (info.event == 0xF0 || info.event == 0xF1) {
- byte delay = *(_position._play_pos++);
+ byte delay = *(_position._playPos++);
info.delta += delay;
if (info.event == 0xF1) {
// This event is, as far as we have been able
@@ -95,16 +95,16 @@ void MidiParser_RO::parseNextEvent (EventInfo &info) {
if (info.event < 0x80)
return;
- _position._running_status = info.event;
+ _position._runningStatus = info.event;
switch (info.command()) {
case 0xC:
- info.basic.param1 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
info.basic.param2 = 0;
break;
case 0x8: case 0x9: case 0xB:
- info.basic.param1 = *(_position._play_pos++);
- info.basic.param2 = *(_position._play_pos++);
+ info.basic.param1 = *(_position._playPos++);
+ info.basic.param2 = *(_position._playPos++);
if (info.command() == 0x9 && info.basic.param2 == 0)
info.event = info.channel() | 0x80;
info.length = 0;
@@ -133,7 +133,7 @@ bool MidiParser_RO::loadMusic (byte *data, uint32 size) {
return false;
}
- _num_tracks = 1;
+ _numTracks = 1;
_ppqn = 120;
_tracks[0] = pos + 2;
_markerCount = _lastMarkerCount = 0;
diff --git a/engines/tony/custom.cpp b/engines/tony/custom.cpp
index f0a9197c6d..516e55b53b 100644
--- a/engines/tony/custom.cpp
+++ b/engines/tony/custom.cpp
@@ -41,7 +41,7 @@
namespace Tony {
-const char *ambianceFile[] = {
+static const char *kAmbianceFile[] = {
"None",
"1.ADP", // Grilli.WAV
"2.ADP", // Grilli-Ovattati.WAV
@@ -52,66 +52,38 @@ const char *ambianceFile[] = {
"6.ADP" // Mare1.WAV half volume
};
-struct MusicFileEntry {
- const char *name;
- int sync;
-};
-
-const MusicFileEntry musicFiles[] = {
- {"00.ADP", 0}, {"01.ADP", 0},
- {"02.ADP", 0}, {"03.ADP", 0},
- {"04.ADP", 0}, {"05.ADP", 0},
- {"06.ADP", 0}, {"07.ADP", 0},
- {"08.ADP", 2450}, {"09.ADP", 0},
- {"10.ADP", 0}, {"11.ADP", 0},
- {"12.ADP", 0}, {"13.ADP", 0},
- {"14.ADP", 0}, {"15.ADP", 0},
- {"16.ADP", 0}, {"17.ADP", 0},
- {"18.ADP", 0}, {"19.ADP", 0},
- {"20.ADP", 0}, {"21.ADP", 0},
- {"22.ADP", 0}, {"23.ADP", 0},
- {"24.ADP", 0}, {"25.ADP", 0},
- {"26.ADP", 0}, {"27.ADP", 0},
- {"28.ADP", 1670}, {"29.ADP", 0},
- {"30.ADP", 0}, {"31.ADP", 0},
- {"32.ADP", 2900}, {"33.ADP", 0},
- {"34.ADP", 0}, {"35.ADP", 0},
- {"36.ADP", 0}, {"37.ADP", 0},
- {"38.ADP", 0}, {"39.ADP", 0},
- {"40.ADP", 0}, {"41.ADP", 1920},
- {"42.ADP", 1560}, {"43.ADP", 1920},
- {"44.ADP", 1920}, {"45.ADP", 1920},
- {"46.ADP", 1920}, {"47.ADP", 1920},
- {"48.ADP", 1920}, {"49.ADP", 1920},
- {"50.ADP", 1920}, {"51.ADP", 1920},
- {"52.ADP", 1920}, {"53.ADP", 0},
- {"54.ADP", 0}, {"55.ADP", 0},
- {"56.ADP", 0}, {"57.ADP", 0},
- {"58.ADP", 0}, {"59.ADP", 0}
+static const MusicFileEntry kMusicFiles[] = {
+ {"00.ADP", 0}, {"01.ADP", 0}, {"02.ADP", 0}, {"03.ADP", 0},
+ {"04.ADP", 0}, {"05.ADP", 0}, {"06.ADP", 0}, {"07.ADP", 0},
+ {"08.ADP", 2450}, {"09.ADP", 0}, {"10.ADP", 0}, {"11.ADP", 0},
+ {"12.ADP", 0}, {"13.ADP", 0}, {"14.ADP", 0}, {"15.ADP", 0},
+ {"16.ADP", 0}, {"17.ADP", 0}, {"18.ADP", 0}, {"19.ADP", 0},
+ {"20.ADP", 0}, {"21.ADP", 0}, {"22.ADP", 0}, {"23.ADP", 0},
+ {"24.ADP", 0}, {"25.ADP", 0}, {"26.ADP", 0}, {"27.ADP", 0},
+ {"28.ADP", 1670}, {"29.ADP", 0}, {"30.ADP", 0}, {"31.ADP", 0},
+ {"32.ADP", 2900}, {"33.ADP", 0}, {"34.ADP", 0}, {"35.ADP", 0},
+ {"36.ADP", 0}, {"37.ADP", 0}, {"38.ADP", 0}, {"39.ADP", 0},
+ {"40.ADP", 0}, {"41.ADP", 1920}, {"42.ADP", 1560}, {"43.ADP", 1920},
+ {"44.ADP", 1920}, {"45.ADP", 1920}, {"46.ADP", 1920}, {"47.ADP", 1920},
+ {"48.ADP", 1920}, {"49.ADP", 1920}, {"50.ADP", 1920}, {"51.ADP", 1920},
+ {"52.ADP", 1920}, {"53.ADP", 0}, {"54.ADP", 0}, {"55.ADP", 0},
+ {"56.ADP", 0}, {"57.ADP", 0}, {"58.ADP", 0}, {"59.ADP", 0}
};
-const char *jingleFileNames[] = {
- "S00.ADP", "S01.ADP",
- "S02.ADP", "S03.ADP",
- "S04.ADP", "S05.ADP",
- "S06.ADP", "S07.ADP",
- "S08.ADP", "S09.ADP",
- "S10.ADP", "S11.ADP",
- "S12.ADP", "S13.ADP",
- "S14.ADP", "S15.ADP",
- "S16.ADP", "S17.ADP",
- "S18.ADP"
+static const char *kJingleFileNames[] = {
+ "S00.ADP", "S01.ADP", "S02.ADP", "S03.ADP", "S04.ADP",
+ "S05.ADP", "S06.ADP", "S07.ADP", "S08.ADP", "S09.ADP",
+ "S10.ADP", "S11.ADP", "S12.ADP", "S13.ADP", "S14.ADP",
+ "S15.ADP", "S16.ADP", "S17.ADP", "S18.ADP"
};
-
-void ReapplyChangedHotspot() {
- int i;
- for (i = 0; i < GLOBALS._curChangedHotspot; i++)
+void reapplyChangedHotspot() {
+ for (int i = 0; i < GLOBALS._curChangedHotspot; i++)
GLOBALS._loc->getItemFromCode(GLOBALS._changedHotspot[i]._dwCode)->changeHotspot(RMPoint(GLOBALS._changedHotspot[i]._nX, GLOBALS._changedHotspot[i]._nY));
}
-void SaveChangedHotspot(Common::OutSaveFile *f) {
+void saveChangedHotspot(Common::OutSaveFile *f) {
f->writeByte(GLOBALS._curChangedHotspot);
if (GLOBALS._curChangedHotspot > 0) {
for (int i = 0; i < GLOBALS._curChangedHotspot; ++i)
@@ -119,7 +91,7 @@ void SaveChangedHotspot(Common::OutSaveFile *f) {
}
}
-void LoadChangedHotspot(Common::InSaveFile *f) {
+void loadChangedHotspot(Common::InSaveFile *f) {
GLOBALS._curChangedHotspot = f->readByte();
if (GLOBALS._curChangedHotspot > 0) {
@@ -128,7 +100,6 @@ void LoadChangedHotspot(Common::InSaveFile *f) {
}
}
-
/**
* Classes required for custom functions
*
@@ -139,14 +110,14 @@ void LoadChangedHotspot(Common::InSaveFile *f) {
* AddInventory -> theEngine.AddInventory()
*/
-void MCharResetCodes() {
+void mCharResetCodes() {
for (int i = 0; i < 10; i++)
GLOBALS._mCharacter[i]._item = GLOBALS._loc->getItemFromCode(GLOBALS._mCharacter[i]._code);
for (int i = 0; i < 10; i++)
GLOBALS._character[i]._item = GLOBALS._loc->getItemFromCode(GLOBALS._character[i]._code);
}
-void CharsSaveAll(Common::OutSaveFile *f) {
+void charsSaveAll(Common::OutSaveFile *f) {
for (int i = 0; i < 10; i++) {
f->writeByte(GLOBALS._isMChar[i]);
if (GLOBALS._isMChar[i]) {
@@ -157,7 +128,7 @@ void CharsSaveAll(Common::OutSaveFile *f) {
}
}
-void CharsLoadAll(Common::InSaveFile *f) {
+void charsLoadAll(Common::InSaveFile *f) {
for (int i = 0; i < 10; i++) {
GLOBALS._isMChar[i] = f->readByte();
if (GLOBALS._isMChar[i])
@@ -167,28 +138,28 @@ void CharsLoadAll(Common::InSaveFile *f) {
}
}
-DECLARE_CUSTOM_FUNCTION(FaceToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void faceToMe(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_STANDDOWN);
}
-DECLARE_CUSTOM_FUNCTION(BackToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void backToMe(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_STANDUP);
}
-DECLARE_CUSTOM_FUNCTION(LeftToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void leftToMe(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_STANDLEFT);
}
-DECLARE_CUSTOM_FUNCTION(RightToMe)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void rightToMe(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_STANDRIGHT);
}
-DECLARE_CUSTOM_FUNCTION(TonySetPerorate)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) {
+void tonySetPerorate(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) {
g_vm->getEngine()->setPerorate(bStatus);
}
-DECLARE_CUSTOM_FUNCTION(MySleep)(CORO_PARAM, uint32 dwTime, uint32, uint32, uint32) {
+void mySleep(CORO_PARAM, uint32 dwTime, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
int i;
CORO_END_CONTEXT(_ctx);
@@ -201,12 +172,12 @@ DECLARE_CUSTOM_FUNCTION(MySleep)(CORO_PARAM, uint32 dwTime, uint32, uint32, uint
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(SetAlwaysDisplay)(CORO_PARAM, uint32 val, uint32, uint32, uint32) {
+void setAlwaysDisplay(CORO_PARAM, uint32 val, uint32, uint32, uint32) {
GLOBALS._bAlwaysDisplay = (val != 0);
}
-DECLARE_CUSTOM_FUNCTION(SetPointer)(CORO_PARAM, uint32 dwPointer, uint32, uint32, uint32) {
+void setPointer(CORO_PARAM, uint32 dwPointer, uint32, uint32, uint32) {
switch (dwPointer) {
case 1:
GLOBALS._pointer->setSpecialPointer(GLOBALS._pointer->PTR_ARROWUP);
@@ -230,7 +201,7 @@ DECLARE_CUSTOM_FUNCTION(SetPointer)(CORO_PARAM, uint32 dwPointer, uint32, uint32
}
}
-VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) {
+VoiceHeader *searchVoiceHeader(uint32 codehi, uint32 codelo) {
int code = (codehi << 16) | codelo;
if (g_vm->_voices.size() == 0)
@@ -245,7 +216,7 @@ VoiceHeader *SearchVoiceHeader(uint32 codehi, uint32 codelo) {
}
-DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX, uint32 nY, uint32) {
+void sendTonyMessage(CORO_PARAM, uint32 dwMessage, uint32 nX, uint32 nY, uint32) {
CORO_BEGIN_CONTEXT;
RMMessage msg;
int i;
@@ -266,7 +237,7 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX
if (!_ctx->msg.isValid())
return;
- _ctx->curVoc = SearchVoiceHeader(0, dwMessage);
+ _ctx->curVoc = searchVoiceHeader(0, dwMessage);
_ctx->voice = NULL;
if (_ctx->curVoc) {
// Is positioned within the database of entries beginning at the first
@@ -362,12 +333,12 @@ DECLARE_CUSTOM_FUNCTION(SendTonyMessage)(CORO_PARAM, uint32 dwMessage, uint32 nX
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(ChangeBoxStatus)(CORO_PARAM, uint32 nLoc, uint32 nBox, uint32 nStatus, uint32) {
+void changeBoxStatus(CORO_PARAM, uint32 nLoc, uint32 nBox, uint32 nStatus, uint32) {
GLOBALS._boxes->changeBoxStatus(nLoc, nBox, nStatus);
}
-DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) {
+void custLoadLocation(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) {
CORO_BEGIN_CONTEXT;
uint32 h;
CORO_END_CONTEXT(_ctx);
@@ -390,7 +361,7 @@ DECLARE_CUSTOM_FUNCTION(CustLoadLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, ui
}
-DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) {
+void sendFullscreenMsgStart(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) {
CORO_BEGIN_CONTEXT;
RMMessage *msg;
RMGfxClearTask clear;
@@ -449,7 +420,7 @@ DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgStart)(CORO_PARAM, uint32 nMsg, uint32
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void clearScreen(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
char buf[256];
RMGfxClearTask clear;
@@ -469,33 +440,33 @@ DECLARE_CUSTOM_FUNCTION(ClearScreen)(CORO_PARAM, uint32, uint32, uint32, uint32)
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(SendFullscreenMsgEnd)(CORO_PARAM, uint32 bNotEnableTony, uint32, uint32, uint32) {
+void sendFullscreenMsgEnd(CORO_PARAM, uint32 bNotEnableTony, uint32, uint32, uint32) {
g_vm->getEngine()->loadLocation(GLOBALS._fullScreenMessageLoc, RMPoint(GLOBALS._fullScreenMessagePt._x, GLOBALS._fullScreenMessagePt._y), RMPoint(-1, -1));
if (!bNotEnableTony)
GLOBALS._tony->show();
- MCharResetCodes();
- ReapplyChangedHotspot();
+ mCharResetCodes();
+ reapplyChangedHotspot();
}
-DECLARE_CUSTOM_FUNCTION(SendFullscreenMessage)(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) {
+void sendFullscreenMessage(CORO_PARAM, uint32 nMsg, uint32 nFont, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
CORO_BEGIN_CODE(_ctx);
- CORO_INVOKE_4(SendFullscreenMsgStart, nMsg, nFont, 0, 0);
- CORO_INVOKE_4(SendFullscreenMsgEnd, 0, 0, 0, 0);
+ CORO_INVOKE_4(sendFullscreenMsgStart, nMsg, nFont, 0, 0);
+ CORO_INVOKE_4(sendFullscreenMsgEnd, 0, 0, 0, 0);
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(NoBullsEye)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void noBullsEye(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._bNoBullsEye = true;
}
-DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void closeLocation(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -515,7 +486,7 @@ DECLARE_CUSTOM_FUNCTION(CloseLocation)(CORO_PARAM, uint32, uint32, uint32, uint3
}
-DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) {
+void changeLocation(CORO_PARAM, uint32 nLoc, uint32 tX, uint32 tY, uint32 bUseStartPos) {
CORO_BEGIN_CONTEXT;
uint32 h;
CORO_END_CONTEXT(_ctx);
@@ -543,7 +514,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint
if (GLOBALS._lastTappeto != GLOBALS._ambiance[nLoc]) {
GLOBALS._lastTappeto = GLOBALS._ambiance[nLoc];
if (GLOBALS._lastTappeto != 0)
- g_vm->playMusic(4, ambianceFile[GLOBALS._lastTappeto], 0, true, 2000);
+ g_vm->playMusic(4, kAmbianceFile[GLOBALS._lastTappeto], 0, true, 2000);
}
if (!GLOBALS._bNoBullsEye) {
@@ -566,51 +537,49 @@ DECLARE_CUSTOM_FUNCTION(ChangeLocation)(CORO_PARAM, uint32 nLoc, uint32 tX, uint
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(SetLocStartPosition)(CORO_PARAM, uint32 nLoc, uint32 lX, uint32 lY, uint32) {
+void setLocStartPosition(CORO_PARAM, uint32 nLoc, uint32 lX, uint32 lY, uint32) {
GLOBALS._startLocPos[nLoc].set(lX, lY);
}
-DECLARE_CUSTOM_FUNCTION(SaveTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void saveTonyPosition(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._saveTonyPos = GLOBALS._tony->position();
GLOBALS._saveTonyLoc = GLOBALS._loc->TEMPGetNumLoc();
}
-DECLARE_CUSTOM_FUNCTION(RestoreTonyPosition)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void restoreTonyPosition(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
CORO_BEGIN_CODE(_ctx);
- CORO_INVOKE_4(ChangeLocation, GLOBALS._saveTonyLoc, GLOBALS._saveTonyPos._x, GLOBALS._saveTonyPos._y, 0);
+ CORO_INVOKE_4(changeLocation, GLOBALS._saveTonyLoc, GLOBALS._saveTonyPos._x, GLOBALS._saveTonyPos._y, 0);
- MCharResetCodes();
+ mCharResetCodes();
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(DisableInput)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void disableInput(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->getEngine()->disableInput();
}
-DECLARE_CUSTOM_FUNCTION(EnableInput)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void enableInput(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->getEngine()->enableInput();
}
-DECLARE_CUSTOM_FUNCTION(StopTony)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void stopTony(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._tony->stopNoAction(coroParam);
}
-DECLARE_CUSTOM_FUNCTION(CustEnableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void custEnableGUI(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS.EnableGUI();
}
-DECLARE_CUSTOM_FUNCTION(CustDisableGUI)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void custDisableGUI(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS.DisableGUI();
}
-
-
-void TonyGenericTake1(CORO_PARAM, uint32 nDirection) {
+void tonyGenericTake1(CORO_PARAM, uint32 nDirection) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -624,7 +593,7 @@ void TonyGenericTake1(CORO_PARAM, uint32 nDirection) {
CORO_END_CODE;
}
-void TonyGenericTake2(CORO_PARAM, uint32 nDirection) {
+void tonyGenericTake2(CORO_PARAM, uint32 nDirection) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -640,7 +609,7 @@ void TonyGenericTake2(CORO_PARAM, uint32 nDirection) {
CORO_END_CODE;
}
-void TonyGenericPut1(CORO_PARAM, uint32 nDirection) {
+void tonyGenericPut1(CORO_PARAM, uint32 nDirection) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -654,7 +623,7 @@ void TonyGenericPut1(CORO_PARAM, uint32 nDirection) {
CORO_END_CODE;
}
-void TonyGenericPut2(CORO_PARAM, uint32 nDirection) {
+void tonyGenericPut2(CORO_PARAM, uint32 nDirection) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -671,71 +640,65 @@ void TonyGenericPut2(CORO_PARAM, uint32 nDirection) {
}
-DECLARE_CUSTOM_FUNCTION(TonyTakeUp1)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericTake1(coroParam, 0);
+void tonyTakeUp1(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericTake1(coroParam, 0);
}
-DECLARE_CUSTOM_FUNCTION(TonyTakeMid1)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericTake1(coroParam, 1);
+void tonyTakeMid1(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericTake1(coroParam, 1);
}
-DECLARE_CUSTOM_FUNCTION(TonyTakeDown1)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericTake1(coroParam, 2);
+void tonyTakeDown1(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericTake1(coroParam, 2);
}
-
-
-DECLARE_CUSTOM_FUNCTION(TonyTakeUp2)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericTake2(coroParam, 0);
+void tonyTakeUp2(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericTake2(coroParam, 0);
}
-DECLARE_CUSTOM_FUNCTION(TonyTakeMid2)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericTake2(coroParam, 1);
+void tonyTakeMid2(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericTake2(coroParam, 1);
}
-DECLARE_CUSTOM_FUNCTION(TonyTakeDown2)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericTake2(coroParam, 2);
+void tonyTakeDown2(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericTake2(coroParam, 2);
}
-
-
-DECLARE_CUSTOM_FUNCTION(TonyPutUp1)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericPut1(coroParam, 0);
+void tonyPutUp1(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericPut1(coroParam, 0);
}
-
-DECLARE_CUSTOM_FUNCTION(TonyPutMid1)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericPut1(coroParam, 1);
+void tonyPutMid1(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericPut1(coroParam, 1);
}
-DECLARE_CUSTOM_FUNCTION(TonyPutDown1)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericPut1(coroParam, 2);
+void tonyPutDown1(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericPut1(coroParam, 2);
}
-DECLARE_CUSTOM_FUNCTION(TonyPutUp2)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericPut2(coroParam, 0);
+void tonyPutUp2(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericPut2(coroParam, 0);
}
-
-DECLARE_CUSTOM_FUNCTION(TonyPutMid2)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericPut2(coroParam, 1);
+void tonyPutMid2(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericPut2(coroParam, 1);
}
-DECLARE_CUSTOM_FUNCTION(TonyPutDown2)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- TonyGenericPut2(coroParam, 2);
+void tonyPutDown2(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ tonyGenericPut2(coroParam, 2);
}
-DECLARE_CUSTOM_FUNCTION(TonyOnTheFloor)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) {
+void tonyOnTheFloor(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) {
if (dwParte == 0)
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_ONTHEFLOORLEFT);
else
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_ONTHEFLOORRIGHT);
}
-DECLARE_CUSTOM_FUNCTION(TonyGetUp)(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) {
+void tonyGetUp(CORO_PARAM, uint32 dwParte, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -752,11 +715,11 @@ DECLARE_CUSTOM_FUNCTION(TonyGetUp)(CORO_PARAM, uint32 dwParte, uint32, uint32, u
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyShepherdess)(CORO_PARAM, uint32 bIsPast, uint32, uint32, uint32) {
+void tonyShepherdess(CORO_PARAM, uint32 bIsPast, uint32, uint32, uint32) {
GLOBALS._tony->setShepherdess(bIsPast);
}
-DECLARE_CUSTOM_FUNCTION(TonyWhistle)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWhistle(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -771,98 +734,97 @@ DECLARE_CUSTOM_FUNCTION(TonyWhistle)(CORO_PARAM, uint32, uint32, uint32, uint32)
CORO_END_CODE;
}
-
-void TonySetNumTexts(uint32 dwText) {
+void tonySetNumTexts(uint32 dwText) {
GLOBALS._dwTonyNumTexts = dwText;
GLOBALS._bTonyInTexts = false;
}
-DECLARE_CUSTOM_FUNCTION(TonyLaugh)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyLaugh(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_LAUGH;
}
-DECLARE_CUSTOM_FUNCTION(TonyGiggle)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyGiggle(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_LAUGH2;
}
-DECLARE_CUSTOM_FUNCTION(TonyHips)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyHips(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_HIPS;
}
-DECLARE_CUSTOM_FUNCTION(TonySing)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonySing(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SING;
}
-DECLARE_CUSTOM_FUNCTION(TonyIndicate)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyIndicate(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_INDICATE;
}
-DECLARE_CUSTOM_FUNCTION(TonyScaredWithHands)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyScaredWithHands(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SCARED;
}
-DECLARE_CUSTOM_FUNCTION(TonyScaredWithoutHands)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyScaredWithoutHands(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SCARED2;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithHammer)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithHammer(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHHAMMER;
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHHAMMER);
}
-DECLARE_CUSTOM_FUNCTION(TonyWithGlasses)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithGlasses(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHGLASSES;
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHGLASSES);
}
-DECLARE_CUSTOM_FUNCTION(TonyWithWorm)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithWorm(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHWORM;
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHWORM);
}
-DECLARE_CUSTOM_FUNCTION(TonyWithRope)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithRope(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHROPE;
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHROPE);
}
-DECLARE_CUSTOM_FUNCTION(TonyWithSecretary)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithSecretary(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHSECRETARY;
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_WITHSECRETARY);
}
-DECLARE_CUSTOM_FUNCTION(TonyWithRabbitANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithRabbitANIM(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHRABBIT;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithRecipeANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithRecipeANIM(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHRECIPE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithCardsANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithCardsANIM(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHCARDS;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanANIM)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyWithSnowmanANIM(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_WITHSNOWMAN;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithSnowmanStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -875,7 +837,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanStart)(CORO_PARAM, uint32, uint32, uint32
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithSnowmanEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -888,7 +850,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithSnowmanEnd)(CORO_PARAM, uint32, uint32, uint32,
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithRabbitStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithRabbitStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -901,7 +863,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithRabbitStart)(CORO_PARAM, uint32, uint32, uint32,
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithRabbitEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithRabbitEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -914,7 +876,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithRabbitEnd)(CORO_PARAM, uint32, uint32, uint32, u
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithRecipeStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithRecipeStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -927,7 +889,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithRecipeStart)(CORO_PARAM, uint32, uint32, uint32,
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithRecipeEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithRecipeEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -940,7 +902,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithRecipeEnd)(CORO_PARAM, uint32, uint32, uint32, u
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithCardsStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithCardsStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -953,7 +915,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithCardsStart)(CORO_PARAM, uint32, uint32, uint32,
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithCardsEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithCardsEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -966,7 +928,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithCardsEnd)(CORO_PARAM, uint32, uint32, uint32, ui
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithNotebookStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithNotebookStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -979,7 +941,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithNotebookStart)(CORO_PARAM, uint32, uint32, uint3
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithNotebookEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithNotebookEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -992,7 +954,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithNotebookEnd)(CORO_PARAM, uint32, uint32, uint32,
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithMegaphoneStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithMegaphoneStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1005,7 +967,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithMegaphoneStart)(CORO_PARAM, uint32, uint32, uint
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithMegaphoneEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithMegaphoneEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1018,7 +980,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithMegaphoneEnd)(CORO_PARAM, uint32, uint32, uint32
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithBeardStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithBeardStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1031,7 +993,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithBeardStart)(CORO_PARAM, uint32, uint32, uint32,
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyWithBeardEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyWithBeardEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1044,7 +1006,7 @@ DECLARE_CUSTOM_FUNCTION(TonyWithBeardEnd)(CORO_PARAM, uint32, uint32, uint32, ui
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyScaredStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyScaredStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1057,7 +1019,7 @@ DECLARE_CUSTOM_FUNCTION(TonyScaredStart)(CORO_PARAM, uint32, uint32, uint32, uin
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonyScaredEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonyScaredEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1071,12 +1033,12 @@ DECLARE_CUSTOM_FUNCTION(TonyScaredEnd)(CORO_PARAM, uint32, uint32, uint32, uint3
}
-DECLARE_CUSTOM_FUNCTION(TonyDisgusted)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonyDisgusted(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_DISGUSTED;
}
-DECLARE_CUSTOM_FUNCTION(TonySniffLeft)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonySniffLeft(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1084,12 +1046,12 @@ DECLARE_CUSTOM_FUNCTION(TonySniffLeft)(CORO_PARAM, uint32, uint32, uint32, uint3
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_SNIFF_LEFT);
CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern);
- CORO_INVOKE_4(LeftToMe, 0, 0, 0, 0);
+ CORO_INVOKE_4(leftToMe, 0, 0, 0, 0);
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonySniffRight)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void tonySniffRight(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1097,17 +1059,17 @@ DECLARE_CUSTOM_FUNCTION(TonySniffRight)(CORO_PARAM, uint32, uint32, uint32, uint
GLOBALS._tony->setPattern(GLOBALS._tony->PAT_SNIFF_RIGHT);
CORO_INVOKE_0(GLOBALS._tony->waitForEndPattern);
- CORO_INVOKE_4(RightToMe, 0, 0, 0, 0);
+ CORO_INVOKE_4(rightToMe, 0, 0, 0, 0);
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(TonySarcastic)(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
- TonySetNumTexts(dwText);
+void tonySarcastic(CORO_PARAM, uint32 dwText, uint32, uint32, uint32) {
+ tonySetNumTexts(dwText);
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_SARCASTIC;
}
-DECLARE_CUSTOM_FUNCTION(TonyMacbeth)(CORO_PARAM, uint32 nPos, uint32, uint32, uint32) {
+void tonyMacbeth(CORO_PARAM, uint32 nPos, uint32, uint32, uint32) {
switch (nPos) {
case 1:
GLOBALS._nTonyNextTalkType = GLOBALS._tony->TALK_MACBETH1;
@@ -1140,15 +1102,15 @@ DECLARE_CUSTOM_FUNCTION(TonyMacbeth)(CORO_PARAM, uint32 nPos, uint32, uint32, ui
}
-DECLARE_CUSTOM_FUNCTION(EnableTony)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void enableTony(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._tony->show();
}
-DECLARE_CUSTOM_FUNCTION(DisableTony)(CORO_PARAM, uint32 bShowShadow, uint32, uint32, uint32) {
+void disableTony(CORO_PARAM, uint32 bShowShadow, uint32, uint32, uint32) {
GLOBALS._tony->hide(bShowShadow);
}
-DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(CORO_PARAM, uint32 nItem, uint32, uint32, uint32) {
+void waitForPatternEnd(CORO_PARAM, uint32 nItem, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
RMItem *item;
CORO_END_CONTEXT(_ctx);
@@ -1164,11 +1126,11 @@ DECLARE_CUSTOM_FUNCTION(WaitForPatternEnd)(CORO_PARAM, uint32 nItem, uint32, uin
}
-DECLARE_CUSTOM_FUNCTION(SetTonyPosition)(CORO_PARAM, uint32 nX, uint32 nY, uint32 nLoc, uint32) {
+void setTonyPosition(CORO_PARAM, uint32 nX, uint32 nY, uint32 nLoc, uint32) {
GLOBALS._tony->setPosition(RMPoint(nX, nY), nLoc);
}
-DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) {
+void moveTonyAndWait(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -1187,11 +1149,11 @@ DECLARE_CUSTOM_FUNCTION(MoveTonyAndWait)(CORO_PARAM, uint32 nX, uint32 nY, uint3
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(MoveTony)(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) {
+void moveTony(CORO_PARAM, uint32 nX, uint32 nY, uint32, uint32) {
GLOBALS._tony->move(coroParam, RMPoint(nX, nY));
}
-DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) {
+void scrollLocation(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) {
CORO_BEGIN_CONTEXT;
int lx, ly;
RMPoint pt;
@@ -1239,7 +1201,7 @@ DECLARE_CUSTOM_FUNCTION(ScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) {
+void syncScrollLocation(CORO_PARAM, uint32 nX, uint32 nY, uint32 sX, uint32 sY) {
CORO_BEGIN_CONTEXT;
int lx, ly;
RMPoint pt, startpt;
@@ -1321,7 +1283,7 @@ DECLARE_CUSTOM_FUNCTION(SyncScrollLocation)(CORO_PARAM, uint32 nX, uint32 nY, ui
}
-DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uint32 nY, uint32) {
+void changeHotspot(CORO_PARAM, uint32 dwCode, uint32 nX, uint32 nY, uint32) {
int i;
for (i = 0; i < GLOBALS._curChangedHotspot; i++) {
@@ -1343,15 +1305,15 @@ DECLARE_CUSTOM_FUNCTION(ChangeHotspot)(CORO_PARAM, uint32 dwCode, uint32 nX, uin
}
-DECLARE_CUSTOM_FUNCTION(AutoSave)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void autoSave(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->autoSave(coroParam);
}
-DECLARE_CUSTOM_FUNCTION(AbortGame)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void abortGame(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->abortGame();
}
-DECLARE_CUSTOM_FUNCTION(ShakeScreen)(CORO_PARAM, uint32 nScosse, uint32, uint32, uint32) {
+void shakeScreen(CORO_PARAM, uint32 nScosse, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
uint32 i;
uint32 curTime;
@@ -1389,7 +1351,7 @@ DECLARE_CUSTOM_FUNCTION(ShakeScreen)(CORO_PARAM, uint32 nScosse, uint32, uint32,
* Characters
*/
-DECLARE_CUSTOM_FUNCTION(CharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) {
+void charSetCode(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) {
assert(nChar < 16);
GLOBALS._character[nChar]._code = nCode;
GLOBALS._character[nChar]._item = GLOBALS._loc->getItemFromCode(nCode);
@@ -1404,26 +1366,26 @@ DECLARE_CUSTOM_FUNCTION(CharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uin
GLOBALS._isMChar[nChar] = false;
}
-DECLARE_CUSTOM_FUNCTION(CharSetColor)(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) {
+void charSetColor(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) {
assert(nChar < 16);
GLOBALS._character[nChar]._r = r;
GLOBALS._character[nChar]._g = g;
GLOBALS._character[nChar]._b = b;
}
-DECLARE_CUSTOM_FUNCTION(CharSetTalkPattern)(CORO_PARAM, uint32 nChar, uint32 tp, uint32 sp, uint32) {
+void charSetTalkPattern(CORO_PARAM, uint32 nChar, uint32 tp, uint32 sp, uint32) {
assert(nChar < 16);
GLOBALS._character[nChar]._talkPattern = tp;
GLOBALS._character[nChar]._standPattern = sp;
}
-DECLARE_CUSTOM_FUNCTION(CharSetStartEndTalkPattern)(CORO_PARAM, uint32 nChar, uint32 sp, uint32 ep, uint32) {
+void charSetStartEndTalkPattern(CORO_PARAM, uint32 nChar, uint32 sp, uint32 ep, uint32) {
assert(nChar < 16);
GLOBALS._character[nChar]._startTalkPattern = sp;
GLOBALS._character[nChar]._endTalkPattern = ep;
}
-DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32) {
+void charSendMessage(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32) {
CORO_BEGIN_CONTEXT;
RMMessage *msg;
int i;
@@ -1450,7 +1412,7 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess
GLOBALS._character[nChar]._item->setPattern(GLOBALS._character[nChar]._talkPattern);
- _ctx->curVoc = SearchVoiceHeader(0, dwMessage);
+ _ctx->curVoc = searchVoiceHeader(0, dwMessage);
_ctx->voice = NULL;
if (_ctx->curVoc) {
// Position within the database of entries, beginning at the first
@@ -1530,15 +1492,15 @@ DECLARE_CUSTOM_FUNCTION(CharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMess
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(AddInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) {
+void addInventory(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) {
GLOBALS._inventory->addItem(dwCode);
}
-DECLARE_CUSTOM_FUNCTION(RemoveInventory)(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) {
+void removeInventory(CORO_PARAM, uint32 dwCode, uint32, uint32, uint32) {
GLOBALS._inventory->removeItem(dwCode);
}
-DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(CORO_PARAM, uint32 dwCode, uint32 dwStatus, uint32, uint32) {
+void changeInventoryStatus(CORO_PARAM, uint32 dwCode, uint32 dwStatus, uint32, uint32) {
GLOBALS._inventory->changeItemStatus(dwCode, dwStatus);
}
@@ -1547,7 +1509,7 @@ DECLARE_CUSTOM_FUNCTION(ChangeInventoryStatus)(CORO_PARAM, uint32 dwCode, uint32
* Master Characters
*/
-DECLARE_CUSTOM_FUNCTION(MCharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) {
+void mCharSetCode(CORO_PARAM, uint32 nChar, uint32 nCode, uint32, uint32) {
assert(nChar < 10);
GLOBALS._mCharacter[nChar]._code = nCode;
if (nCode == 0)
@@ -1569,56 +1531,52 @@ DECLARE_CUSTOM_FUNCTION(MCharSetCode)(CORO_PARAM, uint32 nChar, uint32 nCode, ui
GLOBALS._isMChar[nChar] = true;
}
-DECLARE_CUSTOM_FUNCTION(MCharResetCode)(CORO_PARAM, uint32 nChar, uint32, uint32, uint32) {
+void mCharResetCode(CORO_PARAM, uint32 nChar, uint32, uint32, uint32) {
GLOBALS._mCharacter[nChar]._item = GLOBALS._loc->getItemFromCode(GLOBALS._mCharacter[nChar]._code);
}
-DECLARE_CUSTOM_FUNCTION(MCharSetPosition)(CORO_PARAM, uint32 nChar, uint32 nX, uint32 nY, uint32) {
+void mCharSetPosition(CORO_PARAM, uint32 nChar, uint32 nX, uint32 nY, uint32) {
assert(nChar < 10);
GLOBALS._mCharacter[nChar]._x = nX;
GLOBALS._mCharacter[nChar]._y = nY;
}
-
-DECLARE_CUSTOM_FUNCTION(MCharSetColor)(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) {
+void mCharSetColor(CORO_PARAM, uint32 nChar, uint32 r, uint32 g, uint32 b) {
assert(nChar < 10);
GLOBALS._mCharacter[nChar]._r = r;
GLOBALS._mCharacter[nChar]._g = g;
GLOBALS._mCharacter[nChar]._b = b;
}
-
-DECLARE_CUSTOM_FUNCTION(MCharSetNumTalksInGroup)(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32 nTalks, uint32) {
+void mCharSetNumTalksInGroup(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32 nTalks, uint32) {
assert(nChar < 10);
assert(nGroup < 10);
GLOBALS._mCharacter[nChar]._numTalks[nGroup] = nTalks;
}
-
-DECLARE_CUSTOM_FUNCTION(MCharSetCurrentGroup)(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32, uint32) {
+void mCharSetCurrentGroup(CORO_PARAM, uint32 nChar, uint32 nGroup, uint32, uint32) {
assert(nChar < 10);
assert(nGroup < 10);
GLOBALS._mCharacter[nChar]._curGroup = nGroup;
}
-DECLARE_CUSTOM_FUNCTION(MCharSetNumTexts)(CORO_PARAM, uint32 nChar, uint32 nTexts, uint32, uint32) {
+void mCharSetNumTexts(CORO_PARAM, uint32 nChar, uint32 nTexts, uint32, uint32) {
assert(nChar < 10);
GLOBALS._mCharacter[nChar]._numTexts = nTexts - 1;
GLOBALS._mCharacter[nChar]._bInTexts = false;
}
-DECLARE_CUSTOM_FUNCTION(MCharSetAlwaysBack)(CORO_PARAM, uint32 nChar, uint32 bAlwaysBack, uint32, uint32) {
+void mCharSetAlwaysBack(CORO_PARAM, uint32 nChar, uint32 bAlwaysBack, uint32, uint32) {
assert(nChar < 10);
GLOBALS._mCharacter[nChar]._bAlwaysBack = bAlwaysBack;
}
-
-DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32 nFont) {
+void mCharSendMessage(CORO_PARAM, uint32 nChar, uint32 dwMessage, uint32 bIsBack, uint32 nFont) {
CORO_BEGIN_CONTEXT;
RMMessage *msg;
int i;
@@ -1658,11 +1616,10 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes
}
}
- _ctx->curVoc = SearchVoiceHeader(0, dwMessage);
+ _ctx->curVoc = searchVoiceHeader(0, dwMessage);
_ctx->voice = NULL;
if (_ctx->curVoc) {
// Position within the database of entries, beginning at the first
- // fseek(g_vm->m_vdbFP, curVoc->offset, SEEK_SET);
g_vm->_vdbFP.seek(_ctx->curVoc->_offset);
_ctx->curOffset = _ctx->curVoc->_offset;
}
@@ -1744,9 +1701,7 @@ DECLARE_CUSTOM_FUNCTION(MCharSendMessage)(CORO_PARAM, uint32 nChar, uint32 dwMes
* Dialogs
*/
-int g_curDialog;
-
-DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg, uint32, uint32) {
+void sendDialogMessage(CORO_PARAM, uint32 nPers, uint32 nMsg, uint32, uint32) {
CORO_BEGIN_CONTEXT;
char *string;
RMTextDialog *text;
@@ -1766,7 +1721,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg
if (nPers != 0 && GLOBALS._isMChar[nPers] && GLOBALS._mCharacter[nPers]._bAlwaysBack)
_ctx->bIsBack = true;
- _ctx->curVoc = SearchVoiceHeader(g_curDialog, nMsg);
+ _ctx->curVoc = searchVoiceHeader(GLOBALS._curDialog, nMsg);
_ctx->voice = NULL;
if (_ctx->curVoc) {
@@ -1927,7 +1882,7 @@ DECLARE_CUSTOM_FUNCTION(SendDialogMessage)(CORO_PARAM, uint32 nPers, uint32 nMsg
// @@@@ This cannot be skipped!!!!!!!!!!!!!!!!!!!
-DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGroup, uint32, uint32) {
+void startDialog(CORO_PARAM, uint32 nDialog, uint32 nStartGroup, uint32, uint32) {
CORO_BEGIN_CONTEXT;
uint32 nChoice;
uint32 *sl;
@@ -1939,7 +1894,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr
CORO_BEGIN_CODE(_ctx);
- g_curDialog = nDialog;
+ GLOBALS._curDialog = nDialog;
// Call MPAL to start the dialog
mpalQueryDoDialog(nDialog, nStartGroup);
@@ -2010,7 +1965,7 @@ DECLARE_CUSTOM_FUNCTION(StartDialog)(CORO_PARAM, uint32 nDialog, uint32 nStartGr
* Sync between idle and mpal
*/
-DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) {
+void takeOwnership(CORO_PARAM, uint32 num, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -2028,7 +1983,7 @@ DECLARE_CUSTOM_FUNCTION(TakeOwnership)(CORO_PARAM, uint32 num, uint32, uint32, u
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32, uint32) {
+void releaseOwnership(CORO_PARAM, uint32 num, uint32, uint32, uint32) {
if (!GLOBALS._mut[num]._lockCount) {
warning("ReleaseOwnership tried to release mutex %d, which isn't held", num);
return;
@@ -2058,7 +2013,7 @@ DECLARE_CUSTOM_FUNCTION(ReleaseOwnership)(CORO_PARAM, uint32 num, uint32, uint32
*
*/
-void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) {
+void threadFadeInMusic(CORO_PARAM, const void *nMusic) {
CORO_BEGIN_CONTEXT;
int i;
CORO_END_CONTEXT(_ctx);
@@ -2083,7 +2038,7 @@ void ThreadFadeInMusic(CORO_PARAM, const void *nMusic) {
CORO_END_CODE;
}
-void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) {
+void threadFadeOutMusic(CORO_PARAM, const void *nMusic) {
CORO_BEGIN_CONTEXT;
int i;
int startVolume;
@@ -2114,52 +2069,52 @@ void ThreadFadeOutMusic(CORO_PARAM, const void *nMusic) {
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(FadeInSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) {
- CoroScheduler.createProcess(ThreadFadeInMusic, &GLOBALS._curSoundEffect, sizeof(int));
+void fadeInSoundEffect(CORO_PARAM, uint32, uint32, uint32, uint32) {
+ CoroScheduler.createProcess(threadFadeInMusic, &GLOBALS._curSoundEffect, sizeof(int));
}
-DECLARE_CUSTOM_FUNCTION(FadeOutSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void fadeOutSoundEffect(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._bFadeOutStop = false;
- CoroScheduler.createProcess(ThreadFadeOutMusic, &GLOBALS._curSoundEffect, sizeof(int));
+ CoroScheduler.createProcess(threadFadeOutMusic, &GLOBALS._curSoundEffect, sizeof(int));
}
-DECLARE_CUSTOM_FUNCTION(FadeOutJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void fadeOutJingle(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._bFadeOutStop = false;
int channel = 2;
- CoroScheduler.createProcess(ThreadFadeOutMusic, &channel, sizeof(int));
+ CoroScheduler.createProcess(threadFadeOutMusic, &channel, sizeof(int));
}
-DECLARE_CUSTOM_FUNCTION(FadeInJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void fadeInJingle(CORO_PARAM, uint32, uint32, uint32, uint32) {
int channel = 2;
- CoroScheduler.createProcess(ThreadFadeInMusic, &channel, sizeof(int));
+ CoroScheduler.createProcess(threadFadeInMusic, &channel, sizeof(int));
}
-DECLARE_CUSTOM_FUNCTION(StopSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void stopSoundEffect(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->stopMusic(GLOBALS._curSoundEffect);
}
-DECLARE_CUSTOM_FUNCTION(StopJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void stopJingle(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->stopMusic(2);
}
-DECLARE_CUSTOM_FUNCTION(MuteSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void muteSoundEffect(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->setMusicVolume(GLOBALS._curSoundEffect, 0);
}
-DECLARE_CUSTOM_FUNCTION(DemuteSoundEffect)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void demuteSoundEffect(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._bFadeOutStop = true;
g_vm->setMusicVolume(GLOBALS._curSoundEffect, 64);
}
-DECLARE_CUSTOM_FUNCTION(MuteJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void muteJingle(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->setMusicVolume(2, 0);
}
-DECLARE_CUSTOM_FUNCTION(DemuteJingle)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void demuteJingle(CORO_PARAM, uint32, uint32, uint32, uint32) {
g_vm->setMusicVolume(2, 64);
}
-void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int nSync = 0) {
+void custPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int nSync = 0) {
if (nSync == 0)
nSync = 2000;
debugC(DEBUG_INTERMEDIATE, kTonyDebugMusic, "Start CustPlayMusic");
@@ -2167,21 +2122,21 @@ void CustPlayMusic(uint32 nChannel, const char *mFN, uint32 nFX, bool bLoop, int
debugC(DEBUG_INTERMEDIATE, kTonyDebugMusic, "End CustPlayMusic");
}
-DECLARE_CUSTOM_FUNCTION(PlaySoundEffect)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bNoLoop, uint32) {
+void playSoundEffect(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bNoLoop, uint32) {
if (nFX == 0 || nFX == 1 || nFX == 2) {
debugC(DEBUG_INTERMEDIATE, kTonyDebugSound, "PlaySoundEffect stop fadeout");
GLOBALS._bFadeOutStop = true;
}
GLOBALS._lastMusic = nMusic;
- CustPlayMusic(GLOBALS._curSoundEffect, musicFiles[nMusic].name, nFX, bNoLoop ? false : true, musicFiles[nMusic].sync);
+ custPlayMusic(GLOBALS._curSoundEffect, kMusicFiles[nMusic]._name, nFX, bNoLoop ? false : true, kMusicFiles[nMusic]._sync);
}
-DECLARE_CUSTOM_FUNCTION(PlayJingle)(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bLoop, uint32) {
- CustPlayMusic(2, jingleFileNames[nMusic], nFX, bLoop);
+void playJingle(CORO_PARAM, uint32 nMusic, uint32 nFX, uint32 bLoop, uint32) {
+ custPlayMusic(2, kJingleFileNames[nMusic], nFX, bLoop);
}
-DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(CORO_PARAM, uint32 nItem, uint32 nSFX, uint32, uint32) {
+void playItemSfx(CORO_PARAM, uint32 nItem, uint32 nSFX, uint32, uint32) {
if (nItem == 0) {
GLOBALS._tony->playSfx(nSFX);
} else {
@@ -2191,76 +2146,71 @@ DECLARE_CUSTOM_FUNCTION(PlayItemSfx)(CORO_PARAM, uint32 nItem, uint32 nSFX, uint
}
}
-
-void RestoreMusic(CORO_PARAM) {
+void restoreMusic(CORO_PARAM) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
CORO_BEGIN_CODE(_ctx);
- CORO_INVOKE_4(PlaySoundEffect, GLOBALS._lastMusic, 0, 0, 0);
+ CORO_INVOKE_4(playSoundEffect, GLOBALS._lastMusic, 0, 0, 0);
if (GLOBALS._lastTappeto != 0)
- CustPlayMusic(4, ambianceFile[GLOBALS._lastTappeto], 0, true);
+ custPlayMusic(4, kAmbianceFile[GLOBALS._lastTappeto], 0, true);
CORO_END_CODE;
}
-void SaveMusic(Common::OutSaveFile *f) {
+void saveMusic(Common::OutSaveFile *f) {
f->writeByte(GLOBALS._lastMusic);
f->writeByte(GLOBALS._lastTappeto);
}
-void LoadMusic(Common::InSaveFile *f) {
+void loadMusic(Common::InSaveFile *f) {
GLOBALS._lastMusic = f->readByte();
GLOBALS._lastTappeto = f->readByte();
}
-
-DECLARE_CUSTOM_FUNCTION(JingleFadeStart)(CORO_PARAM, uint32 nJingle, uint32 bLoop, uint32, uint32) {
+void jingleFadeStart(CORO_PARAM, uint32 nJingle, uint32 bLoop, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
CORO_BEGIN_CODE(_ctx);
- CORO_INVOKE_4(FadeOutSoundEffect, 0, 0, 0, 0);
- CORO_INVOKE_4(MuteJingle, 0, 0, 0, 0);
- CORO_INVOKE_4(PlayJingle, nJingle, 0, bLoop, 0);
- CORO_INVOKE_4(FadeInJingle, 0, 0, 0, 0);
+ CORO_INVOKE_4(fadeOutSoundEffect, 0, 0, 0, 0);
+ CORO_INVOKE_4(muteJingle, 0, 0, 0, 0);
+ CORO_INVOKE_4(playJingle, nJingle, 0, bLoop, 0);
+ CORO_INVOKE_4(fadeInJingle, 0, 0, 0, 0);
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(JingleFadeEnd)(CORO_PARAM, uint32 nJingle, uint32 bLoop, uint32, uint32) {
+void jingleFadeEnd(CORO_PARAM, uint32 nJingle, uint32 bLoop, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
CORO_BEGIN_CODE(_ctx);
- CORO_INVOKE_4(FadeOutJingle, 0, 0, 0, 0);
- CORO_INVOKE_4(FadeInSoundEffect, 0, 0, 0, 0);
+ CORO_INVOKE_4(fadeOutJingle, 0, 0, 0, 0);
+ CORO_INVOKE_4(fadeInSoundEffect, 0, 0, 0, 0);
CORO_END_CODE;
}
-
-
-
-DECLARE_CUSTOM_FUNCTION(MustSkipIdleStart)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void mustSkipIdleStart(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._bSkipIdle = true;
CoroScheduler.setEvent(GLOBALS._hSkipIdle);
}
-DECLARE_CUSTOM_FUNCTION(MustSkipIdleEnd)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void mustSkipIdleEnd(CORO_PARAM, uint32, uint32, uint32, uint32) {
GLOBALS._bSkipIdle = false;
CoroScheduler.resetEvent(GLOBALS._hSkipIdle);
}
-DECLARE_CUSTOM_FUNCTION(PatIrqFreeze)(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) {
+void patIrqFreeze(CORO_PARAM, uint32 bStatus, uint32, uint32, uint32) {
// Unused in ScummVM.
}
-DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void openInitLoadMenu(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -2271,7 +2221,7 @@ DECLARE_CUSTOM_FUNCTION(OpenInitLoadMenu)(CORO_PARAM, uint32, uint32, uint32, ui
CORO_END_CODE;
}
-DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(CORO_PARAM, uint32, uint32, uint32, uint32) {
+void openInitOptions(CORO_PARAM, uint32, uint32, uint32, uint32) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -2282,8 +2232,7 @@ DECLARE_CUSTOM_FUNCTION(OpenInitOptions)(CORO_PARAM, uint32, uint32, uint32, uin
CORO_END_CODE;
}
-
-DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint32, uint32) {
+void doCredits(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint32, uint32) {
CORO_BEGIN_CONTEXT;
RMMessage *msg;
RMTextDialog *text;
@@ -2355,159 +2304,157 @@ DECLARE_CUSTOM_FUNCTION(DoCredits)(CORO_PARAM, uint32 nMsg, uint32 dwTime, uint3
CORO_END_CODE;
}
-
-
BEGIN_CUSTOM_FUNCTION_MAP()
-ASSIGN(1, CustLoadLocation)
-ASSIGN(2, MySleep)
-ASSIGN(3, SetPointer)
-ASSIGN(5, MoveTony)
-ASSIGN(6, FaceToMe)
-ASSIGN(7, BackToMe)
-ASSIGN(8, LeftToMe)
-ASSIGN(9, RightToMe)
-ASSIGN(10, SendTonyMessage)
-ASSIGN(11, ChangeBoxStatus)
-ASSIGN(12, ChangeLocation)
-ASSIGN(13, DisableTony)
-ASSIGN(14, EnableTony)
-ASSIGN(15, WaitForPatternEnd)
-ASSIGN(16, SetLocStartPosition)
-ASSIGN(17, ScrollLocation)
-ASSIGN(18, MoveTonyAndWait)
-ASSIGN(19, ChangeHotspot)
-ASSIGN(20, AddInventory)
-ASSIGN(21, RemoveInventory)
-ASSIGN(22, ChangeInventoryStatus)
-ASSIGN(23, SetTonyPosition)
-ASSIGN(24, SendFullscreenMessage)
-ASSIGN(25, SaveTonyPosition)
-ASSIGN(26, RestoreTonyPosition)
-ASSIGN(27, DisableInput)
-ASSIGN(28, EnableInput)
-ASSIGN(29, StopTony)
-
-ASSIGN(30, TonyTakeUp1)
-ASSIGN(31, TonyTakeMid1)
-ASSIGN(32, TonyTakeDown1)
-ASSIGN(33, TonyTakeUp2)
-ASSIGN(34, TonyTakeMid2)
-ASSIGN(35, TonyTakeDown2)
-
-ASSIGN(72, TonyPutUp1)
-ASSIGN(73, TonyPutMid1)
-ASSIGN(74, TonyPutDown1)
-ASSIGN(75, TonyPutUp2)
-ASSIGN(76, TonyPutMid2)
-ASSIGN(77, TonyPutDown2)
-
-ASSIGN(36, TonyOnTheFloor)
-ASSIGN(37, TonyGetUp)
-ASSIGN(38, TonyShepherdess)
-ASSIGN(39, TonyWhistle)
-
-ASSIGN(40, TonyLaugh)
-ASSIGN(41, TonyHips)
-ASSIGN(42, TonySing)
-ASSIGN(43, TonyIndicate)
-ASSIGN(44, TonyScaredWithHands)
-ASSIGN(49, TonyScaredWithoutHands)
-ASSIGN(45, TonyWithGlasses)
-ASSIGN(46, TonyWithWorm)
-ASSIGN(47, TonyWithHammer)
-ASSIGN(48, TonyWithRope)
-ASSIGN(90, TonyWithRabbitANIM)
-ASSIGN(91, TonyWithRecipeANIM)
-ASSIGN(92, TonyWithCardsANIM)
-ASSIGN(93, TonyWithSnowmanANIM)
-ASSIGN(94, TonyWithSnowmanStart)
-ASSIGN(95, TonyWithSnowmanEnd)
-ASSIGN(96, TonyWithRabbitStart)
-ASSIGN(97, TonyWithRabbitEnd)
-ASSIGN(98, TonyWithRecipeStart)
-ASSIGN(99, TonyWithRecipeEnd)
-ASSIGN(100, TonyWithCardsStart)
-ASSIGN(101, TonyWithCardsEnd)
-ASSIGN(102, TonyWithNotebookStart)
-ASSIGN(103, TonyWithNotebookEnd)
-ASSIGN(104, TonyWithMegaphoneStart)
-ASSIGN(105, TonyWithMegaphoneEnd)
-ASSIGN(106, TonyWithBeardStart)
-ASSIGN(107, TonyWithBeardEnd)
-ASSIGN(108, TonyGiggle)
-ASSIGN(109, TonyDisgusted)
-ASSIGN(110, TonySarcastic)
-ASSIGN(111, TonyMacbeth)
-ASSIGN(112, TonySniffLeft)
-ASSIGN(113, TonySniffRight)
-ASSIGN(114, TonyScaredStart)
-ASSIGN(115, TonyScaredEnd)
-ASSIGN(116, TonyWithSecretary)
-
-ASSIGN(50, CharSetCode)
-ASSIGN(51, CharSetColor)
-ASSIGN(52, CharSetTalkPattern)
-ASSIGN(53, CharSendMessage)
-ASSIGN(54, CharSetStartEndTalkPattern)
-
-ASSIGN(60, MCharSetCode)
-ASSIGN(61, MCharSetColor)
-ASSIGN(62, MCharSetCurrentGroup)
-ASSIGN(63, MCharSetNumTalksInGroup)
-ASSIGN(64, MCharSetNumTexts)
-ASSIGN(65, MCharSendMessage)
-ASSIGN(66, MCharSetPosition)
-ASSIGN(67, MCharSetAlwaysBack)
-ASSIGN(68, MCharResetCode)
-
-ASSIGN(70, StartDialog)
-ASSIGN(71, SendDialogMessage)
-
-ASSIGN(80, TakeOwnership)
-ASSIGN(81, ReleaseOwnership)
-
-ASSIGN(86, PlaySoundEffect)
-ASSIGN(87, PlayJingle)
-ASSIGN(88, FadeInSoundEffect)
-ASSIGN(89, FadeOutSoundEffect)
-ASSIGN(123, FadeInJingle)
-ASSIGN(124, FadeOutJingle)
-ASSIGN(125, MuteSoundEffect)
-ASSIGN(126, DemuteSoundEffect)
-ASSIGN(127, MuteJingle)
-ASSIGN(128, DemuteJingle)
-ASSIGN(84, StopSoundEffect)
-ASSIGN(85, StopJingle)
-ASSIGN(83, PlayItemSfx)
-ASSIGN(129, JingleFadeStart)
-ASSIGN(130, JingleFadeEnd)
-
-ASSIGN(120, ShakeScreen)
-ASSIGN(121, AutoSave)
-ASSIGN(122, AbortGame)
-ASSIGN(131, NoBullsEye)
-ASSIGN(132, SendFullscreenMsgStart)
-ASSIGN(133, SendFullscreenMsgEnd)
-ASSIGN(134, CustEnableGUI)
-ASSIGN(135, CustDisableGUI)
-ASSIGN(136, ClearScreen)
-ASSIGN(137, PatIrqFreeze)
-ASSIGN(138, TonySetPerorate)
-ASSIGN(139, OpenInitLoadMenu)
-ASSIGN(140, OpenInitOptions)
-ASSIGN(141, SyncScrollLocation)
-ASSIGN(142, CloseLocation)
-ASSIGN(143, SetAlwaysDisplay)
-ASSIGN(144, DoCredits)
-
-ASSIGN(200, MustSkipIdleStart);
-ASSIGN(201, MustSkipIdleEnd);
+ASSIGN(1, custLoadLocation)
+ASSIGN(2, mySleep)
+ASSIGN(3, setPointer)
+ASSIGN(5, moveTony)
+ASSIGN(6, faceToMe)
+ASSIGN(7, backToMe)
+ASSIGN(8, leftToMe)
+ASSIGN(9, rightToMe)
+ASSIGN(10, sendTonyMessage)
+ASSIGN(11, changeBoxStatus)
+ASSIGN(12, changeLocation)
+ASSIGN(13, disableTony)
+ASSIGN(14, enableTony)
+ASSIGN(15, waitForPatternEnd)
+ASSIGN(16, setLocStartPosition)
+ASSIGN(17, scrollLocation)
+ASSIGN(18, moveTonyAndWait)
+ASSIGN(19, changeHotspot)
+ASSIGN(20, addInventory)
+ASSIGN(21, removeInventory)
+ASSIGN(22, changeInventoryStatus)
+ASSIGN(23, setTonyPosition)
+ASSIGN(24, sendFullscreenMessage)
+ASSIGN(25, saveTonyPosition)
+ASSIGN(26, restoreTonyPosition)
+ASSIGN(27, disableInput)
+ASSIGN(28, enableInput)
+ASSIGN(29, stopTony)
+
+ASSIGN(30, tonyTakeUp1)
+ASSIGN(31, tonyTakeMid1)
+ASSIGN(32, tonyTakeDown1)
+ASSIGN(33, tonyTakeUp2)
+ASSIGN(34, tonyTakeMid2)
+ASSIGN(35, tonyTakeDown2)
+
+ASSIGN(72, tonyPutUp1)
+ASSIGN(73, tonyPutMid1)
+ASSIGN(74, tonyPutDown1)
+ASSIGN(75, tonyPutUp2)
+ASSIGN(76, tonyPutMid2)
+ASSIGN(77, tonyPutDown2)
+
+ASSIGN(36, tonyOnTheFloor)
+ASSIGN(37, tonyGetUp)
+ASSIGN(38, tonyShepherdess)
+ASSIGN(39, tonyWhistle)
+
+ASSIGN(40, tonyLaugh)
+ASSIGN(41, tonyHips)
+ASSIGN(42, tonySing)
+ASSIGN(43, tonyIndicate)
+ASSIGN(44, tonyScaredWithHands)
+ASSIGN(49, tonyScaredWithoutHands)
+ASSIGN(45, tonyWithGlasses)
+ASSIGN(46, tonyWithWorm)
+ASSIGN(47, tonyWithHammer)
+ASSIGN(48, tonyWithRope)
+ASSIGN(90, tonyWithRabbitANIM)
+ASSIGN(91, tonyWithRecipeANIM)
+ASSIGN(92, tonyWithCardsANIM)
+ASSIGN(93, tonyWithSnowmanANIM)
+ASSIGN(94, tonyWithSnowmanStart)
+ASSIGN(95, tonyWithSnowmanEnd)
+ASSIGN(96, tonyWithRabbitStart)
+ASSIGN(97, tonyWithRabbitEnd)
+ASSIGN(98, tonyWithRecipeStart)
+ASSIGN(99, tonyWithRecipeEnd)
+ASSIGN(100, tonyWithCardsStart)
+ASSIGN(101, tonyWithCardsEnd)
+ASSIGN(102, tonyWithNotebookStart)
+ASSIGN(103, tonyWithNotebookEnd)
+ASSIGN(104, tonyWithMegaphoneStart)
+ASSIGN(105, tonyWithMegaphoneEnd)
+ASSIGN(106, tonyWithBeardStart)
+ASSIGN(107, tonyWithBeardEnd)
+ASSIGN(108, tonyGiggle)
+ASSIGN(109, tonyDisgusted)
+ASSIGN(110, tonySarcastic)
+ASSIGN(111, tonyMacbeth)
+ASSIGN(112, tonySniffLeft)
+ASSIGN(113, tonySniffRight)
+ASSIGN(114, tonyScaredStart)
+ASSIGN(115, tonyScaredEnd)
+ASSIGN(116, tonyWithSecretary)
+
+ASSIGN(50, charSetCode)
+ASSIGN(51, charSetColor)
+ASSIGN(52, charSetTalkPattern)
+ASSIGN(53, charSendMessage)
+ASSIGN(54, charSetStartEndTalkPattern)
+
+ASSIGN(60, mCharSetCode)
+ASSIGN(61, mCharSetColor)
+ASSIGN(62, mCharSetCurrentGroup)
+ASSIGN(63, mCharSetNumTalksInGroup)
+ASSIGN(64, mCharSetNumTexts)
+ASSIGN(65, mCharSendMessage)
+ASSIGN(66, mCharSetPosition)
+ASSIGN(67, mCharSetAlwaysBack)
+ASSIGN(68, mCharResetCode)
+
+ASSIGN(70, startDialog)
+ASSIGN(71, sendDialogMessage)
+
+ASSIGN(80, takeOwnership)
+ASSIGN(81, releaseOwnership)
+
+ASSIGN(86, playSoundEffect)
+ASSIGN(87, playJingle)
+ASSIGN(88, fadeInSoundEffect)
+ASSIGN(89, fadeOutSoundEffect)
+ASSIGN(123, fadeInJingle)
+ASSIGN(124, fadeOutJingle)
+ASSIGN(125, muteSoundEffect)
+ASSIGN(126, demuteSoundEffect)
+ASSIGN(127, muteJingle)
+ASSIGN(128, demuteJingle)
+ASSIGN(84, stopSoundEffect)
+ASSIGN(85, stopJingle)
+ASSIGN(83, playItemSfx)
+ASSIGN(129, jingleFadeStart)
+ASSIGN(130, jingleFadeEnd)
+
+ASSIGN(120, shakeScreen)
+ASSIGN(121, autoSave)
+ASSIGN(122, abortGame)
+ASSIGN(131, noBullsEye)
+ASSIGN(132, sendFullscreenMsgStart)
+ASSIGN(133, sendFullscreenMsgEnd)
+ASSIGN(134, custEnableGUI)
+ASSIGN(135, custDisableGUI)
+ASSIGN(136, clearScreen)
+ASSIGN(137, patIrqFreeze)
+ASSIGN(138, tonySetPerorate)
+ASSIGN(139, openInitLoadMenu)
+ASSIGN(140, openInitOptions)
+ASSIGN(141, syncScrollLocation)
+ASSIGN(142, closeLocation)
+ASSIGN(143, setAlwaysDisplay)
+ASSIGN(144, doCredits)
+
+ASSIGN(200, mustSkipIdleStart);
+ASSIGN(201, mustSkipIdleEnd);
END_CUSTOM_FUNCTION_MAP()
void processKilledCallback(Common::PROCESS *p) {
- for (uint i = 0; i < 10; i++)
+ for (uint i = 0; i < 10; i++) {
if (GLOBALS._mut[i]._ownerPid == p->pid) {
// Handle scripts which don't call ReleaseOwnership, such as
// the one in loc37's vEnter when Tony is chasing the mouse.
@@ -2517,6 +2464,7 @@ void processKilledCallback(Common::PROCESS *p) {
GLOBALS._mut[i]._lockCount = 0;
CoroScheduler.setEvent(GLOBALS._mut[i]._eventId);
}
+ }
}
void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation *loc, RMInventory *inv, RMInput *input) {
@@ -2531,13 +2479,12 @@ void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation
GLOBALS.EnableGUI = mainEnableGUI;
GLOBALS._bAlwaysDisplay = false;
- int i;
CoroScheduler.setResourceCallback(processKilledCallback);
- for (i = 0; i < 10; i++)
+ for (int i = 0; i < 10; i++)
GLOBALS._mut[i]._eventId = CoroScheduler.createEvent(false, true);
- for (i = 0; i < 200; i++)
+ for (int i = 0; i < 200; i++)
GLOBALS._ambiance[i] = 0;
GLOBALS._ambiance[6] = AMBIANCE_CRICKETS;
diff --git a/engines/tony/custom.h b/engines/tony/custom.h
index 524ab14aab..0f1061e8cd 100644
--- a/engines/tony/custom.h
+++ b/engines/tony/custom.h
@@ -36,9 +36,12 @@ namespace Tony {
using namespace MPAL;
-#define INIT_CUSTOM_FUNCTION MapCustomFunctions
+struct MusicFileEntry {
+ const char *_name;
+ int _sync;
+};
-#define DECLARE_CUSTOM_FUNCTION(x) void x
+#define INIT_CUSTOM_FUNCTION MapCustomFunctions
#define BEGIN_CUSTOM_FUNCTION_MAP() \
static void AssignError(int num) { \
@@ -63,6 +66,17 @@ class RMLocation;
class RMInventory;
class RMInput;
+void charsSaveAll(Common::OutSaveFile *f);
+void charsLoadAll(Common::InSaveFile *f);
+void mCharResetCodes();
+void saveChangedHotspot(Common::OutSaveFile *f);
+void loadChangedHotspot(Common::InSaveFile *f);
+void reapplyChangedHotspot();
+
+void restoreMusic(CORO_PARAM);
+void saveMusic(Common::OutSaveFile *f);
+void loadMusic(Common::InSaveFile *f);
+
void INIT_CUSTOM_FUNCTION(LPCUSTOMFUNCTION *lpMap, Common::String *lpStrMap);
void setupGlobalVars(RMTony *tony, RMPointer *ptr, RMGameBoxes *box, RMLocation *loc, RMInventory *inv, RMInput *input);
diff --git a/engines/tony/font.cpp b/engines/tony/font.cpp
index 927adf9006..f4594f080d 100644
--- a/engines/tony/font.cpp
+++ b/engines/tony/font.cpp
@@ -84,10 +84,9 @@ void RMFont::unload() {
RMGfxPrimitive *RMFont::makeLetterPrimitive(byte bChar, int &nLength) {
RMFontPrimitive *prim;
- int nLett;
// Convert from character to glyph index
- nLett = convertToLetter(bChar);
+ int nLett = convertToLetter(bChar);
assert(nLett < _nLetters);
// Create primitive font
@@ -120,12 +119,11 @@ void RMFont::close() {
}
int RMFont::stringLen(const Common::String &text) {
- uint len, i;
-
if (text.empty())
return letterLength('\0');
- len = 0;
+ uint len = 0;
+ uint i;
for (i = 0; i < text.size() - 1; i++)
len += letterLength(text[i], text[i + 1]);
len += letterLength(text[i]);
@@ -157,7 +155,6 @@ void RMFontColor::setBaseColor(byte r1, byte g1, byte b1) {
int gstep = g / 14;
int bstep = b / 14;
- int i;
byte pal[768 * 3];
// Check if we are already on the right color
@@ -169,7 +166,7 @@ void RMFontColor::setBaseColor(byte r1, byte g1, byte b1) {
_fontB = b1;
// Constructs a new palette for the font
- for (i = 1; i < 16; i++) {
+ for (int i = 1; i < 16; i++) {
pal[i * 3 + 0] = r >> 16;
pal[i * 3 + 1] = g >> 16;
pal[i * 3 + 2] = b >> 16;
@@ -184,7 +181,7 @@ void RMFontColor::setBaseColor(byte r1, byte g1, byte b1) {
pal[15 * 3 + 2] += 8;
// Puts in all the letters
- for (i = 0; i < _nLetters; i++)
+ for (int i = 0; i < _nLetters; i++)
_letter[i].loadPaletteWA(pal);
}
@@ -204,8 +201,6 @@ int RMFontWithTables::letterLength(int nChar, int nNext) {
\****************************************************************************/
void RMFontDialog::init() {
- int i;
-
// bernie: Number of characters in the font
int nchars =
112 // base
@@ -222,7 +217,7 @@ void RMFontDialog::init() {
_hDefault = 18;
Common::fill(&_l2Table[0][0], &_l2Table[0][0] + (256 * 256), '\0');
- for (i = 0; i < 256; i++) {
+ for (int i = 0; i < 256; i++) {
_cTable[i] = g_vm->_cTableDialog[i];
_lTable[i] = g_vm->_lTableDialog[i];
}
@@ -234,8 +229,6 @@ void RMFontDialog::init() {
\****************************************************************************/
void RMFontMacc::init() {
- int i;
-
// bernie: Number of characters in the font
int nchars =
102 // base
@@ -245,7 +238,6 @@ void RMFontMacc::init() {
+ 8 // francais
+ 5; // deutsch
-
load(RES_F_MACC, nchars, 11, 16);
// Default
@@ -253,7 +245,7 @@ void RMFontMacc::init() {
_hDefault = 17;
Common::fill(&_l2Table[0][0], &_l2Table[0][0] + (256 * 256), '\0');
- for (i = 0; i < 256; i++) {
+ for (int i = 0; i < 256; i++) {
_cTable[i] = g_vm->_cTableMacc[i];
_lTable[i] = g_vm->_lTableMacc[i];
}
@@ -264,8 +256,6 @@ void RMFontMacc::init() {
\****************************************************************************/
void RMFontCredits::init() {
- int i;
-
// bernie: Number of characters in the font
int nchars =
112 // base
@@ -275,7 +265,6 @@ void RMFontCredits::init() {
+ 8 // french
+ 2; // deutsch
-
load(RES_F_CREDITS, nchars, 27, 28, RES_F_CPAL);
// Default
@@ -283,7 +272,7 @@ void RMFontCredits::init() {
_hDefault = 28;
Common::fill(&_l2Table[0][0], &_l2Table[0][0] + (256 * 256), '\0');
- for (i = 0; i < 256; i++) {
+ for (int i = 0; i < 256; i++) {
_cTable[i] = g_vm->_cTableCred[i];
_lTable[i] = g_vm->_lTableCred[i];
}
@@ -305,10 +294,7 @@ void RMFontObj::setBothCase(int nChar, int nNext, signed char spiazz) {
_l2Table[TOLOWER(nChar)][TOLOWER(nNext)] = spiazz;
}
-
void RMFontObj::init() {
- int i;
-
//bernie: Number of characters in the font (solo maiuscolo)
int nchars =
85 // base
@@ -318,7 +304,6 @@ void RMFontObj::init() {
+ 0 // francais (no uppercase chars)
+ 1; // deutsch
-
load(RES_F_OBJ, nchars, 25, 30);
// Initialize the font table
@@ -326,7 +311,7 @@ void RMFontObj::init() {
_hDefault = 30;
Common::fill(&_l2Table[0][0], &_l2Table[0][0] + (256 * 256), '\0');
- for (i = 0; i < 256; i++) {
+ for (int i = 0; i < 256; i++) {
_cTable[i] = g_vm->_cTableObj[i];
_lTable[i] = g_vm->_lTableObj[i];
}
@@ -345,7 +330,6 @@ void RMFontObj::init() {
setBothCase('R', 'U', 3);
}
-
/****************************************************************************\
* RMText Methods
\****************************************************************************/
@@ -409,11 +393,6 @@ void RMText::writeText(const Common::String &text, int nFont, int *time) {
void RMText::writeText(Common::String text, RMFontColor *font, int *time) {
RMGfxPrimitive *prim;
- uint p, old_p;
- int j, x, y;
- int len;
- int numchar;
- int width, height;
// Set the base color
font->setBaseColor(_textR, _textG, _textB);
@@ -428,8 +407,9 @@ void RMText::writeText(Common::String text, RMFontColor *font, int *time) {
// Divide the words into lines. In this cycle, X contains the maximum length reached by a line,
// and the number of lines
Common::Array<Common::String> lines;
- p = 0;
- j = x = 0;
+ uint p = 0;
+ int j = 0;
+ int x = 0;
while (p < text.size()) {
j += font->stringLen(text[p]);
if (j > (((_aHorType == HLEFTPAR) && (lines.size() > 0)) ? _maxLineLength - 25 : _maxLineLength)) {
@@ -443,7 +423,7 @@ void RMText::writeText(Common::String text, RMFontColor *font, int *time) {
// width of a line caused discontinuation of the whole sentence.
// This workaround has the partial word broken up so it will still display
//
- old_p = p;
+ uint old_p = p;
while (text[p] != ' ' && text[p] != '-' && p > 0)
p--;
@@ -475,8 +455,8 @@ void RMText::writeText(Common::String text, RMFontColor *font, int *time) {
x += 8;
// Starting position for the surface: X1, Y
- width = x;
- height = (lines.size() - 1) * font->letterHeight() + font->_fontDimy;
+ int width = x;
+ int height = (lines.size() - 1) * font->letterHeight() + font->_fontDimy;
// Create the surface
create(width, height);
@@ -484,8 +464,8 @@ void RMText::writeText(Common::String text, RMFontColor *font, int *time) {
p = 0;
- y = 0;
- numchar = 0;
+ int y = 0;
+ int numchar = 0;
for (uint i = 0; i < lines.size(); ++i) {
const Common::String &line = lines[i];
@@ -522,6 +502,7 @@ void RMText::writeText(Common::String text, RMFontColor *font, int *time) {
continue;
}
+ int len;
prim = font->makeLetterPrimitive(line[p], len);
prim->getDst()._x1 = x;
prim->getDst()._y1 = y;
@@ -987,8 +968,6 @@ void RMDialogChoice::close() {
}
void RMDialogChoice::setNumChoices(int num) {
- int i;
-
_numChoices = num;
_curAdded = 0;
@@ -997,7 +976,7 @@ void RMDialogChoice::setNumChoices(int num) {
_ptDrawStrings = new RMPoint[num];
// Initialization
- for (i = 0; i < _numChoices; i++) {
+ for (int i = 0; i < _numChoices; i++) {
_drawedStrings[i].setColor(0, 255, 0);
_drawedStrings[i].setAlignType(RMText::HLEFTPAR, RMText::VTOP);
_drawedStrings[i].setMaxLineLength(600);
diff --git a/engines/tony/game.cpp b/engines/tony/game.cpp
index 2bcfdc7fc2..5b586611c9 100644
--- a/engines/tony/game.cpp
+++ b/engines/tony/game.cpp
@@ -34,7 +34,6 @@
#include "tony/mpal/memory.h"
#include "tony/mpal/mpal.h"
#include "tony/mpal/mpalutils.h"
-#include "tony/custom.h"
#include "tony/game.h"
#include "tony/gfxengine.h"
#include "tony/tony.h"
diff --git a/engines/tony/gfxengine.cpp b/engines/tony/gfxengine.cpp
index 5c038e154d..abc9e03617 100644
--- a/engines/tony/gfxengine.cpp
+++ b/engines/tony/gfxengine.cpp
@@ -40,7 +40,7 @@ namespace Tony {
* RMGfxEngine Methods
\****************************************************************************/
-void ExitAllIdles(CORO_PARAM, const void *param) {
+void exitAllIdles(CORO_PARAM, const void *param) {
CORO_BEGIN_CONTEXT;
CORO_END_CONTEXT(_ctx);
@@ -129,7 +129,7 @@ void RMGfxEngine::openOptionScreen(CORO_PARAM, int type) {
GLOBALS._bIdleExited = false;
- CoroScheduler.createProcess(ExitAllIdles, &_nCurLoc, sizeof(int));
+ CoroScheduler.createProcess(exitAllIdles, &_nCurLoc, sizeof(int));
}
}
@@ -532,17 +532,6 @@ void RMGfxEngine::disableMouse() {
_bAlwaysDrawMouse = false;
}
-void CharsSaveAll(Common::OutSaveFile *f);
-void CharsLoadAll(Common::InSaveFile *f);
-void MCharResetCodes();
-void SaveChangedHotspot(Common::OutSaveFile *f);
-void LoadChangedHotspot(Common::InSaveFile *f);
-void ReapplyChangedHotspot();
-
-void RestoreMusic(CORO_PARAM);
-void SaveMusic(Common::OutSaveFile *f);
-void LoadMusic(Common::InSaveFile *f);
-
#define TONY_SAVEGAME_VERSION 8
void RMGfxEngine::saveState(const Common::String &fn, byte *curThumb, const Common::String &name) {
@@ -617,7 +606,7 @@ void RMGfxEngine::saveState(const Common::String &fn, byte *curThumb, const Comm
f->writeByte(bStat);
// Save the chars
- CharsSaveAll(f);
+ charsSaveAll(f);
// Save the options
f->writeByte(GLOBALS._bCfgInvLocked);
@@ -639,10 +628,10 @@ void RMGfxEngine::saveState(const Common::String &fn, byte *curThumb, const Comm
f->writeByte(GLOBALS._nCfgSFXVolume);
// Save the hotspots
- SaveChangedHotspot(f);
+ saveChangedHotspot(f);
// Save the music
- SaveMusic(f);
+ saveMusic(f);
f->finalize();
delete f;
@@ -751,7 +740,7 @@ void RMGfxEngine::loadState(CORO_PARAM, const Common::String &fn) {
bStat = _ctx->f->readByte();
_inter.setPerorate(bStat);
- CharsLoadAll(_ctx->f);
+ charsLoadAll(_ctx->f);
}
if (_ctx->ver >= 6) {
@@ -775,11 +764,11 @@ void RMGfxEngine::loadState(CORO_PARAM, const Common::String &fn) {
GLOBALS._nCfgSFXVolume = _ctx->f->readByte();
// Load hotspots
- LoadChangedHotspot(_ctx->f);
+ loadChangedHotspot(_ctx->f);
}
if (_ctx->ver >= 7) {
- LoadMusic(_ctx->f);
+ loadMusic(_ctx->f);
}
delete _ctx->f;
@@ -793,13 +782,13 @@ void RMGfxEngine::loadState(CORO_PARAM, const Common::String &fn) {
mpalQueryDoAction(0, _ctx->loc, 0);
else {
// In the new ones, we just reset the mcode
- MCharResetCodes();
+ mCharResetCodes();
}
if (_ctx->ver >= 6)
- ReapplyChangedHotspot();
+ reapplyChangedHotspot();
- CORO_INVOKE_0(RestoreMusic);
+ CORO_INVOKE_0(restoreMusic);
_bGUIInterface = true;
_bGUIInventory = true;
diff --git a/engines/tony/mpal/mpal.cpp b/engines/tony/mpal/mpal.cpp
index da18b538d5..8d83363c24 100644
--- a/engines/tony/mpal/mpal.cpp
+++ b/engines/tony/mpal/mpal.cpp
@@ -642,6 +642,9 @@ void ScriptThread(CORO_PARAM, const void *param) {
CORO_KILL_SELF();
return;
}
+
+ // WORKAROUND: Wait for events to pulse.
+ CORO_SLEEP(1);
}
}
@@ -710,6 +713,9 @@ void ActionThread(CORO_PARAM, const void *param) {
GLOBALS._mpalError = 1;
break;
}
+
+ // WORKAROUND: Wait for events to pulse.
+ CORO_SLEEP(1);
}
globalDestroy(_ctx->item);
@@ -1121,6 +1127,9 @@ void GroupThread(CORO_PARAM, const void *param) {
CORO_KILL_SELF();
return;
}
+
+ // WORKAROUND: Wait for events to pulse.
+ CORO_SLEEP(1);
}
// The gruop is finished, so we can return to the calling function.
@@ -1386,11 +1395,7 @@ bool doSelection(uint32 i, uint32 dwData) {
*/
bool mpalInit(const char *lpszMpcFileName, const char *lpszMprFileName,
LPLPCUSTOMFUNCTION lplpcfArray, Common::String *lpcfStrings) {
- Common::File hMpc;
byte buf[5];
- uint32 nBytesRead;
- bool bCompress;
- uint32 dwSizeDecomp, dwSizeComp;
byte *cmpbuf;
// Save the array of custom functions
@@ -1398,21 +1403,22 @@ bool mpalInit(const char *lpszMpcFileName, const char *lpszMprFileName,
GLOBALS._lplpFunctionStrings = lpcfStrings;
// OPen the MPC file for reading
+ Common::File hMpc;
if (!hMpc.open(lpszMpcFileName))
return false;
// Read and check the header
- nBytesRead = hMpc.read(buf, 5);
+ uint32 nBytesRead = hMpc.read(buf, 5);
if (nBytesRead != 5)
return false;
if (buf[0] != 'M' || buf[1] != 'P' || buf[2] != 'C' || buf[3] != 0x20)
return false;
- bCompress = buf[4];
+ bool bCompress = buf[4];
// Reads the size of the uncompressed file, and allocate memory
- dwSizeDecomp = hMpc.readUint32LE();
+ uint32 dwSizeDecomp = hMpc.readUint32LE();
if (hMpc.err())
return false;
@@ -1422,7 +1428,7 @@ bool mpalInit(const char *lpszMpcFileName, const char *lpszMprFileName,
if (bCompress) {
// Get the compressed size and read the data in
- dwSizeComp = hMpc.readUint32LE();
+ uint32 dwSizeComp = hMpc.readUint32LE();
if (hMpc.err())
return false;
@@ -1463,7 +1469,7 @@ bool mpalInit(const char *lpszMpcFileName, const char *lpszMprFileName,
// Seek to the end of the file to read overall information
GLOBALS._hMpr.seek(-12, SEEK_END);
- dwSizeComp = GLOBALS._hMpr.readUint32LE();
+ uint32 dwSizeComp = GLOBALS._hMpr.readUint32LE();
if (GLOBALS._hMpr.err())
return false;
@@ -1941,11 +1947,9 @@ uint32 mpalGetError() {
* @returns TRUE if the script 'was launched, FALSE on failure
*/
bool mpalExecuteScript(int nScript) {
- LpMpalScript s;
-
LockScripts();
int n = scriptGetOrderFromNum(nScript);
- s = (LpMpalScript)globalAlloc(GMEM_FIXED | GMEM_ZEROINIT, sizeof(MpalScript));
+ LpMpalScript s = (LpMpalScript)globalAlloc(GMEM_FIXED | GMEM_ZEROINIT, sizeof(MpalScript));
if (s == NULL)
return false;
diff --git a/engines/wintermute/readme.txt b/engines/wintermute/readme.txt
deleted file mode 100644
index 57592dac2a..0000000000
--- a/engines/wintermute/readme.txt
+++ /dev/null
@@ -1,155 +0,0 @@
-Wintermute Engine - Copyright (c) 2011 Jan Nedoma
-ScummVM port by Einar Johan Trøan Sømåen (somaen)
-
-***************************
-*** General information ***
-***************************
-The Wintermute Engine is a game engine mainly aimed at creating adventure
-games, it supports both 3D, 2.5D, 2D and First-Person games, and has numerous
-games both free, open-source and commercial created with it. This port was
-created by somaen as part of Google Summer of Code 2012.
-
-****************
-*** Features ***
-****************
-This port of the Wintermute Engine (WME) is based on WME Lite, which lacks the following functionality
-originally found in WME: (from http://res.dead-code.org/doku.php/wmelite:start)
-
-The following features of WME 1.x are NOT supported by WME Lite:
-* 3D characters. WME Lite only supports 2D games.
-* Sprite frame mirroring.
-* Sprite rotations.
-* Sprite blending modes.
-* Video playback.
-* Plugins.
-* Calling external functions from DLL libraries from scripts.
-* Game Explorer support.
-* 'Directory' script object.
-
-This port does reimplement a few of these features, currently:
-* Sprite frame mirroring - WORKS.
-* Video playback - Theora PARTIALLY WORKING. (Slow, and doesn't support seeking)
-
-In addition, this port removes a few additional features that were never/rarely used:
-* 'File' script object - ScummVM doesn't have any easy way to write/read arbitrary files.
-* Debugger/Compiler - weren't properly accessible in WME Lite anyhow.
-* CD-numbering support in .dcp-files - was never used.
-* 'SaveDirectory'-property of 'Game' will not return anything usefull to the game-scripts (saving is handled through SaveFileMan)
-
-*******************************
-*** Additional limitations: ***
-*******************************
-* Only .OGG and RAW-.WAV sounds are supported at this point
-* TTF-fonts might behave a bit differently, owing to both the change to FreeType in WME Lite
- and the change in dpi in this port of WME.
-* The window-caption-setting in-game will be ignored, for the sake of concistency with ScummVM.
-* Most VKey-combinations might still be missing (as they already were in WME Lite)
-* Since we don't use FreeImage, some games might use odd files that weren't expected when the
- image-decoders in ScummVM were written. One example here is interlaced-PNGs.
-* UTF8-support is not ported, which means only games with western charsets will work for now.
-* Games that select language by moving .dcp-files around still need a bit more handling on detection/load
- adding support for those languages on a language-by-language basis.
-* Most games assume the availability of the Windows-fonts (particularly arial.ttf)
- at this point no fallback has been put in place for using FreeFonts as replacements,
- simply for lack of having them easily accessible to the engines at this point. So, at least
- arial.ttf should be put in either the game-folder or made available through the extras-folder
- for now, otherwise kGUIBigFont will be used as a replacement.
-
-
-*********************************
-*** Advanced engine-features: ***
-*********************************
-At this point the engine implements the following "advanced engine features":
-* RTL ("Return to Launcher") support
-* Global options dialog support
-* Listing savestates via command line or Launcher
-* Loading savestates via command line or Launcher
-* Deleting savestates via the Launcher and GMM
-* Savestate metadata support
-* Loading/Saving during run time
-
-and NOT the following:
-* Enhanced debug/error messages
-
-*****************
-*** Detection ***
-*****************
-Since Wintermute has authoring tools available, there will at any point in
-time be atleast a few games that are works-in-progress, and as the authors
-of these games might want to test their games in ScummVM, the engine has
-to be able to detect arbitrary Wintermute-games, to this end the detector
-code in this engine will check any folder containing "data.dcp", and try to
-read "startup.settings" and "default.game" (or optionally any other .game-file
-defined in startup.settings), the Name/Caption fields in the .game-file will
-be used as gameid/title (prefixing the gameid with "wmefan-" to avoid confusion
-with any other WME game that might happen to have taken that id.
-
-All COMPLETED games should have their md5s and gameid's properly added, IFF
-they don't require 3D.
-
-3D games may also be added, for the purpose of giving the user feedback
-as to why their game won't run, but at this point, any such MD5 should
-be added as a comment only, to avoid confusion, as no mechanism for giving
-the user feedback about 3D-games not being supported is currently added.
-
-*************************************
-*** Games targeted by the engine: ***
-*************************************
-This engine potentially targets a very large amount of games:
-http://res.dead-code.org/doku.php/games:start
-
-Since the feature-set of WME Lite differs from that of the full Wintermute Engine,
-games will need to be targeted on a case-by-case, feature-by-feature basis, this is
-a list of the games that are currently known to work (although perhaps with minor
-issues) through to completion:
-
-* Dirty Split (dirtysplit)
-* the white chamber (twc)
-* Chivalry is NOT dead (chivalry)
-* Rosemary (rosemary)
-* The Box (thebox)
-* J.U.L.I.A. (Demo) (julia)
-* Pigeons in the park (pigeons)
-
-Untested, but starts:
-* East Side Story (Demo) (eastside)
-* Actual Destination (actualdest)
-* Ghost in the sheet (ghostsheet)
-
-********************************
-*** Games with known issues: ***
-********************************
-Certain games will work mostly fine with this engine, but can still
-be impossible to complete for various reasons, this is a list of games
-that technically qualify (as in they do not require the 3D-parts of the engine)
-but have issues that make them problematic or not completable:
-
-Won't start:
-* Five Lethal Demons (5ld) - Requires support for interlaced PNGs
-* Five Magical Amulets (5ma) - Requires support for interlaced PNGs
-* Kulivoeko - Requires support for interlaced PNGs
-* Reversion (reversion) - Requires support for Non-V1.1 JPEGs and interlaced PNGs
-* Mirage (mirage) - Tries to seek in a vorbis-stream inside a ZipStream
-* Hamlet or the last game without MMORPS features, shaders and product placement (hamlet)
- - Requires support for interlaced PNGs
-
-Gameplay broken:
-* J.U.L.I.A. (Full game) (julia) - Requires sprite-rotation for a puzzle.
-
-Non-critical:
-* Ghost in the sheet (ghostsheet) - uses Non-V1.1-JPEGs
-* East Side Story (eastside) - wants "framd.ttf"
-
-*****************************
-*** General known issues: ***
-*****************************
-
-Mostly a TODO-section, to not forget fixing outstanding general issues:
-* Save/Load-screens are not shown during save/load
- this is probably a result of reducing the amount of redrawing done
- during save/load, and I'm not sure it should be put back, if that means
- making saves slower again.
-* Font-sizes are wrong enough to allow Dirty Split to draw text that is hidden in
- the original game (most visible on the coin-interface)
-* Alpha-masks for Theora-videos are broken on big-endian platforms
-