From 35630e0b054fea9eb4ba6abcf3596554551151b0 Mon Sep 17 00:00:00 2001 From: ashe27 <6131777@gmail.com> Date: Tue, 24 Nov 2026 12:33:03 +0800 Subject: [PATCH] Cheats: show every shrine and tower on the map, and travel to them The map draws a place's marker from the record's visit count, and travels to it from a flag bit the marker carries once the place was activated. Cheats > Map hooks three of those decisions: the count read (a never-visited shrine, tower, stable or lab reads as 1), the travel bit (kept on for the shrines, towers and labs) and the draw's colour check (the bit is hidden for places whose record still has count 0, so a tower the option shows keeps the icon a place that was never visited has). No game data is written: nothing is saved and no tower is activated, so the map fog stays as it is. Stables are shown but are not travel destinations, as in the game. --- docs/cheats-and-assists.md | 1 + runtime/control_settings.c | 2 +- runtime/game_sites.h | 5 ++- runtime/place_display.c | 75 +++++++++++++++++++++++++++++++++++++ runtime/place_display.h | 16 ++++++++ runtime/settings.c | 2 + runtime/settings.h | 1 + runtime/ui/i18n/de.inc | 2 + runtime/ui/i18n/es.inc | 2 + runtime/ui/i18n/fr.inc | 2 + runtime/ui/i18n/he.inc | 2 + runtime/ui/i18n/it.inc | 2 + runtime/ui/i18n/ja.inc | 2 + runtime/ui/i18n/ko.inc | 2 + runtime/ui/i18n/nl.inc | 2 + runtime/ui/i18n/pt.inc | 2 + runtime/ui/i18n/ru.inc | 2 + runtime/ui/i18n/th.inc | 2 + runtime/ui/i18n/zh-Hans.inc | 2 + runtime/ui/i18n/zh-Hant.inc | 2 + runtime/ui/menu.mm | 7 ++++ tools/game_sites.py | 17 +++++++++ tools/patches.py | 36 ++++++++++++++++++ 23 files changed, 186 insertions(+), 2 deletions(-) create mode 100644 runtime/place_display.c create mode 100644 runtime/place_display.h diff --git a/docs/cheats-and-assists.md b/docs/cheats-and-assists.md index a95eff957..7e3dc18e6 100644 --- a/docs/cheats-and-assists.md +++ b/docs/cheats-and-assists.md @@ -77,6 +77,7 @@ game is shipped with Savage Wind. | Free sprint out of combat | Sprinting on the ground takes no stamina while no enemy is fighting you. Once enemies start the battle music, sprinting costs stamina again until the music fades. Climbing, swimming, gliding and attacks cost stamina as usual. | | Item pickup multiplier | Multiplies the stackable items you pick up (materials, monster parts, arrows) by 2, 4 or 8, up to 999. | | Sure-footed horse | A running horse no longer stops dead and rears when it runs into something, even a small rock. It no longer stops at cliff edges either: mind where you ride. | +| Show shrines and towers | Shows every shrine, tower, stable and ancient lab on the map, and makes the shrines, towers and labs travel destinations (a stable is shown but never travelled to). Nothing is saved and no tower is activated, so the map fog stays as it is. | ## Teleport and console cheats diff --git a/runtime/control_settings.c b/runtime/control_settings.c index b03cc77d8..441d62cad 100644 --- a/runtime/control_settings.c +++ b/runtime/control_settings.c @@ -61,7 +61,7 @@ static const Setting settings[] = { {"color_lut", g_settings.color_lut, TEXT, 0, 0, NULL}, I(color_lut_strength, 0, 100, NULL), B(color_lut_set), B(no_weapon_wear), I(weapon_wear, WEAPON_WEAR_MIN, WEAPON_WEAR_MAX, NULL), B(infinite_arrows), - B(infinite_stamina), B(infinite_rupees), I(item_multiplier, 1, 8, NULL), B(free_sprint), B(sure_footed), I(weather, 0, WEATHER_COUNT - 1, + B(infinite_stamina), B(infinite_rupees), I(item_multiplier, 1, 8, NULL), B(free_sprint), B(sure_footed), B(show_all_places), I(weather, 0, WEATHER_COUNT - 1, "game|no_rain|no_storms|clear|cloudy|rain|heavy_rain|snow|heavy_snow|thunderstorm|thunder_rain|sun_shower"), B(god_mode), B(one_hit_kill), I(damage_taken, 25, 400, NULL), I(damage_dealt, 25, 400, NULL), I(text_language, 0, 0, NULL), I(voice_language, 0, 0, NULL), B(save_backups), B(stick_cam_on), I(stick_cam_x, STICK_CAM_MIN, STICK_CAM_MAX, NULL), diff --git a/runtime/game_sites.h b/runtime/game_sites.h index 41bdd8ff5..a73b00860 100644 --- a/runtime/game_sites.h +++ b/runtime/game_sites.h @@ -1,4 +1,4 @@ -// Addresses in the game's main module that the runtime reads or writes. They differ between game versions: +// Addresses in the game's main module that the runtime reads or writes. They differ between game versions: // tools/game_sites.py finds them for the version the game code was generated from, and the game library carries them // (runtime/gamelib.h, the generated layout.c). g_site holds them once the library is loaded (gamelib_load). #pragma once @@ -29,6 +29,9 @@ X(title_version_format) /* "Ver.%s": the title screen's version line */ \ X(player_info) /* uking::act::PlayerInfo * (test tools) */ \ X(world_mgr) /* ksys::world::Manager * (test tools, weather.c)*/ \ + X(place_count_read) /* the map marker update's count read (Cheats > Map, patches.py) */ \ + X(place_travel) /* the marker's travel bit (Cheats > Map, patches.py) */ \ + X(place_icon) /* the tower marker's colour decision (Cheats > Map, patches.py) */ \ X(main_data) /* main's .data (then .bss, up to main_end) */ \ X(main_end) diff --git a/runtime/place_display.c b/runtime/place_display.c new file mode 100644 index 000000000..30e8860a7 --- /dev/null +++ b/runtime/place_display.c @@ -0,0 +1,75 @@ +// Cheats > Map (runtime/place_display.h): shows every shrine, tower, stable and lab on the map, and makes the places it +// shows travel destinations. No game data is written: nothing is saved and no tower is activated, so the map fog stays +// as it is. +// +// Three decisions of the game's own marker logic are hooked: +// - the visit count a marker is drawn from (record +0x1c): a place that was never visited reads as 1 +// (patches.py _place_count_read), so the game marks and draws it itself. Only that read changes - the record in +// memory keeps its 0, so what the game records elsewhere (completion and the like) is untouched; +// - the travel bit of a marker's flags (marker +0x3c, bit 0x200): kept on for the places above (patches.py +// _place_travel), so they can be travelled to without being activated. Stables are left out: the game itself +// never travels to one; +// - the draw's colour decision (patches.py _place_icon): it tests that same travel bit, which is what makes a tower +// look activated. For a place whose record still has count 0 - travelable only because of this option - the bit is +// hidden from that read, so the marker keeps the look it has for a place that was never visited. +#include +#include +#include + +#include "place_display.h" +#include "rt.h" // GUEST_LO/GUEST_HI (guest addresses are the process's own addresses) +#include "settings.h" + +#define RECORD_NAME_OFF 0x10 +#define RECORD_COUNT_OFF 0x1c +#define MARKER_RECORD_OFF 0x58 +#define MARKER_TRAVEL_BIT 0x200u + +// The groups the option covers, by the place record's name (the record's name is a plain char * at +0x10). +static bool is_named(const char *name, const char *prefix, size_t len) { return strncmp(name, prefix, len) == 0; } +static bool is_shrine(const char *name) { return is_named(name, "Location_Dungeon", 16); } +static bool is_tower(const char *name) { return is_named(name, "Location_MapTower", 17); } +static bool is_stable(const char *name) { return is_named(name, "Location_", 9) && strstr(name, "Hatago") != NULL; } +static bool is_lab(const char *name) { return is_named(name, "Location_", 9) && strstr(name, "Labo") != NULL; } +// Shown: shrines, towers, stables and the ancient labs. Travelled to: the same except the stables. +static bool shown(const char *name) { + return name && (is_shrine(name) || is_tower(name) || is_stable(name) || is_lab(name)); +} +static bool travels(const char *name) { return shown(name) && !is_stable(name); } + +// The place record a marker belongs to, and its name; 0/NULL when this is not one of the map's markers. +static uint64_t marker_record(uint64_t marker) { + if (marker < GUEST_LO || marker >= GUEST_HI || (marker & 3)) return 0; + uint64_t record = *(volatile uint64_t *)(uintptr_t)(marker + MARKER_RECORD_OFF); + return record >= GUEST_LO && record < GUEST_HI ? record : 0; +} + +static const char *record_name(uint64_t record) { + if (record < GUEST_LO || record >= GUEST_HI) return NULL; + const char *name = *(const char *const volatile *)(uintptr_t)(record + RECORD_NAME_OFF); + return (uint64_t)(uintptr_t)name >= GUEST_LO && (uint64_t)(uintptr_t)name < GUEST_HI ? name : NULL; +} + +// The visit count the marker update reads for a place: never-visited places of the groups above read as visited. +uint32_t rt_place_count(uint64_t record, uint32_t count) { + if (!g_settings.show_all_places || count != 0 || record < GUEST_LO || record >= GUEST_HI) return count; + const char *name = record_name(record); + return shown(name) ? 1 : count; +} + +// The travel bit of a marker's flags, as the marker update computes it: kept on while the option is on. +uint32_t rt_place_travel(uint64_t marker, uint32_t bit) { + if (!g_settings.show_all_places) return bit; + const char *name = record_name(marker_record(marker)); + return travels(name) ? MARKER_TRAVEL_BIT : bit; +} + +// The draw's view of a marker's flags: the travel bit is hidden for places that are only travelable because of this +// option (their record still has count 0), so they keep the normal icon instead of the activated-looking one. +uint32_t rt_place_icon(uint64_t marker, uint32_t flags) { + if (!g_settings.show_all_places || !(flags & MARKER_TRAVEL_BIT)) return flags; + uint64_t record = marker_record(marker); + const char *name = record_name(record); + if (!travels(name)) return flags; + return *(volatile uint32_t *)(uintptr_t)(record + RECORD_COUNT_OFF) == 0 ? (flags & ~MARKER_TRAVEL_BIT) : flags; +} diff --git a/runtime/place_display.h b/runtime/place_display.h new file mode 100644 index 000000000..70557b5a1 --- /dev/null +++ b/runtime/place_display.h @@ -0,0 +1,16 @@ +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif +// Cheats > Map (runtime/place_display.c): shows every shrine, tower, stable and lab on the map, and makes the places it +// shows travel destinations, by hooking three decisions of the game's own marker logic. No game data is written: +// nothing is saved and no tower is activated, so the map fog stays as it is. +uint32_t rt_place_count(uint64_t record, uint32_t count); // the visit count a marker is drawn from +uint32_t rt_place_travel(uint64_t marker, uint32_t bit); // the travel bit (0x200) of a marker's flags +uint32_t rt_place_icon(uint64_t marker, uint32_t flags); // the draw's view of those flags (the icon's colour) +#ifdef __cplusplus +} +#endif diff --git a/runtime/settings.c b/runtime/settings.c index 3e9efadbf..15810df8a 100644 --- a/runtime/settings.c +++ b/runtime/settings.c @@ -627,6 +627,7 @@ void settings_load(void) { else if (!strcmp(key, "infinite_rupees")) g_settings.infinite_rupees = atoi(val) != 0; else if (!strcmp(key, "item_multiplier")) g_settings.item_multiplier = atoi(val); else if (!strcmp(key, "free_sprint")) g_settings.free_sprint = atoi(val) != 0; + else if (!strcmp(key, "show_all_places")) g_settings.show_all_places = atoi(val) != 0; else if (!strcmp(key, "sure_footed")) g_settings.sure_footed = atoi(val) != 0; else if (!strcmp(key, "weather")) { g_settings.weather = 0; @@ -910,6 +911,7 @@ bool settings_save_to(const char *path) { fprintf(f, "infinite_rupees = %d\n", g_settings.infinite_rupees); fprintf(f, "item_multiplier = %d\n", g_settings.item_multiplier); fprintf(f, "free_sprint = %d\n", g_settings.free_sprint); + fprintf(f, "show_all_places = %d\n", g_settings.show_all_places); fprintf(f, "sure_footed = %d\n", g_settings.sure_footed); int wx = g_settings.weather; fprintf(f, "weather = %s\n", g_weather_keys[wx >= 0 && wx < WEATHER_COUNT ? wx : 0]); diff --git a/runtime/settings.h b/runtime/settings.h index 8ddd3702c..889f71fed 100644 --- a/runtime/settings.h +++ b/runtime/settings.h @@ -226,6 +226,7 @@ typedef struct { int item_multiplier; // 1, 2, 4 or 8: multiply stackable item pickups (runtime/items.c) bool free_sprint; // sprinting takes no stamina while no enemy is fighting Link (runtime/free_sprint.c) bool sure_footed; // a running horse doesn't stop dead and rear when it hits something (runtime/sure_footed.c) + bool show_all_places; // every shrine, tower, lab and stable on the map (runtime/place_display.c) int weather; // WEATHER_COUNT: the game's, rain or thunderstorms kept out, or one weather held (weather.c) bool god_mode; // Link takes no damage bool one_hit_kill; // whatever else takes damage loses all its life at once diff --git a/runtime/ui/i18n/de.inc b/runtime/ui/i18n/de.inc index 9e5386972..023192f57 100644 --- a/runtime/ui/i18n/de.inc +++ b/runtime/ui/i18n/de.inc @@ -1261,3 +1261,5 @@ T("Downloading Intel XeSS", "Intel XeSS wird heruntergeladen") T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "Dynamisch: rendert die 3D-Szene kleiner, wenn Frames langsam sind, und wieder schärfer, wenn nicht; bleibt in voller Größe, wo das nichts bringt.") T("About mods", "Über Mods") T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "Mods stammen von anderen Leuten, nicht von Savage Wind. Wir prüfen, testen und unterstützen sie nicht und sind nicht verantwortlich für das, was sie tun, auch wenn sie das Spiel oder deine Spielstände beschädigen. Sichere deine Spielstände, bevor du einen ausprobierst, und schalte Mods aus, bevor du einen Fehler meldest: Eine Meldung zu einem Fehler, den ein Mod verursacht, wird sofort geschlossen. Savage-Wind-Versionen enthalten nie Mods; künftig empfehlen wir vielleicht einige, die gut mit Savage Wind laufen.") +T("Shows every shrine, tower, stable and ancient lab on the map, and makes the shrines, towers and labs travel destinations (a stable is shown but never travelled to). Nothing is saved and no tower is activated, so the map fog stays as it is.", "Zeigt alle Schreine, Türme, Ställe und antiken Labore auf der Karte und macht Schreine, Türme und Labore zu Reisezielen (ein Stall wird nur angezeigt). Nichts wird gespeichert und kein Turm aktiviert, der Nebel der Karte bleibt.") +T("Show shrines and towers", "Schreine und Türme anzeigen") diff --git a/runtime/ui/i18n/es.inc b/runtime/ui/i18n/es.inc index 7cfb7cbb7..720826d6d 100644 --- a/runtime/ui/i18n/es.inc +++ b/runtime/ui/i18n/es.inc @@ -1260,3 +1260,5 @@ T("Downloading Intel XeSS", "Descargando Intel XeSS") T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "Dinámico: renderiza la escena 3D más pequeña cuando los fotogramas van lentos y más nítida cuando no; se queda a tamaño completo donde eso no gana nada.") T("About mods", "Sobre los mods") T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "Los mods los hacen otras personas, no Savage Wind. No los revisamos, probamos ni damos soporte, y no nos hacemos responsables de lo que hagan, incluso si rompen el juego o tus partidas. Haz una copia de tus partidas antes de probar uno y desactiva los mods antes de reportar un error: un reporte de un error causado por un mod se cierra de inmediato. Las versiones de Savage Wind nunca incluyen mods; en el futuro quizá recomendemos algunos que funcionen bien con Savage Wind.") +T("Shows every shrine, tower, stable and ancient lab on the map, and makes the shrines, towers and labs travel destinations (a stable is shown but never travelled to). Nothing is saved and no tower is activated, so the map fog stays as it is.", "Muestra todos los santuarios, torres, establos y laboratorios antiguos en el mapa y permite viajar a santuarios, torres y laboratorios (un establo se muestra pero no es destino). No se guarda nada ni se activa ninguna torre: la niebla del mapa no cambia.") +T("Show shrines and towers", "Mostrar santuarios y torres") diff --git a/runtime/ui/i18n/fr.inc b/runtime/ui/i18n/fr.inc index 89adbc608..9884e03cf 100644 --- a/runtime/ui/i18n/fr.inc +++ b/runtime/ui/i18n/fr.inc @@ -1261,3 +1261,5 @@ T("Downloading Intel XeSS", "Téléchargement de Intel XeSS") T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "Dynamique : rend la scène 3D plus petite quand les images sont lentes, plus nette quand elles ne le sont pas ; reste en pleine taille là où ça n'apporte rien.") T("About mods", "À propos des mods") T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "Les mods sont faits par d'autres personnes, pas par Savage Wind. Nous ne les vérifions pas, ne les testons pas et ne les prenons pas en charge, et nous ne sommes pas responsables de ce qu'ils font, y compris s'ils cassent le jeu ou vos sauvegardes. Sauvegardez vos parties avant d'en essayer un, et désactivez les mods avant de signaler un bug : le signalement d'un bug causé par un mod est fermé immédiatement. Les versions de Savage Wind n'incluent jamais de mods ; à l'avenir, nous pourrons en recommander certains qui fonctionnent bien avec Savage Wind.") +T("Shows every shrine, tower, stable and ancient lab on the map, and makes the shrines, towers and labs travel destinations (a stable is shown but never travelled to). Nothing is saved and no tower is activated, so the map fog stays as it is.", "Affiche tous les sanctuaires, tours, relais et laboratoires antiques sur la carte et rend les sanctuaires, tours et laboratoires accessibles en voyage (un relais est affiché mais pas desservi). Rien n'est sauvegardé et aucune tour n'est activée : la brume de la carte reste.") +T("Show shrines and towers", "Afficher sanctuaires et tours") diff --git a/runtime/ui/i18n/he.inc b/runtime/ui/i18n/he.inc index d23da92b4..355ebd08f 100644 --- a/runtime/ui/i18n/he.inc +++ b/runtime/ui/i18n/he.inc @@ -1260,3 +1260,5 @@ T("Downloading Intel XeSS", "מוריד את Intel XeSS") T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "דינמי: מרנדר את סצנת ה-3D קטנה יותר כשהפריימים איטיים וחדה יותר כשלא; נשארת בגודל מלא כשאין בכך תועלת.") T("About mods", "על מודים") T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "המודים נוצרים על ידי אנשים אחרים, לא על ידי Savage Wind. איננו בודקים, מנסים או תומכים בהם, ואיננו אחראים למה שהם עושים, כולל אם הם שוברים את המשחק או את השמירות שלך. גבה את השמירות לפני שאתה מנסה מוד, וכבה את המודים לפני דיווח על באג: דיווח על באג שנגרם על ידי מוד ייסגר מיד. גרסאות Savage Wind לעולם אינן כוללות מודים; בעתיד אולי נמליץ על כמה שעובדים טוב עם Savage Wind.") +T("Shows every shrine, tower, stable and ancient lab on the map, and makes the shrines, towers and labs travel destinations (a stable is shown but never travelled to). Nothing is saved and no tower is activated, so the map fog stays as it is.", "מציג במפה את כל המקדשים, המגדלים, האורוות והמעבדות העתיקות ומאפשר מעבר אל מקדשים, מגדלים ומעבדות (אורווה רק מוצגת). שום דבר לא נשמר ואף מגדל לא מופעל, ולכן ערף המפה נשאר כפי שהוא.") +T("Show shrines and towers", "הצג מקדשים ומגדלים") diff --git a/runtime/ui/i18n/it.inc b/runtime/ui/i18n/it.inc index 075f46d38..c1275586e 100644 --- a/runtime/ui/i18n/it.inc +++ b/runtime/ui/i18n/it.inc @@ -1261,3 +1261,5 @@ T("Downloading Intel XeSS", "Download di Intel XeSS") T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "Dinamico: rende la scena 3D più piccola quando i frame sono lenti, più nitida quando non lo sono; resta a piena dimensione dove non serve.") T("About mods", "Informazioni sulle mod") T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "Le mod sono fatte da altre persone, non da Savage Wind. Non le controlliamo, non le testiamo e non le supportiamo, e non siamo responsabili di ciò che fanno, anche se rompono il gioco o i tuoi salvataggi. Fai una copia dei salvataggi prima di provarne una e disattiva le mod prima di segnalare un bug: la segnalazione di un bug causato da una mod viene chiusa subito. Le versioni di Savage Wind non includono mai mod; in futuro potremmo consigliarne alcune che funzionano bene con Savage Wind.") +T("Shows every shrine, tower, stable and ancient lab on the map, and makes the shrines, towers and labs travel destinations (a stable is shown but never travelled to). Nothing is saved and no tower is activated, so the map fog stays as it is.", "Mostra tutti i santuari, le torri, le stalle e i laboratori antichi sulla mappa e rende santuari, torri e laboratori mete di viaggio (una stalla è solo mostrata). Nulla viene salvato e nessuna torre viene attivata: la nebbia della mappa resta com'è.") +T("Show shrines and towers", "Mostra santuari e torri") diff --git a/runtime/ui/i18n/ja.inc b/runtime/ui/i18n/ja.inc index 7f8bed7e3..d9b50eb84 100644 --- a/runtime/ui/i18n/ja.inc +++ b/runtime/ui/i18n/ja.inc @@ -1261,3 +1261,5 @@ T("Downloading Intel XeSS", "Intel XeSS をダウンロード中") T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "動的:フレームが遅いときは 3D シーンを小さく、速いときは鮮明にレンダリングします。効果がない環境ではフルサイズのままです。") T("About mods", "MOD について") T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "MOD は Savage Wind ではなく、ほかの人が作ったものです。私たちは MOD の確認・テスト・サポートを行わず、ゲームやセーブデータが壊れた場合も含め、MOD の動作について責任を負いません。試す前にセーブデータをバックアップし、不具合を報告する前には MOD をオフにしてください。MOD が原因の不具合の報告はすぐにクローズされます。Savage Wind のリリースに MOD が含まれることはありません。今後、Savage Wind でよく動く MOD を紹介することはあるかもしれません。") +T("Shows every shrine, tower, stable and ancient lab on the map, and makes the shrines, towers and labs travel destinations (a stable is shown but never travelled to). Nothing is saved and no tower is activated, so the map fog stays as it is.", "マップにすべての祠・塔・馬宿・古代研究所を表示し、祠・塔・研究所へはワープできます(馬宿は表示のみ)。セーブは書き換えず、塔も起動しないため、マップの霧はそのままです。") +T("Show shrines and towers", "祠と塔を表示") diff --git a/runtime/ui/i18n/ko.inc b/runtime/ui/i18n/ko.inc index 18346ad05..6e3bcf7cd 100644 --- a/runtime/ui/i18n/ko.inc +++ b/runtime/ui/i18n/ko.inc @@ -1261,3 +1261,5 @@ T("Downloading Intel XeSS", "Intel XeSS 다운로드 중") T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "동적: 프레임이 느릴 때 3D 장면을 더 작게, 빠를 때 더 선명하게 렌더링합니다. 이득이 없는 환경에서는 전체 크기를 유지합니다.") T("About mods", "모드 안내") T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "모드는 Savage Wind가 아니라 다른 사람들이 만든 것입니다. 저희는 모드를 확인하거나 테스트하거나 지원하지 않으며, 게임이나 세이브가 망가지는 경우를 포함해 모드가 하는 일에 책임지지 않습니다. 모드를 써 보기 전에 세이브를 백업하고, 버그를 신고하기 전에는 모드를 꺼 주세요. 모드 때문에 생긴 버그 신고는 바로 닫힙니다. Savage Wind 릴리스에는 모드가 포함되지 않습니다. 앞으로 Savage Wind에서 잘 작동하는 모드를 추천할 수는 있습니다.") +T("Shows every shrine, tower, stable and ancient lab on the map, and makes the shrines, towers and labs travel destinations (a stable is shown but never travelled to). Nothing is saved and no tower is activated, so the map fog stays as it is.", "지도에 모든 사당·탑·마구간·고대 연구소를 표시하고 사당·탑·연구소로 이동할 수 있습니다(마구간은 표시만). 저장되지 않고 탑도 활성화되지 않아 지도 안개는 그대로입니다.") +T("Show shrines and towers", "사당과 탑 표시") diff --git a/runtime/ui/i18n/nl.inc b/runtime/ui/i18n/nl.inc index 36361d27e..979e262d9 100644 --- a/runtime/ui/i18n/nl.inc +++ b/runtime/ui/i18n/nl.inc @@ -1261,3 +1261,5 @@ T("Downloading Intel XeSS", "Intel XeSS wordt gedownload") T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "Dynamisch: rendert de 3D-scène kleiner als frames traag zijn, scherper als dat niet zo is; blijft op volle grootte waar het niets oplevert.") T("About mods", "Over mods") T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "Mods worden door anderen gemaakt, niet door Savage Wind. We controleren, testen en ondersteunen ze niet en zijn niet verantwoordelijk voor wat ze doen, ook niet als ze het spel of je saves breken. Maak een back-up van je saves voordat je er een probeert, en zet mods uit voordat je een bug meldt: een melding van een bug die een mod veroorzaakt, wordt meteen gesloten. Savage Wind-releases bevatten nooit mods; in de toekomst raden we misschien een paar aan die goed werken met Savage Wind.") +T("Shows every shrine, tower, stable and ancient lab on the map, and makes the shrines, towers and labs travel destinations (a stable is shown but never travelled to). Nothing is saved and no tower is activated, so the map fog stays as it is.", "Toont alle schrijnen, torens, stallen en oude laboratoria op de kaart en maakt schrijnen, torens en laboratoria reisbestemmingen (een stal wordt alleen getoond). Niets wordt opgeslagen en geen toren wordt geactiveerd, dus de mist op de kaart blijft.") +T("Show shrines and towers", "Schrijnen en torens tonen") diff --git a/runtime/ui/i18n/pt.inc b/runtime/ui/i18n/pt.inc index b63277b21..b1a7b4629 100644 --- a/runtime/ui/i18n/pt.inc +++ b/runtime/ui/i18n/pt.inc @@ -1261,3 +1261,5 @@ T("Downloading Intel XeSS", "Baixando Intel XeSS") T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "Dinâmico: renderiza a cena 3D menor quando os quadros ficam lentos e mais nítida quando não; mantém o tamanho cheio onde isso não ganha nada.") T("About mods", "Sobre os mods") T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "Os mods são feitos por outras pessoas, não pelo Savage Wind. Não os verificamos, testamos nem damos suporte, e não somos responsáveis pelo que fazem, incluindo se estragarem o jogo ou os seus saves. Faça uma cópia dos seus saves antes de experimentar um e desative os mods antes de reportar um erro: um relatório de um erro causado por um mod é fechado de imediato. As versões do Savage Wind nunca incluem mods; no futuro talvez recomendemos alguns que funcionem bem com o Savage Wind.") +T("Shows every shrine, tower, stable and ancient lab on the map, and makes the shrines, towers and labs travel destinations (a stable is shown but never travelled to). Nothing is saved and no tower is activated, so the map fog stays as it is.", "Mostra todos os santuários, torres, estábulos e laboratórios antigos no mapa e torna santuários, torres e laboratórios destinos de viagem (um estábulo é mostrado mas não é destino). Nada é gravado e nenhuma torre é ativada, por isso o nevoeiro do mapa mantém-se.") +T("Show shrines and towers", "Mostrar santuários e torres") diff --git a/runtime/ui/i18n/ru.inc b/runtime/ui/i18n/ru.inc index e1c0c123f..5c53b5ba3 100644 --- a/runtime/ui/i18n/ru.inc +++ b/runtime/ui/i18n/ru.inc @@ -1261,3 +1261,5 @@ T("Downloading Intel XeSS", "Загрузка Intel XeSS") T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "Динамический: рендерит 3D-сцену меньше, когда кадры идут медленно, и резче, когда нет; остаётся в полном размере там, где это ничего не даёт.") T("About mods", "О модах") T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "Моды делают другие люди, а не Savage Wind. Мы их не проверяем, не тестируем и не поддерживаем и не отвечаем за то, что они делают, в том числе если они ломают игру или ваши сохранения. Сделайте копию сохранений, прежде чем пробовать мод, и выключите моды, прежде чем сообщать об ошибке: сообщение об ошибке, которую вызвал мод, сразу закрывается. Релизы Savage Wind никогда не включают моды; в будущем мы, возможно, порекомендуем некоторые, которые хорошо работают с Savage Wind.") +T("Shows every shrine, tower, stable and ancient lab on the map, and makes the shrines, towers and labs travel destinations (a stable is shown but never travelled to). Nothing is saved and no tower is activated, so the map fog stays as it is.", "Показывает на карте все святилища, башни, конюшни и древние лаборатории и позволяет перемещаться к святилищам, башням и лабораториям (конюшня только показывается). Ничего не сохраняется, башни не активируются — туман на карте остаётся.") +T("Show shrines and towers", "Показать святилища и башни") diff --git a/runtime/ui/i18n/th.inc b/runtime/ui/i18n/th.inc index 0dc5f99c1..0f3d8b5c6 100644 --- a/runtime/ui/i18n/th.inc +++ b/runtime/ui/i18n/th.inc @@ -1261,3 +1261,5 @@ T("Downloading Intel XeSS", "กำลังดาวน์โหลด Intel Xe T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "ไดนามิก: เรนเดอร์ฉาก 3D เล็กลงเมื่อเฟรมช้า และคมขึ้นเมื่อเร็ว คงขนาดเต็มเมื่อไม่ได้ประโยชน์") T("About mods", "เกี่ยวกับม็อด") T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "ม็อดสร้างโดยผู้อื่น ไม่ใช่ Savage Wind เราไม่ได้ตรวจสอบ ทดสอบ หรือดูแลม็อด และไม่รับผิดชอบต่อสิ่งที่ม็อดทำ รวมถึงหากม็อดทำให้เกมหรือเซฟเสียหาย สำรองเซฟก่อนลองม็อด และปิดม็อดก่อนรายงานบั๊ก รายงานบั๊กที่เกิดจากม็อดจะถูกปิดทันที รุ่นเผยแพร่ของ Savage Wind จะไม่รวมม็อดใด ๆ ในอนาคตเราอาจแนะนำม็อดบางตัวที่เล่นกับ Savage Wind ได้ดี") +T("Shows every shrine, tower, stable and ancient lab on the map, and makes the shrines, towers and labs travel destinations (a stable is shown but never travelled to). Nothing is saved and no tower is activated, so the map fog stays as it is.", "แสดงศาลเจ้า หอคอย คอกม้า และห้องแล็บโบราณทั้งหมดบนแผนที่ และทำให้ศาลเจ้า หอคอย และห้องแล็บเป็นจุดเดินทาง (คอกม้าแสดงแต่เดินทางไปไม่ได้) ไม่มีการบันทึกและไม่เปิดใช้งานหอคอย หมอกบนแผนที่จึงคงเดิม") +T("Show shrines and towers", "แสดงศาลเจ้าและหอคอย") diff --git a/runtime/ui/i18n/zh-Hans.inc b/runtime/ui/i18n/zh-Hans.inc index 5022f2c0b..a9b63e5e6 100644 --- a/runtime/ui/i18n/zh-Hans.inc +++ b/runtime/ui/i18n/zh-Hans.inc @@ -1261,3 +1261,5 @@ T("Downloading Intel XeSS", "正在下载 Intel XeSS") T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "动态:帧率低时缩小 3D 场景,帧率够时恢复清晰;降档无收益的环境保持原生尺寸。") T("About mods", "关于模组") T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "模组由其他人制作,而非 Savage Wind。我们不检查、不测试也不支持模组,对模组造成的任何后果概不负责,包括游戏或存档损坏。试用模组前请备份存档,报告错误前请先关闭模组;由模组导致的错误报告会被立即关闭。Savage Wind 的发布版本绝不包含模组;将来我们可能会推荐一些与 Savage Wind 配合良好的模组。") +T("Shows every shrine, tower, stable and ancient lab on the map, and makes the shrines, towers and labs travel destinations (a stable is shown but never travelled to). Nothing is saved and no tower is activated, so the map fog stays as it is.", "在地图上显示所有神庙、塔、驿站和古代研究所;神庙、塔和研究所可直接传送(驿站只显示,不可传送)。不写入存档、不激活塔,地图迷雾保持不变。") +T("Show shrines and towers", "显示神庙与塔") diff --git a/runtime/ui/i18n/zh-Hant.inc b/runtime/ui/i18n/zh-Hant.inc index e36752bc0..ef43f6962 100644 --- a/runtime/ui/i18n/zh-Hant.inc +++ b/runtime/ui/i18n/zh-Hant.inc @@ -1261,3 +1261,5 @@ T("Downloading Intel XeSS", "正在下載 Intel XeSS") T("Dynamic: renders the 3D scene smaller when frames are slow, sharper when they aren't; stays full size where that gains nothing.", "動態:幀率低時縮小 3D 場景,幀率足夠時恢復清晰;降檔無收益的環境保持原生尺寸。") T("About mods", "關於模組") T("Mods are made by other people, not by Savage Wind. We don't check, test or support them, and we aren't responsible for what they do, including if they break the game or your saves. Back up your saves before trying one, and turn mods off before reporting a bug: a report of a bug a mod causes is closed right away. Savage Wind releases never include mods; in the future we may suggest some we've found to play well with Savage Wind.", "模組由其他人製作,而非 Savage Wind。我們不檢查、不測試也不支援模組,對模組造成的任何後果概不負責,包括遊戲或存檔損壞。試用模組前請備份存檔,回報錯誤前請先關閉模組;由模組導致的錯誤回報會被立即關閉。Savage Wind 的發行版本絕不包含模組;將來我們可能會推薦一些與 Savage Wind 搭配良好的模組。") +T("Shows every shrine, tower, stable and ancient lab on the map, and makes the shrines, towers and labs travel destinations (a stable is shown but never travelled to). Nothing is saved and no tower is activated, so the map fog stays as it is.", "在地圖上顯示所有神廟、塔、驛站和古代研究所;神廟、塔和研究所可直接傳送(驛站只顯示,不可傳送)。不寫入存檔、不啟用塔,地圖迷霧保持不變。") +T("Show shrines and towers", "顯示神廟與塔") diff --git a/runtime/ui/menu.mm b/runtime/ui/menu.mm index 0f3df0ef5..9af4e83a7 100644 --- a/runtime/ui/menu.mm +++ b/runtime/ui/menu.mm @@ -14,6 +14,7 @@ #include #include "i18n.h" +#include "../place_display.h" #include "quick_hint_font.h" #include "imgui.h" #include "gyro_drag.h" @@ -1450,6 +1451,12 @@ static void cheats_options(void) { heart_buf[0] = 0; } } + { // every place the map has a marker for (runtime/place_display.c: its count, travel bit and colour) + opt_toggle("Show shrines and towers", &g_settings.show_all_places, false, + "Shows every shrine, tower, stable and ancient lab on the map, and makes the shrines, towers and " + "labs travel destinations (a stable is shown but never travelled to). Nothing is saved and no " + "tower is activated, so the map fog stays as it is."); + } static const char *const weather[WEATHER_COUNT] = {"Automatic", "No rain", "No thunderstorms", "Clear", "Cloudy", "Rain", "Heavy rain", "Snow", "Heavy snow", "Thunderstorm", "Thunder rain", "Rain in sunshine"}; // (settings.h weather) diff --git a/tools/game_sites.py b/tools/game_sites.py index 5ef248299..5ecda482e 100644 --- a/tools/game_sites.py +++ b/tools/game_sites.py @@ -443,6 +443,20 @@ Site('replace_toast_tail_b', 'code', 'aa1303e0 52800021 94000000/fc000000 aa1303e0 a9414ff4 a8c27bfd 14000000/fc000000', 6), Site('replace_ui_draw_native', 'code', '39440008 7100011f 39440809 3943f80a 3943fc0b 7a401920 7a400944 7a421964', 0), Site('replace_full_info_call', 'code', '91238108 90000009/9f00001f 91000129/ffc003ff f9000268 90000008/9f00001f 91000108/ffc003ff 91004129 a9022269 f9400bf3 a8c27bfd d65f03c0 90000008/9f00001f 91000108/ffc003ff 91004108 f8010408 14000000/fc000000 a9be7bfd f9000bf3 910003fd 90000008/9f00001f aa0003f3 f9400108/ffc003ff 91004108 f8010408 94000000/fc000000 aa1303e0 f9400bf3 a8c27bfd 14000000/fc000000 52800020 d65f03c0 a9bf7bfd 910003fd 91008000 94000000/fc000000', 34), + # The read of the record's visit count in the marker update (1.9.0 0x7000d7bea4): the map draws a place's marker + # from it, so Cheats > Map reads it as 1 for the places it covers (patches.py _place_count_read) - the count in + # memory is not touched, the game marks and draws the place itself. + Site('place_count_read', 'code', 'b9401d08 7100011f b9403c09 1211012b 120f7929 b9006008 1a9fd7ea 4a4b3d4c', 0), + # The travel bit of a place marker (1.9.0 0x7000d7b904): the update computes a marker's flags - 0x400 for its + # state and 0x200 for "the map may travel here". Cheats > Map replaces the 0x200 select (patches.py + # _place_travel), so a place the option shows is a travel destination without being activated - no tower + # activated, so the map fog stays. + Site('place_travel', 'code', '1a9f116b 2a0b0108 2a0a0108 b9003c08 37000009/fff8001f d65f03c0 a9bd7bfd a90157f6', 0), + # The tower marker's colour decision (1.9.0 0x7000dac488): the map's marker draw reads the marker's flags and + # tests the travel bit (0x200) - that test is what draws a tower the option made warpable as an activated one. + # Cheats > Map hooks the read (patches.py _place_icon) and clears the bit for places that were never visited, + # so they keep the normal look while staying travel destinations. + Site('place_icon', 'code', 'b9403e68 7217011f f9406121 a9414ff4 1e200c20 a8c27bfd d61f0020 a9414ff4', 0), Site('main_data', 'data', '', 0), Site('main_end', 'end', '', 0), ] @@ -734,6 +748,9 @@ 'item_tick': 0x7000cc4c3c, 'pouch_item_get': 0x7000d921bc, 'pouch_mgr': 0x7001e18570, + 'place_count_read': 0x7000d7bea4, + 'place_travel': 0x7000d7b904, + 'place_icon': 0x7000dac488, 'main_data': 0x7001b7a000, 'main_end': 0x7001e98000, }, diff --git a/tools/patches.py b/tools/patches.py index 2f13427ae..cfdd70b99 100644 --- a/tools/patches.py +++ b/tools/patches.py @@ -1180,6 +1180,39 @@ def _tp_gate(gen, a): f' /* {a:#x}: sub sp, sp, #0xa0 (is the ground around Link still loading?) */') +# The read the whole marker update is built on: the record's visit count. With the option on it reads as 1 for a place +# never visited, so the game marks it as visited itself and draws its marker - no game data is written at all. The +# record pointer goes along so the runtime can leave everything that is not a shrine, tower, stable or lab alone. +def _place_count_read(gen, a): + assert _word(gen, a) == 0xb9401d08, hex(_word(gen, a)) # ldr w8, [x8, #0x1c] + return ('{ extern uint32_t rt_place_count(uint64_t, uint32_t); ' + 'c->x[8] = rt_place_count(c->x[8], LD32(c->x[8] + 0x1c)); }' + f' /* {a:#x}: ldr w8, [x8, #0x1c] (map markers: Cheats > Map) */') + + +# The travel bit of a place marker: the update computes a marker's flags with 0x400 for its state and 0x200 for "the +# map may travel here". Cheats > Map replaces that select: a place the option shows is a travel destination without +# being activated, which is also what leaves the map fog alone (activating a tower is what reveals its region). The +# original select is kept for everything the option does not cover. +def _place_travel(gen, a): + assert _word(gen, a) == 0x1a9f116b, hex(_word(gen, a)) # csel w11, w11, wzr, ne + return ('{ extern uint32_t rt_place_travel(uint64_t, uint32_t); ' + 'c->x[11] = ((c->x[1] & 1u) ? (uint32_t)c->x[11] : 0u); ' + 'c->x[11] = rt_place_travel(c->x[0], (uint32_t)c->x[11]); }' + f' /* {a:#x}: csel w11, w11, wzr, ne (map markers: Cheats > Map) */') + + +# The marker draw's colour decision: it reads the marker's flags and tests the travel bit (0x200) - a marker the +# option made travelable would be drawn as an activated tower. For a place that was never visited (its record's count +# is still 0 in memory), the bit is cleared for this read only, so the marker keeps its normal look while the travel +# point stays in the flags. +def _place_icon(gen, a): + assert _word(gen, a) == 0xb9403e68, hex(_word(gen, a)) # ldr w8, [x19, #0x3c] + return ('{ extern uint32_t rt_place_icon(uint64_t, uint32_t); ' + 'c->x[8] = rt_place_icon(c->x[19], LD32(c->x[19] + 0x3c)); }' + f' /* {a:#x}: ldr w8, [x19, #0x3c] (map markers: Cheats > Map) */') + + PATCHES = { 'ui_layout_draw': _ui_layout_draw, 'ui_layout_pane': _ui_layout_pane, @@ -1312,6 +1345,9 @@ def _tp_gate(gen, a): 'horse_crash': _horse_crash, 'horse_look_ahead': _horse_look_ahead, 'item_tick': _item_tick, + 'place_count_read': _place_count_read, + 'place_travel': _place_travel, + 'place_icon': _place_icon, }