diff options
-rw-r--r-- | engines/simon/debug.h | 2 | ||||
-rw-r--r-- | engines/simon/items.cpp | 22 | ||||
-rw-r--r-- | engines/simon/simon.cpp | 11 | ||||
-rw-r--r-- | engines/simon/simon.h | 4 |
4 files changed, 29 insertions, 10 deletions
diff --git a/engines/simon/debug.h b/engines/simon/debug.h index fdcb2c3fcb..053c2c3936 100644 --- a/engines/simon/debug.h +++ b/engines/simon/debug.h @@ -1217,7 +1217,7 @@ static const char *const feeblefiles_opcode_name_table[256] = { "W|CLEAR_VGAPOINTER_ENTRY", NULL, "|VGA_POINTER_OP_3", - NULL, + "|CENTRE_SCROLL", /* 188 */ "BSJ|STRING2_IS", "|CLEAR_MARKS", diff --git a/engines/simon/items.cpp b/engines/simon/items.cpp index d43c49b2a2..176bc52997 100644 --- a/engines/simon/items.cpp +++ b/engines/simon/items.cpp @@ -1445,14 +1445,22 @@ void SimonEngine::o3_oracleTextUp() { void SimonEngine::o3_ifTime() { // 124: if time - uint time = getVarOrWord(); - setScriptCondition(true); - warning("STUB: script opcode 124 (%d)", time); + time_t t; + + uint a = getVarOrWord(); + time(&t); + t -= _gameStoppedClock; + t -= a; + if (t >= _timeStore) + setScriptCondition(true); + else + setScriptCondition(false); } void SimonEngine::o3_setTime() { // 131 - warning("STUB: script opcode 131"); + time(&_timeStore); + _timeStore -= _gameStoppedClock; } void SimonEngine::o3_loadUserGame() { @@ -1547,12 +1555,14 @@ void SimonEngine::o3_setPathValues() { void SimonEngine::o3_stopClock() { // 193: pause clock - warning("STUB: script opcode 193"); + _clockStopped = time(NULL); } void SimonEngine::o3_restartClock() { // 194: resume clock - warning("STUB: script opcode 194"); + if (_clockStopped != 0) + _gameStoppedClock += time(NULL) - _clockStopped; + _clockStopped = 0; } void SimonEngine::o3_setColour() { diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp index 4a9eaeb85d..3c275a8fb0 100644 --- a/engines/simon/simon.cpp +++ b/engines/simon/simon.cpp @@ -304,6 +304,8 @@ SimonEngine::SimonEngine(OSystem *syst) _printCharPixelCount = 0; _numLettersToPrint = 0; + _clockStopped = 0; + _gameStoppedClock = 0; _lastTime = 0; _firstTimeStruct = 0; @@ -2663,6 +2665,11 @@ void SimonEngine::timer_vga_sprites() { scrollEvent(); } + if (getGameType() == GType_FF && getBitFlag(84)) { + // TODO + warning("Animation by Y value not supported"); + } + vsp = _vgaSprites; while (vsp->id != 0) { @@ -2904,7 +2911,7 @@ void SimonEngine::closeWindow(uint a) { if (_windowArray[a] == NULL) return; removeIconArray(a); - video_copy_if_flag_0x8_c(_windowArray[a]); + resetWindow(_windowArray[a]); _windowArray[a] = NULL; if (_curWindow == a) { _textWindow = NULL; @@ -3265,7 +3272,7 @@ void SimonEngine::video_toggle_colors(HitArea * ha, byte a, byte b, byte c, byte _lockWord &= ~0x8000; } -void SimonEngine::video_copy_if_flag_0x8_c(WindowBlock *window) { +void SimonEngine::resetWindow(WindowBlock *window) { if (window->flags & 8) restoreWindow(window); window->mode = 0; diff --git a/engines/simon/simon.h b/engines/simon/simon.h index 7722484ca1..423b03887e 100644 --- a/engines/simon/simon.h +++ b/engines/simon/simon.h @@ -307,6 +307,8 @@ protected: uint _numLettersToPrint; uint _lastTime; + uint _clockStopped, _gameStoppedClock; + time_t _timeStore; TimeEvent *_firstTimeStruct, *_pendingDeleteTimeEvent; @@ -1032,7 +1034,7 @@ protected: bool isSpriteLoaded(uint16 id, uint16 fileId); - void video_copy_if_flag_0x8_c(WindowBlock *window); + void resetWindow(WindowBlock *window); void delete_hitarea_by_index(uint index); void windowPutChar(uint a); |