diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/simon/intern.h | 1 | ||||
-rw-r--r-- | engines/simon/items.cpp | 16 | ||||
-rw-r--r-- | engines/simon/module.mk | 1 | ||||
-rw-r--r-- | engines/simon/oracle.cpp | 55 | ||||
-rw-r--r-- | engines/simon/simon.cpp | 8 | ||||
-rw-r--r-- | engines/simon/simon.h | 6 |
6 files changed, 87 insertions, 0 deletions
diff --git a/engines/simon/intern.h b/engines/simon/intern.h index aa60d0245f..90aeec1a8c 100644 --- a/engines/simon/intern.h +++ b/engines/simon/intern.h @@ -90,6 +90,7 @@ struct FillOrCopyStruct { uint16 x, y; uint16 width, height; uint16 textColumn, textRow; + uint16 scrollY; uint8 textColumnOffset, textLength, textMaxLength; uint8 fill_color, text_color, unk5; FillOrCopyData *fcs_data; diff --git a/engines/simon/items.cpp b/engines/simon/items.cpp index d1df1aa82c..ba791fca65 100644 --- a/engines/simon/items.cpp +++ b/engines/simon/items.cpp @@ -990,6 +990,22 @@ int SimonEngine::runScript() { } break; + case 171:{ /* oracle hyperlink on */ + if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) + goto invalid_opcode; + + hyperLinkOn(getVarOrWord()); + } + break; + + case 172:{ /* oracle hyperlink off */ + if (getGameType() == GType_SIMON1 || getGameType() == GType_SIMON2) + goto invalid_opcode; + + hyperLinkOff(); + } + break; + case 175:{ /* vga pointer op 1 */ o_lockZone(); } diff --git a/engines/simon/module.mk b/engines/simon/module.mk index dfc61371f2..be8787e70a 100644 --- a/engines/simon/module.mk +++ b/engines/simon/module.mk @@ -10,6 +10,7 @@ MODULE_OBJS := \ items.o \ midi.o \ midiparser_s1d.o \ + oracle.o \ res.o \ saveload.o \ sound.o \ diff --git a/engines/simon/oracle.cpp b/engines/simon/oracle.cpp new file mode 100644 index 0000000000..319b1209f9 --- /dev/null +++ b/engines/simon/oracle.cpp @@ -0,0 +1,55 @@ +/* ScummVM - Scumm Interpreter + * Copyright (C) 2001-2006 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + +#include "common/stdafx.h" +#include "simon/simon.h" +#include "simon/intern.h" +#include "simon/vga.h" + +#include <sys/stat.h> + +namespace Simon { + +void SimonEngine::hyperLinkOn(uint16 x) +{ + if ((_bitArray[3] & (1 << 3)) == 0) + return; + + _hyperLink = x; + _variableArray[50] = _textWindow->textColumn+_textWindow->x; + _variableArray[51] = _textWindow->textRow+_textWindow->y+ + (_oracleMaxScrollY - _textWindow->scrollY) * 15; +} + + +void SimonEngine::hyperLinkOff() +{ + if ((_bitArray[3] & (1 << 3)) == 0) + return; + + _variableArray[52] = _textWindow->x + _textWindow->textColumn - _variableArray[50]; + addNewHitArea(_variableArray[53], _variableArray[50], _variableArray[51], _variableArray[52], 15, 145, 208, _dummyItem1); + _variableArray[53]++; + _hyperLink = 0; +} + +} // End of namespace Simon diff --git a/engines/simon/simon.cpp b/engines/simon/simon.cpp index e43f618fba..90f6e219c2 100644 --- a/engines/simon/simon.cpp +++ b/engines/simon/simon.cpp @@ -509,6 +509,10 @@ SimonEngine::SimonEngine(OSystem *syst) _saveOrLoad = false; _saveLoadFlag = false; + _hyperLink = 0; + _oracleMaxScrollY = 0; + _noOracleScroll = 0; + _sdlMouseX = 0; _sdlMouseY = 0; @@ -3508,6 +3512,10 @@ void SimonEngine::playSpeech(uint speech_id, uint vgaSpriteId) { } void SimonEngine::printText(uint vgaSpriteId, uint color, const char *string, int16 x, int16 y, int16 width) { + // FIXME + if (getGameType() == GType_FF) + return; + char convertedString[320]; char *convertedString2 = convertedString; int16 height, talkDelay; diff --git a/engines/simon/simon.h b/engines/simon/simon.h index d61bedca77..bbacd95b31 100644 --- a/engines/simon/simon.h +++ b/engines/simon/simon.h @@ -265,6 +265,9 @@ protected: const byte *_scrollImage; byte _vgaVar8; + uint16 _hyperLink; + uint16 _oracleMaxScrollY, _noOracleScroll; + int16 _scriptVerb, _scriptNoun1, _scriptNoun2; int16 _scriptAdj1, _scriptAdj2; @@ -580,6 +583,9 @@ protected: void o_inventory_descriptions(); + void hyperLinkOn(uint16 x); + void hyperLinkOff(); + void mouseOff(); void mouseOn(); |