Skip to content

Commit

Permalink
[XCX] Port to most versions, added freecam mode and other changes
Browse files Browse the repository at this point in the history
Thanks to @intra2 for the work!
  • Loading branch information
intra2 authored Sep 25, 2022
1 parent 240179e commit 97c0d90
Show file tree
Hide file tree
Showing 113 changed files with 1,998 additions and 906 deletions.
5 changes: 2 additions & 3 deletions src/XenobladeChroniclesX/Mods/60FPS/patch_Cutscene.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[XCX_FPS++_Cutscene]
moduleMatches = 0xF882D5CF, 0x30B6E091, 0x7672271D ; 1.0.1E, 1.0.2U, 1.0.2J

moduleMatches = 0xF882D5CF, 0x30B6E091, 0x7672271D, 0x218F6E07, 0xAB97DE6B, 0x676EB33E, 0x785CA8A9 ; 1.0.1E, 1.0.2U, 1.0.2J, 1.0.0E, 1.0.1U, 1.0.0U, 1.0.0J
.origin = codecave

forceCutsceneLimit:
Expand Down Expand Up @@ -109,4 +108,4 @@ mr r4, r10
lis r10, const_30@ha
lfs f10, const_30@l(r10)

b _setGameSpeed
b _setGameSpeed
147 changes: 116 additions & 31 deletions src/XenobladeChroniclesX/Mods/60FPS/patch_GameSpeed.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[XCX_FPS++_GameSpeed]
moduleMatches = 0xF882D5CF, 0x30B6E091, 0x7672271D ; 1.0.1E, 1.0.2U, 1.0.2J

moduleMatches = 0xF882D5CF, 0x30B6E091, 0x7672271D, 0x218F6E07, 0xAB97DE6B, 0x676EB33E, 0x785CA8A9 ; 1.0.1E, 1.0.2U, 1.0.2J, 1.0.0E, 1.0.1U, 1.0.0U, 1.0.0J
.origin = codecave

# Constants
Expand Down Expand Up @@ -248,8 +247,8 @@ lwz r10, 0x14(r1)
blr


[XCX_FPS++_GameSpeed_V101E]
moduleMatches = 0xF882D5CF
[XCX_FPS++_GameSpeed_V101E] ; #####################################################################################################################################################
moduleMatches = 0xF882D5CF, 0x218F6E07 ; 1.0.1E, 1.0.0E

; Global data patch
0x10171980 = havokHalfSpeed:
Expand Down Expand Up @@ -291,8 +290,51 @@ moduleMatches = 0xF882D5CF
# 0x027A33DC = lfs f1, averageFPS1Inv@l(r10) ; But introduces shake and stutter issue. CODE XREF: ev::CEvtManager::startPage((float,bool))+6Cj


[XCX_FPS++_GameSpeed_V102J]
moduleMatches = 0x7672271D
[XCX_FPS++_GameSpeed_V102U] ; #####################################################################################################################################################
moduleMatches = 0x30B6E091 ; 1.0.2U

; Global data patch
0x10171980 = havokHalfSpeed:
0x10171980 = .float $fpsLimit
0x100598E4 = titleScreenSpeed:
0x100598E4 = .float (30.0/$fpsLimit)
0x10012644 = soulVoiceSpeed:
0x10012644 = .float (900/$fpsLimit)

; Instruction-specific patches
0x02228274 = lis r5, averageFPS0.1@ha ; Controller acceleration
0x0222827C = lfs f30, averageFPS0.1@l(r5) ; Controller acceleration
0x0273E3CC = lis r7, averageFPS1Inv@ha ; Sync elevator, vehicles etc
0x0273E3D0 = lfs f31, averageFPS1Inv@l(r7) ; Sync elevator, vehicles etc
0x0276A85C = lis r8, averageFPS1Inv@ha ; Sync in-game cutscenes
0x0276A860 = lfs f31, averageFPS1Inv@l(r8) ; Sync in-game cutscenes
0x025F299C = lis r12, averageFPS1Inv@ha ; Move__11CfSceneTaskFv ; Filter CPU, 30FPS logic
0x025F29A4 = lfs f31, averageFPS1Inv@l(r12) ; Move__11CfSceneTaskFv
# 0x02D39CE0 = lis r12, const_guiSpeed@ha ; AnimeObject::set
# 0x02D39CE4 = lfs f13, const_guiSpeed@l(r12) ; AnimeObject::set
0x02D202C8 = lis r12, const_guiSpeed@ha ; MenuObject::playEvent
0x02D202CC = lfs f31, const_guiSpeed@l(r12) ; MenuObject::playEvent
0x02D20394 = lis r12, const_guiSpeed@ha ; MenuObject::playEventFrame
0x02D20398 = lfs f31, const_guiSpeed@l(r12) ; MenuObject::playEventFrame

