aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorTravis Howell2006-04-04 10:12:22 +0000
committerTravis Howell2006-04-04 10:12:22 +0000
commit49dc2622dd64924fe4d6fa76831e05db48017285 (patch)
treeca4dc46bfefb3dfea95c4eba5a68d9bda9a2fbbf /engines
parentcb513de999a8602cadfcba7f87f9e9a1c87caf1e (diff)
downloadscummvm-rg350-49dc2622dd64924fe4d6fa76831e05db48017285.tar.gz
scummvm-rg350-49dc2622dd64924fe4d6fa76831e05db48017285.tar.bz2
scummvm-rg350-49dc2622dd64924fe4d6fa76831e05db48017285.zip
Add verb codes differences in FF
svn-id: r21589
Diffstat (limited to 'engines')
-rw-r--r--engines/simon/charset.cpp4
-rw-r--r--engines/simon/debugger.cpp4
-rw-r--r--engines/simon/items.cpp4
-rw-r--r--engines/simon/saveload.cpp2
-rw-r--r--engines/simon/simon.cpp64
-rw-r--r--engines/simon/simon.h11
-rw-r--r--engines/simon/verb.cpp135
-rw-r--r--engines/simon/vga.cpp22
8 files changed, 169 insertions, 77 deletions
diff --git a/engines/simon/charset.cpp b/engines/simon/charset.cpp
index b5c14e584d..20af0955d3 100644
--- a/engines/simon/charset.cpp
+++ b/engines/simon/charset.cpp
@@ -420,9 +420,9 @@ void SimonEngine::video_putchar_newline(FillOrCopyStruct *fcs) {
if (getGameType() == GType_FF) {
if (_noOracleScroll == 0) {
if (fcs->textRow + 30 > fcs->height) {
- if (vcGetBit(94) == false) {
+ if (getBitFlag(94) == false) {
_noOracleScroll = 1;
- if (vcGetBit(92) == true) {
+ if (getBitFlag(92) == true) {
_noOracleScroll = 0;
checkLinkBox();
scrollOracle();
diff --git a/engines/simon/debugger.cpp b/engines/simon/debugger.cpp
index 1384c60693..7e3d9df156 100644
--- a/engines/simon/debugger.cpp
+++ b/engines/simon/debugger.cpp
@@ -154,13 +154,13 @@ bool Debugger::Cmd_SetBit(int argc, const char **argv) {
bit = atoi(argv[1]);
value = atoi(argv[2]);
if (value <= 1) {
- _vm->vcSetBitTo(bit, value != 0);
+ _vm->setBitFlag(bit, value != 0);
DebugPrintf("Set bit %d to %d\n", bit, value);
} else
DebugPrintf("Bit value out of range (0 - 1)\n");
} else if (argc > 1) {
bit = atoi(argv[1]);
- value = _vm->vcGetBit(bit);
+ value = _vm->getBitFlag(bit);
DebugPrintf("Bit %d is %d\n", bit, value);
} else
DebugPrintf("Syntax: bit <bitnum> <value>\n");
diff --git a/engines/simon/items.cpp b/engines/simon/items.cpp
index 39930ff614..c8065ba4df 100644
--- a/engines/simon/items.cpp
+++ b/engines/simon/items.cpp
@@ -1327,7 +1327,7 @@ bool SimonEngine::checkIfToRunSubroutineLine(SubroutineLine *sl, Subroutine *sub
void SimonEngine::o_83_helper() {
if (_exitCutscene) {
- if (vcGetBit(9)) {
+ if (getBitFlag(9)) {
endCutscene();
}
} else {
@@ -1339,7 +1339,7 @@ void SimonEngine::o_waitForMark(uint i) {
_exitCutscene = false;
while (!(_marks & (1 << i))) {
if (_exitCutscene) {
- if (vcGetBit(9)) {
+ if (getBitFlag(9)) {
endCutscene();
break;
}
diff --git a/engines/simon/saveload.cpp b/engines/simon/saveload.cpp
index 04ebd94aa1..ba5edbe134 100644
--- a/engines/simon/saveload.cpp
+++ b/engines/simon/saveload.cpp
@@ -127,7 +127,7 @@ void SimonEngine::quickLoadOrSave() {
drawIconArray(2, getItem1Ptr(), 0, 0);
mouseOn();
// Reset engine?
- vcSetBitTo(97, true);
+ setBitFlag(97, true);
sub = getSubroutineByID(100);
startSubroutine(sub);
}
diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp
index 063c854626..9bd3e4b1ea 100644
--- a/engines/simon/simon.cpp
+++ b/engines/simon/simon.cpp
@@ -253,6 +253,8 @@ SimonEngine::SimonEngine(OSystem *syst)
_subtitles = true;
_fade = true;
_mouseCursor = 0;
+ _mouseAnim = 0;
+ _mouseAnimMax = 0;
_vgaVar9 = 0;
_scriptUnk1 = 0;
_restoreWindow6 = 0;
@@ -1538,6 +1540,48 @@ void SimonEngine::o_setup_cond_c() {
void SimonEngine::setup_cond_c_helper() {
HitArea *last;
+ _noRightClick = 1;
+
+ if (getGameType() == GType_FF) {
+ int cursor = 5;
+ int animMax = 16;
+
+ if (getBitFlag(200)) {
+ cursor = 11;
+ animMax = 5;
+ } else if (getBitFlag(201)) {
+ cursor = 12;
+ animMax = 5;
+ } else if (getBitFlag(202)) {
+ cursor = 13;
+ animMax = 5;
+ } else if (getBitFlag(203)) {
+ cursor = 14;
+ animMax = 9;
+ } else if (getBitFlag(205)) {
+ cursor = 17;
+ animMax = 11;
+ } else if (getBitFlag(206)) {
+ cursor = 16;
+ animMax = 2;
+ } else if (getBitFlag(208)) {
+ cursor = 26;
+ animMax = 2;
+ } else if (getBitFlag(209)) {
+ cursor = 27;
+ animMax = 9;
+ } else if (getBitFlag(210)) {
+ cursor = 28;
+ animMax = 9;
+ }
+
+ //_animatePointer = 0;
+ _mouseCursor = cursor;
+ _mouseAnimMax = animMax;
+ _mouseAnim = 1;
+ _needHitAreaRecalc++;
+ }
+
if (getGameType() == GType_SIMON2) {
_mouseCursor = 0;
if (_defaultVerb != 999) {
@@ -1580,9 +1624,9 @@ void SimonEngine::setup_cond_c_helper() {
if (_lastHitArea == NULL) {
} else if (_lastHitArea->id == 0x7FFB) {
- handle_uparrow_hitarea(_lastHitArea->fcs);
+ inventoryUp(_lastHitArea->fcs);
} else if (_lastHitArea->id == 0x7FFC) {
- handle_downarrow_hitarea(_lastHitArea->fcs);
+ inventoryDown(_lastHitArea->fcs);
} else if (_lastHitArea->item_ptr != NULL) {
_hitAreaObjectItem = _lastHitArea->item_ptr;
_variableArray[60] = (_lastHitArea->flags & 1) ? (_lastHitArea->flags / 256) : 0xFFFF;
@@ -1594,6 +1638,8 @@ out_of_here:
_lastHitArea3 = 0;
_lastHitArea = 0;
_lastHitArea2Ptr = NULL;
+ _mouseCursor = 0;
+ _noRightClick = 0;
}
void SimonEngine::endCutscene() {
@@ -1682,7 +1728,7 @@ void SimonEngine::handle_mouse_moved() {
if (_rightClick) {
_rightClick = false;
- setVerb_Feeble();
+ setVerb(NULL);
}
}
@@ -2040,9 +2086,9 @@ startOver:
if (ha == NULL) {
} else if (ha->id == 0x7FFB) {
- handle_uparrow_hitarea(ha->fcs);
+ inventoryUp(ha->fcs);
} else if (ha->id == 0x7FFC) {
- handle_downarrow_hitarea(ha->fcs);
+ inventoryDown(ha->fcs);
} else if (ha->id >= 101 && ha->id < 113) {
_verbHitArea = ha->verb;
setVerb(ha);
@@ -2671,12 +2717,12 @@ void SimonEngine::o_waitForSync(uint a) {
_rightClick = false;
while (_vgaWaitFor != 0) {
if (_rightClick && (getGameType() == GType_SIMON2 || getGameType() == GType_FF)) {
- if (_vgaWaitFor == 200 && !vcGetBit(14)) {
+ if (_vgaWaitFor == 200 && !getBitFlag(14)) {
skipSpeech();
break;
}
} else if (_exitCutscene) {
- if (vcGetBit(9)) {
+ if (getBitFlag(9)) {
endCutscene();
break;
}
@@ -2869,9 +2915,9 @@ void SimonEngine::timer_proc1() {
if (_updateScreen) {
if (getGameType() == GType_FF) {
- if (vcGetBit(78) == false) {
+ if (getBitFlag(78) == false) {
oracleLogo();
- } else if (vcGetBit(76) == true) {
+ } else if (getBitFlag(76) == true) {
swapCharacterLogo();
}
}
diff --git a/engines/simon/simon.h b/engines/simon/simon.h
index 55f8a91ce1..860f9a61ce 100644
--- a/engines/simon/simon.h
+++ b/engines/simon/simon.h
@@ -255,6 +255,8 @@ protected:
bool _subtitles;
bool _fade;
byte _mouseCursor;
+ byte _mouseAnim;
+ byte _mouseAnimMax;
bool _vgaVar9;
int16 _scriptUnk1;
bool _restoreWindow6;
@@ -554,7 +556,6 @@ protected:
HitArea *findEmptyHitArea();
void resetVerbs();
void setVerb(HitArea * ha);
- void setVerb_Feeble();
void hitarea_leave(HitArea * ha);
void leaveHitAreaById(uint hitarea_id);
@@ -630,8 +631,8 @@ protected:
void defocusHitarea();
void endCutscene();
void runSubroutine101();
- void handle_uparrow_hitarea(FillOrCopyStruct *fcs);
- void handle_downarrow_hitarea(FillOrCopyStruct *fcs);
+ void inventoryUp(FillOrCopyStruct *fcs);
+ void inventoryDown(FillOrCopyStruct *fcs);
void hitareaChangedHelper();
void focusVerb(uint hitarea_id);
HitArea *findHitAreaByID(uint hitarea_id);
@@ -816,8 +817,8 @@ protected:
void add_vga_timer(uint num, const byte *code_ptr, uint cur_sprite, uint cur_file);
VgaSprite *findCurSprite();
- bool vcGetBit(uint bit);
- void vcSetBitTo(uint bit, bool value);
+ bool getBitFlag(uint bit);
+ void setBitFlag(uint bit, bool value);
void expire_vga_timers();
diff --git a/engines/simon/verb.cpp b/engines/simon/verb.cpp
index ba0680424d..65b4126bd2 100644
--- a/engines/simon/verb.cpp
+++ b/engines/simon/verb.cpp
@@ -388,65 +388,110 @@ void SimonEngine::addNewHitArea(int id, int x, int y, int width, int height, int
}
void SimonEngine::resetVerbs() {
- uint id;
- HitArea *ha;
+ if (getGameType() == GType_FF) {
+ _verbHitArea = 300;
+ int cursor = 0;
+ int animMax = 16;
+
+ if (getBitFlag(203)) {
+ cursor = 14;
+ animMax = 9;
+ } else if (getBitFlag(204)) {
+ cursor = 15;
+ animMax = 9;
+ } else if (getBitFlag(207)) {
+ cursor = 26;
+ animMax = 2;
+ }
- if (getGameType() == GType_SIMON2) {
- id = 2;
- if (!(_bitArray[4] & 0x8000))
- id = (_mouseY >= 136) ? 102 : 101;
+ _mouseCursor = cursor;
+ _mouseAnimMax = animMax;
+ _mouseAnim = 1;
+ _needHitAreaRecalc++;
+
+ if (getBitFlag(99)) {
+ setVerb(NULL);
+ }
} else {
- id = (_mouseY >= 136) ? 102 : 101;
- }
+ uint id;
+ HitArea *ha;
+
+ if (getGameType() == GType_SIMON2) {
+ id = 2;
+ if (!(_bitArray[4] & 0x8000))
+ id = (_mouseY >= 136) ? 102 : 101;
+ } else {
+ id = (_mouseY >= 136) ? 102 : 101;
+ }
- _defaultVerb = id;
+ _defaultVerb = id;
- ha = findHitAreaByID(id);
- if (ha == NULL)
- return;
+ ha = findHitAreaByID(id);
+ if (ha == NULL)
+ return;
- if (ha->flags & 0x40) {
- _defaultVerb = 999;
- _currentVerbBox = NULL;
- } else {
- _verbHitArea = ha->verb;
- setVerb(ha);
+ if (ha->flags & 0x40) {
+ _defaultVerb = 999;
+ _currentVerbBox = NULL;
+ } else {
+ _verbHitArea = ha->verb;
+ setVerb(ha);
+ }
}
}
void SimonEngine::setVerb(HitArea *ha) {
- HitArea *tmp = _currentVerbBox;
-
- if (ha == tmp)
- return;
+ if (getGameType() == GType_FF) {
+ int cursor = _mouseCursor;
+ if (!_noRightClick)
+ return;
- if (getGameType() == GType_SIMON1) {
- if (tmp != NULL) {
- tmp->flags |= 8;
- video_toggle_colors(tmp, 0xd5, 0xd0, 0xd5, 0xA);
+ if (cursor > 13)
+ cursor = 0;
+ cursor++;
+ if (cursor == 5)
+ cursor = 1;
+ if (cursor == 4) {
+ if (getBitFlag(72)) {
+ cursor = 1;
+ }
+ } else if (cursor == 2) {
+ if (getBitFlag(99)) {
+ cursor = 3;
+ }
}
- if (ha->flags & 2)
- video_toggle_colors(ha, 0xda, 0xd5, 0xd5, 5);
- else
- video_toggle_colors(ha, 0xdf, 0xda, 0xda, 0xA);
-
- ha->flags &= ~(2 + 8);
-
+ _mouseCursor = cursor;
+ _mouseAnimMax = (cursor == 4) ? 14: 16;
+ _mouseAnim = 1;
+ _needHitAreaRecalc++;
+ _verbHitArea = cursor + 300;
} else {
- if (ha->id < 101)
+ HitArea *tmp = _currentVerbBox;
+
+ if (ha == tmp)
return;
- _mouseCursor = ha->id - 101;
- _needHitAreaRecalc++;
- }
- _currentVerbBox = ha;
-}
-void SimonEngine::setVerb_Feeble() {
- if (_noRightClick)
- return;
+ if (getGameType() == GType_SIMON1) {
+ if (tmp != NULL) {
+ tmp->flags |= 8;
+ video_toggle_colors(tmp, 0xd5, 0xd0, 0xd5, 0xA);
+ }
- warning("STUB: setVerb_Feeble");
+ if (ha->flags & 2)
+ video_toggle_colors(ha, 0xda, 0xd5, 0xd5, 5);
+ else
+ video_toggle_colors(ha, 0xdf, 0xda, 0xda, 0xA);
+
+ ha->flags &= ~(2 + 8);
+ } else {
+ if (ha->id < 101)
+ return;
+ _mouseCursor = ha->id - 101;
+ _needHitAreaRecalc++;
+ }
+ _currentVerbBox = ha;
+ }
}
void SimonEngine::hitarea_leave(HitArea *ha) {
@@ -463,7 +508,7 @@ void SimonEngine::leaveHitAreaById(uint hitarea_id) {
hitarea_leave(ha);
}
-void SimonEngine::handle_uparrow_hitarea(FillOrCopyStruct *fcs) {
+void SimonEngine::inventoryUp(FillOrCopyStruct *fcs) {
uint index;
index = get_fcs_ptr_3_index(fcs);
@@ -476,7 +521,7 @@ void SimonEngine::handle_uparrow_hitarea(FillOrCopyStruct *fcs) {
mouseOn();
}
-void SimonEngine::handle_downarrow_hitarea(FillOrCopyStruct *fcs) {
+void SimonEngine::inventoryDown(FillOrCopyStruct *fcs) {
uint index;
index = get_fcs_ptr_3_index(fcs);
diff --git a/engines/simon/vga.cpp b/engines/simon/vga.cpp
index b2991c0ba5..5ff6281663 100644
--- a/engines/simon/vga.cpp
+++ b/engines/simon/vga.cpp
@@ -929,7 +929,7 @@ void SimonEngine::drawImages_Feeble(VC10_state *state) {
if (state->flags & kDFMasked) {
- if (vcGetBit(81) == false) {
+ if (getBitFlag(81) == false) {
if (state->x > _feebleRect.right)
return;
if (state->y > _feebleRect.bottom)
@@ -1110,7 +1110,7 @@ void SimonEngine::drawImages(VC10_state *state) {
dst = state->surf_addr + w * 2; /* edi */
h = state->draw_height;
- if ((getGameType() == GType_SIMON1) && vcGetBit(88)) {
+ if ((getGameType() == GType_SIMON1) && getBitFlag(88)) {
/* transparency */
do {
if (mask[0] & 0xF0) {
@@ -1768,13 +1768,13 @@ void SimonEngine::vc42_delayIfNotEQ() {
}
void SimonEngine::vc43_skipIfBitClear() {
- if (!vcGetBit(vcReadNextWord())) {
+ if (!getBitFlag(vcReadNextWord())) {
vcSkipNextInstruction();
}
}
void SimonEngine::vc44_skipIfBitSet() {
- if (vcGetBit(vcReadNextWord())) {
+ if (getBitFlag(vcReadNextWord())) {
vcSkipNextInstruction();
}
}
@@ -1866,22 +1866,22 @@ void SimonEngine::vc48_setPathFinder() {
}
}
-void SimonEngine::vcSetBitTo(uint bit, bool value) {
+void SimonEngine::setBitFlag(uint bit, bool value) {
uint16 *bits = &_bitArray[bit / 16];
*bits = (*bits & ~(1 << (bit & 15))) | (value << (bit & 15));
}
-bool SimonEngine::vcGetBit(uint bit) {
+bool SimonEngine::getBitFlag(uint bit) {
uint16 *bits = &_bitArray[bit / 16];
return (*bits & (1 << (bit & 15))) != 0;
}
void SimonEngine::vc49_setBit() {
- vcSetBitTo(vcReadNextWord(), true);
+ setBitFlag(vcReadNextWord(), true);
}
void SimonEngine::vc50_clearBit() {
- vcSetBitTo(vcReadNextWord(), false);
+ setBitFlag(vcReadNextWord(), false);
}
void SimonEngine::vc51_clear_hitarea_bit_0x40() {
@@ -2361,8 +2361,8 @@ void SimonEngine::vc78_computeXY() {
_variableArray[16] = posy;
vsp->y = posy;
- vcSetBitTo(85, false);
- if (vcGetBit(74) == true) {
+ setBitFlag(85, false);
+ if (getBitFlag(74) == true) {
//centreScroll();
}
}
@@ -2404,7 +2404,7 @@ void SimonEngine::vc82_getPathValue() {
uint16 var = vcReadNextWord();
- if (vcGetBit(82) == true) {
+ if (getBitFlag(82) == true) {
val = _pathValues1[_GPVCount1++];
} else {
val = _pathValues[_GPVCount++];