aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBenjamin Haisch2010-10-18 11:00:17 +0000
committerWillem Jan Palenstijn2011-11-20 22:43:10 +0100
commit9c3a4bc055243af586f7ab091ba802e5274943b5 (patch)
tree76e0cae6b043bea78929d385be55d0b7d597eec1 /engines
parent8f3b287db139383c45a04e729b85474a9129578c (diff)
downloadscummvm-rg350-9c3a4bc055243af586f7ab091ba802e5274943b5.tar.gz
scummvm-rg350-9c3a4bc055243af586f7ab091ba802e5274943b5.tar.bz2
scummvm-rg350-9c3a4bc055243af586f7ab091ba802e5274943b5.zip
TOLTECS: - Implement kSupportsLoadingDuringStartup
Diffstat (limited to 'engines')
-rw-r--r--engines/toltecs/detection.cpp4
-rw-r--r--engines/toltecs/script.cpp8
-rw-r--r--engines/toltecs/script.h5
-rw-r--r--engines/toltecs/toltecs.cpp9
4 files changed, 17 insertions, 9 deletions
diff --git a/engines/toltecs/detection.cpp b/engines/toltecs/detection.cpp
index a341bea6f3..1c113ddf7a 100644
--- a/engines/toltecs/detection.cpp
+++ b/engines/toltecs/detection.cpp
@@ -172,7 +172,7 @@ public:
}
virtual const char *getOriginalCopyright() const {
- return "Toltecs Engine (C) 1996";
+ return "Toltecs Engine Revistronic (C) 1996";
}
virtual bool hasFeature(MetaEngineFeature f) const;
@@ -186,7 +186,7 @@ public:
bool ToltecsMetaEngine::hasFeature(MetaEngineFeature f) const {
return
(f == kSupportsListSaves) ||
-// (f == kSupportsLoadingDuringStartup) ||
+ (f == kSupportsLoadingDuringStartup) ||
// (f == kSupportsDeleteSave) ||
(f == kSavesSupportMetaInfo) ||
(f == kSavesSupportThumbnail);
diff --git a/engines/toltecs/script.cpp b/engines/toltecs/script.cpp
index d062f46806..4e15fa3dc1 100644
--- a/engines/toltecs/script.cpp
+++ b/engines/toltecs/script.cpp
@@ -157,13 +157,11 @@ void ScriptInterpreter::loadScript(uint resIndex, uint slotIndex) {
}
-void ScriptInterpreter::runScript(uint slotIndex) {
-
+void ScriptInterpreter::setMainScript(uint slotIndex) {
_switchLocalDataNear = true;
_switchLocalDataFar = false;
_switchLocalDataToStack = false;
_cmpBitTest = false;
-
_regs.reg0 = 0;
_regs.reg1 = 0;
_regs.reg2 = 0;
@@ -173,8 +171,10 @@ void ScriptInterpreter::runScript(uint slotIndex) {
_regs.reg6 = 0;
_regs.sp = 4096;
_regs.reg8 = 0;
-
_code = getSlotData(_regs.reg4);
+}
+
+void ScriptInterpreter::runScript() {
while (!_vm->shouldQuit()) {
diff --git a/engines/toltecs/script.h b/engines/toltecs/script.h
index e82e3da6cd..966ed3defa 100644
--- a/engines/toltecs/script.h
+++ b/engines/toltecs/script.h
@@ -56,7 +56,8 @@ public:
~ScriptInterpreter();
void loadScript(uint resIndex, uint slotIndex);
- void runScript(uint slotIndex);
+ void setMainScript(uint slotIndex);
+ void runScript();
byte *getSlotData(int slotIndex) const { return _slots[slotIndex].data; }
@@ -102,7 +103,7 @@ protected:
ScriptRegs _regs;
int16 _savedSp;
-
+
byte readByte();
int16 readInt16();
diff --git a/engines/toltecs/toltecs.cpp b/engines/toltecs/toltecs.cpp
index 62bf250062..0c8d5658b3 100644
--- a/engines/toltecs/toltecs.cpp
+++ b/engines/toltecs/toltecs.cpp
@@ -174,7 +174,14 @@ Common::Error ToltecsEngine::run() {
#if 1
_script->loadScript(0, 0);
- _script->runScript(0);
+ _script->setMainScript(0);
+ if (ConfMan.hasKey("save_slot")) {
+ int saveSlot = ConfMan.getInt("save_slot");
+ if (saveSlot >= 0 && saveSlot <= 99) {
+ loadGameState(saveSlot);
+ }
+ }
+ _script->runScript();
#endif
delete _arc;