From fdfd91fd7fbda9494bca086119c1bf7c8529ae6d Mon Sep 17 00:00:00 2001 From: Avijeet Date: Thu, 23 Jun 2022 17:34:42 +0530 Subject: [PATCH] GLK: SCOTT: Add support for Super Gran --- engines/glk/scott/c64_checksums.cpp | 2 + engines/glk/scott/detection_tables.h | 3 + engines/glk/scott/game_specific.cpp | 41 ++++++++++++++ engines/glk/scott/game_specific.h | 1 + engines/glk/scott/games.h | 82 ++++++++++++++++++++++++++++ engines/glk/scott/globals.cpp | 1 + engines/glk/scott/load_game.cpp | 3 + 7 files changed, 133 insertions(+) diff --git a/engines/glk/scott/c64_checksums.cpp b/engines/glk/scott/c64_checksums.cpp index afe721e9e4f..bdd00129512 100644 --- a/engines/glk/scott/c64_checksums.cpp +++ b/engines/glk/scott/c64_checksums.cpp @@ -142,6 +142,8 @@ static C64Rec g_C64Registry[] = { { INDIANS_C64, 0x4f9f, 0xe6c8, TYPE_T64, 1 }, // Ten Little Indians C64 { WAXWORKS_C64, 0x4a11, 0xa37a, TYPE_T64, 1 }, // Waxworks C64 + { SUPERGRAN_C64, 0x726f, 0x0901, TYPE_T64, 1, nullptr, nullptr, 0, 0xd802, 0xc623, 0x1f00 }, // Super Gran C64 (T64) PUCrunch Generic Hack + { UNKNOWN_GAME, 0, 0, UNKNOWN_FILE_TYPE, 0, nullptr, nullptr, 0, 0, 0, 0 } }; diff --git a/engines/glk/scott/detection_tables.h b/engines/glk/scott/detection_tables.h index c3807ae494c..abf2740c806 100644 --- a/engines/glk/scott/detection_tables.h +++ b/engines/glk/scott/detection_tables.h @@ -87,6 +87,7 @@ const PlainGameDescriptor SCOTT_GAME_LIST[] = { { "topsecretadv", "Top Secret Adventure" }, { "gremlins", "Gremlins" }, { "seasofblood", "Seas Of Blood" }, + { "supergran", "Super Gran" }, { nullptr, nullptr } }; @@ -198,6 +199,8 @@ const GlkDetectionEntry SCOTT_GAMES[] = { DT_ENTRY1("marveladventure", "C64", "d80e133dd396565f773052cb317e8222", 174848), DT_ENTRY1("marveladventure2","C64", "5d0ea85ca1f260ca718a6bbb6da4cdb9", 174848), DT_ENTRY1("marveladventure2","C64", "3d88539a6dd7e6e179bb61041125cc0f", 36466), + DT_ENTRY1("supergran", "C64", "36a5b1b2afb38902933856b3446d760e", 29295), + //Scott Adams DT_ENTRY1("adventureland", "C64", "05cf6c64ecde5288ae2e46099bfd19a3", 27152), diff --git a/engines/glk/scott/game_specific.cpp b/engines/glk/scott/game_specific.cpp index 283a9458ac4..7ffaf6ccc73 100644 --- a/engines/glk/scott/game_specific.cpp +++ b/engines/glk/scott/game_specific.cpp @@ -321,5 +321,46 @@ void spiderman64Sysmess() { _G(_sys)[SOMETHING] = "\" something. "; } +void supergran64Sysmess(void) { + SysMessageType messagekey[] = { + NORTH, + SOUTH, + EAST, + WEST, + UP, + DOWN, + EXITS, + YOU_SEE, + YOU_ARE, + I_DONT_KNOW_WHAT_A, + IS, + YOU_CANT_GO_THAT_WAY, + OK, + WHAT_NOW, + HUH, + YOU_HAVE_IT, + TAKEN, + DROPPED, + YOU_HAVENT_GOT_IT, + INVENTORY, + YOU_DONT_SEE_IT, + THATS_BEYOND_MY_POWER, + DIRECTION, + YOURE_CARRYING_TOO_MUCH, + IM_DEAD, + PLAY_AGAIN, + RESUME_A_SAVED_GAME, + YOU_CANT_DO_THAT_YET, + I_DONT_UNDERSTAND, + NOTHING}; + + for (int i = 0; i < 30; i++) { + _G(_sys)[messagekey[i]] = _G(_systemMessages)[i]; + } + + _G(_sys)[I_DONT_KNOW_WHAT_A] = "\""; + _G(_sys)[IS] = "\" is a word I don't know. "; +} + } // End of namespace Scott } // End of namespace Glk diff --git a/engines/glk/scott/game_specific.h b/engines/glk/scott/game_specific.h index 75e0af0c67d..269537f9d82 100644 --- a/engines/glk/scott/game_specific.h +++ b/engines/glk/scott/game_specific.h @@ -42,6 +42,7 @@ void adventurelandAction(int p); void adventurelandDarkness(); void adventureland64Sysmess(); void spiderman64Sysmess(); +void supergran64Sysmess(void); } // End of namespace Scott } // End of namespace Glk diff --git a/engines/glk/scott/games.h b/engines/glk/scott/games.h index d28ec4b060c..2ad4d51d9b2 100644 --- a/engines/glk/scott/games.h +++ b/engines/glk/scott/games.h @@ -1908,5 +1908,87 @@ const GameInfo _games[NUMGAMES] = { 43, // number_of_pictures; C64B, // palette 0, // picture_format_version; + 0), + GameInfo("Supergran", + SUPERGRAN, + NO_TYPE, // type + ENGLISH, // subtype + FOUR_LETTER_UNCOMPRESSED, // dictionary type + + 85, // Number of items + 204, // Number of actions + 105, // Number of words + 39, // Number of rooms + 6, // Max carried items + 4, // Word length + 99, // Number of messages + + 101, // number_of_verbs + 106, // number_of_nouns; + + 0x236d, // header + LATE, // header style + 0x38c8, // room images + FOLLOWS, // item flags + FOLLOWS, // item images + 0x399e, // actions + COMPRESSED, + 0x42fd, // dictionary + 0x4708, // start_of_room_descriptions; + FOLLOWS, // start_of_room_connections; + FOLLOWS, // start_of_messages; + FOLLOWS, // start_of_item_descriptions; + FOLLOWS, // start_of_item_locations; + + 0x2423, // start_of_system_messages + 0x25f3, // start of directions + + 0x5a4e, // start_of_characters; + FOLLOWS, // start_of_image_data + 0x634e, // image_address_offset + 47, // number_of_pictures; + ZXOPT, // palette + 3, // picture_format_version; + 0), + GameInfo("Supergran C64", + SUPERGRAN_C64, + NO_TYPE, // type + static_cast(ENGLISH | C64), // subtype + FOUR_LETTER_UNCOMPRESSED, // dictionary type + + 85, // Number of items + 204, // Number of actions + 105, // Number of words + 39, // Number of rooms + 6, // Max carried items + 4, // Word length + 99, // Number of messages + + 101, // number_of_verbs + 105, // number_of_nouns; + + 0x4624, // header + SUPERGRAN_C64_HEADER, // header style + 0x4636, // room images + FOLLOWS, // item flags + FOLLOWS, // item images + 0x47b5, // actions + COMPRESSED, + 0x5119, // dictionary + 0x5524, // start_of_room_descriptions; + FOLLOWS, // start_of_room_connections; + FOLLOWS, // start_of_messages; + FOLLOWS, // start_of_item_descriptions; + 0x470a, // start_of_item_locations; + + 0x0a53, // start_of_system_messages + 0x0a53, // start of directions + + 0x6a02, // start_of_characters; + FOLLOWS, // start_of_image_data + 0x7302, // image_address_offset + 49, // number_of_pictures; + C64B, // palette + 3, // picture_format_version; 0) }; diff --git a/engines/glk/scott/globals.cpp b/engines/glk/scott/globals.cpp index d336604bb2e..f2d446aa289 100644 --- a/engines/glk/scott/globals.cpp +++ b/engines/glk/scott/globals.cpp @@ -151,6 +151,7 @@ Globals::Globals() : _sys(MAX_SYSMESS), _directions(NUMBER_OF_DIRECTIONS), _extr _md5Index.setVal("96a1ccb3212808eee03e74cdc1f0d1a4", 54); // perseus _md5Index.setVal("79ee3669ccfff7338dfc1810228005dc", 55); // 10 indians _md5Index.setVal("facc11aa8b51e88a807236b765203eb0", 56); // waxworks11 + _md5Index.setVal("36a5b1b2afb38902933856b3446d760e", 57); // super gran } Globals::~Globals() { diff --git a/engines/glk/scott/load_game.cpp b/engines/glk/scott/load_game.cpp index c69233462d0..f7900bbe19d 100644 --- a/engines/glk/scott/load_game.cpp +++ b/engines/glk/scott/load_game.cpp @@ -169,6 +169,9 @@ void loadGameFile(Common::SeekableReadStream *f) { case SPIDERMAN_C64: spiderman64Sysmess(); break; + case SUPERGRAN_C64: + supergran64Sysmess(); + break; case SAVAGE_ISLAND_C64: _G(_items)[20]._image = 13; case SAVAGE_ISLAND2_C64: