DREAMWEB: added autogenerated source
This commit is contained in:
parent
38c9988938
commit
52a89174ab
13 changed files with 22989 additions and 0 deletions
|
@ -106,6 +106,9 @@ public:
|
|||
#if PLUGIN_ENABLED_STATIC(DRASCULA)
|
||||
LINK_PLUGIN(DRASCULA)
|
||||
#endif
|
||||
#if PLUGIN_ENABLED_STATIC(DREAMWEB)
|
||||
LINK_PLUGIN(DREAMWEB)
|
||||
#endif
|
||||
#if PLUGIN_ENABLED_STATIC(GOB)
|
||||
LINK_PLUGIN(GOB)
|
||||
#endif
|
||||
|
|
1
configure
vendored
1
configure
vendored
|
@ -83,6 +83,7 @@ add_engine cine "Cinematique evo 1" yes
|
|||
add_engine cruise "Cinematique evo 2" yes
|
||||
add_engine draci "Dragon History" yes
|
||||
add_engine drascula "Drascula: The Vampire Strikes Back" yes
|
||||
add_engine dreamweb "Dreamweb" no
|
||||
add_engine gob "Gobli*ns" yes
|
||||
add_engine groovie "Groovie" yes "groovie2"
|
||||
add_engine groovie2 "Groovie 2 games" no
|
||||
|
|
36
engines/dreamweb/console.cpp
Normal file
36
engines/dreamweb/console.cpp
Normal file
|
@ -0,0 +1,36 @@
|
|||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* 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: https://svn.scummvm.org:4444/svn/dreamweb/console.cpp $
|
||||
* $Id: console.cpp 70 2011-01-26 05:36:55Z digitall $
|
||||
*
|
||||
*/
|
||||
|
||||
#include "dreamweb/console.h"
|
||||
|
||||
namespace DreamWeb {
|
||||
|
||||
DreamWebConsole::DreamWebConsole(DreamWebEngine *vm) : GUI::Debugger(), _vm(vm) {
|
||||
}
|
||||
|
||||
DreamWebConsole::~DreamWebConsole() {
|
||||
}
|
||||
|
||||
} // End of namespace DreamWeb
|
46
engines/dreamweb/console.h
Normal file
46
engines/dreamweb/console.h
Normal file
|
@ -0,0 +1,46 @@
|
|||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* 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: https://svn.scummvm.org:4444/svn/dreamweb/console.h $
|
||||
* $Id: console.h 70 2011-01-26 05:36:55Z digitall $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DREAMWEB_CONSOLE_H
|
||||
#define DREAMWEB_CONSOLE_H
|
||||
|
||||
#include "gui/debugger.h"
|
||||
|
||||
namespace DreamWeb {
|
||||
|
||||
class DreamWebEngine;
|
||||
|
||||
class DreamWebConsole : public GUI::Debugger {
|
||||
public:
|
||||
DreamWebConsole(DreamWebEngine *vm);
|
||||
virtual ~DreamWebConsole(void);
|
||||
|
||||
private:
|
||||
DreamWebEngine *_vm;
|
||||
};
|
||||
|
||||
} // End of namespace DreamWeb
|
||||
|
||||
#endif
|
148
engines/dreamweb/detection.cpp
Normal file
148
engines/dreamweb/detection.cpp
Normal file
|
@ -0,0 +1,148 @@
|
|||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* 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: https://svn.scummvm.org:4444/svn/dreamweb/detection.cpp $
|
||||
* $Id: detection.cpp 3 2010-09-16 19:32:18Z megath $
|
||||
*
|
||||
*/
|
||||
|
||||
#include "base/plugins.h"
|
||||
|
||||
#include "engines/advancedDetector.h"
|
||||
#include "common/system.h"
|
||||
|
||||
#include "dreamweb/dreamweb.h"
|
||||
|
||||
namespace DreamWeb {
|
||||
|
||||
struct DreamWebGameDescription {
|
||||
ADGameDescription desc;
|
||||
};
|
||||
|
||||
} // End of namespace DreamWeb
|
||||
|
||||
static const PlainGameDescriptor dreamWebGames[] = {
|
||||
{ "dreamweb", "DreamWeb" },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
static const ADObsoleteGameID obsoleteGameIDsTable[] = {
|
||||
{ 0, 0, Common::kPlatformUnknown }
|
||||
};
|
||||
|
||||
#include "dreamweb/detection_tables.h"
|
||||
|
||||
static const ADParams detectionParams = {
|
||||
// Pointer to ADGameDescription or its superset structure
|
||||
(const byte *)DreamWeb::gameDescriptions,
|
||||
// Size of that superset structure
|
||||
sizeof(DreamWeb::DreamWebGameDescription),
|
||||
// Number of bytes to compute MD5 sum for
|
||||
5000,
|
||||
// List of all engine targets
|
||||
dreamWebGames,
|
||||
// Structure for autoupgrading obsolete targets
|
||||
obsoleteGameIDsTable,
|
||||
// Name of single gameid (optional)
|
||||
"dreamweb",
|
||||
// List of files for file-based fallback detection (optional)
|
||||
0,
|
||||
// Flags
|
||||
0,
|
||||
// Additional GUI options (for every game}
|
||||
Common::GUIO_NOMIDI,
|
||||
// Maximum directory depth
|
||||
1,
|
||||
// List of directory globs
|
||||
0
|
||||
};
|
||||
|
||||
class DreamWebMetaEngine : public AdvancedMetaEngine {
|
||||
public:
|
||||
DreamWebMetaEngine() : AdvancedMetaEngine(detectionParams) {}
|
||||
|
||||
virtual const char *getName() const {
|
||||
return "DreamWeb engine";
|
||||
}
|
||||
|
||||
virtual const char *getOriginalCopyright() const {
|
||||
return "DreamWeb (C) Creative Reality";
|
||||
}
|
||||
|
||||
virtual bool createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const;
|
||||
virtual bool hasFeature(MetaEngineFeature f) const;
|
||||
virtual SaveStateList listSaves(const char *target) const;
|
||||
virtual int getMaximumSaveSlot() const;
|
||||
virtual void removeSaveState(const char *target, int slot) const;
|
||||
};
|
||||
|
||||
bool DreamWebMetaEngine::hasFeature(MetaEngineFeature f) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DreamWeb::DreamWebEngine::hasFeature(EngineFeature f) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DreamWebMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGameDescription *desc) const {
|
||||
const DreamWeb::DreamWebGameDescription *gd = (const DreamWeb::DreamWebGameDescription *)desc;
|
||||
if (gd) {
|
||||
*engine = new DreamWeb::DreamWebEngine(syst, gd);
|
||||
}
|
||||
return gd != 0;
|
||||
}
|
||||
|
||||
SaveStateList DreamWebMetaEngine::listSaves(const char *target) const {
|
||||
//Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
|
||||
SaveStateList saveList;
|
||||
|
||||
return saveList;
|
||||
}
|
||||
|
||||
int DreamWebMetaEngine::getMaximumSaveSlot() const { return 99; }
|
||||
|
||||
void DreamWebMetaEngine::removeSaveState(const char *target, int slot) const {
|
||||
}
|
||||
|
||||
#if PLUGIN_ENABLED_DYNAMIC(DREAMWEB)
|
||||
REGISTER_PLUGIN_DYNAMIC(DREAMWEB, PLUGIN_TYPE_ENGINE, DreamWebMetaEngine);
|
||||
#else
|
||||
REGISTER_PLUGIN_STATIC(DREAMWEB, PLUGIN_TYPE_ENGINE, DreamWebMetaEngine);
|
||||
#endif
|
||||
|
||||
namespace DreamWeb {
|
||||
|
||||
Common::Error DreamWebEngine::loadGameState(int slot) {
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
Common::Error DreamWebEngine::saveGameState(int slot, const char *desc) {
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
bool DreamWebEngine::canLoadGameStateCurrently() {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DreamWebEngine::canSaveGameStateCurrently() {
|
||||
return false;
|
||||
}
|
||||
|
||||
} // End of namespace DreamWeb
|
51
engines/dreamweb/detection_tables.h
Normal file
51
engines/dreamweb/detection_tables.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* 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: https://svn.scummvm.org:4444/svn/dreamweb/detection_tables.h $
|
||||
* $Id: detection_tables.h 66 2010-11-07 08:31:21Z eriktorbjorn $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DREAMWEB_DETECTION_TABLES_H
|
||||
#define DREAMWEB_DETECTION_TABLES_H
|
||||
|
||||
namespace DreamWeb {
|
||||
|
||||
using Common::GUIO_NONE;
|
||||
|
||||
static const DreamWebGameDescription gameDescriptions[] = {
|
||||
{
|
||||
{
|
||||
"dreamweb",
|
||||
"",
|
||||
AD_ENTRY1s("dreamweb.r00", "3b5c87717fc40cc5a5ae19c155662ee3", 152918),
|
||||
Common::EN_ANY,
|
||||
Common::kPlatformPC,
|
||||
ADGF_NO_FLAGS,
|
||||
GUIO_NONE
|
||||
},
|
||||
},
|
||||
|
||||
{ AD_TABLE_END_MARKER }
|
||||
};
|
||||
|
||||
} // End of namespace DreamWeb
|
||||
|
||||
#endif
|
22062
engines/dreamweb/dreamgen.cpp
Normal file
22062
engines/dreamweb/dreamgen.cpp
Normal file
File diff suppressed because it is too large
Load diff
78
engines/dreamweb/dreamgen.h
Normal file
78
engines/dreamweb/dreamgen.h
Normal file
|
@ -0,0 +1,78 @@
|
|||
#ifndef TASMRECOVER_DREAMGEN_STUBS_H__
|
||||
#define TASMRECOVER_DREAMGEN_STUBS_H__
|
||||
|
||||
# include "runtime.h"
|
||||
|
||||
namespace dreamgen {
|
||||
|
||||
struct Data : public Segment {
|
||||
Data();
|
||||
};
|
||||
|
||||
|
||||
typedef RegisterContext<Data> Context;
|
||||
|
||||
void __dispatch_call(Context &context, unsigned addr);
|
||||
|
||||
void randomnumber(Context &context);
|
||||
void dreamweb(Context &context);
|
||||
void resetkeyboard(Context &context);
|
||||
void removeemm(Context &context);
|
||||
void soundend(Context &context);
|
||||
void disablesoundint(Context &context);
|
||||
void out22c(Context &context);
|
||||
void getridofpit(Context &context);
|
||||
void deallocatemem(Context &context);
|
||||
void vsync(Context &context);
|
||||
void closefile(Context &context);
|
||||
void readfromfile(Context &context);
|
||||
void allocatemem(Context &context);
|
||||
void openfile(Context &context);
|
||||
void loadsecondsample(Context &context);
|
||||
void mousecall(Context &context);
|
||||
void loadseg(Context &context);
|
||||
void dontloadseg(Context &context);
|
||||
void showgroup(Context &context);
|
||||
void showpcx(Context &context);
|
||||
void mode640x480(Context &context);
|
||||
void setmode(Context &context);
|
||||
void scanfornames(Context &context);
|
||||
void openfilenocheck(Context &context);
|
||||
void setsoundoff(Context &context);
|
||||
void loadsample(Context &context);
|
||||
void set16colpalette(Context &context);
|
||||
void gettime(Context &context);
|
||||
void fadedos(Context &context);
|
||||
void setmouse(Context &context);
|
||||
void setupemm(Context &context);
|
||||
void setkeyboardint(Context &context);
|
||||
void soundstartup(Context &context);
|
||||
void checkbasemem(Context &context);
|
||||
void keyboardread(Context &context);
|
||||
void openforsave(Context &context);
|
||||
void createfile(Context &context);
|
||||
void pitinterupt(Context &context);
|
||||
void setuppit(Context &context);
|
||||
void startdmablock(Context &context);
|
||||
void dmaend(Context &context);
|
||||
void restoreems(Context &context);
|
||||
void saveems(Context &context);
|
||||
void bothchannels(Context &context);
|
||||
void channel1only(Context &context);
|
||||
void channel0only(Context &context);
|
||||
void interupttest(Context &context);
|
||||
void enablesoundint(Context &context);
|
||||
void checksoundint(Context &context);
|
||||
void loadspeech(Context &context);
|
||||
void saveseg(Context &context);
|
||||
void loadposition(Context &context);
|
||||
void saveposition(Context &context);
|
||||
void error(Context &context);
|
||||
void generalerror(Context &context);
|
||||
void dosreturn(Context &context);
|
||||
void doshake(Context &context);
|
||||
void readoneblock(Context &context);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
131
engines/dreamweb/dreamweb.cpp
Normal file
131
engines/dreamweb/dreamweb.cpp
Normal file
|
@ -0,0 +1,131 @@
|
|||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* 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: https://svn.scummvm.org:4444/svn/dreamweb/dreamweb.cpp $
|
||||
* $Id: dreamweb.cpp 79 2011-06-05 08:26:54Z eriktorbjorn $
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common/config-manager.h"
|
||||
#include "common/debug-channels.h"
|
||||
#include "common/events.h"
|
||||
#include "common/EventRecorder.h"
|
||||
#include "common/file.h"
|
||||
#include "common/func.h"
|
||||
#include "common/iff_container.h"
|
||||
#include "common/system.h"
|
||||
#include "common/timer.h"
|
||||
|
||||
#include "engines/util.h"
|
||||
|
||||
#include "audio/mixer.h"
|
||||
|
||||
#include "graphics/palette.h"
|
||||
|
||||
#include "dreamweb/dreamweb.h"
|
||||
|
||||
namespace DreamWeb {
|
||||
|
||||
DreamWebEngine::DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
|
||||
// Setup mixer
|
||||
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
|
||||
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
|
||||
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, ConfMan.getInt("speech_volume"));
|
||||
|
||||
_rnd = new Common::RandomSource("dreamweb");
|
||||
|
||||
_vSyncInterrupt = false;
|
||||
|
||||
_console = 0;
|
||||
DebugMan.addDebugChannel(kDebugAnimation, "Animation", "Animation Debug Flag");
|
||||
DebugMan.addDebugChannel(kDebugSaveLoad, "SaveLoad", "Track Save/Load Function");
|
||||
}
|
||||
|
||||
DreamWebEngine::~DreamWebEngine() {
|
||||
DebugMan.clearAllDebugChannels();
|
||||
delete _console;
|
||||
delete _rnd;
|
||||
}
|
||||
|
||||
// Let's see if it's a good idea to emulate VSYNC interrupts with a timer like
|
||||
// this. There's a chance we'll miss interrupts, which could be countered by
|
||||
// counting them instead of just flagging them, but we'll see...
|
||||
|
||||
static void vSyncInterrupt(void *refCon) {
|
||||
DreamWebEngine *vm = (DreamWebEngine *)refCon;
|
||||
|
||||
if (!vm->isPaused()) {
|
||||
vm->setVSyncInterrupt(true);
|
||||
}
|
||||
}
|
||||
|
||||
void DreamWebEngine::setVSyncInterrupt(bool flag) {
|
||||
_vSyncInterrupt = flag;
|
||||
}
|
||||
|
||||
void DreamWebEngine::waitForVSync() {
|
||||
while (!_vSyncInterrupt) {
|
||||
_system->delayMillis(10);
|
||||
}
|
||||
setVSyncInterrupt(false);
|
||||
// doshake
|
||||
// dofade
|
||||
}
|
||||
|
||||
Common::Error DreamWebEngine::run() {
|
||||
_console = new DreamWebConsole(this);
|
||||
|
||||
Common::EventManager *event_manager = _system->getEventManager();
|
||||
getTimerManager()->installTimerProc(vSyncInterrupt, 1000000 / 60, this);
|
||||
|
||||
do {
|
||||
uint32 frame_time = _system->getMillis();
|
||||
Common::Event event;
|
||||
while (event_manager->pollEvent(event)) {
|
||||
switch(event.type) {
|
||||
case Common::EVENT_RTL:
|
||||
return Common::kNoError;
|
||||
case Common::EVENT_MOUSEMOVE:
|
||||
_mouse = event.mouse;
|
||||
break;
|
||||
case Common::EVENT_KEYDOWN:
|
||||
switch (event.kbd.keycode) {
|
||||
case Common::KEYCODE_d:
|
||||
if (event.kbd.flags & Common::KBD_CTRL) {
|
||||
_console->attach();
|
||||
_console->onFrame();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
debug(0, "skipped event type %d", event.type);
|
||||
}
|
||||
}
|
||||
} while (!shouldQuit());
|
||||
|
||||
getTimerManager()->removeTimerProc(vSyncInterrupt);
|
||||
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
} // End of namespace DreamWeb
|
83
engines/dreamweb/dreamweb.h
Normal file
83
engines/dreamweb/dreamweb.h
Normal file
|
@ -0,0 +1,83 @@
|
|||
/* ScummVM - Graphic Adventure Engine
|
||||
*
|
||||
* ScummVM is the legal property of its developers, whose names
|
||||
* are too numerous to list here. Please refer to the COPYRIGHT
|
||||
* file distributed with this source distribution.
|
||||
*
|
||||
* 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: https://svn.scummvm.org:4444/svn/dreamweb/dreamweb.h $
|
||||
* $Id: dreamweb.h 77 2011-05-18 14:26:43Z digitall $
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DREAMWEB_H
|
||||
#define DREAMWEB_H
|
||||
|
||||
#include "common/scummsys.h"
|
||||
#include "common/random.h"
|
||||
#include "common/rect.h"
|
||||
#include "common/error.h"
|
||||
|
||||
#include "engines/engine.h"
|
||||
#include "dreamweb/console.h"
|
||||
|
||||
namespace Graphics {
|
||||
class Surface;
|
||||
}
|
||||
|
||||
namespace DreamWeb {
|
||||
|
||||
// Engine Debug Flags
|
||||
enum {
|
||||
kDebugAnimation = (1 << 0),
|
||||
kDebugSaveLoad = (1 << 1)
|
||||
};
|
||||
|
||||
struct DreamWebGameDescription;
|
||||
|
||||
class DreamWebEngine : public Engine {
|
||||
private:
|
||||
DreamWebConsole *_console;
|
||||
bool _vSyncInterrupt;
|
||||
|
||||
protected:
|
||||
// Engine APIs
|
||||
virtual Common::Error run();
|
||||
virtual bool hasFeature(EngineFeature f) const;
|
||||
|
||||
public:
|
||||
DreamWebEngine(OSystem *syst, const DreamWebGameDescription *gameDesc);
|
||||
virtual ~DreamWebEngine();
|
||||
|
||||
void setVSyncInterrupt(bool flag);
|
||||
void waitForVSync();
|
||||
|
||||
Common::Error loadGameState(int slot);
|
||||
Common::Error saveGameState(int slot, const char *desc);
|
||||
|
||||
bool canLoadGameStateCurrently();
|
||||
bool canSaveGameStateCurrently();
|
||||
|
||||
const DreamWebGameDescription *_gameDescription;
|
||||
|
||||
Common::RandomSource *_rnd;
|
||||
|
||||
Common::Point _mouse;
|
||||
};
|
||||
|
||||
} // End of namespace DreamWeb
|
||||
|
||||
#endif
|
15
engines/dreamweb/module.mk
Normal file
15
engines/dreamweb/module.mk
Normal file
|
@ -0,0 +1,15 @@
|
|||
MODULE := engines/dreamweb
|
||||
|
||||
MODULE_OBJS := \
|
||||
console.o \
|
||||
detection.o \
|
||||
dreamweb.o \
|
||||
dreamgen.o
|
||||
|
||||
# This module can be built as a plugin
|
||||
ifeq ($(ENABLE_DREAMWEB), DYNAMIC_PLUGIN)
|
||||
PLUGIN := 1
|
||||
endif
|
||||
|
||||
# Include common rules
|
||||
include $(srcdir)/rules.mk
|
330
engines/dreamweb/runtime.h
Normal file
330
engines/dreamweb/runtime.h
Normal file
|
@ -0,0 +1,330 @@
|
|||
#ifndef TASM_RECOVER_H__
|
||||
#define TASM_RECOVER_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
#include <vector>
|
||||
|
||||
typedef uint16_t uint16;
|
||||
typedef uint8_t uint8;
|
||||
typedef int16_t int16;
|
||||
typedef int8_t int8;
|
||||
|
||||
//little endian
|
||||
#define REG_LOW 0
|
||||
#define REG_HIGH 1
|
||||
|
||||
struct Register {
|
||||
union {
|
||||
uint16 _value;
|
||||
uint8 _part[2];
|
||||
};
|
||||
inline Register(): _value() {}
|
||||
inline Register& operator=(uint16_t v) { _value = v; return *this; }
|
||||
inline operator uint16&() { return _value; }
|
||||
inline void cbw() {
|
||||
if (_value & 0x80)
|
||||
_value |= 0xff00;
|
||||
else
|
||||
_value &= 0xff;
|
||||
}
|
||||
};
|
||||
|
||||
template<unsigned PART>
|
||||
struct RegisterPart {
|
||||
uint8_t &_part;
|
||||
|
||||
inline RegisterPart(Register ®) : _part(reg._part[PART]) {}
|
||||
|
||||
inline operator uint8&() {
|
||||
return _part;
|
||||
}
|
||||
inline RegisterPart& operator=(const RegisterPart& o) {
|
||||
_part = o._part;
|
||||
return *this;
|
||||
}
|
||||
inline RegisterPart& operator=(uint8_t v) {
|
||||
_part = v;
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
struct WordRef {
|
||||
std::vector<uint8> &data;
|
||||
unsigned index;
|
||||
bool changed;
|
||||
uint16_t value;
|
||||
|
||||
inline WordRef(std::vector<uint8> &data, unsigned index) : data(data), index(index), changed(false) {
|
||||
assert(index + 1 < data.size());
|
||||
value = data[index] | (data[index + 1] << 8);
|
||||
}
|
||||
inline WordRef& operator=(const WordRef &ref) {
|
||||
changed = true;
|
||||
value = ref.value;
|
||||
return *this;
|
||||
}
|
||||
inline WordRef& operator=(uint16_t v) {
|
||||
changed = true;
|
||||
value = v;
|
||||
return *this;
|
||||
}
|
||||
inline operator uint16_t() const {
|
||||
return value;
|
||||
}
|
||||
inline operator uint16_t&() {
|
||||
return value;
|
||||
}
|
||||
inline ~WordRef() {
|
||||
if (changed) {
|
||||
data[index] = value & 0xff;
|
||||
data[index + 1] = value >> 8;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct Segment {
|
||||
std::vector<uint8> data;
|
||||
inline uint8_t &byte(unsigned index) {
|
||||
assert(index < data.size());
|
||||
return data[index];
|
||||
}
|
||||
inline uint16_t word(unsigned index) const {
|
||||
assert(index + 1 < data.size());
|
||||
return data[index] | (data[index + 1] << 8);
|
||||
}
|
||||
|
||||
inline WordRef word(unsigned index) {
|
||||
return WordRef(data, index);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct SegmentRef {
|
||||
public:
|
||||
uint16_t value;
|
||||
std::vector<uint8> *data;
|
||||
inline SegmentRef& operator=(const SegmentRef &o) {
|
||||
data = o.data;
|
||||
return *this;
|
||||
}
|
||||
inline SegmentRef& operator=(const uint16_t id) {
|
||||
return *this;
|
||||
}
|
||||
inline uint8_t &byte(unsigned index) {
|
||||
assert(index < data->size());
|
||||
return (*data)[index];
|
||||
}
|
||||
inline uint16_t word(unsigned index) const {
|
||||
assert(index + 1 < data->size());
|
||||
return (*data)[index] | ((*data)[index + 1] << 8);
|
||||
}
|
||||
|
||||
inline operator uint16_t() const {
|
||||
return value;
|
||||
}
|
||||
|
||||
inline WordRef word(unsigned index) {
|
||||
return WordRef(*data, index);
|
||||
}
|
||||
};
|
||||
|
||||
struct Flags {
|
||||
bool _z, _c, _s, _o;
|
||||
inline Flags(): _z(true), _c(false), _s(false), _o(false) {}
|
||||
|
||||
inline bool z() const { return _z; }
|
||||
inline bool c() const { return _c; }
|
||||
inline bool s() const { return _s; }
|
||||
//complex flags:
|
||||
inline bool g() const { return !_z && _s == _o; }
|
||||
inline bool ge() const { return _z || _s == _o; }
|
||||
inline bool l() const { return !_z && _s != _o; }
|
||||
inline bool le() const { return _z || _s != _o; }
|
||||
|
||||
inline void update_sign(uint8 v) {
|
||||
bool s = v & 0x80;
|
||||
_o = s != _s;
|
||||
_s = s;
|
||||
_z = v == 0;
|
||||
}
|
||||
|
||||
inline void update(uint16 v) {
|
||||
bool s = v & 0x8000;
|
||||
_o = s != _s;
|
||||
_s = s;
|
||||
_z = v == 0;
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Data>
|
||||
struct RegisterContext {
|
||||
Register ax, dx, bx, cx, si, di;
|
||||
RegisterPart<REG_LOW> al;
|
||||
RegisterPart<REG_HIGH> ah;
|
||||
RegisterPart<REG_LOW> bl;
|
||||
RegisterPart<REG_HIGH> bh;
|
||||
RegisterPart<REG_LOW> cl;
|
||||
RegisterPart<REG_HIGH> ch;
|
||||
RegisterPart<REG_LOW> dl;
|
||||
RegisterPart<REG_HIGH> dh;
|
||||
|
||||
SegmentRef cs, ds, es;
|
||||
Flags flags;
|
||||
|
||||
inline RegisterContext(): al(ax), ah(ax), bl(bx), bh(bx), cl(cx), ch(cx), dl(dx), dh(dx) {}
|
||||
|
||||
inline void _cmp(uint8 a, uint8 b) {
|
||||
uint8 x = a;
|
||||
_sub(x, b);
|
||||
}
|
||||
inline void _cmp(uint16 a, uint16 b) {
|
||||
uint16 x = a;
|
||||
_sub(x, b);
|
||||
}
|
||||
inline void _test(uint8 a, uint8 b) {
|
||||
uint8 x = a;
|
||||
_and(x, b);
|
||||
}
|
||||
inline void _test(uint16 a, uint16 b) {
|
||||
uint16 x = a;
|
||||
_and(x, b);
|
||||
}
|
||||
|
||||
inline void _add(uint8 &dst, uint8 src) {
|
||||
flags._c = dst + src < dst;
|
||||
dst += src;
|
||||
flags.update(dst);
|
||||
}
|
||||
inline void _add(uint16 &dst, uint16 src) {
|
||||
flags._c = dst + src < dst;
|
||||
dst += src;
|
||||
flags.update(dst);
|
||||
}
|
||||
inline void _sub(uint8 &dst, uint8 src) {
|
||||
flags._c = dst < src;
|
||||
dst -= src;
|
||||
flags.update(dst);
|
||||
}
|
||||
inline void _sub(uint16 &dst, uint16 src) {
|
||||
flags._c = dst < src;
|
||||
dst -= src;
|
||||
flags.update(dst);
|
||||
}
|
||||
|
||||
inline void _and(uint8 &dst, uint8 src) {
|
||||
dst &= src;
|
||||
flags._c = false;
|
||||
flags.update(dst);
|
||||
}
|
||||
inline void _and(uint16 &dst, uint16 src) {
|
||||
dst &= src;
|
||||
flags._c = false;
|
||||
flags.update(dst);
|
||||
}
|
||||
inline void _or(uint8 &dst, uint8 src) {
|
||||
dst |= src;
|
||||
flags._c = false;
|
||||
flags.update(dst);
|
||||
}
|
||||
inline void _or(uint16 &dst, uint16 src) {
|
||||
dst |= src;
|
||||
flags._c = false;
|
||||
flags.update(dst);
|
||||
}
|
||||
|
||||
inline void _xor(uint8 &dst, uint8 src) {
|
||||
dst ^= src;
|
||||
flags._c = false;
|
||||
flags.update(dst);
|
||||
}
|
||||
inline void _xor(uint16 &dst, uint16 src) {
|
||||
dst ^= src;
|
||||
flags._c = false;
|
||||
flags.update(dst);
|
||||
}
|
||||
|
||||
inline void _shr(uint8 &dst, uint8 src) {}
|
||||
inline void _shr(uint16 &dst, uint8 src) {}
|
||||
inline void _shl(uint8 &dst, uint8 src) {}
|
||||
inline void _shl(uint16 &dst, uint8 src) {}
|
||||
inline void _mul(uint8 src) {
|
||||
unsigned r = unsigned(al) * src;
|
||||
ax = (uint16)r;
|
||||
flags._c = r >= 0x10000;
|
||||
flags._z = r == 0;
|
||||
bool s = r & 0x8000;
|
||||
flags._o = s != flags._s;
|
||||
flags._s = s;
|
||||
}
|
||||
inline void _mul(uint16 src) {
|
||||
unsigned r = unsigned(ax) * src; //assuming here that we have at least 32 bits
|
||||
dx = (r >> 16) & 0xffff;
|
||||
ax = r & 0xffff;
|
||||
flags._c = false;//fixme
|
||||
flags._z = r == 0;
|
||||
bool s = r & 0x80000000;
|
||||
flags._o = s != flags._s;
|
||||
flags._s = s;
|
||||
}
|
||||
inline void _neg(uint8 &src) {
|
||||
src = ~src;
|
||||
flags._c = false;
|
||||
flags.update(src);
|
||||
}
|
||||
inline void _neg(uint16 &src) {
|
||||
src = ~src;
|
||||
flags._c = false;
|
||||
flags.update(src);
|
||||
}
|
||||
|
||||
inline void _movsb() {
|
||||
es.byte(di++) = ds.byte(si++);
|
||||
}
|
||||
inline void _movsw() {
|
||||
es.word(di) = ds.word(si);
|
||||
di += 2;
|
||||
si += 2;
|
||||
}
|
||||
inline void _lodsb() {
|
||||
al = ds.byte(si++);
|
||||
}
|
||||
inline void _lodsw() {
|
||||
ax = ds.word(si);
|
||||
si += 2;
|
||||
}
|
||||
inline void _stosb() {
|
||||
es.byte(di++) = al;
|
||||
}
|
||||
inline void _stosw() {
|
||||
es.word(di) = al;
|
||||
di += 2;
|
||||
}
|
||||
|
||||
inline void _xchg(uint16 &a, uint16 &b) {
|
||||
uint16 x = a;
|
||||
a = b;
|
||||
b = x;
|
||||
}
|
||||
|
||||
inline void _xchg(uint8 &a, uint8 &b) {
|
||||
uint8 t = a;
|
||||
a = b;
|
||||
b = t;
|
||||
}
|
||||
|
||||
std::vector<uint16> stack;
|
||||
inline void push(uint16 v) {
|
||||
stack.push_back(v);
|
||||
}
|
||||
inline uint16 pop() {
|
||||
uint16 v = stack.back();
|
||||
stack.pop_back();
|
||||
return v;
|
||||
}
|
||||
|
||||
Data data;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -46,6 +46,11 @@ DEFINES += -DENABLE_DRASCULA=$(ENABLE_DRASCULA)
|
|||
MODULES += engines/drascula
|
||||
endif
|
||||
|
||||
ifdef ENABLE_DREAMWEB
|
||||
DEFINES += -DENABLE_DREAMWEB=$(ENABLE_DREAMWEB)
|
||||
MODULES += engines/dreamweb
|
||||
endif
|
||||
|
||||
ifdef ENABLE_GOB
|
||||
DEFINES += -DENABLE_GOB=$(ENABLE_GOB)
|
||||
MODULES += engines/gob
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue