diff options
author | Benjamin Haisch | 2008-06-12 11:09:04 +0000 |
---|---|---|
committer | Benjamin Haisch | 2008-06-12 11:09:04 +0000 |
commit | fb31c62ad82c26b17ec8f95c33f532eca1deba62 (patch) | |
tree | 065fad466a344b13fabcca363aac043351baed95 | |
parent | 555ddf9f9540bd1d62e0b2affbff4b62c284d9d1 (diff) | |
download | scummvm-rg350-fb31c62ad82c26b17ec8f95c33f532eca1deba62.tar.gz scummvm-rg350-fb31c62ad82c26b17ec8f95c33f532eca1deba62.tar.bz2 scummvm-rg350-fb31c62ad82c26b17ec8f95c33f532eca1deba62.zip |
- Added support for Rodney's Fun Screen
- Added audio cd playback (still kinda broken though)
- Renamed getObjectPropertyPtr to findObjectProperty
svn-id: r32669
-rw-r--r-- | engines/made/database.cpp | 9 | ||||
-rw-r--r-- | engines/made/database.h | 6 | ||||
-rw-r--r-- | engines/made/detection.cpp | 17 | ||||
-rw-r--r-- | engines/made/made.cpp | 13 | ||||
-rw-r--r-- | engines/made/made.h | 15 | ||||
-rw-r--r-- | engines/made/screen.h | 1 | ||||
-rw-r--r-- | engines/made/scriptfuncs.cpp | 22 |
7 files changed, 57 insertions, 26 deletions
diff --git a/engines/made/database.cpp b/engines/made/database.cpp index 4616b63252..edf608f02a 100644 --- a/engines/made/database.cpp +++ b/engines/made/database.cpp @@ -301,7 +301,7 @@ int16 GameDatabase::getObjectProperty(int16 objectIndex, int16 propertyId) { return 0; int16 propertyFlag; - int16 *property = getObjectPropertyPtr(objectIndex, propertyId, propertyFlag); + int16 *property = findObjectProperty(objectIndex, propertyId, propertyFlag); if (property) { return (int16)READ_LE_UINT16(property); @@ -317,7 +317,7 @@ int16 GameDatabase::setObjectProperty(int16 objectIndex, int16 propertyId, int16 return 0; int16 propertyFlag; - int16 *property = getObjectPropertyPtr(objectIndex, propertyId, propertyFlag); + int16 *property = findObjectProperty(objectIndex, propertyId, propertyFlag); if (property) { if (propertyFlag == 1) { @@ -430,7 +430,7 @@ int16 GameDatabaseV2::loadgame(const char *filename, int16 version) { return result; } -int16 *GameDatabaseV2::getObjectPropertyPtr(int16 objectIndex, int16 propertyId, int16 &propertyFlag) { +int16 *GameDatabaseV2::findObjectProperty(int16 objectIndex, int16 propertyId, int16 &propertyFlag) { Object *obj = getObject(objectIndex); int16 *prop = (int16*)obj->getData(); @@ -489,6 +489,7 @@ int16 *GameDatabaseV2::getObjectPropertyPtr(int16 objectIndex, int16 propertyId, } + debug(1, "findObjectProperty(%04X, %04) Property not found", objectIndex, propertyId); return NULL; } @@ -597,7 +598,7 @@ int16 GameDatabaseV3::loadgame(const char *filename, int16 version) { return result; } -int16 *GameDatabaseV3::getObjectPropertyPtr(int16 objectIndex, int16 propertyId, int16 &propertyFlag) { +int16 *GameDatabaseV3::findObjectProperty(int16 objectIndex, int16 propertyId, int16 &propertyFlag) { Object *obj = getObject(objectIndex); int16 *prop = (int16*)obj->getData(); diff --git a/engines/made/database.h b/engines/made/database.h index 476439c1e2..466d1a8f69 100644 --- a/engines/made/database.h +++ b/engines/made/database.h @@ -133,7 +133,7 @@ public: const char *getObjectString(int16 index); void setObjectString(int16 index, const char *str); - virtual int16 *getObjectPropertyPtr(int16 objectIndex, int16 propertyId, int16 &propertyFlag) = 0; + virtual int16 *findObjectProperty(int16 objectIndex, int16 propertyId, int16 &propertyFlag) = 0; virtual const char *getString(uint16 offset) = 0; virtual bool getSavegameDescription(const char *filename, Common::String &description) = 0; virtual int16 savegame(const char *filename, const char *description, int16 version) = 0; @@ -157,7 +157,7 @@ class GameDatabaseV2 : public GameDatabase { public: GameDatabaseV2(MadeEngine *vm); ~GameDatabaseV2(); - int16 *getObjectPropertyPtr(int16 objectIndex, int16 propertyId, int16 &propertyFlag); + int16 *findObjectProperty(int16 objectIndex, int16 propertyId, int16 &propertyFlag); const char *getString(uint16 offset); bool getSavegameDescription(const char *filename, Common::String &description); int16 savegame(const char *filename, const char *description, int16 version); @@ -170,7 +170,7 @@ protected: class GameDatabaseV3 : public GameDatabase { public: GameDatabaseV3(MadeEngine *vm); - int16 *getObjectPropertyPtr(int16 objectIndex, int16 propertyId, int16 &propertyFlag); + int16 *findObjectProperty(int16 objectIndex, int16 propertyId, int16 &propertyFlag); const char *getString(uint16 offset); bool getSavegameDescription(const char *filename, Common::String &description); int16 savegame(const char *filename, const char *description, int16 version); diff --git a/engines/made/detection.cpp b/engines/made/detection.cpp index 7d30873866..dc7dbdee87 100644 --- a/engines/made/detection.cpp +++ b/engines/made/detection.cpp @@ -65,6 +65,7 @@ static const PlainGameDescriptor madeGames[] = { {"manhole", "The Manhole"}, {"rtz", "Return to Zork"}, {"lgop2", "Leather Goddesses of Phobos 2"}, + {"rodney", "Rodney's Fun Screen"}, {0, 0} }; @@ -276,6 +277,22 @@ static const MadeGameDescription gameDescriptions[] = { 0, }, + { + // Rodney's Fun Screen + { + "rodney", + "", + AD_ENTRY1("rodneys.dat", "a79887dbaa47689facd7c6f09258ba5a"), + Common::EN_ANY, + Common::kPlatformPC, + Common::ADGF_NO_FLAGS + }, + GID_RODNEY, + 0, + GF_FLOPPY, + 0, + }, + { AD_TABLE_END_MARKER, 0, 0, 0, 0 } }; diff --git a/engines/made/made.cpp b/engines/made/made.cpp index 09a9a85ec6..59ec487c37 100644 --- a/engines/made/made.cpp +++ b/engines/made/made.cpp @@ -35,6 +35,7 @@ #include "base/plugins.h" #include "base/version.h" +#include "sound/audiocd.h" #include "sound/mixer.h" #include "made/made.h" @@ -87,7 +88,7 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng _res = new ProjectReader(); _screen = new Screen(this); - if (getGameID() == GID_LGOP2 || getGameID() == GID_MANHOLE) { + if (getGameID() == GID_LGOP2 || getGameID() == GID_MANHOLE || getGameID() == GID_RODNEY) { _dat = new GameDatabaseV2(this); } else if (getGameID() == GID_RTZ) { _dat = new GameDatabaseV3(this); @@ -119,7 +120,7 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng // Set default sound frequency // Return to Zork sets it itself via a script funtion - if (getGameID() == GID_MANHOLE) { + if (getGameID() == GID_MANHOLE || getGameID() == GID_RODNEY) { _soundRate = 11025; } else { _soundRate = 8000; @@ -238,6 +239,8 @@ void MadeEngine::handleEvents() { } } + + AudioCD.updateCD(); } @@ -245,7 +248,7 @@ int MadeEngine::go() { for (int i = 0; i < ARRAYSIZE(_timers); i++) _timers[i] = -1; - + if (getGameID() == GID_RTZ) { _engineVersion = 3; if (getFeatures() & GF_DEMO) { @@ -271,6 +274,10 @@ int MadeEngine::go() { _engineVersion = 2; _dat->open("lgop2.dat"); _res->open("lgop2.prj"); + } else if (getGameID() == GID_RODNEY) { + _engineVersion = 2; + _dat->open("rodneys.dat"); + _res->open("rodneys.prj"); } else { error ("Unknown MADE game"); } diff --git a/engines/made/made.h b/engines/made/made.h index f7e3354c4d..461941e5cf 100644 --- a/engines/made/made.h +++ b/engines/made/made.h @@ -48,16 +48,17 @@ namespace Made { enum MadeGameID { - GID_RTZ = 0, - GID_MANHOLE = 1, - GID_LGOP2 = 2 + GID_RTZ = 0, + GID_MANHOLE = 1, + GID_LGOP2 = 2, + GID_RODNEY = 3 }; enum MadeGameFeatures { - GF_DEMO = 1 << 0, - GF_CD = 1 << 1, - GF_CD_COMPRESSED = 1 << 2, - GF_FLOPPY = 1 << 3 + GF_DEMO = 1 << 0, + GF_CD = 1 << 1, + GF_CD_COMPRESSED = 1 << 2, + GF_FLOPPY = 1 << 3 }; const uint32 kTimerResolution = 40; diff --git a/engines/made/screen.h b/engines/made/screen.h index 92f3512954..5d55085e5c 100644 --- a/engines/made/screen.h +++ b/engines/made/screen.h @@ -95,6 +95,7 @@ public: void setRGBPalette(byte *palRGB, int start = 0, int count = 256); bool isPaletteLocked() { return _paletteLock; } void setPaletteLock(bool lock) { _paletteLock = lock; } + bool isScreenLocked() { return _screenLock; } void setScreenLock(bool lock) { _screenLock = lock; } void setVisualEffectNum(int visualEffectNum) { _visualEffectNum = visualEffectNum; } diff --git a/engines/made/scriptfuncs.cpp b/engines/made/scriptfuncs.cpp index 8e06c2e8bf..932447a1eb 100644 --- a/engines/made/scriptfuncs.cpp +++ b/engines/made/scriptfuncs.cpp @@ -26,8 +26,8 @@ #include "common/endian.h" #include "common/util.h" #include "common/events.h" - #include "graphics/cursorman.h" +#include "sound/audiocd.h" #include "made/made.h" #include "made/resource.h" @@ -94,7 +94,7 @@ void ScriptFunctions::setupExternalsTable() { External(sfSetSpriteGround); External(sfLoadResText); - if (_vm->getGameID() == GID_MANHOLE || _vm->getGameID() == GID_LGOP2) { + if (_vm->getGameID() == GID_MANHOLE || _vm->getGameID() == GID_LGOP2 || _vm->getGameID() == GID_RODNEY) { External(sfAddScreenMask); External(sfSetSpriteMask); } else if (_vm->getGameID() == GID_RTZ) { @@ -183,6 +183,8 @@ int16 ScriptFunctions::sfDrawPicture(int16 argc, int16 *argv) { } int16 ScriptFunctions::sfClearScreen(int16 argc, int16 *argv) { + if (_vm->_screen->isScreenLocked()) + return 0; if (_vm->_autoStopSound) { _vm->_mixer->stopHandle(_audioStreamHandle); _vm->_autoStopSound = false; @@ -548,25 +550,27 @@ int16 ScriptFunctions::sfPlayVoice(int16 argc, int16 *argv) { } int16 ScriptFunctions::sfPlayCd(int16 argc, int16 *argv) { - // This one is called loads of times, so it has been commented out to reduce spam - //warning("Unimplemented opcode: sfPlayCd"); + AudioCD.play(argv[0], -1, 0, 0); return 0; } int16 ScriptFunctions::sfStopCd(int16 argc, int16 *argv) { - warning("Unimplemented opcode: sfStopCd"); - return 0; + if (AudioCD.isPlaying()) { + AudioCD.stop(); + return 1; + } else { + return 0; + } } int16 ScriptFunctions::sfGetCdStatus(int16 argc, int16 *argv) { - // This one is called loads of times, so it has been commented out to reduce spam - //warning("Unimplemented opcode: sfGetCdStatus"); - return 0; + return AudioCD.isPlaying() ? 1 : 0; } int16 ScriptFunctions::sfGetCdTime(int16 argc, int16 *argv) { // This one is called loads of times, so it has been commented out to reduce spam //warning("Unimplemented opcode: sfGetCdTime"); + // TODO return 0; } |