; Call GX2SetSwapInterval with 0 which removes any vsync
0x02FD8A34 = li r3, 0
; Use FPS waiting logic even with swap interval being 0
0x02FD59B4 = li r3, 1

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
# 0x027398C0 = lfs f1, averageFPS1@l(r11) ; Double updateEventParam cutscenes
# 0x027A33D8 = lis r10, averageFPS1Inv@ha ; Half SyncFrame cinematic cutscene, fixes timing issues with cinematic cutscenes
# 0x027A33DC = lfs f1, averageFPS1Inv@l(r10) ; But introduces shake and stutter issue. CODE XREF: ev::CEvtManager::startPage((float,bool))+6Cj


[XCX_FPS++_GameSpeed_V102J] ; #####################################################################################################################################################
moduleMatches = 0x7672271D ; 1.0.2J

; Global data patch
0x10171570 = havokHalfSpeed:
Expand Down Expand Up @@ -334,12 +376,12 @@ moduleMatches = 0x7672271D
# 0x027A1124 = lfs f1, averageFPS1Inv@l(r10) ; But introduces shake and stutter issue. CODE XREF: ev::CEvtManager::startPage((float,bool))+6Cj


[XCX_FPS++_GameSpeed_V102U]
moduleMatches = 0x30B6E091
[XCX_FPS++_GameSpeed_V100U] ; #####################################################################################################################################################
moduleMatches = 0xAB97DE6B, 0x676EB33E ; 1.0.1U, 1.0.0U

; Global data patch
0x10171980 = havokHalfSpeed:
0x10171980 = .float $fpsLimit
0x10171880 = havokHalfSpeed:
0x10171880 = .float $fpsLimit
0x100598E4 = titleScreenSpeed:
0x100598E4 = .float (30.0/$fpsLimit)
0x10012644 = soulVoiceSpeed:
Expand All @@ -348,30 +390,73 @@ moduleMatches = 0x30B6E091
; Instruction-specific patches
0x02228274 = lis r5, averageFPS0.1@ha ; Controller acceleration
0x0222827C = lfs f30, averageFPS0.1@l(r5) ; Controller acceleration
0x0273E3CC = lis r7, averageFPS1Inv@ha ; Sync elevator, vehicles etc
0x0273E3D0 = lfs f31, averageFPS1Inv@l(r7) ; Sync elevator, vehicles etc
0x0276A85C = lis r8, averageFPS1Inv@ha ; Sync in-game cutscenes
0x0276A860 = lfs f31, averageFPS1Inv@l(r8) ; Sync in-game cutscenes
0x025F299C = lis r12, averageFPS1Inv@ha ; Move__11CfSceneTaskFv ; Filter CPU, 30FPS logic
0x025F29A4 = lfs f31, averageFPS1Inv@l(r12) ; Move__11CfSceneTaskFv
# 0x02D39CE0 = lis r12, const_guiSpeed@ha ; AnimeObject::set
# 0x02D39CE4 = lfs f13, const_guiSpeed@l(r12) ; AnimeObject::set
0x02D202C8 = lis r12, const_guiSpeed@ha ; MenuObject::playEvent
0x02D202CC = lfs f31, const_guiSpeed@l(r12) ; MenuObject::playEvent
0x02D20394 = lis r12, const_guiSpeed@ha ; MenuObject::playEventFrame
0x02D20398 = lfs f31, const_guiSpeed@l(r12) ; MenuObject::playEventFrame
0x0273E36C = lis r7, averageFPS1Inv@ha ; Sync elevator, vehicles etc
0x0273E370 = lfs f31, averageFPS1Inv@l(r7) ; Sync elevator, vehicles etc
0x0276A7FC = lis r8, averageFPS1Inv@ha ; Sync in-game cutscenes
0x0276A800 = lfs f31, averageFPS1Inv@l(r8) ; Sync in-game cutscenes
0x025F292C = lis r12, averageFPS1Inv@ha ; Move__11CfSceneTaskFv ; Filter CPU, 30FPS logic
0x025F2934 = lfs f31, averageFPS1Inv@l(r12) ; Move__11CfSceneTaskFv
# 0x02D39B68 = lis r12, const_guiSpeed@ha ; AnimeObject::set
# 0x02D39B6C = lfs f13, const_guiSpeed@l(r12) ; AnimeObject::set
0x02D20150 = lis r12, const_guiSpeed@ha ; MenuObject::playEvent
0x02D20154 = lfs f31, const_guiSpeed@l(r12) ; MenuObject::playEvent
0x02D2021C = lis r12, const_guiSpeed@ha ; MenuObject::playEventFrame
0x02D20220 = lfs f31, const_guiSpeed@l(r12) ; MenuObject::playEventFrame

