summaryrefslogtreecommitdiff
path: root/src/code/z_debug.c
diff options
context:
space:
mode:
authorRandom <28494085+Random06457@users.noreply.github.com>2020-05-22 14:33:10 +0200
committerGitHub <noreply@github.com>2020-05-22 08:33:10 -0400
commit89b0977e39a744838ce7053a40ad3c3e37a2f491 (patch)
tree98921654498a18f7ee58e08e2ba0c6396d28408a /src/code/z_debug.c
parent9a478a96ec3fe329e643383a6a246d5553831158 (diff)
Decompile code_8008E6A0.c / Add CHECK_PAD macro (#156)
* Decompile code_8008E6A0.c * Delete "counter" file
Diffstat (limited to 'src/code/z_debug.c')
-rw-r--r--src/code/z_debug.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/code/z_debug.c b/src/code/z_debug.c
index fc663c3d2..bcb40d16e 100644
--- a/src/code/z_debug.c
+++ b/src/code/z_debug.c
@@ -115,8 +115,7 @@ void func_8006390C(Input* input) {
regGroup = (gGameInfo->regGroup * REG_PAGES + gGameInfo->regPage) * REG_PER_PAGE - REG_PER_PAGE;
dpad = input->cur.in.button & (U_JPAD | L_JPAD | R_JPAD | D_JPAD);
- if (!~(input->cur.in.button | ~L_TRIG) || !~(input->cur.in.button | ~R_TRIG) ||
- !~(input->cur.in.button | ~START_BUTTON)) {
+ if (CHECK_PAD(input->cur, L_TRIG) || CHECK_PAD(input->cur, R_TRIG) || CHECK_PAD(input->cur, START_BUTTON)) {
input_combo = inputCombos;
for (i = 0; i < REG_GROUPS; i++) {
if (~(~input_combo->push | input->cur.in.button) || ~(~input_combo->held | input->press.in.button)) {
@@ -157,16 +156,15 @@ void func_8006390C(Input* input) {
increment =
(dpad & R_JPAD)
- ? (!~(input->cur.in.button | ~(A_BUTTON | B_BUTTON))
+ ? (CHECK_PAD(input->cur, A_BUTTON | B_BUTTON)
? 1000
- : !~(input->cur.in.button | ~A_BUTTON) ? 100
- : !~(input->cur.in.button | ~B_BUTTON) ? 10 : 1)
- : (dpad & L_JPAD) ? (!~(input->cur.in.button | ~(A_BUTTON | B_BUTTON))
- ? -1000
- : !~(input->cur.in.button | ~A_BUTTON)
- ? -100
- : !~(input->cur.in.button | ~B_BUTTON) ? -10 : -1)
- : 0;
+ : CHECK_PAD(input->cur, A_BUTTON) ? 100 : CHECK_PAD(input->cur, B_BUTTON) ? 10 : 1)
+ : (dpad & L_JPAD)
+ ? (CHECK_PAD(input->cur, A_BUTTON | B_BUTTON)
+ ? -1000
+ : CHECK_PAD(input->cur, A_BUTTON) ? -100
+ : CHECK_PAD(input->cur, B_BUTTON) ? -10 : -1)
+ : 0;
gGameInfo->data[gGameInfo->regCur + regGroup] += increment;
if (dpad & U_JPAD) {