Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

padmgr and related #71

Merged
merged 20 commits into from
Apr 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
OK after merge
  • Loading branch information
silv3rwing07 committed Apr 12, 2020
commit 89832a09b84d0f3df6b500dd506e9a22e0aa9c84
1 change: 1 addition & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ build/src/libultra_boot_O2/%.o: CC := $(CC_OLD)

build/src/boot/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
build/src/code/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
#build/src/libultra_code/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
build/src/overlays/actors/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
build/src/overlays/effects/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
build/src/overlays/gamestates/%.o: CC := python3 tools/asm_processor/build.py $(CC) -- $(AS) $(ASFLAGS) --
Expand Down
4 changes: 1 addition & 3 deletions src/code/code_800D31A0.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ void func_800D31A0() {
}

void func_800D31F0() {
PadMgr* padMgr = (PadMgr*)(u32)&gPadMgr; // cast required to match

D_8012DBC0 = (padMgr->unk_2A8 & 2) != 0;
D_8012DBC0 = (gPadMgr.valid_ctrlrs_mask & 2) != 0;
}

void func_800D3210() {
Expand Down
4 changes: 2 additions & 2 deletions src/code/graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,8 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) {
}
sGraphUpdateTime = time;

if (D_8012DBC0 && (!~(gameState->input[0].padPressed | ~Z_TRIG)) &&
(!~(gameState->input[0].raw.pad | ~(L_TRIG | R_TRIG)))) {
if (D_8012DBC0 && (!~(gameState->input[0].pressed_diff.input.button | ~Z_TRIG)) &&
(!~(gameState->input[0].current.input.button | ~(L_TRIG | R_TRIG)))) {
gSaveContext.game_mode = 0;
SET_NEXT_GAMESTATE(gameState, func_80801E44, char[0x240]); // TODO : SelectContext
gameState->running = false;
Expand Down
21 changes: 4 additions & 17 deletions src/code/z_demo.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,24 +443,15 @@ void Cutscene_Command_Terminator(GlobalContext* globalCtx, CutsceneContext* csCt

if ((gSaveContext.game_mode != 0) && (gSaveContext.game_mode != 3) && (globalCtx->sceneNum != SCENE_SPOT00) &&
(csCtx->frames > 20) &&
<<<<<<< HEAD
(!~(globalCtx->state.input[0].pressed_diff.input.button | 0xFFFF7FFF) || !~(globalCtx->state.input[0].pressed_diff.input.button | -0x4001) ||
!~(globalCtx->state.input[0].pressed_diff.input.button | -0x1001)) &&
=======
(!~(globalCtx->state.input[0].padPressed | ~A_BUTTON) || !~(globalCtx->state.input[0].padPressed | ~B_BUTTON) ||
!~(globalCtx->state.input[0].padPressed | ~START_BUTTON)) &&
>>>>>>> upstream/master
(!~(globalCtx->state.input[0].pressed_diff.input.button | ~A_BUTTON) || !~(globalCtx->state.input[0].pressed_diff.input.button | ~B_BUTTON) ||
!~(globalCtx->state.input[0].pressed_diff.input.button | ~START_BUTTON)) &&
silv3rwing07 marked this conversation as resolved.
Show resolved Hide resolved
(gSaveContext.file_num != 0xFEDC) && (globalCtx->sceneLoadFlag == 0)) {
Audio_PlaySoundGeneral(NA_SE_SY_PIECE_OF_HEART, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8);
temp = 1;
}

if ((csCtx->frames == cmd->startFrame) || (temp != 0) ||
<<<<<<< HEAD
((csCtx->frames > 20) && (!~(globalCtx->state.input[0].pressed_diff.input.button | -0x1001)) &&
=======
((csCtx->frames > 20) && (!~(globalCtx->state.input[0].padPressed | ~START_BUTTON)) &&
>>>>>>> upstream/master
((csCtx->frames > 20) && (!~(globalCtx->state.input[0].pressed_diff.input.button | ~START_BUTTON)) &&
(gSaveContext.file_num != 0xFEDC))) {
csCtx->state = CS_STATE_UNSKIPPABLE_EXEC;
func_800F68BC(0);
Expand Down Expand Up @@ -1532,11 +1523,7 @@ void Cutscene_ProcessCommands(GlobalContext* globalCtx, CutsceneContext* csCtx,
return;
}

<<<<<<< HEAD
if (!~(globalCtx->state.input[0].pressed_diff.input.button | -0x101)) {
=======
if (!~(globalCtx->state.input[0].padPressed | ~R_JPAD)) {
>>>>>>> upstream/master
if (!~(globalCtx->state.input[0].pressed_diff.input.button | ~R_JPAD)) {
csCtx->state = CS_STATE_UNSKIPPABLE_INIT;
return;
}
Expand Down