1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-08 00:44:42 +00:00

Decompile code_8008E6A0.c / Add CHECK_PAD macro (#156)

* Decompile code_8008E6A0.c

* Delete "counter" file
This commit is contained in:
Random 2020-05-22 14:33:10 +02:00 committed by GitHub
parent 9a478a96ec
commit 89b0977e39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 88 additions and 111 deletions

View file

@ -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) {