; Call GX2SetSwapInterval with 0 which removes any vsync
0x02FD8A34 = li r3, 0
0x02FD88BC = li r3, 0
; Use FPS waiting logic even with swap interval being 0
0x02FD59B4 = li r3, 1
0x02FD583C = li r3, 1

0x02FD5A54 = bla _calculateGamespeed
0x027685B0 = bla _useCutsceneLimit
0x03AC2790 = bla _usePrerenderedCutsceneLimit
0x02FD58DC = bla _calculateGamespeed
0x02768550 = bla _useCutsceneLimit
0x03AC2610 = bla _usePrerenderedCutsceneLimit

# These patches are replaced by lowering the framerate to prevent side-effects
# 0x027398B4 = lis r11, averageFPS1@ha ; Double updateEventParam cutscenes
# 0x027398C0 = lfs f1, averageFPS1@l(r11) ; Double updateEventParam cutscenes
# 0x027A33D8 = lis r10, averageFPS1Inv@ha ; Half SyncFrame cinematic cutscene, fixes timing issues with cinematic cutscenes
# 0x027A33DC = lfs f1, averageFPS1Inv@l(r10) ; But introduces shake and stutter issue. CODE XREF: ev::CEvtManager::startPage((float,bool))+6Cj
# 0x02739854 = lis r11, averageFPS1@ha ; Double updateEventParam cutscenes
# 0x02739860 = lfs f1, averageFPS1@l(r11) ; Double updateEventParam cutscenes
# 0x027A3378 = lis r10, averageFPS1Inv@ha ; Half SyncFrame cinematic cutscene, fixes timing issues with cinematic cutscenes
# 0x027A337C = lfs f1, averageFPS1Inv@l(r10) ; But introduces shake and stutter issue. CODE XREF: ev::CEvtManager::startPage((float,bool))+6Cj


[XCX_FPS++_GameSpeed_V100J] ; #####################################################################################################################################################
moduleMatches = 0x785CA8A9 ; 1.0.0J

; Global data patch
0x10171070 = havokHalfSpeed:
0x10171070 = .float $fpsLimit
0x10059514 = titleScreenSpeed:
0x10059514 = .float (30.0/$fpsLimit)
0x1001260C = soulVoiceSpeed:
0x1001260C = .float (900/$fpsLimit)

; Instruction-specific patches
0x02227ABC = lis r5, averageFPS0.1@ha ; Controller acceleration
0x02227AC4 = lfs f30, averageFPS0.1@l(r5) ; Controller acceleration
0x0273BBD0 = lis r7, averageFPS1Inv@ha ; Sync elevator, vehicles etc
0x0273BBD4 = lfs f31, averageFPS1Inv@l(r7) ; Sync elevator, vehicles etc
0x02768064 = lis r8, averageFPS1Inv@ha ; Sync in-game cutscenes
0x02768068 = lfs f31, averageFPS1Inv@l(r8) ; Sync in-game cutscenes
0x025F149C = lis r12, averageFPS1Inv@ha ; Move__11CfSceneTaskFv ; Filter CPU, 30FPS logic
0x025F14A4 = lfs f31, averageFPS1Inv@l(r12) ; Move__11CfSceneTaskFv
# 0x02D30A10 = lis r12, const_guiSpeed@ha ; AnimeObject::set
# 0x02D30A14 = lfs f13, const_guiSpeed@l(r12) ; AnimeObject::set
0x02D1709C = lis r12, const_guiSpeed@ha ; MenuObject::playEvent
0x02D170A0 = lfs f31, const_guiSpeed@l(r12) ; MenuObject::playEvent
0x02D17168 = lis r12, const_guiSpeed@ha ; MenuObject::playEventFrame
0x02D1716C = lfs f31, const_guiSpeed@l(r12) ; MenuObject::playEventFrame

; Call GX2SetSwapInterval with 0 which removes any vsync
0x02FCEB9C = li r3, 0
; Use FPS waiting logic even with swap interval being 0
0x02FCBB1C = li r3, 1

0x02FCBBBC = bla _calculateGamespeed
0x02765DB8 = bla _useCutsceneLimit
0x03AB85A8 = bla _usePrerenderedCutsceneLimit

