aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/simon/simon.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp
index ca6f2f5728..f646288d78 100644
--- a/engines/simon/simon.cpp
+++ b/engines/simon/simon.cpp
@@ -2632,16 +2632,17 @@ void SimonEngine::scrollEvent() {
uint x, y;
if (_scrollXMax == 0) {
+ uint screenSize = 8 * _screenWidth;
if (_scrollFlag < 0) {
- memmove(dst + 8 * _screenWidth, dst, (_scrollWidth - 8) * _screenHeight);
+ memmove(dst + screenSize, dst, _scrollWidth * _screenHeight - screenSize);
} else {
- memmove(dst, dst + 8 * _screenWidth, (_scrollWidth - 8) * _screenHeight);
+ memmove(dst, dst + screenSize, _scrollWidth * _screenHeight - screenSize);
}
y = _scrollY - 8;
if (_scrollFlag > 0) {
- dst += (_screenHeight - 8) * _screenWidth;
+ dst += _screenHeight * _screenWidth - screenSize;
y += 488;
}