Skip to content

Commit

Permalink
fix inputs on first actionable frame
Browse files Browse the repository at this point in the history
  • Loading branch information
JLaferri committed Dec 14, 2022
1 parent 1c93be8 commit bd57a70
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Online/Core/TriggerSendInput.asm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ PROCESS_NOT_ROLLBACK:
# both replays are identical when considering only finalized frames
################################################################################
lbz r3, ODB_DELAY_FRAMES(REG_ODB_ADDRESS)
li r4, UNFREEZE_INPUTS_FRAME
li r4, START_SYNC_FRAME
sub r3, r4, r3
cmpw REG_FRAME_INDEX, r3 # Frame 84 +/- 1 (not sure) is first unfrozen frame
bge SKIP_FROZEN_INPUT_CLEAR
Expand Down Expand Up @@ -767,7 +767,7 @@ logf LOG_LEVEL_NOTICE, "[TSI] [%d] (Opp) P%d Needs Prediction"
# Don't save any states at the start of the game, it's frozen anyway
# and there might still be stuff loading
lbz r3, ODB_DELAY_FRAMES(REG_ODB_ADDRESS)
li r4, UNFREEZE_INPUTS_FRAME
li r4, START_SYNC_FRAME
sub r3, r4, r3
cmpw REG_FRAME_INDEX, r3 # Frame 84 +/- 1 (not sure) is first unfrozen frame
blt LOAD_STALE_INPUTS
Expand Down
5 changes: 5 additions & 0 deletions Online/Online.s
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@

.set UNFREEZE_INPUTS_FRAME, 84

# Inputs before freeze time are important because if they get zero'd out, inputs on the first
# actionable frame will be treated as new inputs rather than held inputs.
# Think 5 should be more than enough (pad buffer size), 6 to be safe
.set START_SYNC_FRAME, UNFREEZE_INPUTS_FRAME - 6

.set STATIC_PLAYER_BLOCK_P1, 0x80453080
.set STATIC_PLAYER_BLOCK_LEN, 0xE90

Expand Down
4 changes: 2 additions & 2 deletions Output/Netplay/GALE01r2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,7 @@ C2376A28 000000F2 #Online/Core/TriggerSendInput.asm
887B00DF 2C030000
41820010 887B00E0
2C030000 4182067C
887B0021 38800054
887B0021 3880004E
7C632050 7C1A1800
4080001C 387E002C
38800030 3D808000
Expand Down Expand Up @@ -1982,7 +1982,7 @@ BA8100B0 800100E4
1CD40004 38C6001A
7C66C02E 7C7A1850
2C030000 408000D8
887B0021 38800054
887B0021 3880004E
7C632050 7C1A1800
418000C0 887B000F
2C030001 418200B4
Expand Down
4 changes: 2 additions & 2 deletions Output/Netplay/GALJ01r2.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1811,7 +1811,7 @@ C2376A28 000000F2 #Online/Core/TriggerSendInput.asm
887B00DF 2C030000
41820010 887B00E0
2C030000 4182067C
887B0021 38800054
887B0021 3880004E
7C632050 7C1A1800
4080001C 387E002C
38800030 3D808000
Expand Down Expand Up @@ -1981,7 +1981,7 @@ BA8100B0 800100E4
1CD40004 38C6001A
7C66C02E 7C7A1850
2C030000 408000D8
887B0021 38800054
887B0021 3880004E
7C632050 7C1A1800
418000C0 887B000F
2C030001 418200B4
Expand Down

0 comments on commit bd57a70

Please sign in to comment.