# These patches are replaced by lowering the framerate to prevent side-effects
# 0x027370B8 = lis r11, averageFPS1@ha ; Double updateEventParam cutscenes
# 0x027370C4 = lfs f1, averageFPS1@l(r11) ; Double updateEventParam cutscenes
# 0x027A0180 = lis r10, averageFPS1Inv@ha ; Half SyncFrame cinematic cutscene, fixes timing issues with cinematic cutscenes
# 0x027A0184 = lfs f1, averageFPS1Inv@l(r10) ; But introduces shake and stutter issue. CODE XREF: ev::CEvtManager::startPage((float,bool))+6Cj
25 changes: 11 additions & 14 deletions src/XenobladeChroniclesX/Mods/60FPS/patch_Overdrive.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[XCX_FPS++_Overdrive_General] ; ########################################################
moduleMatches = 0xF882D5CF, 0x30B6E091, 0x7672271D ; 1.0.1E, 1.0.2U, 1.0.2J

[XCX_FPS++_Overdrive_General]
moduleMatches = 0xF882D5CF, 0x30B6E091, 0x7672271D, 0x218F6E07, 0xAB97DE6B, 0x676EB33E, 0x785CA8A9 ; 1.0.1E, 1.0.2U, 1.0.2J, 1.0.0E, 1.0.1U, 1.0.0U, 1.0.0J
.origin = codecave

_over:
Expand All @@ -10,20 +9,18 @@ _over:
fmuls f1, f31, f1
blr

[XCX_FPS++_Overdrive_V101E] ; ########################################################
moduleMatches = 0xF882D5CF ; 1.0.1E

[XCX_FPS++_Overdrive_V101E_V102U_V100U]
moduleMatches = 0xF882D5CF, 0x30B6E091, 0x218F6E07, 0xAB97DE6B, 0x676EB33E ; 1.0.1E, 1.0.2U, 1.0.0E, 1.0.1U, 1.0.0U
0x021BC904 = bla _over ; Gear::CGear::update((float))
0x021E2020 = bla _over ; Gear::CMode::Update((float))

[XCX_FPS++_Overdrive_V102U] ; ########################################################
moduleMatches = 0x30B6E091 ; 1.0.2U

0x021BC904 = bla _over ; Gear::CGear::update((float))
0x021E2020 = bla _over ; Gear::CMode::Update((float))

[XCX_FPS++_Overdrive_V102J] ; ########################################################
[XCX_FPS++_Overdrive_V102J]
moduleMatches = 0x7672271D ; 1.0.2J

0x021BC3D0 = bla _over ; Gear::CGear::update((float))
0x021E1AEC = bla _over ; Gear::CMode::Update((float))
0x021E1AEC = bla _over ; Gear::CMode::Update((float))

[XCX_FPS++_Overdrive_V100J]
moduleMatches = 0x785CA8A9 ; 1.0.0J
0x021BC14C = bla _over ; Gear::CGear::update((float))
0x021E1868 = bla _over ; Gear::CMode::Update((float))
36 changes: 24 additions & 12 deletions src/XenobladeChroniclesX/Mods/60FPS/patch_QTE.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[XCX_FPS++_QTE_General] ; ########################################################
moduleMatches = 0xF882D5CF, 0x30B6E091, 0x7672271D ; 1.0.1E, 1.0.2U, 1.0.2J

[XCX_FPS++_QTE_General]
moduleMatches = 0xF882D5CF, 0x30B6E091, 0x7672271D, 0x218F6E07, 0xAB97DE6B, 0x676EB33E, 0x785CA8A9 ; 1.0.1E, 1.0.2U, 1.0.2J, 1.0.0E, 1.0.1U, 1.0.0U, 1.0.0J
.origin = codecave

timingFloatConv:
Expand Down Expand Up @@ -76,35 +75,48 @@ _justFrame2:

blr

[XCX_FPS++_QTE_V101E] ; ########################################################
moduleMatches = 0xF882D5CF ; 1.0.1E

[XCX_FPS++_QTE_V101E] ; ########################################################
moduleMatches = 0xF882D5CF, 0x218F6E07 ; 1.0.1E, 1.0.0E
; menu::MenuButtonChallenge::setup
0x02ACE40C = lis r7, averageFPS30Inv@ha
0x02ACE414 = lfs f0, averageFPS30Inv@l(r7)

; menu::MenuButtonChallenge::move
0x02ACE6E4 = bla _justFrame1
0x02ACE700 = bla _justFrame2

