aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/simon/charset.cpp17
-rw-r--r--engines/simon/items.cpp2
-rw-r--r--engines/simon/simon.cpp18
-rw-r--r--engines/simon/simon.h2
-rw-r--r--engines/simon/string.cpp2
-rw-r--r--engines/simon/verb.cpp2
-rw-r--r--engines/simon/vga.cpp40
7 files changed, 69 insertions, 14 deletions
diff --git a/engines/simon/charset.cpp b/engines/simon/charset.cpp
index dff2fe2719..ad25a1ca13 100644
--- a/engines/simon/charset.cpp
+++ b/engines/simon/charset.cpp
@@ -183,7 +183,7 @@ void SimonEngine::renderString(uint vga_sprite_id, uint color, uint width, uint
VgaPointersEntry *vpe = &_vgaBufferPointers[2];
byte *src, *dst, *p, *dst_org, chr;
const int textHeight = (getGameType() == GType_FF) ? 15: 10;
- uint count;
+ uint count = 0;
if (vga_sprite_id >= 100) {
vga_sprite_id -= 100;
@@ -192,9 +192,14 @@ void SimonEngine::renderString(uint vga_sprite_id, uint color, uint width, uint
src = dst = vpe->vgaFile2;
- count = 4000;
- if (vga_sprite_id == 1)
- count *= 2;
+ if (getGameType() == GType_FF) {
+ if (vga_sprite_id == 1)
+ count = 11025;
+ } else {
+ count = 4000;
+ if (vga_sprite_id == 1)
+ count *= 2;
+ }
p = dst + vga_sprite_id * 8;
@@ -207,7 +212,9 @@ void SimonEngine::renderString(uint vga_sprite_id, uint color, uint width, uint
}
dst += readUint32Wrapper(p);
- memset(dst, 0, count);
+ if (count != 0)
+ memset(dst, 0, count);
+
if (_language == Common::HB_ISR)
dst += width - 1; // For Hebrew, start at the right edge, not the left.
diff --git a/engines/simon/items.cpp b/engines/simon/items.cpp
index 806f2ded2c..d43c49b2a2 100644
--- a/engines/simon/items.cpp
+++ b/engines/simon/items.cpp
@@ -1512,7 +1512,7 @@ void SimonEngine::o3_playSmack() {
void SimonEngine::o3_centreScroll() {
// 187
- warning("STUB: script opcode 187");
+ centreScroll();
}
void SimonEngine::o3_resetPVCount() {
diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp
index 5678d5948d..4a9eaeb85d 100644
--- a/engines/simon/simon.cpp
+++ b/engines/simon/simon.cpp
@@ -1554,6 +1554,7 @@ void SimonEngine::o_setup_cond_c() {
void SimonEngine::setup_cond_c_helper() {
HitArea *last;
+ uint id;
_noRightClick = 1;
@@ -1644,7 +1645,14 @@ void SimonEngine::setup_cond_c_helper() {
inventoryDown(_lastHitArea->window);
} else if (_lastHitArea->item_ptr != NULL) {
_hitAreaObjectItem = _lastHitArea->item_ptr;
- _variableArray[60] = (_lastHitArea->flags & kBFTextBox) ? (_lastHitArea->flags / 256) : 0xFFFF;
+ id = 0xFFFF;
+ if (_lastHitArea->flags & kBFTextBox) {
+ if (getGameType() == GType_FF && (_lastHitArea->flags & kBFHyperBox))
+ id = _lastHitArea->data;
+ else
+ id = _lastHitArea->flags / 256;
+ }
+ _variableArray[60] = id;
break;
}
}
@@ -1950,8 +1958,12 @@ startOver:
if_1:;
_hitAreaSubjectItem = ha->item_ptr;
id = 0xFFFF;
- if (ha->flags & kBFTextBox)
- id = ha->flags / 256;
+ if (ha->flags & kBFTextBox) {
+ if (getGameType() == GType_FF && (ha->flags & kBFHyperBox))
+ id = ha->data;
+ else
+ id = ha->flags / 256;
+ }
_variableArray[60] = id;
displayName(ha);
if (_verbHitArea != 0)
diff --git a/engines/simon/simon.h b/engines/simon/simon.h
index 25911adaed..7722484ca1 100644
--- a/engines/simon/simon.h
+++ b/engines/simon/simon.h
@@ -67,6 +67,7 @@ struct HitArea {
uint16 width, height;
uint16 flags;
uint16 id;
+ uint16 data;
WindowBlock *window;
Item *item_ptr;
uint16 verb;
@@ -1015,6 +1016,7 @@ protected:
int getScale(int y, int x);
void checkScrollX(int x, int xpos);
void checkScrollY(int y, int ypos);
+ void centreScroll();
bool itemIsSiblingOf(uint16 val);
bool itemIsParentOf(uint16 a, uint16 b);
diff --git a/engines/simon/string.cpp b/engines/simon/string.cpp
index 6382f2e433..5be02e1495 100644
--- a/engines/simon/string.cpp
+++ b/engines/simon/string.cpp
@@ -125,8 +125,6 @@ bool SimonEngine::printNameOf(Item *item, uint x, uint y) {
}
void SimonEngine::printInteractText(uint16 num, const char *string) {
- printf("printInteractText: num %d, string %s\n", num, string);
-
char convertedString[320];
char *convertedString2 = convertedString;
const char *string2 = string;
diff --git a/engines/simon/verb.cpp b/engines/simon/verb.cpp
index e12f41e3c7..618c7539bb 100644
--- a/engines/simon/verb.cpp
+++ b/engines/simon/verb.cpp
@@ -396,7 +396,7 @@ void SimonEngine::defineBox(int id, int x, int y, int width, int height, int fla
ha->item_ptr = item_ptr;
if (getGameType() == GType_FF && (ha->flags & kBFHyperBox)) {
- // TODO
+ ha->data = _hyperLink;
ha->priority = 50;
}
diff --git a/engines/simon/vga.cpp b/engines/simon/vga.cpp
index 02a9c8ea89..4b109bbccc 100644
--- a/engines/simon/vga.cpp
+++ b/engines/simon/vga.cpp
@@ -2424,8 +2424,8 @@ void SimonEngine::vc78_computeXY() {
vsp->y = posy;
setBitFlag(85, false);
- if (getBitFlag(74) == true) {
- //centreScroll();
+ if (getBitFlag(74)) {
+ centreScroll();
}
}
@@ -2569,4 +2569,40 @@ void SimonEngine::checkScrollY(int y, int ypos) {
}
}
+void SimonEngine::centreScroll() {
+ int16 x, y, tmp;
+
+ if (_scrollXMax != 0) {
+ _scrollCount = 0;
+ x = _variableArray[15] - _scrollX;
+ if (getBitFlag(85) || x >= 624) {
+ x -= 320;
+ tmp = _scrollXMax - _scrollX;
+ if (tmp < x)
+ x = tmp;
+ _scrollCount = x;
+ } else if (x < 17) {
+ x -= 320;
+ if (_scrollX < -x)
+ x = -_scrollX;
+ _scrollCount = x;
+ }
+ } else if (_scrollYMax != 0) {
+ _scrollCount = 0;
+ y = _variableArray[16] - _scrollY;
+ if (y >= 460) {
+ y -= 240;
+ tmp = _scrollYMax - _scrollY;
+ if (tmp < y)
+ y = tmp;
+ _scrollCount = y;
+ } else if (y < 30) {
+ y -= 240;
+ if (_scrollY < -y)
+ y = -_scrollY;
+ _scrollCount = y;
+ }
+ }
+}
+
} // End of namespace Simon