summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakaRikka <38417346+TakaRikka@users.noreply.github.com>2021-02-24 22:25:40 -0800
committerGitHub <noreply@github.com>2021-02-25 01:25:40 -0500
commitae9ac84cf9c05ff7eb88e609f5e55d707c31e217 (patch)
tree02564df4ceb35ef7660751253e939b113682230f
parentd24f2528b8ffdf5cbae09de2ce3c727cafec952c (diff)
basic flag logger / add all dungeons saves (#41)
* basic flag logger to fifo queue * fix * add 'set savefile location' setting * add all dungeons saves * lower case for consistency * update readme * fix * clang * dumb * clang * add 'swap equips' setting swaps x/y button equips for GCN. wii needs discussion about how to handle * clang
-rw-r--r--README.md5
-rw-r--r--RomHack-template.toml50
-rw-r--r--external/misc/ad.py114
-rw-r--r--include/flaglog.h9
-rw-r--r--include/gz_flags.h4
-rw-r--r--include/menu.h4
-rw-r--r--include/menus/ad_saves_menu.h62
-rw-r--r--include/menus/flags_menu.h7
-rw-r--r--include/menus/practice_menu.h1
-rw-r--r--include/menus/settings_menu.h2
-rw-r--r--include/menus/warping_menu.h3
-rw-r--r--res/save_files/ad.binbin0 -> 3920 bytes
-rw-r--r--res/save_files/ad/aeralfos.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/ag.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/argorok.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/beast_ganon.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/bk_skip.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/blizzeta.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/city1.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/city2.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/dangoro.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/darkhammer.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/darknut.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/deathsword.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/deku_toad.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/diababa.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/dot_skip.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/early_ele.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/early_platform.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/eldin_twilight.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/ems.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/faron_boost.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/faron_twilight.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/forest2.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/forest_bit.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/forest_escape.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/gm.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/goats.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/grove2.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/hc.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/horseback.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/hugo.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/karg_flight.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/lakebed1.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/lanayru_twilight.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/mdh.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/morpheel.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/mountain.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/ordon_gate_clip.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/palace1.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/palace2.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/pillar_clip.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/poe_skip.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/post_lanayru.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/purple_mist.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/silver_rupee.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/spr1.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/spr_boost.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/stallord.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/tot.binbin0 -> 2700 bytes
-rw-r--r--res/save_files/ad/zant.binbin0 -> 2700 bytes
-rw-r--r--src/flaglog.cpp58
-rw-r--r--src/gz_flags.cpp2
-rw-r--r--src/menu.cpp3
-rw-r--r--src/menus/ad_saves_menu.cpp166
-rw-r--r--src/menus/flag_log_menu.cpp41
-rw-r--r--src/menus/flag_records_menu.cpp6
-rw-r--r--src/menus/flags_menu.cpp9
-rw-r--r--src/menus/practice_menu.cpp9
-rw-r--r--src/menus/settings_menu.cpp11
-rw-r--r--src/menus/warping_menu.cpp10
-rw-r--r--src/save_injector.cpp14
72 files changed, 573 insertions, 17 deletions
diff --git a/README.md b/README.md
index 8dc6de0..a0cf284 100644
--- a/README.md
+++ b/README.md
@@ -35,6 +35,7 @@ flags menu:
- dungeon flags // Toggle various dungeon flags
- portal flags // Toggle warp portal flags
- temp flags // Toggle local temporary flags
+- flag log // Toggle logging flag changes*
general flags menu:
- boss flag // Set the boss flag value. Press A to lock the value
@@ -67,7 +68,7 @@ memory menu:
- editor // Browse and edit the memory
practice menu:
-- Load practice files* (supports popular Any% and 100% locations)
+- Load practice files* (supports popular Any%, 100%, and All Dungeons locations)
scene menu:
- disable bg music* // Disables background and enemy music
@@ -113,6 +114,7 @@ warping menu:
- spawn // Select Link spawnpoint ID
- layer // Select stage layer (leave as default unless necessary)
- warp // Load selected stage info
+- save // Set savefile location to selected location (need to be in pause menu)
```
### Known Issues
@@ -121,6 +123,7 @@ warping menu:
- disabled bg music tool may not always disable bg music
- loading practice files can crash in certain situations
- using move link tool, link is stuck to the ground unless entering a falling state
+- some flags not logged by flag logger yet
```
### Planned Features
diff --git a/RomHack-template.toml b/RomHack-template.toml
index 536f316..447d28b 100644
--- a/RomHack-template.toml
+++ b/RomHack-template.toml
@@ -162,6 +162,56 @@ libs = ["tpgz.a", "external/libtp_c/libtp_c.a", "external/gcn_c/gcn_c.a"]
"tpgz/save_files/hundo/coo_30.bin" = "res/save_files/hundo/coo_30.bin"
"tpgz/save_files/hundo/cats.bin" = "res/save_files/hundo/cats.bin"
"tpgz/save_files/hundo/hc_darknut.bin" = "res/save_files/hundo/hc_darknut.bin"
+"tpgz/save_files/ad.bin" = "res/save_files/ad.bin"
+"tpgz/save_files/ad/ordon_gate_clip.bin" = "res/save_files/ad/ordon_gate_clip.bin"
+"tpgz/save_files/ad/goats.bin" = "res/save_files/ad/goats.bin"
+"tpgz/save_files/ad/hugo.bin" = "res/save_files/ad/hugo.bin"
+"tpgz/save_files/ad/faron_twilight.bin" = "res/save_files/ad/faron_twilight.bin"
+"tpgz/save_files/ad/ems.bin" = "res/save_files/ad/ems.bin"
+"tpgz/save_files/ad/purple_mist.bin" = "res/save_files/ad/purple_mist.bin"
+"tpgz/save_files/ad/forest_bit.bin" = "res/save_files/ad/forest_bit.bin"
+"tpgz/save_files/ad/forest_escape.bin" = "res/save_files/ad/forest_escape.bin"
+"tpgz/save_files/ad/pillar_clip.bin" = "res/save_files/ad/pillar_clip.bin"
+"tpgz/save_files/ad/lakebed1.bin" = "res/save_files/ad/lakebed1.bin"
+"tpgz/save_files/ad/deku_toad.bin" = "res/save_files/ad/deku_toad.bin"
+"tpgz/save_files/ad/karg_flight.bin" = "res/save_files/ad/karg_flight.bin"
+"tpgz/save_files/ad/forest2.bin" = "res/save_files/ad/forest2.bin"
+"tpgz/save_files/ad/diababa.bin" = "res/save_files/ad/diababa.bin"
+"tpgz/save_files/ad/eldin_twilight.bin" = "res/save_files/ad/eldin_twilight.bin"
+"tpgz/save_files/ad/lanayru_twilight.bin" = "res/save_files/ad/lanayru_twilight.bin"
+"tpgz/save_files/ad/post_lanayru.bin" = "res/save_files/ad/post_lanayru.bin"
+"tpgz/save_files/ad/bk_skip.bin" = "res/save_files/ad/bk_skip.bin"
+"tpgz/save_files/ad/morpheel.bin" = "res/save_files/ad/morpheel.bin"
+"tpgz/save_files/ad/mdh.bin" = "res/save_files/ad/mdh.bin"
+"tpgz/save_files/ad/mountain.bin" = "res/save_files/ad/mountain.bin"
+"tpgz/save_files/ad/spr1.bin" = "res/save_files/ad/spr1.bin"
+"tpgz/save_files/ad/darkhammer.bin" = "res/save_files/ad/darkhammer.bin"
+"tpgz/save_files/ad/spr_boost.bin" = "res/save_files/ad/spr_boost.bin"
+"tpgz/save_files/ad/blizzeta.bin" = "res/save_files/ad/blizzeta.bin"
+"tpgz/save_files/ad/ag.bin" = "res/save_files/ad/ag.bin"
+"tpgz/save_files/ad/poe_skip.bin" = "res/save_files/ad/poe_skip.bin"
+"tpgz/save_files/ad/deathsword.bin" = "res/save_files/ad/deathsword.bin"
+"tpgz/save_files/ad/stallord.bin" = "res/save_files/ad/stallord.bin"
+"tpgz/save_files/ad/early_ele.bin" = "res/save_files/ad/early_ele.bin"
+"tpgz/save_files/ad/gm.bin" = "res/save_files/ad/gm.bin"
+"tpgz/save_files/ad/dangoro.bin" = "res/save_files/ad/dangoro.bin"
+"tpgz/save_files/ad/silver_rupee.bin" = "res/save_files/ad/silver_rupee.bin"
+"tpgz/save_files/ad/city1.bin" = "res/save_files/ad/city1.bin"
+"tpgz/save_files/ad/aeralfos.bin" = "res/save_files/ad/aeralfos.bin"
+"tpgz/save_files/ad/city2.bin" = "res/save_files/ad/city2.bin"
+"tpgz/save_files/ad/argorok.bin" = "res/save_files/ad/argorok.bin"
+"tpgz/save_files/ad/faron_boost.bin" = "res/save_files/ad/faron_boost.bin"
+"tpgz/save_files/ad/grove2.bin" = "res/save_files/ad/grove2.bin"
+"tpgz/save_files/ad/tot.bin" = "res/save_files/ad/tot.bin"
+"tpgz/save_files/ad/darknut.bin" = "res/save_files/ad/darknut.bin"
+"tpgz/save_files/ad/dot_skip.bin" = "res/save_files/ad/dot_skip.bin"
+"tpgz/save_files/ad/palace1.bin" = "res/save_files/ad/palace1.bin"
+"tpgz/save_files/ad/palace2.bin" = "res/save_files/ad/palace2.bin"
+"tpgz/save_files/ad/early_platform.bin" = "res/save_files/ad/early_platform.bin"
+"tpgz/save_files/ad/zant.bin" = "res/save_files/ad/zant.bin"
+"tpgz/save_files/ad/hc.bin" = "res/save_files/ad/hc.bin"
+"tpgz/save_files/ad/beast_ganon.bin" = "res/save_files/ad/beast_ganon.bin"
+"tpgz/save_files/ad/horseback.bin" = "res/save_files/ad/horseback.bin"
"tpgz/stage_info/cave.bin" = "res/stage_info/cave.bin"
"tpgz/stage_info/dungeon.bin" = "res/stage_info/dungeon.bin"
"tpgz/stage_info/interior.bin" = "res/stage_info/interior.bin"
diff --git a/external/misc/ad.py b/external/misc/ad.py
new file mode 100644
index 0000000..a9f334b
--- /dev/null
+++ b/external/misc/ad.py
@@ -0,0 +1,114 @@
+import struct
+
+REQ_POS = 1
+REQ_CAM = 2
+
+default_entry = {
+ "requirements": 0,
+ "pos": (0.0,0.0,0.0),
+ "angle": 0,
+ "cam": {"pos":(0,0,0), "target": (0,0,0)},
+ "counter": 0,
+}
+
+# order matters
+file_names = ["ordon_gate_clip", "ordon_gate_clip", "goats", "hugo", "faron_twilight", "ems", "purple_mist", "forest_bit", "forest_escape", "pillar_clip", "lakebed1", "deku_toad", "karg_flight", "forest2", "diababa", "eldin_twilight", "lanayru_twilight", "post_lanayru", "bk_skip", "morpheel", "mdh", "mountain", "spr1", "darkhammer", "spr_boost", "blizzeta", "ag", "poe_skip", "deathsword", "stallord", "early_ele", "gm", "dangoro", "silver_rupee", "city1", "aeralfos", "city2", "argorok", "faron_boost", "grove2", "tot", "darknut", "dot_skip", "palace1", "palace2", "early_platform", "zant", "hc", "beast_ganon", "horseback_ganon", ]
+
+ad_p = [{**default_entry, "id": i, "filename": file_names[i]} for i in range(49)]
+
+ad_p[0]["requirements"] = REQ_POS | REQ_CAM
+ad_p[0]["pos"] = (827.450012, 216.490097, -4533.90625)
+ad_p[0]["angle"] = 498
+ad_p[0]["cam"]["pos"] = (833.467468, 477.604675, -4241.97266)
+ad_p[0]["cam"]["target"] = (827.497559, 329.622986, -4532.90723)
+ad_p[0]["counter"] = 10
+
+ad_p[1]["requirements"] = REQ_POS | REQ_CAM
+ad_p[1]["pos"] = (466.622467, 319.770752, -11651.3867)
+ad_p[1]["angle"] = 52540
+ad_p[1]["cam"]["pos"] = (735.525391, 524.418701, -11576.4746)
+ad_p[1]["cam"]["target"] = (465.674622, 421.052704, -11651.0684)
+ad_p[1]["counter"] = 10
+
+ad_p[3]["requirements"] = REQ_POS | REQ_CAM
+ad_p[3]["pos"] = (701.797302, 85.5212784, -5299.6123)
+ad_p[3]["angle"] = 63622
+ad_p[3]["cam"]["pos"] = (735.525391, 524.418701, -11576.4746)
+ad_p[3]["cam"]["target"] = (465.674622, 421.052704, -11651.0684)
+
+# purple mist
+ad_p[6]["requirements"] = REQ_POS
+ad_p[6]["pos"] = (-23524.6152, 250.0, -16220.166)
+ad_p[6]["angle"] = 40758
+ad_p[6]["counter"] = 30
+
+# forest escape
+ad_p[8]["requirements"] = REQ_POS | REQ_CAM
+ad_p[8]["pos"] = (-12433.6016, -235.969193, -17103.998)
+ad_p[8]["angle"] = 29553
+ad_p[8]["cam"]["pos"] = (-12552.8252, -53.5801048, -16729.5313)
+ad_p[8]["cam"]["target"] = (-12433.2979, -106.667023, -17104.9512)
+ad_p[8]["counter"] = 30
+
+# eldin twilight
+ad_p[15]["requirements"] = REQ_POS | REQ_CAM
+ad_p[15]["pos"] = (455.088379, -150.0, 11516.7227)
+ad_p[15]["angle"] = 6058
+ad_p[15]["cam"]["pos"] = (219.367218, -20.1253014, 11157.582)
+ad_p[15]["cam"]["target"] = (482.515137, -39.9999771, 11558.5283)
+ad_p[15]["counter"] = 10
+
+# bk skip
+ad_p[18]["requirements"] = REQ_POS | REQ_CAM
+ad_p[18]["pos"] = (71.9835968, 1500.00, 2839.01587)
+ad_p[18]["angle"] = 32767
+ad_p[18]["cam"]["pos"] = (71.9835968, 1719.93542, 2969.04565)
+ad_p[18]["cam"]["target"] = (71.9835968, 1660.0, 2839.01587)
+ad_p[18]["counter"] = 30
+
+# morpheel
+ad_p[19]["requirements"] = REQ_POS | REQ_CAM
+ad_p[19]["pos"] = (-1193.0, -23999.00, -770.0)
+ad_p[19]["angle"] = 10754
+ad_p[19]["counter"] = 20
+
+# spr boost
+ad_p[24]["requirements"] = REQ_POS | REQ_CAM
+ad_p[24]["pos"] = (2019.5192, 200.00, -2865.9890)
+ad_p[24]["angle"] = 16384
+ad_p[24]["counter"] = 30
+
+# poe 1 skip
+ad_p[27]["requirements"] = REQ_POS | REQ_CAM
+ad_p[27]["pos"] = (-2046.97168, 0.0, -587.304871)
+ad_p[27]["angle"] = 49030
+ad_p[27]["cam"]["pos"] = (-1779.00293, 213.707397, -584.686768)
+ad_p[27]["cam"]["target"] = (-2047.97168, 130.16568, -587.317139)
+ad_p[27]["counter"] = 10
+
+# early ele
+ad_p[30]["requirements"] = REQ_POS | REQ_CAM
+ad_p[30]["pos"] = (1304.8733, -355.5959, -5385.2314)
+ad_p[30]["angle"] = 45225
+ad_p[30]["counter"] = 30
+
+# dot skip
+ad_p[42]["requirements"] = REQ_POS | REQ_CAM
+ad_p[42]["cam"]["target"] = 1361.59766, -33.1954155, -1090.47632
+ad_p[42]["cam"]["pos"] = 1396.36316, 9.51973343, -719.644531
+ad_p[42]["angle"] = 33673
+ad_p[42]["pos"] = 1361.68408, -143.56076, -1089.4801
+
+file = open("ad.bin", "wb")
+
+for entry in ad_p:
+ print(entry)
+ file.write(entry["requirements"].to_bytes(1, "big", signed=False))
+ file.write(int(0).to_bytes(1, "big", signed=False)) # padding
+ file.write(entry["angle"].to_bytes(2, "big", signed=False))
+ file.write(struct.pack('>fff', *entry["pos"]))
+ file.write(struct.pack('>fff', *entry["cam"]["pos"]))
+ file.write(struct.pack('>fff', *entry["cam"]["target"]))
+ file.write(entry["counter"].to_bytes(4, "big", signed=False))
+ file.write(struct.pack(">32s", entry["filename"].encode("ascii")))
+ file.write(int(0).to_bytes(4, "big", signed=False)) # padding
diff --git a/include/flaglog.h b/include/flaglog.h
new file mode 100644
index 0000000..c60a24c
--- /dev/null
+++ b/include/flaglog.h
@@ -0,0 +1,9 @@
+#pragma once
+
+extern bool g_flag_log_active;
+
+namespace FlagLog {
+void run();
+void display_log(const char* name, uint8_t* record, uint8_t saved_record[], int record_size);
+void save_record(uint8_t* record, uint8_t saved_record[], int record_size);
+} // namespace FlagLog \ No newline at end of file
diff --git a/include/gz_flags.h b/include/gz_flags.h
index 914ffb2..b2cb0e2 100644
--- a/include/gz_flags.h
+++ b/include/gz_flags.h
@@ -1,10 +1,10 @@
#pragma once
#include "font.h"
#ifdef WII_PLATFORM
-#define MAX_GZ_FLAGS 13
+#define MAX_GZ_FLAGS 14
#endif
#ifdef GCN_PLATFORM
-#define MAX_GZ_FLAGS 12
+#define MAX_GZ_FLAGS 13
#endif
struct GZFlag {
diff --git a/include/menu.h b/include/menu.h
index 7181c45..0a14370 100644
--- a/include/menu.h
+++ b/include/menu.h
@@ -12,7 +12,7 @@
#define MAX_LINE_LENGTH 50
#define MAX_DESCRIPTION_LENGTH 100
-#define MAX_MENU_RENDER_FLAGS 22
+#define MAX_MENU_RENDER_FLAGS 24
#ifdef GCN_PLATFORM
#define SELECTION_BUTTON (Controller::Pad::A)
@@ -47,6 +47,8 @@ enum MenuIndex {
MN_ANY_SAVES_INDEX,
MN_HUNDO_SAVES_INDEX,
MN_POS_SETTINGS_INDEX,
+ MN_FLAG_LOG_INDEX,
+ MN_AD_SAVES_INDEX
};
struct ListMember {
diff --git a/include/menus/ad_saves_menu.h b/include/menus/ad_saves_menu.h
new file mode 100644
index 0000000..231abea
--- /dev/null
+++ b/include/menus/ad_saves_menu.h
@@ -0,0 +1,62 @@
+#include "menu.h"
+
+#define AD_SPECIALS_AMNT 12
+
+enum ADPracticeIndex {
+ AD_ORDON_GATE_CLIP_INDEX,
+ AD_BIT_INDEX,
+ AD_GOATS_INDEX,
+ AD_HUGO_INDEX,
+ AD_FARON_TWILGHT_INDEX,
+ AD_EMS_INDEX,
+ AD_MIST_INDEX,
+ AD_FRST_BIT_INDEX,
+ AD_FRST_ESCAPE_INDEX,
+ AD_PILLAR_CLIP_INDEX,
+ AD_LAKEBED_1_INDEX,
+ AD_TOAD_INDEX,
+ AD_KARG_INDEX,
+ AD_FT2_INDEX,
+ AD_DIABABA_INDEX,
+ AD_ELDIN_TWILIGHT_INDEX,
+ AD_LANAYRU_TWILIGHT_INDEX,
+ AD_POST_LANAYRU_INDEX,
+ AD_BK_SKIP_INDEX,
+ AD_MORPHEEL_INDEX,
+ AD_MDH_INDEX,
+ AD_MOUNTAIN_INDEX,
+ AD_SPR_INDEX,
+ AD_DARK_HAMMER_INDEX,
+ AD_SPR_BOOST_INDEX,
+ AD_BLIZZETA_INDEX,
+ AD_AG_INDEX,
+ AD_POE_SKIP_INDEX,
+ AD_DSS_INDEX,
+ AD_STALLORD_INDEX,
+ AD_EARLY_ELE_INDEX,
+ AD_GM_INDEX,
+ AD_DANGORO_INDEX,
+ AD_RUPEE_INDEX,
+ AD_CITS_1_INDEX,
+ AD_AERALFOS_INDEX,
+ AD_CITS_2_INDEX,
+ AD_ARGOROK_INDEX,
+ AD_FARON_BOOST_INDEX,
+ AD_GROVE_2_INDEX,
+ AD_TOT_INDEX,
+ AD_DARKNUT_INDEX,
+ AD_DOT_SKIP_INDEX,
+ AD_PALACE_1_INDEX,
+ AD_PALACE_2_INDEX,
+ AD_EARLY_PLATFORM_INDEX,
+ AD_ZANT_INDEX,
+ AD_HC_INDEX,
+ AD_BEAST_GANON_INDEX,
+ AD_HORSEBACK_INDEX
+};
+
+class ADSavesMenu : public Menu {
+public:
+ ADSavesMenu() : Menu() {}
+ static void render();
+}; \ No newline at end of file
diff --git a/include/menus/flags_menu.h b/include/menus/flags_menu.h
index ce9228f..f5e9aac 100644
--- a/include/menus/flags_menu.h
+++ b/include/menus/flags_menu.h
@@ -4,6 +4,7 @@
#define DUNGEON_FLAGS_INDEX 1
#define PORTAL_FLAGS_INDEX 2
#define FLAG_RECORDS_INDEX 3
+#define FLAG_LOG_INDEX 4
enum GeneralFlagsIndex {
BOSS_FLAG_INDEX,
@@ -70,4 +71,10 @@ class PortalFlagsMenu : public Menu {
public:
PortalFlagsMenu() : Menu() {}
static void render();
+};
+
+class FlagLogMenu : public Menu {
+public:
+ FlagLogMenu() : Menu() {}
+ static void render();
}; \ No newline at end of file
diff --git a/include/menus/practice_menu.h b/include/menus/practice_menu.h
index ea62076..e00a9b4 100644
--- a/include/menus/practice_menu.h
+++ b/include/menus/practice_menu.h
@@ -2,6 +2,7 @@
#define ANY_INDEX 0
#define HUNDO_INDEX 1
+#define AD_INDEX 2
#define REQ_POS 1
#define REQ_CAM 2
extern bool inject_save_flag;
diff --git a/include/menus/settings_menu.h b/include/menus/settings_menu.h
index 634f43a..9a14dd5 100644
--- a/include/menus/settings_menu.h
+++ b/include/menus/settings_menu.h
@@ -9,6 +9,7 @@ enum SettingsIndex {
CURSOR_COLOR_INDEX,
FONT_INDEX,
DROP_SHADOWS_INDEX,
+ SWAP_EQUIPS_INDEX,
SAVE_CARD_INDEX,
LOAD_CARD_INDEX,
POS_SETTINGS_MENU_INDEX
@@ -17,6 +18,7 @@ extern bool g_drop_shadows;
extern int g_area_reload_behavior;
extern int g_cursor_color;
extern bool g_cursor_color_flag;
+extern bool g_swap_equips_flag;
extern int cursor_rgba;
extern int g_font;
#define LOAD_AREA 0
diff --git a/include/menus/warping_menu.h b/include/menus/warping_menu.h
index 2caf723..c7cab83 100644
--- a/include/menus/warping_menu.h
+++ b/include/menus/warping_menu.h
@@ -6,7 +6,8 @@ enum WarpingIndex {
WARP_ROOM_INDEX,
WARP_SPAWN_INDEX,
WARP_LAYER_INDEX,
- WARP_BUTTON_INDEX
+ WARP_BUTTON_INDEX,
+ SAVE_LOCATION_INDEX
};
struct StageInfo {
diff --git a/res/save_files/ad.bin b/res/save_files/ad.bin
new file mode 100644
index 0000000..901cf97
--- /dev/null
+++ b/res/save_files/ad.bin
Binary files differ
diff --git a/res/save_files/ad/aeralfos.bin b/res/save_files/ad/aeralfos.bin
new file mode 100644
index 0000000..5317008
--- /dev/null
+++ b/res/save_files/ad/aeralfos.bin
Binary files differ
diff --git a/res/save_files/ad/ag.bin b/res/save_files/ad/ag.bin
new file mode 100644
index 0000000..31cfa1b
--- /dev/null
+++ b/res/save_files/ad/ag.bin
Binary files differ
diff --git a/res/save_files/ad/argorok.bin b/res/save_files/ad/argorok.bin
new file mode 100644
index 0000000..c23a36e
--- /dev/null
+++ b/res/save_files/ad/argorok.bin
Binary files differ
diff --git a/res/save_files/ad/beast_ganon.bin b/res/save_files/ad/beast_ganon.bin
new file mode 100644
index 0000000..d3fb8ab
--- /dev/null
+++ b/res/save_files/ad/beast_ganon.bin
Binary files differ
diff --git a/res/save_files/ad/bk_skip.bin b/res/save_files/ad/bk_skip.bin
new file mode 100644
index 0000000..3b666eb
--- /dev/null
+++ b/res/save_files/ad/bk_skip.bin
Binary files differ
diff --git a/res/save_files/ad/blizzeta.bin b/res/save_files/ad/blizzeta.bin
new file mode 100644
index 0000000..5c35564
--- /dev/null
+++ b/res/save_files/ad/blizzeta.bin
Binary files differ
diff --git a/res/save_files/ad/city1.bin b/res/save_files/ad/city1.bin
new file mode 100644
index 0000000..b4a3994
--- /dev/null
+++ b/res/save_files/ad/city1.bin
Binary files differ
diff --git a/res/save_files/ad/city2.bin b/res/save_files/ad/city2.bin
new file mode 100644
index 0000000..b9d1ee2
--- /dev/null
+++ b/res/save_files/ad/city2.bin
Binary files differ
diff --git a/res/save_files/ad/dangoro.bin b/res/save_files/ad/dangoro.bin
new file mode 100644
index 0000000..d9dd3d6
--- /dev/null
+++ b/res/save_files/ad/dangoro.bin
Binary files differ
diff --git a/res/save_files/ad/darkhammer.bin b/res/save_files/ad/darkhammer.bin
new file mode 100644
index 0000000..861f71e
--- /dev/null
+++ b/res/save_files/ad/darkhammer.bin
Binary files differ
diff --git a/res/save_files/ad/darknut.bin b/res/save_files/ad/darknut.bin
new file mode 100644
index 0000000..6c0ba58
--- /dev/null
+++ b/res/save_files/ad/darknut.bin
Binary files differ
diff --git a/res/save_files/ad/deathsword.bin b/res/save_files/ad/deathsword.bin
new file mode 100644
index 0000000..8ea1ed5
--- /dev/null
+++ b/res/save_files/ad/deathsword.bin
Binary files differ
diff --git a/res/save_files/ad/deku_toad.bin b/res/save_files/ad/deku_toad.bin
new file mode 100644
index 0000000..40df407
--- /dev/null
+++ b/res/save_files/ad/deku_toad.bin
Binary files differ
diff --git a/res/save_files/ad/diababa.bin b/res/save_files/ad/diababa.bin
new file mode 100644
index 0000000..1188abf
--- /dev/null
+++ b/res/save_files/ad/diababa.bin
Binary files differ
diff --git a/res/save_files/ad/dot_skip.bin b/res/save_files/ad/dot_skip.bin
new file mode 100644
index 0000000..465d9cd
--- /dev/null
+++ b/res/save_files/ad/dot_skip.bin
Binary files differ
diff --git a/res/save_files/ad/early_ele.bin b/res/save_files/ad/early_ele.bin
new file mode 100644
index 0000000..f7f2107
--- /dev/null
+++ b/res/save_files/ad/early_ele.bin
Binary files differ
diff --git a/res/save_files/ad/early_platform.bin b/res/save_files/ad/early_platform.bin
new file mode 100644
index 0000000..ba00b8d
--- /dev/null
+++ b/res/save_files/ad/early_platform.bin
Binary files differ
diff --git a/res/save_files/ad/eldin_twilight.bin b/res/save_files/ad/eldin_twilight.bin
new file mode 100644
index 0000000..a6db635
--- /dev/null
+++ b/res/save_files/ad/eldin_twilight.bin
Binary files differ
diff --git a/res/save_files/ad/ems.bin b/res/save_files/ad/ems.bin
new file mode 100644
index 0000000..5a2b1e1
--- /dev/null
+++ b/res/save_files/ad/ems.bin
Binary files differ
diff --git a/res/save_files/ad/faron_boost.bin b/res/save_files/ad/faron_boost.bin
new file mode 100644
index 0000000..52f8c01
--- /dev/null
+++ b/res/save_files/ad/faron_boost.bin
Binary files differ
diff --git a/res/save_files/ad/faron_twilight.bin b/res/save_files/ad/faron_twilight.bin
new file mode 100644
index 0000000..7094e5d
--- /dev/null
+++ b/res/save_files/ad/faron_twilight.bin
Binary files differ
diff --git a/res/save_files/ad/forest2.bin b/res/save_files/ad/forest2.bin
new file mode 100644
index 0000000..0969518
--- /dev/null
+++ b/res/save_files/ad/forest2.bin
Binary files differ
diff --git a/res/save_files/ad/forest_bit.bin b/res/save_files/ad/forest_bit.bin
new file mode 100644
index 0000000..cd993f9
--- /dev/null
+++ b/res/save_files/ad/forest_bit.bin
Binary files differ
diff --git a/res/save_files/ad/forest_escape.bin b/res/save_files/ad/forest_escape.bin
new file mode 100644
index 0000000..95e3020
--- /dev/null
+++ b/res/save_files/ad/forest_escape.bin
Binary files differ
diff --git a/res/save_files/ad/gm.bin b/res/save_files/ad/gm.bin
new file mode 100644
index 0000000..d67caa5
--- /dev/null
+++ b/res/save_files/ad/gm.bin
Binary files differ
diff --git a/res/save_files/ad/goats.bin b/res/save_files/ad/goats.bin
new file mode 100644
index 0000000..6aeabc9
--- /dev/null
+++ b/res/save_files/ad/goats.bin
Binary files differ
diff --git a/res/save_files/ad/grove2.bin b/res/save_files/ad/grove2.bin
new file mode 100644
index 0000000..b7f8510
--- /dev/null
+++ b/res/save_files/ad/grove2.bin
Binary files differ
diff --git a/res/save_files/ad/hc.bin b/res/save_files/ad/hc.bin
new file mode 100644
index 0000000..d3d54e6
--- /dev/null
+++ b/res/save_files/ad/hc.bin
Binary files differ
diff --git a/res/save_files/ad/horseback.bin b/res/save_files/ad/horseback.bin
new file mode 100644
index 0000000..c210334
--- /dev/null
+++ b/res/save_files/ad/horseback.bin
Binary files differ
diff --git a/res/save_files/ad/hugo.bin b/res/save_files/ad/hugo.bin
new file mode 100644
index 0000000..e45be2b
--- /dev/null
+++ b/res/save_files/ad/hugo.bin
Binary files differ
diff --git a/res/save_files/ad/karg_flight.bin b/res/save_files/ad/karg_flight.bin
new file mode 100644
index 0000000..0b49fad
--- /dev/null
+++ b/res/save_files/ad/karg_flight.bin
Binary files differ
diff --git a/res/save_files/ad/lakebed1.bin b/res/save_files/ad/lakebed1.bin
new file mode 100644
index 0000000..c3f098b
--- /dev/null
+++ b/res/save_files/ad/lakebed1.bin
Binary files differ
diff --git a/res/save_files/ad/lanayru_twilight.bin b/res/save_files/ad/lanayru_twilight.bin
new file mode 100644
index 0000000..de99f28
--- /dev/null
+++ b/res/save_files/ad/lanayru_twilight.bin
Binary files differ
diff --git a/res/save_files/ad/mdh.bin b/res/save_files/ad/mdh.bin
new file mode 100644
index 0000000..35b72c0
--- /dev/null
+++ b/res/save_files/ad/mdh.bin
Binary files differ
diff --git a/res/save_files/ad/morpheel.bin b/res/save_files/ad/morpheel.bin
new file mode 100644
index 0000000..55ee2d9
--- /dev/null
+++ b/res/save_files/ad/morpheel.bin
Binary files differ
diff --git a/res/save_files/ad/mountain.bin b/res/save_files/ad/mountain.bin
new file mode 100644
index 0000000..b6db949
--- /dev/null
+++ b/res/save_files/ad/mountain.bin
Binary files differ
diff --git a/res/save_files/ad/ordon_gate_clip.bin b/res/save_files/ad/ordon_gate_clip.bin
new file mode 100644
index 0000000..ad0c2d8
--- /dev/null
+++ b/res/save_files/ad/ordon_gate_clip.bin
Binary files differ
diff --git a/res/save_files/ad/palace1.bin b/res/save_files/ad/palace1.bin
new file mode 100644
index 0000000..b918785
--- /dev/null
+++ b/res/save_files/ad/palace1.bin
Binary files differ
diff --git a/res/save_files/ad/palace2.bin b/res/save_files/ad/palace2.bin
new file mode 100644
index 0000000..e3833c5
--- /dev/null
+++ b/res/save_files/ad/palace2.bin
Binary files differ
diff --git a/res/save_files/ad/pillar_clip.bin b/res/save_files/ad/pillar_clip.bin
new file mode 100644
index 0000000..1bd6cc0
--- /dev/null
+++ b/res/save_files/ad/pillar_clip.bin
Binary files differ
diff --git a/res/save_files/ad/poe_skip.bin b/res/save_files/ad/poe_skip.bin
new file mode 100644
index 0000000..5851904
--- /dev/null
+++ b/res/save_files/ad/poe_skip.bin
Binary files differ
diff --git a/res/save_files/ad/post_lanayru.bin b/res/save_files/ad/post_lanayru.bin
new file mode 100644
index 0000000..2c72d28
--- /dev/null
+++ b/res/save_files/ad/post_lanayru.bin
Binary files differ
diff --git a/res/save_files/ad/purple_mist.bin b/res/save_files/ad/purple_mist.bin
new file mode 100644
index 0000000..b7c69a4
--- /dev/null
+++ b/res/save_files/ad/purple_mist.bin
Binary files differ
diff --git a/res/save_files/ad/silver_rupee.bin b/res/save_files/ad/silver_rupee.bin
new file mode 100644
index 0000000..ee433c6
--- /dev/null
+++ b/res/save_files/ad/silver_rupee.bin
Binary files differ
diff --git a/res/save_files/ad/spr1.bin b/res/save_files/ad/spr1.bin
new file mode 100644
index 0000000..651c043
--- /dev/null
+++ b/res/save_files/ad/spr1.bin
Binary files differ
diff --git a/res/save_files/ad/spr_boost.bin b/res/save_files/ad/spr_boost.bin
new file mode 100644
index 0000000..a764543
--- /dev/null
+++ b/res/save_files/ad/spr_boost.bin
Binary files differ
diff --git a/res/save_files/ad/stallord.bin b/res/save_files/ad/stallord.bin
new file mode 100644
index 0000000..3b2ea45
--- /dev/null
+++ b/res/save_files/ad/stallord.bin
Binary files differ
diff --git a/res/save_files/ad/tot.bin b/res/save_files/ad/tot.bin
new file mode 100644
index 0000000..45c9154
--- /dev/null
+++ b/res/save_files/ad/tot.bin
Binary files differ
diff --git a/res/save_files/ad/zant.bin b/res/save_files/ad/zant.bin
new file mode 100644
index 0000000..db834de
--- /dev/null
+++ b/res/save_files/ad/zant.bin
Binary files differ
diff --git a/src/flaglog.cpp b/src/flaglog.cpp
new file mode 100644
index 0000000..b025641
--- /dev/null
+++ b/src/flaglog.cpp
@@ -0,0 +1,58 @@
+#include "controller.h"
+#include "fifo_queue.h"
+#include "libtp_c/include/controller.h"
+#include "libtp_c/include/system.h"
+#include "libtp_c/include/tp.h"
+#include "flaglog.h"
+
+namespace FlagLog {
+
+static char buf[25];
+
+uint8_t s_areatemp_record[0x20];
+uint8_t s_event_record[0x100];
+uint8_t s_minigame_record[0x18];
+uint8_t s_danbit_record[0x18];
+// uint8_t s_onetime_event_record[0x100];
+
+bool init_save_record = false;
+
+void save_record(uint8_t* record, uint8_t saved_record[], int record_size) {
+ for (int i = 0; i < record_size; i++) {
+ saved_record[i] = *(record + i);
+ }
+}
+
+void display_log(const char* name, uint8_t* record, uint8_t saved_record[], int record_size) {
+ for (int i = 0; i < record_size; i++) {
+ if (*(record + i) != saved_record[i]) {
+ for (uint8_t bit = 0; bit < 8; bit++) {
+ if ((*(record + i) & (1 << bit)) != (saved_record[i] & (1 << bit))) {
+ tp_sprintf(buf, "%s [0x%02X: %d]", name, i, bit);
+ FIFOQueue::push(buf, Queue, 0xFFFFFF00);
+ }
+ }
+ saved_record[i] = *(record + i);
+ }
+ }
+}
+
+void run() {
+ if (!init_save_record) {
+ save_record(tp_gameInfo.temp_flags.flags, s_areatemp_record, 0x20);
+ save_record(tp_gameInfo.event_flags.flags, s_event_record, 0x100);
+ save_record(tp_gameInfo.minigame_flags, s_minigame_record, 0x18);
+ // save_record(tp_gameInfo.one_time_events, s_onetime_event_record, 0x100);
+ save_record((uint8_t*)tp_gameInfo.dungeon_temp_flags.switch_bitfield, s_danbit_record,
+ 0x18);
+ init_save_record = true;
+ }
+
+ display_log("area temp", tp_gameInfo.temp_flags.flags, s_areatemp_record, 0x20);
+ display_log("event", tp_gameInfo.event_flags.flags, s_event_record, 0x100);
+ display_log("minigame", tp_gameInfo.minigame_flags, s_minigame_record, 0x18);
+ display_log("dungeon", (uint8_t*)tp_gameInfo.dungeon_temp_flags.switch_bitfield,
+ s_danbit_record, 0x18);
+ // display_log("OT event", tp_gameInfo.one_time_events, s_onetime_event_record, 0x100);
+}
+} // namespace FlagLog \ No newline at end of file
diff --git a/src/gz_flags.cpp b/src/gz_flags.cpp
index 9be704b..affd847 100644
--- a/src/gz_flags.cpp
+++ b/src/gz_flags.cpp
@@ -13,6 +13,7 @@
#include "utils/lines.h"
#include "utils/link.h"
#include "utils/loading.h"
+#include "flaglog.h"
bool inject_save_flag = false;
@@ -22,6 +23,7 @@ GZFlag GZ_Flags[MAX_GZ_FLAGS] = {
{&ToolItems[Tools::BIT_INDEX].active, BiTIndicator::run},
#endif
{&ToolItems[Tools::ROLL_INDEX].active, RollIndicator::run},
+ {&g_flag_log_active, FlagLog::run},
{&inject_save_flag, Utilities::trigger_load},
{&SceneItems[Scene::FREEZE_ACTOR_INDEX].active, Actor::freeze_actors, Actor::unfreeze_actors},
{&SceneItems[Scene::HIDE_ACTOR_INDEX].active, Actor::hide_actors, Actor::show_actors},
diff --git a/src/menu.cpp b/src/menu.cpp
index b657250..ad42e95 100644
--- a/src/menu.cpp
+++ b/src/menu.cpp
@@ -17,6 +17,7 @@
#include "menus/flag_records_menu.h"
#include "menus/tools_menu.h"
#include "menus/warping_menu.h"
+#include "menus/ad_saves_menu.h"
typedef void (*menu_render_t)();
@@ -28,7 +29,7 @@ menu_render_t MenuRenderList[MAX_MENU_RENDER_FLAGS] = {
PracticeMenu::render, CheatsMenu::render, SceneMenu::render,
SettingsMenu::render, ToolsMenu::render, PauseMenu::render,
AmountsMenu::render, AnySavesMenu::render, HundoSavesMenu::render,
- PosSettingsMenu::render};
+ PosSettingsMenu::render, FlagLogMenu::render, ADSavesMenu::render};
menu_render_t currentMenu = nullptr;
diff --git a/src/menus/ad_saves_menu.cpp b/src/menus/ad_saves_menu.cpp
new file mode 100644
index 0000000..6baa8d2
--- /dev/null
+++ b/src/menus/ad_saves_menu.cpp
@@ -0,0 +1,166 @@
+#include "menus/ad_saves_menu.h"
+#include "controller.h"
+#include "fifo_queue.h"
+#include "gorge.h"
+#include "libtp_c/include/controller.h"
+#include "libtp_c/include/system.h"
+#include "libtp_c/include/tp.h"
+#include "menus/practice_menu.h"
+#include "rollcheck.h"
+#include "save_injector.h"
+#include "utils/cursor.h"
+#include "utils/lines.h"
+#include "utils/loading.h"
+
+#include "fs.h"
+#define LINES 50
+
+static Cursor cursor = {0, 0};
+bool init_once = false;
+
+Line lines[LINES] = {
+ {"ordon gate clip", AD_ORDON_GATE_CLIP_INDEX, "Gate Clip outside Ordon Spring"},
+ {"back in time", AD_BIT_INDEX, "Back In Time off the Ordon Spring bridge"},
+ {"goats", AD_GOATS_INDEX, "Goat herding 2"},
+ {"sword and shield skip", AD_HUGO_INDEX, "Hangin' with Hugo"},
+ {"faron twilight", AD_FARON_TWILGHT_INDEX, "Faron Twilight 1st half"},
+ {"early master sword", AD_EMS_INDEX, "Super Jump to early Sacred Grove"},
+ {"purple mist", AD_MIST_INDEX, "Purple mist in Faron Woods (post-EMS)"},
+ {"forest bit", AD_FRST_BIT_INDEX, "Back In Time in Forest Temple"},
+ {"forest escape", AD_FRST_ESCAPE_INDEX, "LJA over S Faron exit trigger"},
+ {"pillar clip", AD_PILLAR_CLIP_INDEX, "Pillar Clip in Lake Hylia (low water)"},
+ {"lakebed 1", AD_LAKEBED_1_INDEX, "The first Lakebed Temple segment"},
+ {"deku toad", AD_TOAD_INDEX, "The miniboss of Lakebed Temple"},
+ {"kargorok flight", AD_KARG_INDEX, "Clip OoB with trumpet bird"},
+ {"forest temple 2", AD_FT2_INDEX, "Second half of Forest Temple"},
+ {"diababa", AD_DIABABA_INDEX, "The Forest Temple boss"},
+ {"eldin twilight", AD_ELDIN_TWILIGHT_INDEX, "Eldin Twilight tears"},
+ {"lanayru twilight", AD_LANAYRU_TWILIGHT_INDEX, "Lanayru Twilight tears"},
+ {"post lanayru", AD_POST_LANAYRU_INDEX, "Stealing Iza's bombs"},
+ {"lakebed bk skip", AD_BK_SKIP_INDEX, "Boss key skip in Lakebed Temple main room"},
+ {"morpheel", AD_MORPHEEL_INDEX, "Morpheel fight (no Zora Armor)"},
+ {"mdh", AD_MDH_INDEX, "MDH segment"},
+ {"mountain", AD_MOUNTAIN_INDEX, "Climbing up Snowpeak mountain"},
+ {"snowpeak", AD_SPR_INDEX, "The Snowpeak Ruins dungeon segment"},
+ {"dark hammer", AD_DARK_HAMMER_INDEX, "The Snowpeak Ruins miniboss"},
+ {"snowpeak bomb boost", AD_SPR_BOOST_INDEX, "Bomb boost to SPR 2nd floor"},
+ {"blizzeta", AD_BLIZZETA_INDEX, "The Snowpeak Ruins boss"},
+ {"arbiter's grounds", AD_AG_INDEX, "The Arbiter's Grounds segment"},
+ {"poe 1 skip", AD_POE_SKIP_INDEX, "The pillar jump in Arbiter's Grounds"},
+ {"death sword", AD_DSS_INDEX, "The Arbiter's Grounds miniboss"},
+ {"stallord", AD_STALLORD_INDEX, "The Arbiter's Grounds boss"},
+ {"early elevator", AD_EARLY_ELE_INDEX, "OoB clip to DM elevator"},
+ {"goron mines", AD_GM_INDEX, "The Goron Mines segment"},
+ {"dangoro", AD_DANGORO_INDEX, "The Goron Mines miniboss"},
+ {"silver rupee", AD_RUPEE_INDEX, "Silver Rupee collection"},
+ {"city in the sky 1", AD_CITS_1_INDEX, "The first City in the Sky segment"},
+ {"aeralfos skip", AD_AERALFOS_INDEX, "The City in the Sky miniboss"},
+ {"city in the sky 2", AD_CITS_2_INDEX, "The second City in the Sky segment"},
+ {"argorok", AD_ARGOROK_INDEX, "The City in the Sky boss"},
+ {"faron bomb boost", AD_FARON_BOOST_INDEX, "Bomb boost to Sacred Grove"},
+ {"grove 2", AD_GROVE_2_INDEX, "The 2nd Skullkid chase"},
+ {"temple of time", AD_TOT_INDEX, "The Temple of Time segment"},
+ {"darknut", AD_DARKNUT_INDEX, "The Temple of Time miniboss"},
+ {"dot skip", AD_DOT_SKIP_INDEX, "Door of Time skip"},
+ {"palace of twilight 1", AD_PALACE_1_INDEX, "The first Palace of Twilight segment"},
+ {"palace of twilight 2", AD_PALACE_2_INDEX,
+ "The second Palace of Twilight segment (after both Sols)"},
+ {"early platform", AD_EARLY_PLATFORM_INDEX, "Early platform in Palace of Twilight"},
+ {"zant", AD_ZANT_INDEX, "The Palace of Twilight boss"},
+ {"hyrule castle", AD_HC_INDEX, "The Hyrule Castle segment"},
+ {"beast ganon", AD_BEAST_GANON_INDEX, "The Beast Ganon fight"},
+ {"horseback ganon", AD_HORSEBACK_INDEX, "The horseback Ganondorf fight"}};
+
+void default_load() {
+ practice_file.inject_options_before_load = SaveInjector::inject_default_before;
+ practice_file.inject_options_during_load = SaveInjector::inject_default_during;
+ practice_file.inject_options_after_load = SaveInjector::inject_default_after;
+ inject_save_flag = true;
+ fifo_visible = true;
+ MenuRendering::set_menu(MN_NONE_INDEX);
+ init_once = false;
+}
+
+void hugo() {
+ SaveInjector::inject_default_during();
+ tp_gameInfo.temp_flags.flags[14] = 128; // midna trigger off
+ tp_gameInfo.temp_flags.flags[12] = 0; // hugo alive
+}
+
+void karg_oob() {
+ practice_file.inject_options_before_load = nullptr;
+ SaveInjector::inject_default_during();
+ tp_gameInfo.respawn_animation = 0xA; // spawn on kargorok
+ tp_gameInfo.link.is_wolf = false;
+}
+
+void morpheel() {
+ tp_zelAudio.link_debug_ptr->current_item = 68; // clawshot
+ tp_zelAudio.link_debug_ptr->current_boots = 2; // ib
+}
+
+void stallord() {
+ SaveInjector::inject_default_during();
+ tp_gameInfo.boss_room_event_flags = 48; // turn off intro cs, start fight
+ tp_gameInfo.warp.entrance.spawn = 0x01; // spawn at in front of stally
+}
+
+void argorok() {
+ SaveInjector::inject_default_during();
+ tp_gameInfo.boss_room_event_flags = 1;
+}
+
+void palace1() {
+ SaveInjector::inject_default_during();
+ tp_gameInfo.dungeon_temp_flags.switch_bitfield[0] = 0; // reset palace switches
+}
+
+void palace2() {
+ tp_zelAudio.link_debug_ptr->current_item = 3; // master sword
+}
+
+void lakebed_bk_skip_during() {
+ SaveInjector::inject_default_during();
+ tp_gameInfo.temp_flags.flags[11] = 18; // bridge turned
+ tp_gameInfo.temp_flags.flags[20] = 223; // dungeon intro cs off
+}
+
+void bossflags() {
+ SaveInjector::inject_default_during();
+ TP::set_boss_flags();
+}
+
+void ADSavesMenu::render() {
+ special ADSpecials[AD_SPECIALS_AMNT] = {
+ special(AD_HUGO_INDEX, hugo, nullptr),
+ special(AD_KARG_INDEX, karg_oob, nullptr),
+ special(AD_BK_SKIP_INDEX, lakebed_bk_skip_during, nullptr),
+ special(AD_MORPHEEL_INDEX, nullptr, morpheel),
+ special(AD_STALLORD_INDEX, stallord, nullptr),
+ special(AD_FRST_ESCAPE_INDEX, bossflags, nullptr),
+ special(AD_PILLAR_CLIP_INDEX, bossflags, nullptr),
+ special(AD_LAKEBED_1_INDEX, bossflags, nullptr),
+ special(AD_DARK_HAMMER_INDEX, bossflags, nullptr),
+ special(AD_ARGOROK_INDEX, argorok, nullptr),
+ special(AD_PALACE_1_INDEX, palace1, nullptr),
+ special(AD_PALACE_2_INDEX, nullptr, palace2)};
+
+ if (button_is_pressed(BACK_BUTTON)) {
+ MenuRendering::set_menu(MN_PRACTICE_INDEX);
+ init_once = false;
+ return;
+ };
+
+ if (!init_once) {
+ current_input = 0;
+ init_once = true;
+ }
+
+ if (current_input == SELECTION_BUTTON && a_held == false) {
+ Utilities::load_save(cursor.y, (char*)"ad", ADSpecials, AD_SPECIALS_AMNT);
+ init_once = false;
+ }
+
+ Utilities::move_cursor(cursor, LINES);
+ Utilities::render_lines(lines, cursor.y, LINES);
+}; \ No newline at end of file
diff --git a/src/menus/flag_log_menu.cpp b/src/menus/flag_log_menu.cpp
new file mode 100644
index 0000000..a7557e0
--- /dev/null
+++ b/src/menus/flag_log_menu.cpp
@@ -0,0 +1,41 @@
+#include "menus/flags_menu.h"
+#include "controller.h"
+#include "font.h"
+#include "libtp_c/include/flag.h"
+#include "libtp_c/include/tp.h"
+#include "utils/cursor.h"
+#include "utils/lines.h"
+#include "flaglog.h"
+
+#define LINES 1
+
+static Cursor cursor = {0, 0};
+bool init_once = false;
+bool g_flag_log_active = false;
+
+Line lines[LINES] = {{"log activated", 0, "toggle flag logger on/off", true, &g_flag_log_active}};
+
+void FlagLogMenu::render() {
+ if (button_is_pressed(BACK_BUTTON)) {
+ init_once = false;
+ MenuRendering::set_menu(MN_FLAGS_INDEX);
+ return;
+ }
+
+ if (!init_once) {
+ current_input = 0;
+ init_once = true;
+ }
+
+ if (current_input == SELECTION_BUTTON && a_held == false) {
+ switch (cursor.y) {
+ case 0: {
+ g_flag_log_active = !g_flag_log_active;
+ return;
+ }
+ }
+ }
+
+ Utilities::move_cursor(cursor, LINES);
+ Utilities::render_lines(lines, cursor.y, LINES);
+}; \ No newline at end of file
diff --git a/src/menus/flag_records_menu.cpp b/src/menus/flag_records_menu.cpp
index 119fe74..4937af7 100644
--- a/src/menus/flag_records_menu.cpp
+++ b/src/menus/flag_records_menu.cpp
@@ -38,7 +38,7 @@ Texture gzFlagOffTex;
#define SCRL_BACK_TEXT "1"
#endif
-void render_flag_records(uint8_t record[]) {
+void render_flag_records(uint8_t* record) {
if (cursor.y > 0) {
if (button_is_pressed(Controller::DPAD_RIGHT)) {
if (bit_index == 0) {
@@ -75,7 +75,7 @@ void render_flag_records(uint8_t record[]) {
float flag_x_offset = LINE_X_OFFSET + Font::get_chars_width(offset);
for (uint8_t bit = 0; bit < 8; bit++) {
- if (record[idx_num] & (1 << bit)) {
+ if (*(record + idx_num) & (1 << bit)) {
Draw::draw_rect(0xFFFFFFFF, {flag_x_offset + ((7 - bit) * 20.0f), y_offset - 13.0f},
{16, 16}, &gzFlagOnTex._texObj);
} else {
@@ -91,7 +91,7 @@ void render_flag_records(uint8_t record[]) {
}
if (current_input == Controller::Pad::A && a_held == false) {
if (cursor.y == (idx_num + 1)) {
- record[idx_num] ^= (1 << bit_index);
+ *(record + idx_num) ^= (1 << bit_index);
}
}
diff --git a/src/menus/flags_menu.cpp b/src/menus/flags_menu.cpp
index 3a18761..7521ca3 100644
--- a/src/menus/flags_menu.cpp
+++ b/src/menus/flags_menu.cpp
@@ -6,7 +6,7 @@
#include "utils/cursor.h"
#include "utils/lines.h"
-#define LINES 4
+#define LINES 5
static Cursor cursor = {0, 0};
bool init_once = false;
@@ -14,7 +14,8 @@ bool init_once = false;
Line lines[LINES] = {{"general flags", GENERAL_FLAGS_INDEX, "general flags", false},
{"dungeon flags", DUNGEON_FLAGS_INDEX, "dungeon related flags", false},
{"portal flags", PORTAL_FLAGS_INDEX, "warp portal flags", false},
- {"flag records", FLAG_RECORDS_INDEX, "view flag records", false}};
+ {"flag records", FLAG_RECORDS_INDEX, "view flag records", false},
+ {"flag log", FLAG_LOG_INDEX, "view flag log", false}};
void FlagsMenu::render() {
if (button_is_pressed(BACK_BUTTON)) {
@@ -46,6 +47,10 @@ void FlagsMenu::render() {
MenuRendering::set_menu(MN_FLAG_RECORDS_INDEX);
return;
}
+ case FLAG_LOG_INDEX: {
+ MenuRendering::set_menu(MN_FLAG_LOG_INDEX);
+ return;
+ }
}
}
diff --git a/src/menus/practice_menu.cpp b/src/menus/practice_menu.cpp
index dd113e1..1077dcb 100644
--- a/src/menus/practice_menu.cpp
+++ b/src/menus/practice_menu.cpp
@@ -6,14 +6,15 @@
#include "utils/cursor.h"
#include "utils/lines.h"
-#define LINES 2
+#define LINES 3
static Cursor cursor = {0, 0};
bool init_once = false;
PracticeFile practice_file;
Line lines[LINES] = {{"any%", ANY_INDEX, "Any% practice saves", false},
- {"100%", HUNDO_INDEX, "100% practice saves", false}};
+ {"100%", HUNDO_INDEX, "100% practice saves", false},
+ {"all dungeons", AD_INDEX, "All Dungeons practice saves", false}};
void PracticeMenu::render() {
if (button_is_pressed(BACK_BUTTON)) {
@@ -37,6 +38,10 @@ void PracticeMenu::render() {
MenuRendering::set_menu(MN_HUNDO_SAVES_INDEX);
return;
}
+ case AD_INDEX: {
+ MenuRendering::set_menu(MN_AD_SAVES_INDEX);
+ return;
+ }
}
}
diff --git a/src/menus/settings_menu.cpp b/src/menus/settings_menu.cpp
index 3e14be6..9c99e86 100644
--- a/src/menus/settings_menu.cpp
+++ b/src/menus/settings_menu.cpp
@@ -9,7 +9,7 @@
#include "fifo_queue.h"
-#define LINES 7
+#define LINES 8
#define MAX_RELOAD_OPTIONS 2
#define MAX_CURSOR_COLOR_OPTIONS 6
#define MAX_FONT_OPTIONS 7
@@ -20,6 +20,7 @@ bool init_once = false;
int g_area_reload_behavior;
int g_cursor_color;
bool g_cursor_color_flag;
+bool g_swap_equips_flag;
int g_font = 0;
ListMember reload_options[MAX_RELOAD_OPTIONS] = {"load area", "load file"};
@@ -39,6 +40,8 @@ Line lines[LINES] = {
MAX_CURSOR_COLOR_OPTIONS},
{"font:", FONT_INDEX, "Change font", false, nullptr, MAX_FONT_OPTIONS},
{"drop shadows", DROP_SHADOWS_INDEX, "Adds shadows to all font letters", true, &g_drop_shadows},
+ {"swap equips", SWAP_EQUIPS_INDEX, "Swap equips when loading practice files", true,
+ &g_swap_equips_flag},
{"save card", SAVE_CARD_INDEX, "Save settings to memory card"},
{"load card", LOAD_CARD_INDEX, "Load settings from memory card"},
{"menu positions", POS_SETTINGS_MENU_INDEX,
@@ -87,7 +90,11 @@ void SettingsMenu::render() {
card.card_result = CARDProbeEx(0, NULL, &card.sector_size);
Utilities::load_mem_card(card);
break;
- }
+ };
+ case SWAP_EQUIPS_INDEX: {
+ g_swap_equips_flag = !g_swap_equips_flag;
+ break;
+ };
}
}
diff --git a/src/menus/warping_menu.cpp b/src/menus/warping_menu.cpp
index 018fe5b..a9468fc 100644
--- a/src/menus/warping_menu.cpp
+++ b/src/menus/warping_menu.cpp
@@ -10,7 +10,7 @@
#include "libtp_c/include/system.h"
-#define LINES 6
+#define LINES 7
#define SPAWN_OFFSET 4
#define SPAWN_READ_LENGTH 32
#define ROOM_READ_LENGTH 64
@@ -42,7 +42,7 @@ Line lines[LINES] = {
{"spawn:", WARP_SPAWN_INDEX, "Current spawn number", false},
{"layer:", WARP_LAYER_INDEX, "Current layer number", false},
{"warp", WARP_BUTTON_INDEX, "Trigger warp", false},
-};
+ {"save", SAVE_LOCATION_INDEX, "Set savefile location to selected location", false}};
void load_previous_info(void* buffer, signed long& counter, signed long length, char max_num,
int offset) {
@@ -262,6 +262,12 @@ void WarpingMenu::render() {
tp_gameInfo.warp.enabled = true;
break;
}
+ case SAVE_LOCATION_INDEX: {
+ tp_memcpy(&tp_gameInfo.player.player_stage, &warp_info.stage_info.stage_id, 8);
+ tp_gameInfo.player.player_room_id = warp_info.room_info.room_id[0];
+ tp_gameInfo.player.player_spawn_id = warp_info.spawn_info.spawn_id[0];
+ break;
+ }
}
}
diff --git a/src/save_injector.cpp b/src/save_injector.cpp
index addd2f3..b124056 100644
--- a/src/save_injector.cpp
+++ b/src/save_injector.cpp
@@ -2,6 +2,7 @@
#include "fs.h"
#include "libtp_c/include/system.h"
#include "libtp_c/include/tp.h"
+#include "menus/settings_menu.h"
#include "menu.h"
namespace SaveInjector {
@@ -32,6 +33,19 @@ void inject_default_during() {
tp_gameInfo.link_air_meter = 600;
tp_gameInfo.link_air_meter_2 = 600;
tp_gameInfo.link_max_air_meter = 600;
+
+#ifdef GCN_PLATFORM
+ if (g_swap_equips_flag) {
+ uint8_t tmp = tp_gameInfo.link.item_on_x;
+ uint8_t tmp_mix = tp_gameInfo.link.slot_x_combo_item;
+
+ tp_gameInfo.link.item_on_x = tp_gameInfo.link.item_on_y;
+ tp_gameInfo.link.item_on_y = tmp;
+ tp_gameInfo.link.slot_x_combo_item = tp_gameInfo.link.slot_y_combo_item;
+ tp_gameInfo.link.slot_y_combo_item = tmp_mix;
+ }
+#endif
+ // add wii swap equip logic here later
}
void inject_default_after() {}