[XCX_FPS++_QTE_V102U] ; ########################################################
moduleMatches = 0x30B6E091 ; 1.0.2U

; menu::MenuButtonChallenge::setup
0x02ACE3FC = lis r7, averageFPS30Inv@ha
0x02ACE404 = lfs f0, averageFPS30Inv@l(r7)

; menu::MenuButtonChallenge::move
0x02ACE6D4 = bla _justFrame1
0x02ACE6F0 = bla _justFrame2

[XCX_FPS++_QTE_V102J]
[XCX_FPS++_QTE_V102J] ; ########################################################
moduleMatches = 0x7672271D ; 1.0.2J

; menu::MenuButtonChallenge::setup
0x02ACAA38 = lis r7, averageFPS30Inv@ha
0x02ACAA40 = lfs f0, averageFPS30Inv@l(r7)

; menu::MenuButtonChallenge::move
0x02ACAD10 = bla _justFrame1
0x02ACAD2C = bla _justFrame2
0x02ACAD2C = bla _justFrame2

[XCX_FPS++_QTE_V100U] ; ########################################################
moduleMatches = 0xAB97DE6B, 0x676EB33E ; 1.0.1U, 1.0.0U
; menu::MenuButtonChallenge::setup
0x02ACE380 = lis r7, averageFPS30Inv@ha
0x02ACE388 = lfs f0, averageFPS30Inv@l(r7)
; menu::MenuButtonChallenge::move
0x02ACE658 = bla _justFrame1
0x02ACE674 = bla _justFrame2

[XCX_FPS++_QTE_V100J] ; ########################################################
moduleMatches = 0x785CA8A9 ; 1.0.0J
; menu::MenuButtonChallenge::setup
0x02AC8C00 = lis r7, averageFPS30Inv@ha
0x02AC8C08 = lfs f0, averageFPS30Inv@l(r7)
; menu::MenuButtonChallenge::move
0x02AC8ED8 = bla _justFrame1
0x02AC8EF4 = bla _justFrame2
29 changes: 17 additions & 12 deletions src/XenobladeChroniclesX/Mods/BattleDamageModGround/patch_dmg.asm
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
[XCX_DAMAGES] ####################################################################################################################################
moduleMatches = 0xF882D5CF, 0x30B6E091 ; 1.0.1E, 1.0.2U

.origin = codecave

.int $mult

[XCX_DAMAGES_V101E]
moduleMatches = 0xF882D5CF, 0x218F6E07 ; 1.0.1E, 1.0.0E
0x02E0C5B0 = li r3, -1-$mult
0x025D896C = mulli r4, r31, $mult

[XCX_DAMAGES_1U] ####################################################################################################################################
moduleMatches = 0xAB97DE6B ; 1.0.1U

.origin = codecave
[XCX_DAMAGES_V102U]
moduleMatches = 0x30B6E091 ; 1.0.2U
0x02E0C550 = li r3, -1-$mult
0x025D896C = mulli r4, r31, $mult

.int $mult
;[XCX_DAMAGES_V102J]
;DO NOT port to JP 1.0.2 untill official game servers go offline

[XCX_DAMAGES_V100U]
moduleMatches = 0xAB97DE6B, 0x676EB33E ; 1.0.1U, 1.0.0U
0x02E0C3D8 = li r3, -1-$mult
0x025D88FC = mulli r4, r31, $mult

[XCX_DAMAGES_V100J]
moduleMatches = 0x785CA8A9 ; 1.0.0J
0x02E03228 = li r3, -1-$mult
0x025CD268 = mulli r4, r31, $mult
18 changes: 11 additions & 7 deletions src/XenobladeChroniclesX/Mods/BattleDamageModGround/rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,31 @@
titleIds = 0005000010116100,00050000101C4C00,00050000101C4D00
name = "Ground damage multiplicator"
path = "Xenoblade Chronicles X/Mods/Battle/Ground damage multiplicator"
description = Increase the ground damage done by your team (skells not impacted).
version = 5
description = Increase the damage done by your team. Doesn't affect the damage numbers that are shown.
version = 6

[Default]
$mult = 2

[Preset]
name = Damage x 2
name = Damage x2

[Preset]
name = Damage x 3
name = Damage x3
$mult = 3

[Preset]
name = Damage x 5
name = Damage x5
$mult = 5

[Preset]
name = Damage x 10
name = Damage x10
$mult = 10

[Preset]
name = Damage x 100
name = Damage x25
$mult = 25

[Preset]
name = Damage x100
$mult = 100
Loading

0 comments on commit 97c0d90

Please sign in to comment.