From 352566ee646e3a6b9399bc928d4c10a4f5a8fcc8 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sun, 23 Sep 2007 02:15:48 +0000 Subject: 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 svn-id: r29037 --- engines/agi/detection.cpp | 17 +++++++++++++++++ engines/agi/preagi_winnie.cpp | 20 ++++++++++++++++---- engines/agi/preagi_winnie.h | 9 ++++----- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/engines/agi/detection.cpp b/engines/agi/detection.cpp index 38dadf296b..c43e1052a3 100644 --- a/engines/agi/detection.cpp +++ b/engines/agi/detection.cpp @@ -1667,6 +1667,23 @@ static const AGIGameDescription gameDescriptions[] = { 0x0000, }, + { + // 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] { diff --git a/engines/agi/preagi_winnie.cpp b/engines/agi/preagi_winnie.cpp index 8b035e88af..edbfb9f6ed 100644 --- a/engines/agi/preagi_winnie.cpp +++ b/engines/agi/preagi_winnie.cpp @@ -55,6 +55,9 @@ void Winnie::initVars() { 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 @@ uint32 Winnie::readRoom(int iRoom, uint8 *buffer, WTP_ROOM_HDR &roomHdr) { 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 @@ uint32 Winnie::readObj(int iObj, uint8 *buffer) { 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 @@ void Winnie::drawRoomPic() { // 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 @@ void Winnie::drawRoomPic() { _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::init() { void Winnie::run() { randomize(); - intro(); + if (!_vm->getPlatform() == Common::kPlatformC64) + intro(); gameLoop(); } diff --git a/engines/agi/preagi_winnie.h b/engines/agi/preagi_winnie.h index 60f8f5855f..31b539ed21 100644 --- a/engines/agi/preagi_winnie.h +++ b/engines/agi/preagi_winnie.h @@ -36,11 +36,13 @@ namespace Agi { #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 @@ namespace Agi { // 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 moves the pointer. Press when it is by the choice you want. brings back what you have already read." -- cgit v1.2.3