aboutsummaryrefslogtreecommitdiff
path: root/engines/simon/simon.cpp
diff options
context:
space:
mode:
authorTravis Howell2006-04-08 00:12:16 +0000
committerTravis Howell2006-04-08 00:12:16 +0000
commit9a7b16e4d3eeb60ce2ed58159adb40486210ec07 (patch)
treed12a733f7935f263fdd881b1fdd424e09ddab9f9 /engines/simon/simon.cpp
parent9e5950e7042d818508a3b91571d076a3bc35c258 (diff)
downloadscummvm-rg350-9a7b16e4d3eeb60ce2ed58159adb40486210ec07.tar.gz
scummvm-rg350-9a7b16e4d3eeb60ce2ed58159adb40486210ec07.tar.bz2
scummvm-rg350-9a7b16e4d3eeb60ce2ed58159adb40486210ec07.zip
Add initial support for vertical scrolling in FF
svn-id: r21675
Diffstat (limited to 'engines/simon/simon.cpp')
-rw-r--r--engines/simon/simon.cpp62
1 files changed, 41 insertions, 21 deletions
diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp
index 5583c4a15a..6334db9ba8 100644
--- a/engines/simon/simon.cpp
+++ b/engines/simon/simon.cpp
@@ -2689,34 +2689,54 @@ void SimonEngine::timer_vga_sprites() {
void SimonEngine::scrollEvent() {
byte *dst = getFrontBuf();
const byte *src;
- uint x;
+ uint x, y;;
- if (_scrollFlag < 0) {
- memmove(dst + 8, dst, _screenWidth * _scrollHeight - 8);
- } else {
- memmove(dst, dst + 8, _screenWidth * _scrollHeight - 8);
- }
+ if (_scrollXMax == 0) {
+ if (_scrollFlag < 0) {
+ memmove(dst + 8 * _screenWidth, dst, (_scrollHeight - 8) * _screenWidth);
+ } else {
+ memmove(dst, dst + 8 * _screenWidth, (_scrollHeight - 8) * _screenWidth);
+ }
- x = _scrollX;
- x -= (getGameType() == GType_FF) ? 8 : 1;
+ y = _scrollY - 8;
- if (_scrollFlag > 0) {
- dst += _screenWidth - 8;
- x += (getGameType() == GType_FF) ? 648 : 41;
- }
+ if (_scrollFlag > 0) {
+ dst += (_scrollHeight - 8) * _screenWidth;
+ y += 488;
+ }
- if (getGameType() == GType_FF)
- src = _scrollImage + x / 2;
- else
- src = _scrollImage + x * 4;
- decodeStripA(dst, src + readUint32Wrapper(src), _scrollHeight);
+ src = _scrollImage + y / 2;
+ decodeRow(dst, src + readUint32Wrapper(src), _scrollWidth);
- memcpy(_sdl_buf_attached, _sdl_buf, _screenWidth * _screenHeight);
- dx_copy_from_attached_to_3(_scrollHeight);
+ _scrollY += _scrollFlag;
+ vcWriteVar(250, _scrollY);
+ } else {
+ if (_scrollFlag < 0) {
+ memmove(dst + 8, dst, _screenWidth * _scrollHeight - 8);
+ } else {
+ memmove(dst, dst + 8, _screenWidth * _scrollHeight - 8);
+ }
+
+ x = _scrollX;
+ x -= (getGameType() == GType_FF) ? 8 : 1;
+
+ if (_scrollFlag > 0) {
+ dst += _screenWidth - 8;
+ x += (getGameType() == GType_FF) ? 648 : 41;
+ }
- _scrollX += _scrollFlag;
+ if (getGameType() == GType_FF)
+ src = _scrollImage + x / 2;
+ else
+ src = _scrollImage + x * 4;
+ decodeColumn(dst, src + readUint32Wrapper(src), _scrollHeight);
- vcWriteVar(251, _scrollX);
+ _scrollX += _scrollFlag;
+ vcWriteVar(251, _scrollX);
+ }
+
+ memcpy(_sdl_buf_attached, _sdl_buf, _screenWidth * _screenHeight);
+ memcpy(_sdl_buf_3, _sdl_buf_attached, _scrollHeight * _screenWidth);
_scrollFlag = 0;
}