aboutsummaryrefslogtreecommitdiff
path: root/engines/simon
diff options
context:
space:
mode:
authorTravis Howell2006-04-14 09:57:43 +0000
committerTravis Howell2006-04-14 09:57:43 +0000
commitf254b5b73a60857fdd019f059e76fd7e9f0d19ad (patch)
tree25942fd6c76da672324d60d80db165b7f755e4a7 /engines/simon
parentde0816442043f0460866ab2223c5a7dfaa55bd57 (diff)
downloadscummvm-rg350-f254b5b73a60857fdd019f059e76fd7e9f0d19ad.tar.gz
scummvm-rg350-f254b5b73a60857fdd019f059e76fd7e9f0d19ad.tar.bz2
scummvm-rg350-f254b5b73a60857fdd019f059e76fd7e9f0d19ad.zip
Cleanup
svn-id: r21880
Diffstat (limited to 'engines/simon')
-rw-r--r--engines/simon/debug.cpp4
-rw-r--r--engines/simon/items.cpp8
-rw-r--r--engines/simon/saveload.cpp12
-rw-r--r--engines/simon/simon.h18
-rw-r--r--engines/simon/verb.cpp52
-rw-r--r--engines/simon/vga.cpp44
-rw-r--r--engines/simon/vga.h2
7 files changed, 69 insertions, 71 deletions
diff --git a/engines/simon/debug.cpp b/engines/simon/debug.cpp
index 30a8b4cad7..49631b817c 100644
--- a/engines/simon/debug.cpp
+++ b/engines/simon/debug.cpp
@@ -348,7 +348,7 @@ void SimonEngine::dump_bitmap(const char *filename, const byte *offs, int w, int
if (getGameType() == GType_FF) {
for (i = 0; i != w; i++) {
- byte *c = vc10_depack_column(&state);
+ byte *c = vc10_depackColumn(&state);
for (j = 0; j != h; j++) {
byte pix = c[j];
b[j * w + i] = pix;
@@ -356,7 +356,7 @@ void SimonEngine::dump_bitmap(const char *filename, const byte *offs, int w, int
}
} else {
for (i = 0; i != w; i += 2) {
- byte *c = vc10_depack_column(&state);
+ byte *c = vc10_depackColumn(&state);
for (j = 0; j != h; j++) {
byte pix = c[j];
b[j * w + i] = (pix >> 4) | base;
diff --git a/engines/simon/items.cpp b/engines/simon/items.cpp
index efe19cbeb8..151dca6189 100644
--- a/engines/simon/items.cpp
+++ b/engines/simon/items.cpp
@@ -952,17 +952,17 @@ void SimonEngine::o_addBox() {
void SimonEngine::o_delBox() {
// 108: delete hitarea
- delete_hitarea(getVarOrWord());
+ undefineBox(getVarOrWord());
}
void SimonEngine::o_enableBox() {
// 109: clear hitarea bit 0x40
- clear_hitarea_bit_0x40(getVarOrWord());
+ enableBox(getVarOrWord());
}
void SimonEngine::o_disableBox() {
// 110: set hitarea bit 0x40
- set_hitarea_bit_0x40(getVarOrWord());
+ disableBox(getVarOrWord());
}
void SimonEngine::o_moveBox() {
@@ -2139,7 +2139,7 @@ void SimonEngine::sendSync(uint a) {
uint16 id = to16Wrapper(a);
_lockWord |= 0x8000;
_vcPtr = (byte *)&id;
- vc15_wakeup_id();
+ vc15_sync();
_lockWord &= ~0x8000;
}
diff --git a/engines/simon/saveload.cpp b/engines/simon/saveload.cpp
index 5ebc0ab3d5..f2d609cf87 100644
--- a/engines/simon/saveload.cpp
+++ b/engines/simon/saveload.cpp
@@ -163,7 +163,7 @@ void SimonEngine::saveGameDialog(char *buf) {
return;
do {
- clear_hitarea_bit_0x40(0xd0 + i - 1);
+ enableBox(0xd0 + i - 1);
} while (--i);
}
@@ -211,7 +211,7 @@ restart:;
if_1:;
unk132_result = i;
- set_hitarea_bit_0x40(208 + i);
+ disableBox(208 + i);
leaveHitAreaById(208 + i);
// some code here
@@ -274,7 +274,7 @@ restart:;
if (b) {
if (i == 205)
goto get_out;
- clear_hitarea_bit_0x40(0xd0 + unk132_result);
+ enableBox(0xd0 + unk132_result);
if (_saveLoadFlag) {
clearCharacter(_windowArray[5], 8);
// move code
@@ -284,7 +284,7 @@ restart:;
// is_not_b
if (!_saveLoadFlag) {
- clear_hitarea_bit_0x40(0xd0 + unk132_result);
+ enableBox(0xd0 + unk132_result);
goto restart;
}
} while (i >= 0x80 || i == 0);
@@ -404,7 +404,7 @@ start_over_2:;
void SimonEngine::unk_132_helper_3() {
for (int i = 208; i != 208 + 6; i++)
- set_hitarea_bit_0x40(i);
+ disableBox(i);
}
void SimonEngine::clearCharacter(WindowBlock *window, int x, byte b) {
@@ -476,7 +476,7 @@ loop:;
goto loop;
// Return
- delete_hitarea(0x7FFF);
+ undefineBox(0x7FFF);
}
bool SimonEngine::saveGame(uint slot, char *caption) {
diff --git a/engines/simon/simon.h b/engines/simon/simon.h
index 826f09490b..9e936021fb 100644
--- a/engines/simon/simon.h
+++ b/engines/simon/simon.h
@@ -562,11 +562,11 @@ protected:
void changeWindow(uint a);
void closeWindow(uint a);
- void clear_hitarea_bit_0x40(uint hitarea);
- void set_hitarea_bit_0x40(uint hitarea);
+ void enableBox(uint hitarea);
+ void disableBox(uint hitarea);
void moveBox(uint hitarea, int x, int y);
bool is_hitarea_0x40_clear(uint hitarea);
- void delete_hitarea(uint hitarea);
+ void undefineBox(uint hitarea);
void defineBox(int id, int x, int y, int width, int height, int flags, int verb, Item *item_ptr);
HitArea *findEmptyHitArea();
void resetVerbs();
@@ -638,7 +638,7 @@ protected:
void resetNameWindow();
void printVerbOf(uint hitarea_id);
- HitArea *findHitAreaByID(uint hitarea_id);
+ HitArea *findBox(uint hitarea_id);
void showActionString(const byte *string);
void windowPutChar(WindowBlock *window, byte c, byte b = 0);
@@ -726,8 +726,8 @@ public:
void vc12_delay();
void vc13_addToSpriteX();
void vc14_addToSpriteY();
- void vc15_wakeup_id();
- void vc16_sleep_on_id();
+ void vc15_sync();
+ void vc16_waitSync();
void vc17_setPathfinderItem();
void vc18_jump();
void vc19_chain_to_script();
@@ -762,11 +762,11 @@ public:
void vc48_setPathFinder();
void vc49_setBit();
void vc50_clearBit();
- void vc51_clear_hitarea_bit_0x40();
+ void vc51_enableBox();
void vc52_playSound();
- void vc53_no_op();
+ void vc53_panSFX();
void vc54_no_op();
- void vc55_offset_hit_area();
+ void vc55_moveBox();
void vc56_delay();
void vc57_no_op();
void vc58();
diff --git a/engines/simon/verb.cpp b/engines/simon/verb.cpp
index b6c8f11182..4160c51f2d 100644
--- a/engines/simon/verb.cpp
+++ b/engines/simon/verb.cpp
@@ -216,7 +216,7 @@ void SimonEngine::clearName() {
resetNameWindow();
_lastVerbOn = last;
- if (last != NULL && (ha = findHitAreaByID(200)) && (ha->flags & kBFBoxDead) && !(last->flags & kBFBoxDead))
+ if (last != NULL && (ha = findBox(200)) && (ha->flags & kBFBoxDead) && !(last->flags & kBFBoxDead))
printVerbOf(last->id);
}
@@ -318,7 +318,7 @@ void SimonEngine::resetNameWindow() {
_lastVerbOn = NULL;
}
-HitArea *SimonEngine::findHitAreaByID(uint hitarea_id) {
+HitArea *SimonEngine::findBox(uint hitarea_id) {
HitArea *ha = _hitAreas;
uint count = ARRAYSIZE(_hitAreas);
@@ -340,14 +340,14 @@ HitArea *SimonEngine::findEmptyHitArea() {
return NULL;
}
-void SimonEngine::clear_hitarea_bit_0x40(uint hitarea) {
- HitArea *ha = findHitAreaByID(hitarea);
+void SimonEngine::enableBox(uint hitarea) {
+ HitArea *ha = findBox(hitarea);
if (ha != NULL)
ha->flags &= ~kBFBoxDead;
}
-void SimonEngine::set_hitarea_bit_0x40(uint hitarea) {
- HitArea *ha = findHitAreaByID(hitarea);
+void SimonEngine::disableBox(uint hitarea) {
+ HitArea *ha = findBox(hitarea);
if (ha != NULL) {
ha->flags |= kBFBoxDead;
ha->flags &= ~kBFBoxSelected;
@@ -357,7 +357,7 @@ void SimonEngine::set_hitarea_bit_0x40(uint hitarea) {
}
void SimonEngine::moveBox(uint hitarea, int x, int y) {
- HitArea *ha = findHitAreaByID(hitarea);
+ HitArea *ha = findBox(hitarea);
if (ha != NULL) {
if (getGameType() == GType_FF) {
ha->x += x;
@@ -369,8 +369,8 @@ void SimonEngine::moveBox(uint hitarea, int x, int y) {
}
}
-void SimonEngine::delete_hitarea(uint hitarea) {
- HitArea *ha = findHitAreaByID(hitarea);
+void SimonEngine::undefineBox(uint hitarea) {
+ HitArea *ha = findBox(hitarea);
if (ha != NULL) {
ha->flags = 0;
if (ha == _lastNameOn)
@@ -380,7 +380,7 @@ void SimonEngine::delete_hitarea(uint hitarea) {
}
bool SimonEngine::is_hitarea_0x40_clear(uint hitarea) {
- HitArea *ha = findHitAreaByID(hitarea);
+ HitArea *ha = findBox(hitarea);
if (ha == NULL)
return false;
return (ha->flags & kBFBoxDead) == 0;
@@ -388,7 +388,7 @@ bool SimonEngine::is_hitarea_0x40_clear(uint hitarea) {
void SimonEngine::defineBox(int id, int x, int y, int width, int height, int flags, int verb, Item *item_ptr) {
HitArea *ha;
- delete_hitarea(id);
+ undefineBox(id);
ha = findEmptyHitArea();
ha->x = x;
@@ -447,7 +447,7 @@ void SimonEngine::resetVerbs() {
_defaultVerb = id;
- ha = findHitAreaByID(id);
+ ha = findBox(id);
if (ha == NULL)
return;
@@ -526,7 +526,7 @@ void SimonEngine::hitarea_leave(HitArea *ha, bool state) {
}
void SimonEngine::leaveHitAreaById(uint hitarea_id) {
- HitArea *ha = findHitAreaByID(hitarea_id);
+ HitArea *ha = findBox(hitarea_id);
if (ha)
hitarea_leave(ha);
}
@@ -548,12 +548,12 @@ void SimonEngine::checkUp(WindowBlock *window) {
j = k * 6;
if (is_hitarea_0x40_clear(j + 201)) {
loadSprite(4, 9, k + 31, 0, 0, 0);
- delete_hitarea(j + 201);
- delete_hitarea(j + 202);
- delete_hitarea(j + 203);
- delete_hitarea(j + 204);
- delete_hitarea(j + 205);
- delete_hitarea(j + 206);
+ undefineBox(j + 201);
+ undefineBox(j + 202);
+ undefineBox(j + 203);
+ undefineBox(j + 204);
+ undefineBox(j + 205);
+ undefineBox(j + 206);
}
_variableArray[31] -= 52;
_iOverflow = 1;
@@ -575,12 +575,12 @@ void SimonEngine::checkDown(WindowBlock *window) {
j = k * 6;
if (is_hitarea_0x40_clear(j + 201)) {
loadSprite(4, 9, k + 28, 0, 0, 0);
- delete_hitarea(j + 201);
- delete_hitarea(j + 202);
- delete_hitarea(j + 203);
- delete_hitarea(j + 204);
- delete_hitarea(j + 205);
- delete_hitarea(j + 206);
+ undefineBox(j + 201);
+ undefineBox(j + 202);
+ undefineBox(j + 203);
+ undefineBox(j + 204);
+ undefineBox(j + 205);
+ undefineBox(j + 206);
}
}
}
@@ -711,7 +711,7 @@ void SimonEngine::displayName(HitArea *ha) {
_lastNameOn = ha;
return;
}
- if (findHitAreaByID(50))
+ if (findBox(50))
return;
if (getBitFlag(99))
diff --git a/engines/simon/vga.cpp b/engines/simon/vga.cpp
index 9c68891fa1..a5fec70e62 100644
--- a/engines/simon/vga.cpp
+++ b/engines/simon/vga.cpp
@@ -48,8 +48,8 @@ void SimonEngine::setupVgaOpcodes() {
&SimonEngine::vc12_delay,
&SimonEngine::vc13_addToSpriteX,
&SimonEngine::vc14_addToSpriteY,
- &SimonEngine::vc15_wakeup_id,
- &SimonEngine::vc16_sleep_on_id,
+ &SimonEngine::vc15_sync,
+ &SimonEngine::vc16_waitSync,
&SimonEngine::vc17_setPathfinderItem,
&SimonEngine::vc18_jump,
&SimonEngine::vc19_chain_to_script,
@@ -84,11 +84,11 @@ void SimonEngine::setupVgaOpcodes() {
&SimonEngine::vc48_setPathFinder,
&SimonEngine::vc49_setBit,
&SimonEngine::vc50_clearBit,
- &SimonEngine::vc51_clear_hitarea_bit_0x40,
+ &SimonEngine::vc51_enableBox,
&SimonEngine::vc52_playSound,
- &SimonEngine::vc53_no_op,
+ &SimonEngine::vc53_panSFX,
&SimonEngine::vc54_no_op,
- &SimonEngine::vc55_offset_hit_area,
+ &SimonEngine::vc55_moveBox,
&SimonEngine::vc56_delay,
&SimonEngine::vc57_no_op,
&SimonEngine::vc58,
@@ -436,7 +436,7 @@ void SimonEngine::vc9_skip_if_unk3_is() {
vcSkipNextInstruction();
}
-byte *vc10_depack_column(VC10_state * vs) {
+byte *vc10_depackColumn(VC10_state * vs) {
int8 a = vs->depack_cont;
const byte *src = vs->depack_src;
byte *dst = vs->depack_dest;
@@ -480,7 +480,7 @@ get_out:;
void vc10_skip_cols(VC10_state *vs) {
while (vs->x_skip) {
- vc10_depack_column(vs);
+ vc10_depackColumn(vs);
vs->x_skip--;
}
}
@@ -855,7 +855,7 @@ void SimonEngine::drawImages_Feeble(VC10_state *state) {
dst_org = state->surf_addr;
w = 0;
do {
- src = vc10_depack_column(state);
+ src = vc10_depackColumn(state);
dst = dst_org;
h = 0;
@@ -891,7 +891,7 @@ void SimonEngine::drawImages_Feeble(VC10_state *state) {
do {
byte color;
- src = vc10_depack_column(state);
+ src = vc10_depackColumn(state);
dst = dst_org;
h = 0;
@@ -940,7 +940,7 @@ void SimonEngine::drawImages_Feeble(VC10_state *state) {
do {
byte color;
- src = vc10_depack_column(state);
+ src = vc10_depackColumn(state);
dst = dst_org;
h = 0;
@@ -959,7 +959,7 @@ void SimonEngine::drawImages_Feeble(VC10_state *state) {
do {
byte color;
- src = vc10_depack_column(state);
+ src = vc10_depackColumn(state);
dst = dst_org;
h = 0;
@@ -1036,7 +1036,7 @@ void SimonEngine::drawImages(VC10_state *state) {
w = 0;
do {
- mask = vc10_depack_column(state); /* esi */
+ mask = vc10_depackColumn(state); /* esi */
src = state->surf2_addr + w * 2; /* ebx */
dst = state->surf_addr + w * 2; /* edi */
@@ -1202,7 +1202,7 @@ void SimonEngine::drawImages(VC10_state *state) {
dst_org = state->surf_addr;
w = 0;
do {
- src = vc10_depack_column(state);
+ src = vc10_depackColumn(state);
dst = dst_org;
h = 0;
@@ -1223,7 +1223,7 @@ void SimonEngine::drawImages(VC10_state *state) {
do {
byte color;
- src = vc10_depack_column(state);
+ src = vc10_depackColumn(state);
dst = dst_org;
h = 0;
@@ -1442,7 +1442,7 @@ void SimonEngine::vc14_addToSpriteY() {
_vgaSpriteChanged++;
}
-void SimonEngine::vc15_wakeup_id() {
+void SimonEngine::vc15_sync() {
VgaSleepStruct *vfs = _vgaSleepStructs, *vfs_tmp;
uint16 id = vcReadNextWord();
while (vfs->ident != 0) {
@@ -1463,7 +1463,7 @@ void SimonEngine::vc15_wakeup_id() {
_vgaWaitFor = 0;
}
-void SimonEngine::vc16_sleep_on_id() {
+void SimonEngine::vc16_waitSync() {
VgaSleepStruct *vfs = _vgaSleepStructs;
while (vfs->ident)
vfs++;
@@ -1792,8 +1792,6 @@ void SimonEngine::vc41() {
int16 value = vcReadVar(var) - vcReadNextWord();
if ((getGameType() == GType_SIMON2) && var == 15 && !getBitFlag(80)) {
- int16 tmp;
-
if (_scrollCount != 0) {
if (_scrollCount < 0)
goto no_scroll;
@@ -1941,8 +1939,8 @@ void SimonEngine::vc50_clearBit() {
setBitFlag(vcReadNextWord(), false);
}
-void SimonEngine::vc51_clear_hitarea_bit_0x40() {
- clear_hitarea_bit_0x40(vcReadNextWord());
+void SimonEngine::vc51_enableBox() {
+ enableBox(vcReadNextWord());
}
void SimonEngine::vc52_playSound() {
@@ -1971,12 +1969,12 @@ void SimonEngine::vc52_playSound() {
}
}
-void SimonEngine::vc53_no_op() {
+void SimonEngine::vc53_panSFX() {
// Start sound effect, panning it with the animation
int snd = vcReadNextWord();
int xoffs = vcReadNextWord();
int vol = vcReadNextWord();
- debug(0, "STUB: vc53_no_op: snd %d xoffs %d vol %d", snd, xoffs, vol);
+ debug(0, "STUB: vc53_panSFX: snd %d xoffs %d vol %d", snd, xoffs, vol);
}
void SimonEngine::vc54_no_op() {
@@ -1984,7 +1982,7 @@ void SimonEngine::vc54_no_op() {
_vcPtr += 6;
}
-void SimonEngine::vc55_offset_hit_area() {
+void SimonEngine::vc55_moveBox() {
HitArea *ha = _hitAreas;
uint count = ARRAYSIZE(_hitAreas);
uint16 id = vcReadNextWord();
diff --git a/engines/simon/vga.h b/engines/simon/vga.h
index f983b48418..a28cde5f14 100644
--- a/engines/simon/vga.h
+++ b/engines/simon/vga.h
@@ -135,7 +135,7 @@ struct VC10_state {
byte depack_dest[480];
};
-byte *vc10_depack_column(VC10_state *vs);
+byte *vc10_depackColumn(VC10_state *vs);
} // End of namespace Simon