aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2006-09-29 03:25:08 +0000
committerTravis Howell2006-09-29 03:25:08 +0000
commit4dff848e6ec92f7616e68cbf45d5411ca8fc26b7 (patch)
treeea2bb3b8bde675649cb64c8237eaee8f19254e99
parent0e2bdc7fa27edebe03cb2f225f385e811a3ed373 (diff)
downloadscummvm-rg350-4dff848e6ec92f7616e68cbf45d5411ca8fc26b7.tar.gz
scummvm-rg350-4dff848e6ec92f7616e68cbf45d5411ca8fc26b7.tar.bz2
scummvm-rg350-4dff848e6ec92f7616e68cbf45d5411ca8fc26b7.zip
Add more changes for PP
svn-id: r23998
-rw-r--r--engines/simon/charset.cpp28
-rw-r--r--engines/simon/res.cpp3
-rw-r--r--engines/simon/simon.cpp14
-rw-r--r--engines/simon/verb.cpp43
-rw-r--r--engines/simon/window.cpp6
5 files changed, 65 insertions, 29 deletions
diff --git a/engines/simon/charset.cpp b/engines/simon/charset.cpp
index 7ae1113f56..712ed0bc3b 100644
--- a/engines/simon/charset.cpp
+++ b/engines/simon/charset.cpp
@@ -35,7 +35,7 @@ void SimonEngine::print_char_helper_1(const byte *src, uint len) {
return;
while (len-- != 0) {
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_FF || getGameType() == GType_PP) {
if (getBitFlag(93)) {
if (_curWindow == 3) {
if ((_newLines >= _textWindow->scrollY) && (_newLines < (_textWindow->scrollY + 3)))
@@ -184,7 +184,7 @@ void SimonEngine::renderStringAmiga(uint vga_sprite_id, uint color, uint width,
void SimonEngine::renderString(uint vga_sprite_id, uint color, uint width, uint height, const char *txt) {
VgaPointersEntry *vpe = &_vgaBufferPointers[2];
byte *src, *dst, *p, *dst_org, chr;
- const int textHeight = (getGameType() == GType_FF) ? 15: 10;
+ const int textHeight = (getGameType() == GType_FF || getGameType() == GType_PP) ? 15: 10;
uint count = 0;
if (vga_sprite_id >= 100) {
@@ -194,7 +194,7 @@ void SimonEngine::renderString(uint vga_sprite_id, uint color, uint width, uint
src = dst = vpe->vgaFile2;
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_FF || getGameType() == GType_PP) {
if (vga_sprite_id == 1)
count = 45000;
} else {
@@ -205,7 +205,7 @@ void SimonEngine::renderString(uint vga_sprite_id, uint color, uint width, uint
p = dst + vga_sprite_id * 8;
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_FF || getGameType() == GType_PP) {
WRITE_LE_UINT16(p + 4, height);
WRITE_LE_UINT16(p + 6, width);
// We need to adjust the offset to the next buffer to be right
@@ -243,7 +243,7 @@ void SimonEngine::renderString(uint vga_sprite_id, uint color, uint width, uint
byte *img_hdr, *img;
uint i, img_width, img_height;
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_FF || getGameType() == GType_PP) {
img_hdr = src + 96 + chr * 8;
img_height = READ_LE_UINT16(img_hdr + 4);
img_width = READ_LE_UINT16(img_hdr + 6);
@@ -314,7 +314,7 @@ void SimonEngine::showMessageFormat(const char *s, ...) {
openTextWindow();
if (!_showMessageFlag) {
_windowArray[0] = _textWindow;
- if (getGameType() == GType_FF)
+ if (getGameType() == GType_FF || getGameType() == GType_PP)
showmessage_helper_3(_textWindow->textColumn, _textWindow->width);
else
showmessage_helper_3(_textWindow->textLength, _textWindow->textMaxLength);
@@ -341,7 +341,7 @@ void SimonEngine::showmessage_print_char(byte chr) {
// _printCharMaxPos. In Simon, that is probably prevented by
// testing if _printCharCurPos == _printCharMaxPos below.
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_FF || getGameType() == GType_PP) {
fit = _printCharMaxPos > _printCharCurPos + _printCharPixelCount;
} else {
fit = _printCharMaxPos - _printCharCurPos >= _printCharPixelCount;
@@ -359,7 +359,7 @@ void SimonEngine::showmessage_print_char(byte chr) {
if (chr == 10)
_printCharCurPos = 0;
else if (chr != 0)
- _printCharCurPos += (getGameType() == GType_FF) ? feebleFontSize[chr - 32] : 1;
+ _printCharCurPos += (getGameType() == GType_FF || getGameType() == GType_PP) ? feebleFontSize[chr - 32] : 1;
}
} else {
const byte newline_character = 10;
@@ -368,7 +368,7 @@ void SimonEngine::showmessage_print_char(byte chr) {
print_char_helper_1(_lettersToPrintBuf, _numLettersToPrint);
if (chr == ' ') {
print_char_helper_1(&chr, 1);
- _printCharCurPos += (getGameType() == GType_FF) ? feebleFontSize[chr - 32] : 1;
+ _printCharCurPos += (getGameType() == GType_FF || getGameType() == GType_PP) ? feebleFontSize[chr - 32] : 1;
} else {
print_char_helper_1(&chr, 1);
_printCharCurPos = 0;
@@ -378,7 +378,7 @@ void SimonEngine::showmessage_print_char(byte chr) {
_printCharPixelCount = 0;
} else {
_lettersToPrintBuf[_numLettersToPrint++] = chr;
- _printCharPixelCount += (getGameType() == GType_FF) ? feebleFontSize[chr - 32] : 1;
+ _printCharPixelCount += (getGameType() == GType_FF || getGameType() == GType_PP) ? feebleFontSize[chr - 32] : 1;
}
}
@@ -386,7 +386,7 @@ void SimonEngine::openTextWindow() {
if (_textWindow)
return;
- if (getGameType() == GType_FF)
+ if (getGameType() == GType_FF || getGameType() == GType_PP)
_textWindow = openWindow(64, 96, 384, 172, 1, 0, 15);
else
_textWindow = openWindow(8, 144, 24, 6, 1, 0, 15);
@@ -433,7 +433,7 @@ void SimonEngine::windowPutChar(WindowBlock *window, byte c, byte b) {
}
}
} else if (c >= 32) {
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_FF || getGameType() == GType_PP) {
video_putchar_drawchar(window, window->textColumn + window->x, window->textRow + window->y, c);
window->textColumn += feebleFontSize[c - 32];
return;
@@ -1537,7 +1537,7 @@ void SimonEngine::video_putchar_drawchar(WindowBlock *window, uint x, uint y, by
dst = getFrontBuf() + y * _dxSurfacePitch + x + window->textColumnOffset;
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_FF || getGameType() == GType_PP) {
h = 13;
w = feebleFontSize[chr - 0x20];
@@ -1583,7 +1583,7 @@ void SimonEngine::video_putchar_drawchar(WindowBlock *window, uint x, uint y, by
i = 0;
do {
if (b < 0) {
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_FF || getGameType() == GType_PP) {
if (dst[i] == 0)
dst[i] = color;
} else {
diff --git a/engines/simon/res.cpp b/engines/simon/res.cpp
index 760e6885f9..b8fe09120f 100644
--- a/engines/simon/res.cpp
+++ b/engines/simon/res.cpp
@@ -968,6 +968,9 @@ void SimonEngine::loadSound(uint sound, int pan, int vol, uint type) {
}
void SimonEngine::loadVoice(uint speechId) {
+ if (getGameType() == GType_PP && speechId == 99)
+ return;
+
if (getFeatures() & GF_ZLIBCOMP) {
char filename[15];
diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp
index a6e8a49348..74cc08ee8c 100644
--- a/engines/simon/simon.cpp
+++ b/engines/simon/simon.cpp
@@ -784,8 +784,14 @@ uint SimonEngine::getVarOrByte() {
uint SimonEngine::getVarOrWord() {
uint a = READ_BE_UINT16(_codePtr);
_codePtr += 2;
- if (a >= 30000 && a < 30512) {
- return readVariable(a - 30000);
+ if (getGameType() == GType_PP) {
+ if (a >= 60000 && a < 62048) {
+ return readVariable(a - 60000);
+ }
+ } else {
+ if (a >= 30000 && a < 30512) {
+ return readVariable(a - 30000);
+ }
}
return a;
}
@@ -873,7 +879,9 @@ uint SimonEngine::readVariable(uint variable) {
if (variable >= _numVars)
error("readVariable: Variable %d out of range", variable);
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_PP) {
+ return (uint16)_variableArray[variable];
+ } else if (getGameType() == GType_FF) {
if (getBitFlag(83))
return (uint16)_variableArray2[variable];
else
diff --git a/engines/simon/verb.cpp b/engines/simon/verb.cpp
index 7c550c5712..ed621d712e 100644
--- a/engines/simon/verb.cpp
+++ b/engines/simon/verb.cpp
@@ -180,7 +180,7 @@ void SimonEngine::clearName() {
HitArea *last;
HitArea *ha;
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_FF || getGameType() == GType_PP) {
stopAnimateSimon2(2, 6);
_lastNameOn = NULL;
_animatePointer = 0;
@@ -344,7 +344,7 @@ void SimonEngine::handleVerbClicked(uint verb) {
if (sub)
startSubroutine(sub);
- if (getGameType() == GType_SIMON2 || getGameType() == GType_FF)
+ if (getGameType() == GType_SIMON2 || getGameType() == GType_FF || getGameType() == GType_PP)
_runScriptReturn1 = false;
permitInput();
@@ -410,7 +410,7 @@ void SimonEngine::disableBox(uint hitarea) {
void SimonEngine::moveBox(uint hitarea, int x, int y) {
HitArea *ha = findBox(hitarea);
if (ha != NULL) {
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_FF || getGameType() == GType_PP) {
ha->x += x;
ha->y += y;
} else {
@@ -451,7 +451,8 @@ void SimonEngine::defineBox(int id, int x, int y, int width, int height, int fla
ha->verb = verb;
ha->item_ptr = item_ptr;
- if (getGameType() == GType_FF && (ha->flags & kBFHyperBox)) {
+ if ((getGameType() == GType_FF || getGameType() == GType_PP) &&
+ (ha->flags & kBFHyperBox)) {
ha->data = _hyperLink;
ha->priority = 50;
}
@@ -460,7 +461,10 @@ void SimonEngine::defineBox(int id, int x, int y, int width, int height, int fla
}
void SimonEngine::resetVerbs() {
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_PP) {
+ _verbHitArea = 300;
+ return;
+ } else if (getGameType() == GType_FF) {
_verbHitArea = 300;
int cursor = 0;
int animMax = 16;
@@ -513,7 +517,9 @@ void SimonEngine::resetVerbs() {
}
void SimonEngine::setVerb(HitArea *ha) {
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_PP) {
+ return;
+ } else if (getGameType() == GType_FF) {
int cursor = _mouseCursor;
if (_noRightClick)
return;
@@ -737,8 +743,13 @@ void SimonEngine::boxController(uint x, uint y, uint mode) {
if (mode != 0 && mode != 3) {
_lastHitArea = best_ha;
- _variableArray[1] = x;
- _variableArray[2] = y;
+ if (getGameType() == GType_PP) {
+ _variableArray[400] = x;
+ _variableArray[401] = y;
+ } else {
+ _variableArray[1] = x;
+ _variableArray[2] = y;
+ }
}
if (best_ha->flags & kBFNoTouchName) {
@@ -759,7 +770,21 @@ void SimonEngine::displayName(HitArea *ha) {
bool result;
int x = 0, y = 0;
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_PP) {
+ if (ha->flags & kBFHyperBox) {
+ _lastNameOn = ha;
+ return;
+ }
+ if (findBox(50))
+ return;
+
+ y = ha->y;
+ y -= 17;
+ if (y < 0)
+ y = 0;
+ y += 2;
+ x = ha->width / 2 + ha->x;
+ } else if (getGameType() == GType_FF) {
if (ha->flags & kBFHyperBox) {
_lastNameOn = ha;
return;
diff --git a/engines/simon/window.cpp b/engines/simon/window.cpp
index cabbc76cf4..aa39ac0c97 100644
--- a/engines/simon/window.cpp
+++ b/engines/simon/window.cpp
@@ -72,7 +72,7 @@ void SimonEngine::changeWindow(uint a) {
showmessage_print_char(0);
_textWindow = _windowArray[a];
- if (getGameType() == GType_FF)
+ if (getGameType() == GType_FF || getGameType() == GType_PP)
showmessage_helper_3(_textWindow->textColumn, _textWindow->width);
else
showmessage_helper_3(_textWindow->textLength, _textWindow->textMaxLength);
@@ -109,7 +109,7 @@ void SimonEngine::colorWindow(WindowBlock *window) {
_lockWord |= 0x8000;
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_FF || getGameType() == GType_PP) {
dst = getFrontBuf() + _dxSurfacePitch * window->y + window->x;
for (h = 0; h < window->height; h++) {
@@ -142,7 +142,7 @@ void SimonEngine::resetWindow(WindowBlock *window) {
void SimonEngine::restoreWindow(WindowBlock *window) {
_lockWord |= 0x8000;
- if (getGameType() == GType_FF) {
+ if (getGameType() == GType_FF || getGameType() == GType_PP) {
restoreBlock(window->y + window->height, window->x + window->width, window->y, window->x);
} else if (getGameType() == GType_SIMON2) {
if (_restoreWindow6 && _windowArray[2] == window) {