mirror of
https://github.com/zeldaret/oot.git
synced 2025-07-06 16:04:35 +00:00
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
This commit is contained in:
parent
16646aa34d
commit
5aef81071e
45 changed files with 640 additions and 789 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue