Skip to content

Commit

Permalink
[XCX] Apply cutscene fix to prerendered cutscenes
Browse files Browse the repository at this point in the history
  • Loading branch information
Crementif committed Aug 12, 2022
1 parent 20ab154 commit 1495a2d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
22 changes: 18 additions & 4 deletions src/XenobladeChroniclesX/Mods/60FPS/patch_Cutscene.asm
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,29 @@ forceCutsceneLimit:
.int 0

_useCutsceneLimit:
li r10, 1
li r10, 5
lis r9, forceCutsceneLimit@ha
stw r10, forceCutsceneLimit@l(r9)

lfs f11, -0x303C(r8)
blr

_usePrerenderedCutsceneLimit:
li r4, 5
lis r3, forceCutsceneLimit@ha
stw r4, forceCutsceneLimit@l(r3)

lwz r3, 0x0(r30)
blr

_resetCutsceneLimit:
li r10, 0
lis r9, forceCutsceneLimit@ha
lwz r10, forceCutsceneLimit@l(r9)
cmpwi r10, 0
ble _restoreRegisters

li r9, -1
add r10, r10, r9
lis r9, forceCutsceneLimit@ha
stw r10, forceCutsceneLimit@l(r9)
b _restoreRegisters
Expand All @@ -34,8 +48,8 @@ cmpwi r10, 1
bne _calculateFPS
lis r10, forceCutsceneLimit@ha
lwz r10, forceCutsceneLimit@l(r10)
cmpwi r10, 1
bne _calculateFPS
cmpwi r10, 0
ble _calculateFPS

; If a cutscene FPS limit is set, lower FPS
_lowerCutsceneFPS:
Expand Down
3 changes: 3 additions & 0 deletions src/XenobladeChroniclesX/Mods/60FPS/patch_GameSpeed.asm
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ moduleMatches = 0xF882D5CF

0x02FD5AB4 = bla _calculateGamespeed
0x027685B0 = bla _useCutsceneLimit
0x03AC2810 = bla _usePrerenderedCutsceneLimit

# These patches are replaced by lowering the framerate to prevent side-effects
# 0x027398B4 = lis r11, averageFPS1@ha ; Double updateEventParam cutscenes
Expand Down Expand Up @@ -324,6 +325,7 @@ moduleMatches = 0x7672271D

0x02FD0F7C = bla _calculateGamespeed
0x02766D28 = bla _useCutsceneLimit
0x03ABDBA8 = bla _usePrerenderedCutsceneLimit

# These patches are replaced by lowering the framerate to prevent side-effects
# 0x0273802C = lis r11, averageFPS1@ha ; Double updateEventParam cutscenes
Expand Down Expand Up @@ -366,6 +368,7 @@ moduleMatches = 0x30B6E091

0x02FD5A54 = bla _calculateGamespeed
0x027685B0 = bla _useCutsceneLimit
0x03AC2790 = bla _usePrerenderedCutsceneLimit

# These patches are replaced by lowering the framerate to prevent side-effects
# 0x027398B4 = lis r11, averageFPS1@ha ; Double updateEventParam cutscenes
Expand Down

0 comments on commit 1495a2d

Please sign in to comment.