Fix some horizontal scrolling issues in FF

svn-id: r21661
This commit is contained in:
Travis Howell 2006-04-07 09:04:36 +00:00
parent e806e891e3
commit c0e984a80a
4 changed files with 52 additions and 28 deletions

View file

@ -224,7 +224,7 @@ static const byte _simon2_cursors[10][256] = {
}; };
void SimonEngine::drawMousePointer() { 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) if (getGameType() == GType_SIMON2)
_system->setMouseCursor(_simon2_cursors[_mouseCursor], 16, 16, 7, 7); _system->setMouseCursor(_simon2_cursors[_mouseCursor], 16, 16, 7, 7);

View file

@ -2359,7 +2359,9 @@ void SimonEngine::set_video_mode_internal(uint mode, uint vga_res_id) {
_usePaletteDelay = true; _usePaletteDelay = true;
} else { } else {
_scrollX = 0; _scrollX = 0;
_scrollY = 0;
_scrollXMax = 0; _scrollXMax = 0;
_scrollYMax = 0;
_scrollCount = 0; _scrollCount = 0;
_scrollFlag = 0; _scrollFlag = 0;
_scrollHeight = 134; _scrollHeight = 134;
@ -2491,6 +2493,19 @@ void SimonEngine::scroll_timeout() {
if (_scrollCount == 0) if (_scrollCount == 0)
return; 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 (_scrollCount < 0) { if (_scrollCount < 0) {
if (_scrollFlag != -1) { if (_scrollFlag != -1) {
_scrollFlag = -1; _scrollFlag = -1;
@ -2507,6 +2522,7 @@ void SimonEngine::scroll_timeout() {
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) { void SimonEngine::vcResumeSprite(const byte *code_ptr, uint16 cur_file, uint16 cur_sprite) {
VgaPointersEntry *vpe; VgaPointersEntry *vpe;
@ -2626,7 +2642,10 @@ void SimonEngine::timer_vga_sprites() {
if (_paletteFlag == 2) if (_paletteFlag == 2)
_paletteFlag = 1; _paletteFlag = 1;
if ((getGameType() == GType_SIMON2 || getGameType() == GType_FF) && _scrollFlag) { if (getGameType() == GType_FF && _scrollCount) {
scroll_timeout();
}
if (getGameType() == GType_SIMON2 && _scrollFlag) {
scrollEvent(); scrollEvent();
} }
@ -3736,6 +3755,10 @@ void SimonEngine::dx_update_screen_and_palette() {
memcpy(_sdl_buf_attached, _sdl_buf, _screenWidth * _screenHeight); memcpy(_sdl_buf_attached, _sdl_buf, _screenWidth * _screenHeight);
if (getGameType() == GType_FF && _scrollFlag) {
scrollEvent();
}
if (_paletteColorCount != 0) { if (_paletteColorCount != 0) {
if (getGameType() == GType_SIMON1 && _usePaletteDelay) { if (getGameType() == GType_SIMON1 && _usePaletteDelay) {
delay(100); delay(100);

View file

@ -266,8 +266,8 @@ protected:
bool _vgaVar9; bool _vgaVar9;
int16 _scriptUnk1; int16 _scriptUnk1;
bool _restoreWindow6; bool _restoreWindow6;
int _scrollX, _scrollXMax, _scrollHeight; int _scrollX, _scrollXMax, _scrollWidth;
int _scrollY, _scrollYMax, _scrollWidth; int _scrollY, _scrollYMax, _scrollHeight;
int _scrollCount, _scrollFlag; int _scrollCount, _scrollFlag;
const byte *_scrollImage; const byte *_scrollImage;
byte _vgaVar8; byte _vgaVar8;
@ -1000,8 +1000,8 @@ protected:
void vcSkipNextInstruction(); void vcSkipNextInstruction();
int getScale(int y, int x); int getScale(int y, int x);
void checkScrollX(int x); void checkScrollX(int x, int xpos);
void checkScrollY(int y); void checkScrollY(int y, int ypos);
bool itemIsSiblingOf(uint16 val); bool itemIsSiblingOf(uint16 val);
bool itemIsParentOf(uint16 a, uint16 b); bool itemIsParentOf(uint16 a, uint16 b);

View file

@ -729,7 +729,7 @@ void SimonEngine::vc10_draw() {
byte *dst; byte *dst;
uint w; uint w;
_scrollXMax = 640; _scrollXMax = width - 640;
_scrollYMax = 0; _scrollYMax = 0;
_scrollImage = state.depack_src; _scrollImage = state.depack_src;
_scrollHeight = height; _scrollHeight = height;
@ -741,13 +741,14 @@ void SimonEngine::vc10_draw() {
vcWriteVar(251, _scrollX); vcWriteVar(251, _scrollX);
dst = getBackBuf(); dst = getBackBuf();
src = state.depack_src + (_scrollX - 8) / 2; src = state.depack_src + _scrollX / 2;
for (w = 0; w < 80; w++) { for (w = 0; w < 80; w++) {
decodeStripA(dst, src + READ_LE_UINT32(src), height); decodeStripA(dst, src + READ_LE_UINT32(src), height);
dst += 8; dst += 8;
src += 4; src += 4;
} }
return; return;
} }
if (height > 480) { if (height > 480) {
@ -1856,7 +1857,7 @@ void SimonEngine::vc48_setPathFinder() {
y = vsp->y; y = vsp->y;
vsp->y = y1; vsp->y = y1;
checkScrollY(y1 - y); checkScrollY(y, y1);
_variableArray[11] = readUint16Wrapper(p); _variableArray[11] = readUint16Wrapper(p);
_variableArray[13] = pos; _variableArray[13] = pos;
@ -2335,7 +2336,7 @@ void SimonEngine::vc76_setScaleXOffs() {
vsp->x += getScale(vsp->y, x); vsp->x += getScale(vsp->y, x);
_variableArray[var] = vsp->x; _variableArray[var] = vsp->x;
checkScrollX(x); checkScrollX(x, vsp->x);
vsp->flags = kDFScaled; vsp->flags = kDFScaled;
} }
@ -2350,7 +2351,7 @@ void SimonEngine::vc77_setScaleYOffs() {
vsp->y += getScale(vsp->y, y); vsp->y += getScale(vsp->y, y);
_variableArray[var] = vsp->y; _variableArray[var] = vsp->y;
checkScrollY(y); checkScrollY(y, vsp->y);
vsp->flags = kDFScaled; vsp->flags = kDFScaled;
} }
@ -2438,7 +2439,7 @@ void SimonEngine::vc84_stopSoundLoop() {
} }
// Scrolling functions for Feeble Files // 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) if (_scrollXMax == 0 || getBitFlag(80) || getBitFlag(82) || x == 0)
return; return;
@ -2453,7 +2454,7 @@ void SimonEngine::checkScrollX(int x) {
return; return;
} }
if (x - _scrollX >= 480) { if (xpos - _scrollX >= 480) {
_scrollCount = 320; _scrollCount = 320;
tmp = _scrollXMax - _scrollX; tmp = _scrollXMax - _scrollX;
if (tmp < 320) if (tmp < 320)
@ -2469,7 +2470,7 @@ void SimonEngine::checkScrollX(int x) {
return; return;
} }
if ((uint16)(x - _scrollX) < 161) { if ((uint16)(xpos - _scrollX) < 161) {
_scrollCount = -320; _scrollCount = -320;
tmp = _scrollXMax - _scrollX; tmp = _scrollXMax - _scrollX;
if (_scrollX < 320) 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)) if (_scrollYMax == 0 || getBitFlag(80))
return; return;
@ -2493,7 +2494,7 @@ void SimonEngine::checkScrollY(int y) {
return; return;
} }
if (y - _scrollY >= 440) { if (ypos - _scrollY >= 440) {
_scrollCount = 240; _scrollCount = 240;
tmp = _scrollYMax - _scrollY; tmp = _scrollYMax - _scrollY;
if (tmp < 240) if (tmp < 240)
@ -2509,7 +2510,7 @@ void SimonEngine::checkScrollY(int y) {
return; return;
} }
if ((uint16)(y - _scrollY) < 100) { if ((uint16)(ypos - _scrollY) < 100) {
_scrollCount = -240; _scrollCount = -240;
tmp = _scrollYMax - _scrollY; tmp = _scrollYMax - _scrollY;
if (_scrollY < 240) if (_scrollY < 240)