[Scummvm-cvs-logs] SF.net SVN: scummvm: [29037] scummvm/trunk/engines/agi

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Sun Sep 23 04:15:49 CEST 2007


Revision: 29037
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29037&view=rev
Author:   mthreepwood
Date:     2007-09-22 19:15:48 -0700 (Sat, 22 Sep 2007)

Log Message:
-----------
allow Winnie C64 to start, although there are problems with the images (probably wrong offset) and logo.pic/intro.pic are not working, so the intro is skipped

Modified Paths:
--------------
    scummvm/trunk/engines/agi/detection.cpp
    scummvm/trunk/engines/agi/preagi_winnie.cpp
    scummvm/trunk/engines/agi/preagi_winnie.h

Modified: scummvm/trunk/engines/agi/detection.cpp
===================================================================
--- scummvm/trunk/engines/agi/detection.cpp	2007-09-23 00:27:36 UTC (rev 29036)
+++ scummvm/trunk/engines/agi/detection.cpp	2007-09-23 02:15:48 UTC (rev 29037)
@@ -1668,6 +1668,23 @@
 	},
 
 	{
+		// Winnie the Pooh in the Hundred Acre Wood
+		// preagi game
+		{
+			"winnie",
+			"",
+			AD_ENTRY1("title.pic", "d4eb97cffc866110f71e1ec9f84fe643"),
+			Common::EN_ANY,
+			Common::kPlatformC64,
+			Common::ADGF_NO_FLAGS
+		},
+		GID_WINNIE,
+		GType_PreAGI,
+		0,
+		0x0000,
+	},
+
+	{
 		// Xmas Card 1986 (PC) [AGI 2.272]
 		{
 			"xmascard",

Modified: scummvm/trunk/engines/agi/preagi_winnie.cpp
===================================================================
--- scummvm/trunk/engines/agi/preagi_winnie.cpp	2007-09-23 00:27:36 UTC (rev 29036)
+++ scummvm/trunk/engines/agi/preagi_winnie.cpp	2007-09-23 02:15:48 UTC (rev 29037)
@@ -55,6 +55,9 @@
 	mist = -1;
 	doWind = false;
 	winnie_event = false;
+
+	if (_vm->getPlatform() == Common::kPlatformC64)
+		_vm->_picture->setPictureVersion(AGIPIC_C64);
 }
 
 uint32 Winnie::readRoom(int iRoom, uint8 *buffer, WTP_ROOM_HDR &roomHdr) {
@@ -63,18 +66,24 @@
 		sprintf(szFile, IDS_WTP_ROOM_DOS, iRoom);
 	else if (_vm->getPlatform() == Common::kPlatformAmiga)
 		sprintf(szFile, IDS_WTP_ROOM_AMIGA, iRoom);
+	else if (_vm->getPlatform() == Common::kPlatformC64)
+		sprintf(szFile, IDS_WTP_ROOM_C64, iRoom);
 	Common::File file;
 	if (!file.open(szFile)) {
 		warning ("Could not open file \'%s\'", szFile);
 		return 0;
 	}
 	uint32 filelen = file.size();
+	if (_vm->getPlatform() == Common::kPlatformC64) { //Skip the loading address
+		filelen -= 2;
+		file.seek(2, SEEK_CUR);
+	}
 	memset(buffer, 0, sizeof(buffer));
 	file.read(buffer, filelen);
 	file.close();
 
 	memcpy(&roomHdr, buffer, sizeof(WTP_ROOM_HDR));
-	if (_vm->getPlatform() == Common::kPlatformPC) {
+	if (_vm->getPlatform() == Common::kPlatformPC || _vm->getPlatform() == Common::kPlatformC64) {
 		roomHdr.ofsPic = TO_LE_16(roomHdr.ofsPic);
 		roomHdr.fileLen = TO_LE_16(roomHdr.fileLen);
 		roomHdr.reserved0 = TO_LE_16(roomHdr.reserved0);
@@ -113,6 +122,8 @@
 		sprintf(szFile, IDS_WTP_OBJ_DOS, iObj);
 	else if (_vm->getPlatform() == Common::kPlatformAmiga)
 		sprintf(szFile, IDS_WTP_OBJ_AMIGA, iObj);
+	else if (_vm->getPlatform() == Common::kPlatformC64)
+		sprintf(szFile, IDS_WTP_OBJ_C64, iObj);
 	Common::File file;
 	if (!file.open(szFile)) {
 		warning ("Could not open file \'%s\'", szFile);
@@ -1057,7 +1068,7 @@
 	// read room picture
 	readRoom(room, buffer, roomhdr);
 
-	if (_vm->getPlatform() == Common::kPlatformPC)
+	if (_vm->getPlatform() == Common::kPlatformPC || _vm->getPlatform() == Common::kPlatformC64)
 		roomhdr.ofsPic = roomhdr.ofsPic - IDI_WTP_OFS_ROOM;
 
 	// draw room picture
@@ -1065,7 +1076,7 @@
 	_vm->_picture->showPic(IDI_WTP_PIC_X0, IDI_WTP_PIC_Y0, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT);
 
 	// draw object picture
-	if (!_vm->getPlatform() == Common::kPlatformAmiga)
+	if (!_vm->getPlatform() == Common::kPlatformAmiga && !_vm->getPlatform() == Common::kPlatformC64)
 		drawObjPic(iObj, IDI_WTP_PIC_X0 + roomhdr.objX, IDI_WTP_PIC_Y0 + roomhdr.objY);
 
 	free(buffer);
@@ -1152,7 +1163,8 @@
 
 void Winnie::run() {
 	randomize();
-	intro();
+	if (!_vm->getPlatform() == Common::kPlatformC64)
+		intro();
 	gameLoop();
 }
 

Modified: scummvm/trunk/engines/agi/preagi_winnie.h
===================================================================
--- scummvm/trunk/engines/agi/preagi_winnie.h	2007-09-23 00:27:36 UTC (rev 29036)
+++ scummvm/trunk/engines/agi/preagi_winnie.h	2007-09-23 02:15:48 UTC (rev 29037)
@@ -36,11 +36,13 @@
 
 #define IDS_WTP_ROOM_DOS		"rooms\\rm.%02d"
 #define IDS_WTP_ROOM_AMIGA		"room.%d"
+#define IDS_WTP_ROOM_C64		"room%02d"
 #define IDS_WTP_OBJ_DOS			"obj.%02d"
 #define IDS_WTP_OBJ_AMIGA		"object.%d"
-#define IDS_WTP_PATH_SND		"snd.%02d"
+#define IDS_WTP_OBJ_C64			"object%02d"
+#define IDS_WTP_SND_DOS			"snd.%02d"
 #define IDS_WTP_SND_AMIGA		"Sounds"
-#define IDS_WTP_PATH			"%s"
+#define IDS_WTP_SND_C64			"sound.obj"
 
 #define IDS_WTP_FILE_LOGO		"logo"
 #define IDS_WTP_FILE_TITLE		"title"
@@ -84,9 +86,6 @@
 
 // COMMODORE 64 version strings
 
-#define IDS_WTP_PATH_ROOM_C64		"%sroom%02d"
-#define IDS_WTP_PATH_OBJ_C64		"%sobject%02d"
-#define IDS_WTP_PATH_SND_C64		"%ssound.obj"
 #define IDS_WTP_FILE_SAVEGAME_C64	"saved game"
 #define IDS_WTP_DISK_ERROR_C64		"There is a problem with your disk drive.Please make sure your disk is in the    drive correctly."
 #define IDS_WTP_HELP_0_C64			"The <SPACE BAR> moves the pointer.      Press <RETURN> when it is by the choice you want.  <F1> brings back what you    have already read."


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