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

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Mon Sep 24 21:37:58 CEST 2007


Revision: 29090
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29090&view=rev
Author:   mthreepwood
Date:     2007-09-24 12:37:57 -0700 (Mon, 24 Sep 2007)

Log Message:
-----------
allow Winnie Apple II to start up, however room images are slightly distorted and the intro is not shown; other cleanup

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-24 17:44:47 UTC (rev 29089)
+++ scummvm/trunk/engines/agi/detection.cpp	2007-09-24 19:37:57 UTC (rev 29090)
@@ -1790,6 +1790,23 @@
 	},
 
 	{
+		// Winnie the Pooh in the Hundred Acre Wood
+		// preagi game
+		{
+			"winnie",
+			"",
+			AD_ENTRY1("title.pic", "45e06010a3c61d78f4661103c901ae11"),
+			Common::EN_ANY,
+			Common::kPlatformApple2GS,
+			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-24 17:44:47 UTC (rev 29089)
+++ scummvm/trunk/engines/agi/preagi_winnie.cpp	2007-09-24 19:37:57 UTC (rev 29090)
@@ -39,7 +39,7 @@
 #define IDA_DEFAULT_REV	0xF0
 
 void Winnie::parseRoomHeader(WTP_ROOM_HDR *roomHdr, byte *buffer, int len) {
-	bool isBigEndian = !(_vm->getPlatform() == Common::kPlatformPC || _vm->getPlatform() == Common::kPlatformC64);
+	bool isBigEndian = (_vm->getPlatform() == Common::kPlatformAmiga);
 	int i;
 
 	Common::MemoryReadStreamEndian readS(buffer, len, isBigEndian);
@@ -75,7 +75,7 @@
 }
 
 void Winnie::parseObjHeader(WTP_OBJ_HDR *objHdr, byte *buffer, int len) {
-	bool isBigEndian = !(_vm->getPlatform() == Common::kPlatformPC || _vm->getPlatform() == Common::kPlatformC64);
+	bool isBigEndian = (_vm->getPlatform() == Common::kPlatformAmiga);
 	int i;
 
 	Common::MemoryReadStreamEndian readS(buffer, len, isBigEndian);
@@ -101,6 +101,8 @@
 		sprintf(szFile, IDS_WTP_ROOM_AMIGA, iRoom);
 	else if (_vm->getPlatform() == Common::kPlatformC64)
 		sprintf(szFile, IDS_WTP_ROOM_C64, iRoom);
+	else if (_vm->getPlatform() == Common::kPlatformApple2GS)
+		sprintf(szFile, IDS_WTP_ROOM_APPLE, iRoom);
 	Common::File file;
 	if (!file.open(szFile)) {
 		warning ("Could not open file \'%s\'", szFile);
@@ -128,6 +130,8 @@
 		sprintf(szFile, IDS_WTP_OBJ_AMIGA, iObj);
 	else if (_vm->getPlatform() == Common::kPlatformC64)
 		sprintf(szFile, IDS_WTP_OBJ_C64, iObj);
+	else if (_vm->getPlatform() == Common::kPlatformApple2GS)
+		sprintf(szFile, IDS_WTP_OBJ_APPLE, iObj);
 	Common::File file;
 	if (!file.open(szFile)) {
 		warning ("Could not open file \'%s\'", szFile);
@@ -370,11 +374,9 @@
 		}
 
 		// jump to the script block of the selected option
-		if (_vm->getPlatform() == Common::kPlatformPC)
-			pc = hdr.opt[index].ofsOpt[iSel] - IDI_WTP_OFS_ROOM_DOS;
-		else if (_vm->getPlatform() == Common::kPlatformC64)
-			pc = hdr.opt[index].ofsOpt[iSel] - IDI_WTP_OFS_ROOM_C64;
-		else if (_vm->getPlatform() == Common::kPlatformAmiga)
+		if (_vm->getPlatform() != Common::kPlatformAmiga)
+			pc = hdr.opt[index].ofsOpt[iSel] - IDI_WTP_OFS_ROOM;
+		else
 			pc = hdr.opt[index].ofsOpt[iSel];
 
 		opcode = *(buffer + pc);
@@ -1038,21 +1040,18 @@
 	}
 phase2:
 	for (iBlock = 0; iBlock < IDI_WTP_MAX_BLOCK; iBlock++) {
-		if (_vm->getPlatform() == Common::kPlatformPC) {
-			if (parser(hdr.ofsDesc[iBlock] - IDI_WTP_OFS_ROOM_DOS, iBlock, roomdata) == IDI_WTP_PAR_BACK)
+		if (_vm->getPlatform() != Common::kPlatformAmiga) {
+			if (parser(hdr.ofsDesc[iBlock] - IDI_WTP_OFS_ROOM, iBlock, roomdata) == IDI_WTP_PAR_BACK)
 				goto phase1;
-		} else if (_vm->getPlatform() == Common::kPlatformC64) {
-			if (parser(hdr.ofsDesc[iBlock] - IDI_WTP_OFS_ROOM_C64, iBlock, roomdata) == IDI_WTP_PAR_BACK)
-				goto phase1;
-		} else if (_vm->getPlatform() == Common::kPlatformAmiga) {
+		} else {
 			if (parser(hdr.ofsDesc[iBlock], iBlock, roomdata) == IDI_WTP_PAR_BACK)
 				goto phase1;
 		}
 	}
 	for (;;) {
 		for (iBlock = 0; iBlock < IDI_WTP_MAX_BLOCK; iBlock++) {
-			if (_vm->getPlatform() == Common::kPlatformPC) {
-				switch(parser(hdr.ofsBlock[iBlock] - IDI_WTP_OFS_ROOM_DOS, iBlock, roomdata)) {
+			if (_vm->getPlatform() != Common::kPlatformAmiga) {
+				switch(parser(hdr.ofsBlock[iBlock] - IDI_WTP_OFS_ROOM, iBlock, roomdata)) {
 				case IDI_WTP_PAR_GOTO:
 					goto phase0;
 					break;
@@ -1060,16 +1059,7 @@
 					goto phase2;
 					break;
 				}
-			} else if (_vm->getPlatform() == Common::kPlatformC64) {
-				switch(parser(hdr.ofsBlock[iBlock] - IDI_WTP_OFS_ROOM_C64, iBlock, roomdata)) {
-				case IDI_WTP_PAR_GOTO:
-					goto phase0;
-					break;
-				case IDI_WTP_PAR_BACK:
-					goto phase2;
-					break;
-				}
-			} else if (_vm->getPlatform() == Common::kPlatformAmiga) {
+			} else {
 				switch(parser(hdr.ofsBlock[iBlock], iBlock, roomdata)) {
 				case IDI_WTP_PAR_GOTO:
 					goto phase0;
@@ -1090,7 +1080,7 @@
 	uint8 *buffer = (uint8 *)malloc(4096);
 
 	// construct filename
-	if (!_vm->getPlatform() == Common::kPlatformAmiga)
+	if (_vm->getPlatform() != Common::kPlatformAmiga)
 		sprintf(szFile, "%s.pic", szName);
 	else
 		strcpy(szFile, szName);
@@ -1119,7 +1109,7 @@
 	uint32 objSize = readObj(iObj, buffer);
 	parseObjHeader(&objhdr, buffer, sizeof(WTP_OBJ_HDR));
 	
-	if (_vm->getPlatform() == Common::kPlatformPC)
+	if (_vm->getPlatform() == Common::kPlatformPC || _vm->getPlatform() == Common::kPlatformApple2GS)
 		objhdr.ofsPic -= IDI_WTP_OFS_OBJ;
 
 	_vm->_picture->setOffset(x0, y0);
@@ -1141,10 +1131,8 @@
 	// read room picture
 	readRoom(_room, buffer, roomhdr);
 
-	if (_vm->getPlatform() == Common::kPlatformPC)
-		roomhdr.ofsPic = roomhdr.ofsPic - IDI_WTP_OFS_ROOM_DOS;
-	else if (_vm->getPlatform() == Common::kPlatformC64)
-		roomhdr.ofsPic = roomhdr.ofsPic - IDI_WTP_OFS_ROOM_C64;
+	if (_vm->getPlatform() != Common::kPlatformAmiga)
+		roomhdr.ofsPic = roomhdr.ofsPic - IDI_WTP_OFS_ROOM;
 
 	// draw room picture
 	_vm->_picture->decodePicture(buffer + roomhdr.ofsPic, 4096, 1, IDI_WTP_PIC_WIDTH, IDI_WTP_PIC_HEIGHT);
@@ -1175,11 +1163,9 @@
 	uint8 *buffer = (uint8 *)malloc(4096);
 
 	readRoom(iRoom, buffer, hdr);
-	if (_vm->getPlatform() == Common::kPlatformPC)
-		_vm->printStrXOR((char *)(buffer + hdr.ofsStr[iStr - 1] - IDI_WTP_OFS_ROOM_DOS));
-	else if (_vm->getPlatform() == Common::kPlatformC64)
-		_vm->printStrXOR((char *)(buffer + hdr.ofsStr[iStr - 1] - IDI_WTP_OFS_ROOM_C64));
-	else if (_vm->getPlatform() == Common::kPlatformAmiga)
+	if (_vm->getPlatform() != Common::kPlatformAmiga)
+		_vm->printStrXOR((char *)(buffer + hdr.ofsStr[iStr - 1] - IDI_WTP_OFS_ROOM));
+	else
 		_vm->printStr((char *)(buffer + hdr.ofsStr[iStr - 1]));
 
 	free(buffer);
@@ -1245,13 +1231,13 @@
 	_doWind = false;
 	_winnieEvent = false;
 
-	if (_vm->getPlatform() == Common::kPlatformC64)
+	if (_vm->getPlatform() == Common::kPlatformC64 || _vm->getPlatform() == Common::kPlatformApple2GS)
 		_vm->_picture->setPictureVersion(AGIPIC_C64);
 }
 
 void Winnie::run() {
 	randomize();
-	if (_vm->getPlatform() != Common::kPlatformC64)
+	if (_vm->getPlatform() != Common::kPlatformC64 && _vm->getPlatform() != Common::kPlatformApple2GS)
 		intro();
 	gameLoop();
 }

Modified: scummvm/trunk/engines/agi/preagi_winnie.h
===================================================================
--- scummvm/trunk/engines/agi/preagi_winnie.h	2007-09-24 17:44:47 UTC (rev 29089)
+++ scummvm/trunk/engines/agi/preagi_winnie.h	2007-09-24 19:37:57 UTC (rev 29090)
@@ -37,12 +37,15 @@
 #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_ROOM_APPLE		"room%d.obj"
 #define IDS_WTP_OBJ_DOS			"obj.%02d"
 #define IDS_WTP_OBJ_AMIGA		"object.%d"
 #define IDS_WTP_OBJ_C64			"object%02d"
+#define IDS_WTP_OBJ_APPLE		"object%d.obj"
 #define IDS_WTP_SND_DOS			"snd.%02d"
 #define IDS_WTP_SND_AMIGA		"Sounds"
 #define IDS_WTP_SND_C64			"sound.obj"
+#define IDS_WTP_SND_APPLE		"sound.obj"
 
 #define IDS_WTP_FILE_LOGO		"logo"
 #define IDS_WTP_FILE_TITLE		"title"
@@ -134,8 +137,7 @@
 
 // data file offset modifiers
 
-#define IDI_WTP_OFS_ROOM_DOS	0x5400
-#define IDI_WTP_OFS_ROOM_C64	0x5400		//FIXME: This number needs to be higher to show the image
+#define IDI_WTP_OFS_ROOM		0x5400
 #define IDI_WTP_OFS_OBJ			0x0800
 
 // picture


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