Skip to content

Commit 9fd5e5c

Browse files
committed
[XCX] Fix black bar appearing in FPS mod
1 parent cd73846 commit 9fd5e5c

File tree

2 files changed

+15
-33
lines changed

2 files changed

+15
-33
lines changed

src/XenobladeChroniclesX/Mods/60FPS/patch_GameSpeed.asm

Lines changed: 15 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ const_30:
4646
const_60:
4747
.float 60.0
4848

49-
const_roundUpModifier:
50-
.float $roundUpModifier
51-
5249

5350
# Variables
5451

@@ -76,12 +73,6 @@ averageFPS1Inv:
7673
averageFPS0.1:
7774
.float ($fpsLimit/300.0)
7875

79-
averageFPS1IntInv:
80-
averageFPS1IntInvHa:
81-
.uint 0
82-
averageFPS1IntInvL:
83-
.uint 1
84-
8576
buffer:
8677
.float 30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30 ; buffer can only store a max length of 32 frames
8778

@@ -232,17 +223,6 @@ lfs f7, averageFPS30@l(r10)
232223
lis r10, havokHalfSpeed@ha
233224
stfs f7, havokHalfSpeed@l(r10)
234225

235-
; Calculate the FPS speed
236-
_calculateAverageFPSInt:
237-
lis r10, averageFPS1@ha
238-
lfs f7, averageFPS1@l(r10)
239-
lis r10, const_roundUpModifier@ha
240-
lfs f12, const_roundUpModifier@l(r10)
241-
fadds f7, f7, f12
242-
fctiwz f7, f7
243-
lis r10, averageFPS1IntInv@ha
244-
stfd f7, averageFPS1IntInv@l(r10)
245-
246226
; Reset the cutscene FPS limit each frame
247227
_callResetCutsceneLimit:
248228
b _resetCutsceneLimit
@@ -263,8 +243,11 @@ moduleMatches = 0xF882D5CF
263243

264244
; Global data patch
265245
0x10171980 = havokHalfSpeed:
246+
0x10171980 = .float $fpsLimit
266247
0x100598E4 = titleScreenSpeed:
248+
0x100598E4 = .float (30.0/$fpsLimit)
267249
0x10012644 = soulVoiceSpeed:
250+
0x10012644 = .float (900/$fpsLimit)
268251

269252
; Instruction-specific patches
270253
0x02228274 = lis r5, averageFPS0.1@ha ; Controller acceleration
@@ -275,10 +258,8 @@ moduleMatches = 0xF882D5CF
275258
0x0276A860 = lfs f31, averageFPS1Inv@l(r8) ; Sync in-game cutscenes
276259
0x025F299C = lis r12, averageFPS1Inv@ha ; Move__11CfSceneTaskFv ; Filter CPU, 30FPS logic
277260
0x025F29A4 = lfs f31, averageFPS1Inv@l(r12) ; Move__11CfSceneTaskFv
278-
0x02D20328 = lis r12, averageFPS1Inv@ha ; MenuObject::playEvent
279-
0x02D2032C = lfs f31, averageFPS1Inv@l(r12) ; MenuObject::playEvent
280-
0x02D203F4 = lis r12, averageFPS1Inv@ha ; MenuObject::playEventFrame
281-
0x02D203F8 = lfs f31, averageFPS1Inv@l(r12) ; MenuObject::playEventFrame
261+
0x02D39D6C = lis r12, averageFPS1Inv@ha ; AnimeObject::set
262+
0x02D39D70 = lfs f13, averageFPS1Inv@l(r12) ; AnimeObject::set
282263

283264
; Call GX2SetSwapInterval with 0 which removes any vsync
284265
0x02FD8A94 = li r3, 0
@@ -300,8 +281,11 @@ moduleMatches = 0x7672271D
300281

