[Scummvm-cvs-logs] SF.net SVN: scummvm: [32669] scummvm/trunk/engines/made

john_doe at users.sourceforge.net john_doe at users.sourceforge.net
Thu Jun 12 13:09:05 CEST 2008


Revision: 32669
          http://scummvm.svn.sourceforge.net/scummvm/?rev=32669&view=rev
Author:   john_doe
Date:     2008-06-12 04:09:04 -0700 (Thu, 12 Jun 2008)

Log Message:
-----------
- Added support for Rodney's Fun Screen
- Added audio cd playback (still kinda broken though)
- Renamed getObjectPropertyPtr to findObjectProperty

Modified Paths:
--------------
    scummvm/trunk/engines/made/database.cpp
    scummvm/trunk/engines/made/database.h
    scummvm/trunk/engines/made/detection.cpp
    scummvm/trunk/engines/made/made.cpp
    scummvm/trunk/engines/made/made.h
    scummvm/trunk/engines/made/screen.h
    scummvm/trunk/engines/made/scriptfuncs.cpp

Modified: scummvm/trunk/engines/made/database.cpp
===================================================================
--- scummvm/trunk/engines/made/database.cpp	2008-06-12 11:01:08 UTC (rev 32668)
+++ scummvm/trunk/engines/made/database.cpp	2008-06-12 11:09:04 UTC (rev 32669)
@@ -301,7 +301,7 @@
 		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 @@
 		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 @@
 	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 @@
 
 	}
 
+	debug(1, "findObjectProperty(%04X, %04) Property not found", objectIndex, propertyId);
 	return NULL;
 
 }
@@ -597,7 +598,7 @@
 	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();

Modified: scummvm/trunk/engines/made/database.h
===================================================================
--- scummvm/trunk/engines/made/database.h	2008-06-12 11:01:08 UTC (rev 32668)
+++ scummvm/trunk/engines/made/database.h	2008-06-12 11:09:04 UTC (rev 32669)
@@ -133,7 +133,7 @@
 	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 @@
 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 @@
 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);

Modified: scummvm/trunk/engines/made/detection.cpp
===================================================================
--- scummvm/trunk/engines/made/detection.cpp	2008-06-12 11:01:08 UTC (rev 32668)
+++ scummvm/trunk/engines/made/detection.cpp	2008-06-12 11:09:04 UTC (rev 32669)
@@ -65,6 +65,7 @@
 	{"manhole", "The Manhole"},
 	{"rtz", "Return to Zork"},
 	{"lgop2", "Leather Goddesses of Phobos 2"},
+	{"rodney", "Rodney's Fun Screen"},
 	{0, 0}
 };
 
@@ -276,6 +277,22 @@
 		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 }
 };
 

Modified: scummvm/trunk/engines/made/made.cpp
===================================================================
--- scummvm/trunk/engines/made/made.cpp	2008-06-12 11:01:08 UTC (rev 32668)
+++ scummvm/trunk/engines/made/made.cpp	2008-06-12 11:09:04 UTC (rev 32669)
@@ -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 @@
 	_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 @@
 
 	// 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 @@
 
 		}
 	}
+	
+	AudioCD.updateCD();
 
 }
 
@@ -245,7 +248,7 @@
 
 	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 @@
 		_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");
 	}

Modified: scummvm/trunk/engines/made/made.h
===================================================================
--- scummvm/trunk/engines/made/made.h	2008-06-12 11:01:08 UTC (rev 32668)
+++ scummvm/trunk/engines/made/made.h	2008-06-12 11:09:04 UTC (rev 32669)
@@ -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;

Modified: scummvm/trunk/engines/made/screen.h
===================================================================
--- scummvm/trunk/engines/made/screen.h	2008-06-12 11:01:08 UTC (rev 32668)
+++ scummvm/trunk/engines/made/screen.h	2008-06-12 11:09:04 UTC (rev 32669)
@@ -95,6 +95,7 @@
 	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; }
 

Modified: scummvm/trunk/engines/made/scriptfuncs.cpp
===================================================================
--- scummvm/trunk/engines/made/scriptfuncs.cpp	2008-06-12 11:01:08 UTC (rev 32668)
+++ scummvm/trunk/engines/made/scriptfuncs.cpp	2008-06-12 11:09:04 UTC (rev 32669)
@@ -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 @@
 	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::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::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;
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list