diff options
-rw-r--r-- | engines/simon/cursor.cpp | 2 | ||||
-rw-r--r-- | engines/simon/simon.cpp | 47 | ||||
-rw-r--r-- | engines/simon/simon.h | 8 | ||||
-rw-r--r-- | engines/simon/vga.cpp | 23 |
4 files changed, 52 insertions, 28 deletions
diff --git a/engines/simon/cursor.cpp b/engines/simon/cursor.cpp index 2d54f3080b..3b7725c7d7 100644 --- a/engines/simon/cursor.cpp +++ b/engines/simon/cursor.cpp @@ -224,7 +224,7 @@ static const byte _simon2_cursors[10][256] = { }; void SimonEngine::drawMousePointer() { - debug(0, "Mouse %d Anim %d Max %d", _mouseCursor, _mouseAnim, _mouseAnimMax); + //debug(0, "Mouse %d Anim %d Max %d", _mouseCursor, _mouseAnim, _mouseAnimMax); if (getGameType() == GType_SIMON2) _system->setMouseCursor(_simon2_cursors[_mouseCursor], 16, 16, 7, 7); diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp index 27bf2c442d..01b5f4538a 100644 --- a/engines/simon/simon.cpp +++ b/engines/simon/simon.cpp @@ -2359,7 +2359,9 @@ void SimonEngine::set_video_mode_internal(uint mode, uint vga_res_id) { _usePaletteDelay = true; } else { _scrollX = 0; + _scrollY = 0; _scrollXMax = 0; + _scrollYMax = 0; _scrollCount = 0; _scrollFlag = 0; _scrollHeight = 134; @@ -2491,21 +2493,35 @@ void SimonEngine::scroll_timeout() { if (_scrollCount == 0) return; - if (_scrollCount < 0) { - if (_scrollFlag != -1) { - _scrollFlag = -1; - if (++_scrollCount == 0) - return; + if (getGameType() == GType_FF) { + if (_scrollCount < 0) { + if (_scrollFlag != -8) { + _scrollFlag = -8; + _scrollCount += 8; + } + } else { + if (_scrollFlag != 8) { + _scrollFlag = 8; + _scrollCount -= 8; + } } } else { - if (_scrollFlag != 1) { - _scrollFlag = 1; - if (--_scrollCount == 0) - return; + if (_scrollCount < 0) { + if (_scrollFlag != -1) { + _scrollFlag = -1; + if (++_scrollCount == 0) + return; + } + } else { + if (_scrollFlag != 1) { + _scrollFlag = 1; + if (--_scrollCount == 0) + return; + } } - } - add_vga_timer(6, NULL, 0, 0); + add_vga_timer(6, NULL, 0, 0); + } } void SimonEngine::vcResumeSprite(const byte *code_ptr, uint16 cur_file, uint16 cur_sprite) { @@ -2626,7 +2642,10 @@ void SimonEngine::timer_vga_sprites() { if (_paletteFlag == 2) _paletteFlag = 1; - if ((getGameType() == GType_SIMON2 || getGameType() == GType_FF) && _scrollFlag) { + if (getGameType() == GType_FF && _scrollCount) { + scroll_timeout(); + } + if (getGameType() == GType_SIMON2 && _scrollFlag) { scrollEvent(); } @@ -3736,6 +3755,10 @@ void SimonEngine::dx_update_screen_and_palette() { memcpy(_sdl_buf_attached, _sdl_buf, _screenWidth * _screenHeight); + if (getGameType() == GType_FF && _scrollFlag) { + scrollEvent(); + } + if (_paletteColorCount != 0) { if (getGameType() == GType_SIMON1 && _usePaletteDelay) { delay(100); diff --git a/engines/simon/simon.h b/engines/simon/simon.h index 382669506e..1899d07434 100644 --- a/engines/simon/simon.h +++ b/engines/simon/simon.h @@ -266,8 +266,8 @@ protected: bool _vgaVar9; int16 _scriptUnk1; bool _restoreWindow6; - int _scrollX, _scrollXMax, _scrollHeight; - int _scrollY, _scrollYMax, _scrollWidth; + int _scrollX, _scrollXMax, _scrollWidth; + int _scrollY, _scrollYMax, _scrollHeight; int _scrollCount, _scrollFlag; const byte *_scrollImage; byte _vgaVar8; @@ -1000,8 +1000,8 @@ protected: void vcSkipNextInstruction(); int getScale(int y, int x); - void checkScrollX(int x); - void checkScrollY(int y); + void checkScrollX(int x, int xpos); + void checkScrollY(int y, int ypos); bool itemIsSiblingOf(uint16 val); bool itemIsParentOf(uint16 a, uint16 b); diff --git a/engines/simon/vga.cpp b/engines/simon/vga.cpp index a1c0c37228..101e137fc3 100644 --- a/engines/simon/vga.cpp +++ b/engines/simon/vga.cpp @@ -729,7 +729,7 @@ void SimonEngine::vc10_draw() { byte *dst; uint w; - _scrollXMax = 640; + _scrollXMax = width - 640; _scrollYMax = 0; _scrollImage = state.depack_src; _scrollHeight = height; @@ -741,13 +741,14 @@ void SimonEngine::vc10_draw() { vcWriteVar(251, _scrollX); dst = getBackBuf(); - src = state.depack_src + (_scrollX - 8) / 2; + src = state.depack_src + _scrollX / 2; for (w = 0; w < 80; w++) { decodeStripA(dst, src + READ_LE_UINT32(src), height); dst += 8; src += 4; } + return; } if (height > 480) { @@ -1856,7 +1857,7 @@ void SimonEngine::vc48_setPathFinder() { y = vsp->y; vsp->y = y1; - checkScrollY(y1 - y); + checkScrollY(y, y1); _variableArray[11] = readUint16Wrapper(p); _variableArray[13] = pos; @@ -2335,7 +2336,7 @@ void SimonEngine::vc76_setScaleXOffs() { vsp->x += getScale(vsp->y, x); _variableArray[var] = vsp->x; - checkScrollX(x); + checkScrollX(x, vsp->x); vsp->flags = kDFScaled; } @@ -2350,7 +2351,7 @@ void SimonEngine::vc77_setScaleYOffs() { vsp->y += getScale(vsp->y, y); _variableArray[var] = vsp->y; - checkScrollY(y); + checkScrollY(y, vsp->y); vsp->flags = kDFScaled; } @@ -2438,7 +2439,7 @@ void SimonEngine::vc84_stopSoundLoop() { } // Scrolling functions for Feeble Files -void SimonEngine::checkScrollX(int x) { +void SimonEngine::checkScrollX(int x, int xpos) { if (_scrollXMax == 0 || getBitFlag(80) || getBitFlag(82) || x == 0) return; @@ -2453,7 +2454,7 @@ void SimonEngine::checkScrollX(int x) { return; } - if (x - _scrollX >= 480) { + if (xpos - _scrollX >= 480) { _scrollCount = 320; tmp = _scrollXMax - _scrollX; if (tmp < 320) @@ -2469,7 +2470,7 @@ void SimonEngine::checkScrollX(int x) { return; } - if ((uint16)(x - _scrollX) < 161) { + if ((uint16)(xpos - _scrollX) < 161) { _scrollCount = -320; tmp = _scrollXMax - _scrollX; if (_scrollX < 320) @@ -2478,7 +2479,7 @@ void SimonEngine::checkScrollX(int x) { } } -void SimonEngine::checkScrollY(int y) { +void SimonEngine::checkScrollY(int y, int ypos) { if (_scrollYMax == 0 || getBitFlag(80)) return; @@ -2493,7 +2494,7 @@ void SimonEngine::checkScrollY(int y) { return; } - if (y - _scrollY >= 440) { + if (ypos - _scrollY >= 440) { _scrollCount = 240; tmp = _scrollYMax - _scrollY; if (tmp < 240) @@ -2509,7 +2510,7 @@ void SimonEngine::checkScrollY(int y) { return; } - if ((uint16)(y - _scrollY) < 100) { + if ((uint16)(ypos - _scrollY) < 100) { _scrollCount = -240; tmp = _scrollYMax - _scrollY; if (_scrollY < 240) |