301282
; Global data patch
302283
0x10171570 = havokHalfSpeed:
284+
0x10171570 = .float $fpsLimit
303285
0x1005989C = titleScreenSpeed:
286+
0x1005989C = .float (30.0/$fpsLimit)
304287
0x10012644 = soulVoiceSpeed:
288+
0x10012644 = .float (900/$fpsLimit)
305289

306290
; Instruction-specific patches
307291
0x02227D40 = lis r5, averageFPS0.1@ha ; Controller acceleration
@@ -312,10 +296,8 @@ moduleMatches = 0x7672271D
312296
0x02768FD8 = lfs f31, averageFPS1Inv@l(r8) ; Sync in-game cutscenes
313297
0x025F1F78 = lis r12, averageFPS1Inv@ha ; Move__11CfSceneTaskFv ; Filter CPU, 30FPS logic
314298
0x025F1F80 = lfs f31, averageFPS1Inv@l(r12) ; Move__11CfSceneTaskFv
315-
0x02D1B818 = lis r12, averageFPS1Inv@ha ; MenuObject::playEvent
316-
0x02D1B81C = lfs f31, averageFPS1Inv@l(r12) ; MenuObject::playEvent
317-
0x02D1B8E4 = lis r12, averageFPS1Inv@ha ; MenuObject::playEventFrame
318-
0x02D1B8E8 = lfs f31, averageFPS1Inv@l(r12) ; MenuObject::playEventFrame
299+
0x02D35234 = lis r12, averageFPS1Inv@ha ; AnimeObject::set
300+
0x02D35238 = lfs f13, averageFPS1Inv@l(r12) ; AnimeObject::set
319301

320302
; Call GX2SetSwapInterval with 0 which removes any vsync
321303
0x02FD3F5C = li r3, 0
@@ -337,8 +319,11 @@ moduleMatches = 0x30B6E091
337319

338320
; Global data patch
339321
0x10171980 = havokHalfSpeed:
322+
0x10171980 = .float $fpsLimit
340323
0x100598E4 = titleScreenSpeed:
324+
0x100598E4 = .float (30.0/$fpsLimit)
341325
0x10012644 = soulVoiceSpeed:
326+
0x10012644 = .float (900/$fpsLimit)
342327

343328
; Instruction-specific patches
344329
0x02228274 = lis r5, averageFPS0.1@ha ; Controller acceleration
@@ -349,10 +334,8 @@ moduleMatches = 0x30B6E091
349334
0x0276A860 = lfs f31, averageFPS1Inv@l(r8) ; Sync in-game cutscenes
350335
0x025F299C = lis r12, averageFPS1Inv@ha ; Move__11CfSceneTaskFv ; Filter CPU, 30FPS logic
351336
0x025F29A4 = lfs f31, averageFPS1Inv@l(r12) ; Move__11CfSceneTaskFv
352-
0x02D202C8 = lis r12, averageFPS1Inv@ha ; MenuObject::playEvent
353-
0x02D202CC = lfs f31, averageFPS1Inv@l(r12) ; MenuObject::playEvent
354-
0x02D20394 = lis r12, averageFPS1Inv@ha ; MenuObject::playEventFrame
355-
0x02D20398 = lfs f31, averageFPS1Inv@l(r12) ; MenuObject::playEventFrame
337+
0x02D39CE0 = lis r12, averageFPS1Inv@ha ; AnimeObject::set
338+
0x02D39CE4 = lfs f13, averageFPS1Inv@l(r12) ; AnimeObject::set
356339

357340
; Call GX2SetSwapInterval with 0 which removes any vsync
358341
0x02FD8A34 = li r3, 0

src/XenobladeChroniclesX/Mods/60FPS/rules.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ $fpsLimit = 60
1010
$cutsceneFPSLimit:int = 1
1111
$lowFPSLimit = 20
1212
$frameAverageAmount = 8
13-
$roundUpModifier = 0.8
1413

1514
[Preset]
1615
name = 240FPS Limit

0 commit comments

Comments
 (0)