summaryrefslogtreecommitdiff
path: root/src/code/fault.c
diff options
context:
space:
mode:
authorsilv3rwing07 <62714207+silv3rwing07@users.noreply.github.com>2020-04-14 10:17:25 -0700
committerGitHub <noreply@github.com>2020-04-14 13:17:25 -0400
commit5aef81071e501fbbe5298a433ead06a625cdb3d8 (patch)
tree686ccf568a7f05bd7741be96cd22f51d358451d4 /src/code/fault.c
parent16646aa34d533b36e3a93985ae59cbefdf58b6d4 (diff)
padmgr and related (#71)
* In process of moving changes over from old repo * Merged in changes * Finished import of padmgr changes from old repo * Adjusted some volatile * Improving padmgr volatile situation * Almost matched osReadMempak * Working on osMempakDataCRC * Explanations and equivalents but no matches for osMempakAddrCRC and osMempakDataCRC * OK after merge * Matched osMempakAddrCRC and osMempakDataCRC * Matched osReadMempak * Updated PadMgr function names to be less like original code * Changed variable names to make them further from original code * Changed names and it stopped matching * Undid clang-format steamrollering whitespace memes * Cleaned up Input names * More formatting changes * Moved padmgr to z64.h, deleted padmgr.h
Diffstat (limited to 'src/code/fault.c')
-rw-r--r--src/code/fault.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/code/fault.c b/src/code/fault.c
index b3270ea7c..469ef799d 100644
--- a/src/code/fault.c
+++ b/src/code/fault.c
@@ -250,7 +250,7 @@ void Fault_Sleep(u32 duration) {
void Fault_PadCallback(Input* input) {
// BUG: this function is not called correctly and thus will crash from reading a bad pointer at 0x800C7E4C
- func_800C7E08(input, 0);
+ PadMgr_RequestPadData(input, 0);
}
void Fault_UpdatePadImpl() {
@@ -270,7 +270,7 @@ u32 Fault_WaitForInputImpl() {
Fault_Sleep(0x10);
Fault_UpdatePadImpl();
- kDown = curInput->padPressed;
+ kDown = curInput->press.in.button;
if (kDown == 0x20) {
sFaultStructPtr->faultActive = !sFaultStructPtr->faultActive;
@@ -583,7 +583,7 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1) {
count--;
Fault_Sleep(0x10);
Fault_UpdatePadImpl();
- if (!~(curInput->padPressed | ~L_TRIG)) {
+ if (!~(curInput->press.in.button | ~L_TRIG)) {
sFaultStructPtr->faultActive = false;
}
}
@@ -591,42 +591,42 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1) {
do {
Fault_Sleep(0x10);
Fault_UpdatePadImpl();
- } while (curInput->padPressed == 0);
+ } while (curInput->press.in.button == 0);
- if (!~(curInput->padPressed | ~START_BUTTON)) {
+ if (!~(curInput->press.in.button | ~START_BUTTON)) {
return;
}
- if (!~(curInput->raw.pad | ~A_BUTTON)) {
+ if (!~(curInput->cur.in.button | ~A_BUTTON)) {
return;
}
off = 0x10;
- if (!~(curInput->raw.pad | ~Z_TRIG)) {
+ if (!~(curInput->cur.in.button | ~Z_TRIG)) {
off = 0x100;
}
- if (!~(curInput->raw.pad | ~B_BUTTON)) {
+ if (!~(curInput->cur.in.button | ~B_BUTTON)) {
off <<= 8;
}
- if (!~(curInput->raw.pad | ~U_JPAD)) {
+ if (!~(curInput->cur.in.button | ~U_JPAD)) {
addr -= off;
}
- if (!~(curInput->raw.pad | ~D_JPAD)) {
+ if (!~(curInput->cur.in.button | ~D_JPAD)) {
addr += off;
}
- if (!~(curInput->raw.pad | ~U_CBUTTONS)) {
+ if (!~(curInput->cur.in.button | ~U_CBUTTONS)) {
addr = pc;
}
- if (!~(curInput->raw.pad | ~D_CBUTTONS)) {
+ if (!~(curInput->cur.in.button | ~D_CBUTTONS)) {
addr = sp;
}
- if (!~(curInput->raw.pad | ~L_CBUTTONS)) {
+ if (!~(curInput->cur.in.button | ~L_CBUTTONS)) {
addr = unk0;
}
- if (!~(curInput->raw.pad | ~R_CBUTTONS)) {
+ if (!~(curInput->cur.in.button | ~R_CBUTTONS)) {
addr = unk1;
}
- if (!~(curInput->raw.pad | ~L_TRIG)) {
+ if (!~(curInput->cur.in.button | ~L_TRIG)) {
break;
}
}