From 4426476a15924e52f5d9a150352b9f02e35b6a31 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Thu, 15 Aug 2024 20:23:10 -0700 Subject: [PATCH] clean up patch enable quest logic --- src/Client.cc | 6 +-- src/CommandFormats.hh | 3 +- src/Main.cc | 6 ++- src/PatchServer.cc | 2 +- src/Quest.cc | 5 +- src/Quest.hh | 2 +- src/QuestScript.cc | 30 +++++++++--- src/ReceiveCommands.cc | 43 +++++++----------- src/ServerState.cc | 15 +++++- src/ServerState.hh | 2 +- src/Version.cc | 16 +++++-- src/Version.hh | 3 ++ system/config.example.json | 30 +++++------- ...88500-gc-e.bin.txt => q88530-gc-e.bin.txt} | 4 +- .../hidden/{q88500-gc.dat => q88530-gc.dat} | Bin ...88500-gc-j.bin.txt => q88531-gc-e.bin.txt} | 6 +-- system/quests/hidden/q88531-gc.dat | Bin 0 -> 7 bytes ...88500-gc-s.bin.txt => q88532-gc-e.bin.txt} | 6 +-- system/quests/hidden/q88532-gc.dat | Bin 0 -> 7 bytes ...88500-gc-g.bin.txt => q88533-gc-e.bin.txt} | 6 +-- system/quests/hidden/q88533-gc.dat | Bin 0 -> 7 bytes .../hidden/{q88500-gc.s => q8853x-gc.s} | 0 tests/assemble-quest.test.sh | 2 +- tests/config.json | 2 +- 24 files changed, 108 insertions(+), 81 deletions(-) rename system/quests/hidden/{q88500-gc-e.bin.txt => q88530-gc-e.bin.txt} (97%) rename system/quests/hidden/{q88500-gc.dat => q88530-gc.dat} (100%) rename system/quests/hidden/{q88500-gc-j.bin.txt => q88531-gc-e.bin.txt} (89%) create mode 100755 system/quests/hidden/q88531-gc.dat rename system/quests/hidden/{q88500-gc-s.bin.txt => q88532-gc-e.bin.txt} (89%) create mode 100755 system/quests/hidden/q88532-gc.dat rename system/quests/hidden/{q88500-gc-g.bin.txt => q88533-gc-e.bin.txt} (89%) create mode 100755 system/quests/hidden/q88533-gc.dat rename system/quests/hidden/{q88500-gc.s => q8853x-gc.s} (100%) diff --git a/src/Client.cc b/src/Client.cc index 93b6df27..bc6a12e3 100644 --- a/src/Client.cc +++ b/src/Client.cc @@ -85,10 +85,8 @@ void Client::Config::set_flags_for_version(Version version, int64_t sub_version) case 0x20: // DCNTE, possibly also DCv1 JP case 0x21: // DCv1 US - this->set_flag(Flag::NO_D6); - break; - case 0x22: // DCv1 EU 50Hz (presumably) - case 0x23: // DCv1 EU 60Hz (presumably) + case 0x22: // DCv1 EU, 12/2000, and 01/2001, at 50Hz (presumably) + case 0x23: // DCv1 EU, 12/2000, and 01/2001, at 60Hz (presumably) this->set_flag(Flag::NO_D6); break; case 0x25: // DCv2 JP diff --git a/src/CommandFormats.hh b/src/CommandFormats.hh index 966e1ab3..110e56f1 100644 --- a/src/CommandFormats.hh +++ b/src/CommandFormats.hh @@ -1671,7 +1671,8 @@ struct C_LoginV1_DC_PC_V3_90 { // 92 (C->S): Register (DC) struct C_RegisterV1_DC_92 { - parray unknown_a1; + parray unknown_a1; + le_uint32_t sub_version; uint8_t is_extended = 0; // TODO: This is a guess uint8_t language = 0; // TODO: This is a guess; verify it parray unknown_a3; diff --git a/src/Main.cc b/src/Main.cc index e6f5e32c..9fdc4d36 100644 --- a/src/Main.cc +++ b/src/Main.cc @@ -1246,7 +1246,11 @@ Action a_assemble_quest_script( string result = assemble_quest_script(text, include_dir); bool compress = !args.get("decompressed"); if (compress) { - result = prs_compress_optimal(result); + if (args.get("optimal")) { + result = prs_compress_optimal(result); + } else { + result = prs_compress(result); + } } write_output_data(args, result.data(), result.size(), compress ? "bin" : "bind"); }); diff --git a/src/PatchServer.cc b/src/PatchServer.cc index eb1f5351..ab91ef35 100644 --- a/src/PatchServer.cc +++ b/src/PatchServer.cc @@ -349,7 +349,7 @@ void PatchServer::on_listen_accept(struct evconnlistener* listener, evutil_socke c->channel.context_obj = this; this->channel_to_client.emplace(&c->channel, c); - server_log.info("Patch client connected: U-%" PRIX64 " on fd %d via %d (%s)", + server_log.info("Patch client connected: C-%" PRIX64 " on fd %d via %d (%s)", c->id, fd, listen_fd, listening_socket->addr_str.c_str()); this->send_server_init(c); diff --git a/src/Quest.cc b/src/Quest.cc index 0ee78fbc..87d0d32b 100644 --- a/src/Quest.cc +++ b/src/Quest.cc @@ -459,15 +459,12 @@ bool Quest::has_version_any_language(Version v) const { return ((it != this->versions.end()) && ((it->first & 0xFF00) == k)); } -shared_ptr Quest::version(Version v, uint8_t language, bool allow_language_fallback) const { +shared_ptr Quest::version(Version v, uint8_t language) const { // Return the requested version, if it exists try { return this->versions.at(this->versions_key(v, language)); } catch (const out_of_range&) { } - if (!allow_language_fallback) { - return nullptr; - } // Return the English version, if it exists try { diff --git a/src/Quest.hh b/src/Quest.hh index bc7e2b1e..144aba24 100644 --- a/src/Quest.hh +++ b/src/Quest.hh @@ -123,7 +123,7 @@ public: void add_version(std::shared_ptr vq); bool has_version(Version v, uint8_t language) const; bool has_version_any_language(Version v) const; - std::shared_ptr version(Version v, uint8_t language, bool allow_language_fallback = true) const; + std::shared_ptr version(Version v, uint8_t language) const; static uint32_t versions_key(Version v, uint8_t language); diff --git a/src/QuestScript.cc b/src/QuestScript.cc index 97732476..55f01a72 100644 --- a/src/QuestScript.cc +++ b/src/QuestScript.cc @@ -514,7 +514,7 @@ static const QuestScriptOpcodeDefinition opcode_defs[] = { {0x00EE, "pl_add_meseta2", {INT32}, F_V1_V4 | F_ARGS}, {0x00EF, "sync_register2", {INT32, REG32}, F_V1_V2}, {0x00EF, "sync_register2", {REG, INT32}, F_V3_V4 | F_ARGS}, - {0x00F0, "send_regwork", {INT32, REG32}, F_V1_V2}, + {0x00F0, "send_regwork", {REG32, REG32}, F_V1_V2}, {0x00F1, "leti_fixed_camera", {{REG32_SET_FIXED, 6}}, F_V2}, {0x00F1, "leti_fixed_camera", {{REG_SET_FIXED, 6}}, F_V3_V4}, {0x00F2, "default_camera_pos1", {}, F_V2_V4}, @@ -2214,6 +2214,14 @@ std::string assemble_quest_script(const std::string& text, const std::string& in } else if (phosg::starts_with(line, ".zero ")) { size_t size = stoull(line.substr(6), nullptr, 0); code_w.extend_by(size, 0x00); + } else if (phosg::starts_with(line, ".zero_until ")) { + size_t size = stoull(line.substr(12), nullptr, 0); + code_w.extend_to(size, 0x00); + } else if (phosg::starts_with(line, ".align ")) { + size_t alignment = stoull(line.substr(7), nullptr, 0); + while (code_w.size() % alignment) { + code_w.put_u8(0); + } } else if (phosg::starts_with(line, ".include_bin ")) { string filename = line.substr(13); phosg::strip_whitespace(filename); @@ -2286,10 +2294,10 @@ std::string assemble_quest_script(const std::string& text, const std::string& in phosg::strip_leading_whitespace(arg); try { - auto add_cstr = [&](const string& text) -> void { + auto add_cstr = [&](const string& text, bool bin) -> void { switch (quest_version) { case Version::DC_NTE: - code_w.write(tt_utf8_to_sega_sjis(text)); + code_w.write(bin ? text : tt_utf8_to_sega_sjis(text)); code_w.put_u8(0); break; case Version::DC_V1_11_2000_PROTOTYPE: @@ -2300,13 +2308,13 @@ std::string assemble_quest_script(const std::string& text, const std::string& in case Version::GC_EP3_NTE: case Version::GC_EP3: case Version::XB_V3: - code_w.write(quest_language ? tt_utf8_to_8859(text) : tt_utf8_to_sega_sjis(text)); + code_w.write(bin ? text : (quest_language ? tt_utf8_to_8859(text) : tt_utf8_to_sega_sjis(text))); code_w.put_u8(0); break; case Version::PC_NTE: case Version::PC_V2: case Version::BB_V4: - code_w.write(tt_utf8_to_utf16(text)); + code_w.write(bin ? text : tt_utf8_to_utf16(text)); code_w.put_u16(0); break; default: @@ -2374,7 +2382,11 @@ std::string assemble_quest_script(const std::string& text, const std::string& in if (write_as_str) { if (arg[0] == '\"') { code_w.put_u8(0x4E); // arg_pushs - add_cstr(phosg::parse_data_string(arg)); + if (phosg::starts_with(arg, "bin:")) { + add_cstr(phosg::parse_data_string(arg.substr(4)), true); + } else { + add_cstr(phosg::parse_data_string(arg), false); + } } else { throw runtime_error("invalid argument syntax"); } @@ -2460,7 +2472,11 @@ std::string assemble_quest_script(const std::string& text, const std::string& in code_w.put_u32l(stof(arg, nullptr)); break; case Type::CSTRING: - add_cstr(phosg::parse_data_string(arg)); + if (phosg::starts_with(arg, "bin:")) { + add_cstr(phosg::parse_data_string(arg.substr(4)), true); + } else { + add_cstr(phosg::parse_data_string(arg), false); + } break; default: throw logic_error("unknown argument type"); diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 0018f0c1..fd08ebe5 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -405,28 +405,15 @@ void on_login_complete(shared_ptr c) { auto s = c->require_server_state(); if (c->config.check_flag(Client::Flag::CAN_RECEIVE_ENABLE_B2_QUEST) && - !c->config.check_flag(Client::Flag::HAS_SEND_FUNCTION_CALL) && - (s->enable_send_function_call_quest_num >= 0)) { - auto q = s->default_quest_index->get(s->enable_send_function_call_quest_num); + !c->config.check_flag(Client::Flag::HAS_SEND_FUNCTION_CALL)) { + shared_ptr q; + try { + int64_t quest_num = s->enable_send_function_call_quest_numbers.at(c->config.specific_version); + q = s->default_quest_index->get(quest_num); + } catch (const out_of_range&) { + } if (q) { - uint8_t q_language; - switch (c->sub_version) { - case 0x39: - q_language = 0; // Japanese (JP Plus v1.5) - break; - case 0x42: - case 0x43: - q_language = 2; // German (EU Ep3) - break; - case 0x41: - q_language = 4; // Spanish (US Ep3) - break; - case 0x36: - case 0x3A: - default: - q_language = 1; // English (US Plus v1.2 + customizations) - } - auto vq = q->version(is_ep3(c->version()) ? Version::GC_V3 : c->version(), q_language, false); + auto vq = q->version(is_ep3(c->version()) ? Version::GC_V3 : c->version(), 1); if (vq) { c->config.set_flag(Client::Flag::HAS_SEND_FUNCTION_CALL); c->config.set_flag(Client::Flag::SEND_FUNCTION_CALL_NO_CACHE_PATCH); @@ -440,7 +427,9 @@ void on_login_complete(shared_ptr c) { send_open_quest_file(c, bin_filename, bin_filename, xb_filename, vq->quest_number, QuestFileType::ONLINE, vq->bin_contents); send_open_quest_file(c, dat_filename, dat_filename, xb_filename, vq->quest_number, QuestFileType::ONLINE, vq->dat_contents); - send_command(c, 0xAC, 0x00); + if (!is_v1_or_v2(c->version())) { + send_command(c, 0xAC, 0x00); + } } } } @@ -555,7 +544,8 @@ static void set_console_client_flags(shared_ptr c, uint32_t sub_version) if (sub_version <= 0x24) { c->channel.version = Version::DC_V1; c->log.info("Game version changed to DC_V1"); - if (specific_version_is_indeterminate(c->config.specific_version) || c->config.specific_version == SPECIFIC_VERSION_DC_11_2000_PROTOTYPE) { + if (specific_version_is_indeterminate(c->config.specific_version) || + c->config.specific_version == SPECIFIC_VERSION_DC_11_2000_PROTOTYPE) { c->config.specific_version = SPECIFIC_VERSION_DC_V1_INDETERMINATE; } } else if (sub_version <= 0x28) { @@ -709,14 +699,15 @@ static void on_90_DC(shared_ptr c, uint16_t, uint32_t, string& data) { static void on_92_DC(shared_ptr c, uint16_t, uint32_t, string& data) { const auto& cmd = check_size_t(data); c->channel.language = cmd.language; - // It appears that in response to 90 01, the DCv1 prototype sends 93 rather - // than 92, so we use the presence of a 92 command to determine that the - // client is actually DCv1 and not the prototype. + // It appears that in response to 90 01, 11/2000 sends 93 rather than 92, so + // we use the presence of a 92 command to determine that the client is + // actually DCv1 and not the prototype. c->config.set_flag(Client::Flag::CHECKED_FOR_DC_V1_PROTOTYPE); c->channel.version = Version::DC_V1; if (specific_version_is_indeterminate(c->config.specific_version) || c->config.specific_version == SPECIFIC_VERSION_DC_11_2000_PROTOTYPE) { c->config.specific_version = SPECIFIC_VERSION_DC_V1_INDETERMINATE; } + set_console_client_flags(c, cmd.sub_version); c->log.info("Game version changed to DC_V1"); send_command(c, 0x92, 0x01); } diff --git a/src/ServerState.cc b/src/ServerState.cc index 773de63d..1614ea18 100644 --- a/src/ServerState.cc +++ b/src/ServerState.cc @@ -794,7 +794,20 @@ void ServerState::load_config_early() { this->default_rare_notifs_enabled_v3_v4 = this->default_rare_notifs_enabled_v1_v2; this->default_rare_notifs_enabled_v1_v2 = this->config_json->get_bool("RareNotificationsEnabledByDefaultV1V2", this->default_rare_notifs_enabled_v1_v2); this->default_rare_notifs_enabled_v3_v4 = this->config_json->get_bool("RareNotificationsEnabledByDefaultV3V4", this->default_rare_notifs_enabled_v3_v4); - this->enable_send_function_call_quest_num = this->config_json->get_int("EnableSendFunctionCallQuestNumber", -1); + this->enable_send_function_call_quest_numbers.clear(); + try { + for (const auto& it : this->config_json->get_dict("EnableSendFunctionCallQuestNumbers")) { + if (it.first.size() != 4) { + throw runtime_error(phosg::string_printf( + "specific_version %s in EnableSendFunctionCallQuestNumbers is not a 4-byte string", + it.first.c_str())); + } + uint32_t specific_version = phosg::StringReader(it.first).get_u32b(); + int64_t quest_num = it.second->as_int(); + this->enable_send_function_call_quest_numbers.emplace(specific_version, quest_num); + } + } catch (const out_of_range&) { + } this->enable_v3_v4_protected_subcommands = this->config_json->get_bool("EnableV3V4ProtectedSubcommands", false); this->catch_handler_exceptions = this->config_json->get_bool("CatchHandlerExceptions", true); diff --git a/src/ServerState.hh b/src/ServerState.hh index be79d2c2..218c93fd 100644 --- a/src/ServerState.hh +++ b/src/ServerState.hh @@ -120,7 +120,7 @@ struct ServerState : public std::enable_shared_from_this { std::unordered_map quest_flag_rewrites_v4; std::unordered_map> quest_counter_fields; // For $qfread command uint64_t persistent_game_idle_timeout_usecs = 0; - int64_t enable_send_function_call_quest_num = -1; + std::unordered_map enable_send_function_call_quest_numbers; bool enable_v3_v4_protected_subcommands = false; bool catch_handler_exceptions = true; bool ep3_infinite_meseta = false; diff --git a/src/Version.cc b/src/Version.cc index 45b1fe8b..43bde89e 100644 --- a/src/Version.cc +++ b/src/Version.cc @@ -235,11 +235,21 @@ uint32_t default_specific_version_for_version(Version version, int64_t sub_versi // VersionDetectDC, VersionDetectGC, or VersionDetectXB call. switch (version) { case Version::DC_NTE: - return SPECIFIC_VERSION_DC_NTE; // 1OJ1 + return SPECIFIC_VERSION_DC_NTE; // 1OJ1 (NTE) case Version::DC_V1_11_2000_PROTOTYPE: - return SPECIFIC_VERSION_DC_11_2000_PROTOTYPE; // 1OJ2 + return SPECIFIC_VERSION_DC_11_2000_PROTOTYPE; // 1OJ2 (11/2000) case Version::DC_V1: - return SPECIFIC_VERSION_DC_V1_INDETERMINATE; // 1___; need to send VersionDetectDC (but can't on V1; rip) + switch (sub_version) { + case 0x20: + return SPECIFIC_VERSION_DC_V1_JP; // 1OJF (1OJ1 and 1OJ2 use 0x20 as well, but are detected without using sub_version) + case 0x21: + return SPECIFIC_VERSION_DC_V1_US; // 1OEF + case 0x22: + case 0x23: + return SPECIFIC_VERSION_DC_V1_EU_INDETERMINATE; // 1OPF, 10J3 (12/2000), or 1OJ4 (01/2001) + default: + return SPECIFIC_VERSION_DC_V1_INDETERMINATE; + } case Version::DC_V2: return SPECIFIC_VERSION_DC_V2_INDETERMINATE; // 2___; need to send VersionDetectDC case Version::PC_V2: diff --git a/src/Version.hh b/src/Version.hh index d13717a6..f0f74a01 100644 --- a/src/Version.hh +++ b/src/Version.hh @@ -142,6 +142,9 @@ inline bool uses_utf16(Version version) { constexpr uint32_t SPECIFIC_VERSION_DC_NTE = 0x314F4A31; // 1OJ1 constexpr uint32_t SPECIFIC_VERSION_DC_11_2000_PROTOTYPE = 0x314F4A32; // 1OJ2 +constexpr uint32_t SPECIFIC_VERSION_DC_V1_JP = 0x314F4A46; // 1OJF +constexpr uint32_t SPECIFIC_VERSION_DC_V1_US = 0x314F4546; // 1OEF +constexpr uint32_t SPECIFIC_VERSION_DC_V1_EU_INDETERMINATE = 0x314F5000; // 1OP_ constexpr uint32_t SPECIFIC_VERSION_DC_V1_INDETERMINATE = 0x31000000; // 1___ constexpr uint32_t SPECIFIC_VERSION_DC_V2_INDETERMINATE = 0x32000000; // 2___ constexpr uint32_t SPECIFIC_VERSION_PC_V2 = 0x324F4A57; // 2OJW diff --git a/system/config.example.json b/system/config.example.json index e012ff2c..02d25563 100644 --- a/system/config.example.json +++ b/system/config.example.json @@ -1059,24 +1059,18 @@ // (100 on v1, 200 on other versions, or 999 on Episode 3). "NotifyServerForMaxLevelAchieved": false, - // If this number is nonnegative, it specifies a quest which is automatically - // sent to clients using Episodes 1&2 Plus USA when they connect. This is - // intended to be used for enabling server-side patches at connection time. - // This is not enabled by default because it has not yet been tested on real - // hardware, and it also increases the loading time considerably - the player - // has to wait for the initial server connection, then wait for the quest to - // load, then wait for the client to leave the "game", before even getting to - // the welcome message. - // To enable this feature, set this value to 88500. This is the number of the - // quest in system/quests/hidden that implements the patch. - // This quest is not intended to be localized since it should not contain any - // user-visible text, so the server uses the language field to determine - // which quest to send based on the client's version: - // - US Plus v1.2 + customizations: English - // - JP Plus v1.5: Japanese - // - US Ep3: Spanish - // - EU Ep3: German - "EnableSendFunctionCallQuestNumber": -1, + // This setting allows the server to enable server patching for versions that + // don't natively support it. This is not enabled by default because it has + // not yet been tested on real hardware, and it also increases the loading + // time considerably - the player has to wait for the initial server + // connection, then wait for the quest to load, then wait for the client to + // leave the "game", before even getting to the welcome message. + "EnableSendFunctionCallQuestNumbers": { + // "3OE2": 88530, // US Plus (v1.2) + customizations + // "3OJ5": 88531, // JP Plus (v1.5) + // "3SE0": 88532, // US Ep3 + // "3SP0": 88533, // EU Ep3 + }, // Whether to enable protected subcommands on GC and Xbox. This enables the // infinite HP cheat to also automatically revive players and clear conditions diff --git a/system/quests/hidden/q88500-gc-e.bin.txt b/system/quests/hidden/q88530-gc-e.bin.txt similarity index 97% rename from system/quests/hidden/q88500-gc-e.bin.txt rename to system/quests/hidden/q88530-gc-e.bin.txt index 3c33cb02..178e8297 100644 --- a/system/quests/hidden/q88500-gc-e.bin.txt +++ b/system/quests/hidden/q88530-gc-e.bin.txt @@ -1,5 +1,5 @@ .version GC_V3 -.quest_num 88500 +.quest_num 88530 .language 1 .episode Episode1 .name "GC v1.2 USA patch enabler" @@ -55,5 +55,5 @@ copy_done: ret code: - .include_native q88500-gc.s + .include_native q8853x-gc.s code_end: diff --git a/system/quests/hidden/q88500-gc.dat b/system/quests/hidden/q88530-gc.dat similarity index 100% rename from system/quests/hidden/q88500-gc.dat rename to system/quests/hidden/q88530-gc.dat diff --git a/system/quests/hidden/q88500-gc-j.bin.txt b/system/quests/hidden/q88531-gc-e.bin.txt similarity index 89% rename from system/quests/hidden/q88500-gc-j.bin.txt rename to system/quests/hidden/q88531-gc-e.bin.txt index 261b9549..40f85028 100644 --- a/system/quests/hidden/q88500-gc-j.bin.txt +++ b/system/quests/hidden/q88531-gc-e.bin.txt @@ -1,5 +1,5 @@ .version GC_V3 -.quest_num 88500 +.quest_num 88531 .language 0 .episode Episode1 .name "GC v1.5 JP patch enabler" @@ -7,7 +7,7 @@ .long_desc "" start: - // This script is identical to q88500-gc-e.bin.txt, except the addresses are + // This script is identical to q88530-gc-e.bin.txt, except the addresses are // changed to be suitable for JP v1.5. leti r3, 0x80004000 @@ -45,5 +45,5 @@ copy_done: ret code: - .include_native q88500-gc.s + .include_native q8853x-gc.s code_end: diff --git a/system/quests/hidden/q88531-gc.dat b/system/quests/hidden/q88531-gc.dat new file mode 100755 index 0000000000000000000000000000000000000000..fbcbc148b8dc86c552a79225bddabb5bbe6c08a7 GIT binary patch literal 7 OcmWe-`0<~QfdK#sm;xIB literal 0 HcmV?d00001 diff --git a/system/quests/hidden/q88500-gc-s.bin.txt b/system/quests/hidden/q88532-gc-e.bin.txt similarity index 89% rename from system/quests/hidden/q88500-gc-s.bin.txt rename to system/quests/hidden/q88532-gc-e.bin.txt index 5a4fdb96..cd73e3cc 100644 --- a/system/quests/hidden/q88500-gc-s.bin.txt +++ b/system/quests/hidden/q88532-gc-e.bin.txt @@ -1,5 +1,5 @@ .version GC_EP3 -.quest_num 88500 +.quest_num 88532 .language 1 .episode Episode1 .name "GC Ep3 USA patch enabler" @@ -7,7 +7,7 @@ .long_desc "" start: - // This script is identical to q88500-gc-e.bin.txt, except the addresses are + // This script is identical to q88530-gc-e.bin.txt, except the addresses are // changed to be suitable for US Ep3. leti r3, 0x80004000 @@ -45,5 +45,5 @@ copy_done: ret code: - .include_native q88500-gc.s + .include_native q8853x-gc.s code_end: diff --git a/system/quests/hidden/q88532-gc.dat b/system/quests/hidden/q88532-gc.dat new file mode 100755 index 0000000000000000000000000000000000000000..fbcbc148b8dc86c552a79225bddabb5bbe6c08a7 GIT binary patch literal 7 OcmWe-`0<~QfdK#sm;xIB literal 0 HcmV?d00001 diff --git a/system/quests/hidden/q88500-gc-g.bin.txt b/system/quests/hidden/q88533-gc-e.bin.txt similarity index 89% rename from system/quests/hidden/q88500-gc-g.bin.txt rename to system/quests/hidden/q88533-gc-e.bin.txt index 19f8cf12..fee921a8 100644 --- a/system/quests/hidden/q88500-gc-g.bin.txt +++ b/system/quests/hidden/q88533-gc-e.bin.txt @@ -1,5 +1,5 @@ .version GC_EP3 -.quest_num 88500 +.quest_num 88533 .language 1 .episode Episode1 .name "GC Ep3 EU patch enabler" @@ -7,7 +7,7 @@ .long_desc "" start: - // This script is identical to q88500-gc-e.bin.txt, except the addresses are + // This script is identical to q88530-gc-e.bin.txt, except the addresses are // changed to be suitable for EU Ep3. leti r3, 0x80004000 @@ -45,5 +45,5 @@ copy_done: ret code: - .include_native q88500-gc.s + .include_native q8853x-gc.s code_end: diff --git a/system/quests/hidden/q88533-gc.dat b/system/quests/hidden/q88533-gc.dat new file mode 100755 index 0000000000000000000000000000000000000000..fbcbc148b8dc86c552a79225bddabb5bbe6c08a7 GIT binary patch literal 7 OcmWe-`0<~QfdK#sm;xIB literal 0 HcmV?d00001 diff --git a/system/quests/hidden/q88500-gc.s b/system/quests/hidden/q8853x-gc.s similarity index 100% rename from system/quests/hidden/q88500-gc.s rename to system/quests/hidden/q8853x-gc.s diff --git a/tests/assemble-quest.test.sh b/tests/assemble-quest.test.sh index 73869f06..a5acb805 100755 --- a/tests/assemble-quest.test.sh +++ b/tests/assemble-quest.test.sh @@ -8,7 +8,7 @@ if [ -z "$EXECUTABLE" ]; then fi echo "... assemble system/quests/retrieval/q058-gc-e.bin.txt" -$EXECUTABLE assemble-quest-script system/quests/retrieval/q058-gc-e.bin.txt tests/q058-gc-e-test.bin +$EXECUTABLE assemble-quest-script --optimal system/quests/retrieval/q058-gc-e.bin.txt tests/q058-gc-e-test.bin diff tests/q058-gc-e-test.bin tests/q058-gc-e.bin echo "... clean up" diff --git a/tests/config.json b/tests/config.json index b5982a24..c0883e3d 100644 --- a/tests/config.json +++ b/tests/config.json @@ -49,7 +49,7 @@ "HTTPListen": [], "BannedIPV4Ranges": [], "Episode3BehaviorFlags": 0xFA, - "EnableSendFunctionCallQuestNumber": -1, + "EnableSendFunctionCallQuestNumbers": {}, "EnableV3V4ProtectedSubcommands": false, "Episode3InfiniteMeseta": false,