ref: bcc7ef40ed9dd6de323cda0b6bc825ac37b88a36
parent: 885d1d6f05ff759a192b5dfdb20567ffed4c7967
author: Snesrev <[email protected]>
date: Wed Sep 7 20:59:16 EDT 2022
Fill rupees, bombs, and arrows (Fixes #64)
--- a/config.c
+++ b/config.c
@@ -33,8 +33,8 @@
_(SDLK_1), _(SDLK_2), _(SDLK_3), _(SDLK_4), _(SDLK_5), _(SDLK_6), _(SDLK_7), _(SDLK_8), _(SDLK_9), _(SDLK_0), _(SDLK_MINUS), _(SDLK_EQUALS), _(SDLK_BACKSPACE), N, N, N, N, N, N, N,
// Replay Ref State
C(SDLK_1), C(SDLK_2), C(SDLK_3), C(SDLK_4), C(SDLK_5), C(SDLK_6), C(SDLK_7), C(SDLK_8), C(SDLK_9), C(SDLK_0), C(SDLK_MINUS), C(SDLK_EQUALS), C(SDLK_BACKSPACE), N, N, N, N, N, N, N,
- // CheatLife, CheatKeys, ClearKeyLog, StopReplay, Fullscreen, Reset, Pause, PauseDimmed, Turbo, ZoomIn, ZoomOut, DisplayPerf, ToggleRenderer
- _(SDLK_w), _(SDLK_o), _(SDLK_k), _(SDLK_l), A(SDLK_RETURN), _(SDLK_e), S(SDLK_p), _(SDLK_p), _(SDLK_t), N, N, _(SDLK_f), _(SDLK_r),
+ // CheatLife, CheatKeys, CheatEquipment, ClearKeyLog, StopReplay, Fullscreen, Reset, Pause, PauseDimmed, Turbo, ZoomIn, ZoomOut, DisplayPerf, ToggleRenderer
+ _(SDLK_w), _(SDLK_o), S(SDLK_w), _(SDLK_k), _(SDLK_l), A(SDLK_RETURN), _(SDLK_e), S(SDLK_p), _(SDLK_p), _(SDLK_t), N, N, _(SDLK_f), _(SDLK_r),
};
#undef _
#undef A
@@ -51,7 +51,7 @@
#define S(n) {#n, kKeys_##n, 1}
static const KeyNameId kKeyNameId[] = {
M(Controls), M(Load), M(Save), M(Replay), M(LoadRef), M(ReplayRef),
- S(CheatLife), S(CheatKeys), S(ClearKeyLog), S(StopReplay), S(Fullscreen), S(Reset),
+ S(CheatLife), S(CheatKeys), S(CheatEquipment), S(ClearKeyLog), S(StopReplay), S(Fullscreen), S(Reset),
S(Pause), S(PauseDimmed), S(Turbo), S(ZoomIn), S(ZoomOut), S(DisplayPerf), S(ToggleRenderer),
};
#undef S
--- a/config.h
+++ b/config.h
@@ -17,6 +17,7 @@
kKeys_ReplayRef_Last = kKeys_ReplayRef + 19,
kKeys_CheatLife,
kKeys_CheatKeys,
+ kKeys_CheatEquipment,
kKeys_ClearKeyLog,
kKeys_StopReplay,
kKeys_Fullscreen,
--- a/main.c
+++ b/main.c
@@ -420,6 +420,7 @@
} else {
switch (j) {
case kKeys_CheatLife: PatchCommand('w'); break;
+ case kKeys_CheatEquipment: PatchCommand('W'); break;
case kKeys_CheatKeys: PatchCommand('o'); break;
case kKeys_ClearKeyLog: PatchCommand('k'); break;
case kKeys_StopReplay: PatchCommand('l'); break;
--- a/zelda_cpu_infra.c
+++ b/zelda_cpu_infra.c
@@ -999,6 +999,12 @@
StateRecoderMultiPatch_Patch(&mp, 0xf372, 80); // health filler
StateRecoderMultiPatch_Patch(&mp, 0xf373, 80); // magic filler
// b.Patch(0x1FE01, 25);
+ } else if (c == 'W') {
+ StateRecoderMultiPatch_Patch(&mp, 0xf375, 10); // link_bomb_filler
+ StateRecoderMultiPatch_Patch(&mp, 0xf376, 10); // link_arrow_filler
+ uint16 rupees = link_rupees_goal + 100;
+ StateRecoderMultiPatch_Patch(&mp, 0xf360, rupees); // link_rupees_goal
+ StateRecoderMultiPatch_Patch(&mp, 0xf361, rupees >> 8); // link_rupees_goal
} else if (c == 'k') {
StateRecorder_ClearKeyLog(&state_recorder);
} else if (c == 'o') {