[TPHD] Add multiple new cheats and a new Screen Mirroring pack (#721)

Thanks to @Ori-Jakob for adding some new exciting graphic packs:
- New Screen Mirroring mode to force the mirror or normal mode.
  This works irrespective of the type of save you have (Normal or Hero mode). It even works on the fly while playing the game.
- The new mega cheats graphic pack which includes the following options:
  - Moon Jump
  - Always Great Spin Attack
  - Rupee Multiplier
  - Damage Multiplier
  - Never Decrease (Ammo)
  - Climb/Crawl Fast
  - Faster Rolling
  - Drop Duration Modifiers
This commit is contained in:
Ori Jakob
2025-09-11 09:55:09 -04:00
committed by GitHub
parent 465ca17256
commit ef6da25644
4 changed files with 685 additions and 0 deletions

View File

@@ -0,0 +1,241 @@
[TPHDv81]
moduleMatches = 0x1A03E108, 0xA3175EEA
.origin = codecave
;########### variable setup
_controlleraddy:
.int $controller
_moonjumpBtnCombo:
.int $moon_jmp_btn_combo
_gravity:
.float $gravity
_heartdecmult:
.float $heart_dec_mult
_climbspeed:
.float $climb_speed
_climbfast:
.byte $climb_fast
_rupmult:
.byte $rup_mult
_rupinc:
.byte $rup_inc
_heartdec:
.byte $heart_dec
_arrowdec:
.byte $arrow_dec
_bombdec:
.byte $bomb_dec
_oildec:
.byte $oil_dec
_seeddec:
.byte $seed_dec
;###########
;########### asm modifications
;########### rupee multiplier and rupees always increase
rupeelogic:
lwz r12, +0x6280(r31)
lis r4, _rupmult@ha
lbz r16, _rupmult@l(r4)
lbz r4, _rupinc@l(r4)
cmpwi r12, 0
bge handle_multiply
handle_spend:
cmpwi r4, 1
bne rupreturn
li r17, 0
sub r12, r17, r12
b handle_multiply
handle_multiply:
cmpwi r16, 2
blt rupreturn
mullw r12, r12, r16
rupreturn:
blr
;###########
;########### health never decreases and damage taken multiplier
healthdeclogic:
lis r14, _heartdec@ha
lbz r15, _heartdec@l(r14)
checkhealthdec:
cmpwi r15, 1
fsub f26, f26, f26
fcmpu cr1, f8, f26
bgt cr1, healthdecreturn
beq nohealthdec
lfs f26, _heartdecmult@l(r14)
fmul f8, f26, f8
b healthdecreturn
nohealthdec:
fsub f8, f8, f8
healthdecreturn:
fadds f9, f9, f8
blr
;###########
;########### arrows never decrease logic
arrowlogic:
lis r21, _arrowdec@ha
lbz r22, _arrowdec@l(r21)
cmpwi cr1, r22,0
beq cr1, arrowreturn
cmpwi cr1, r11, 0
bgt cr1, arrowreturn
xor r11, r11, r11
arrowreturn:
add r7, r10, r11
blr
;###########
;########### bombs never decrease logic
bomblogic:
lis r14, _bombdec@ha
lbz r15, _bombdec@l(r14)
cmpwi cr1, r15, 0
beq cr1, bombreturn
lbz r15, +0x1(r12)
cmpw cr1, r15, r5
blt cr1, bombreturn
mr r5,r15
bombreturn:
stb r5,+0x1(r12)
blr
;###########
;########### bombs never decrease logic
oillogic:
lis r14, _oildec@ha
lbz r15, _oildec@l(r14)
cmpwi cr1, r15, 0
beq cr1, oilreturn
mr r5,r0
oilreturn:
sth r5, +0xA(r30)
blr
;###########
;########### bombs never decrease logic
seedlogic:
lis r14, _seeddec@ha
lbz r15, _seeddec@l(r14)
cmpwi cr1, r15, 0
beq cr1, seedreturn
lbz r15, +0xf4(r8)
cmpw cr1, r15, r5
blt cr1, seedreturn
mr r5,r15
seedreturn:
stb r5, +0xf4(r8)
blr
;###########
;########### moonjump logic
moonjumplogic:
lis r17, _gravity@ha
lfs f20, _gravity@l(r17)
fsub f19, f19, f19
fcmpu f20, f19
beq moonreturn
lwz r18, _controlleraddy@l(r17)
lhz r18, +0x02(r18)
lwz r17, _moonjumpBtnCombo@l(r17)
cmpw r18, r17
bne moonreturn
fmr f7, f20
moonreturn:
stfs f7, +0x4fc(r28)
blr
;###########
;########### climb fast logic
climblogic:
lis r14, _climbfast@ha
lbz r15, _climbfast@l(r14)
cmpwi r15, 0
beq originalclimb
lfs f13, _climbspeed@l(r14)
b climbreturn
originalclimb:
lfs f13, +0x728c(r12)
climbreturn:
fmuls f1, f12, f13
blr
;###########
;########### crawl fast logic
crawllogic:
lis r14, _climbfast@ha
lbz r15, _climbfast@l(r14)
cmpwi r15, 0
beq originalcrawl
lfs f0, _climbspeed@l(r14)
b crawlreturn
originalcrawl:
lfs f0, +0x728c(r12)
crawlreturn:
fmadds f1, f0, f12, f13
blr
;###########
;########### Hooks
0x02A1DB74 = bla rupeelogic
0x02A1C664 = bla healthdeclogic
0x02A22734 = bla arrowlogic
0x02AA6764 = ba bomblogic
0x02A1CBD0 = bla oillogic
0x02A22C00 = bla seedlogic
0x02071db8 = bla moonjumplogic
0x0203f5d0 = ba climblogic
0x020a8ed8 = ba climblogic
0x020a6650 = ba climblogic
0x0205367c = ba crawllogic
0x0204d1d4 = .int $roll_asm
0x0203ac14 = .int $always_spin1
0x0203ac24 = .int $always_spin2
0x1000790C = .float $roll_speed
0x1002C076 = .short $drop1
0x1002C078 = .short $drop2

View File

@@ -0,0 +1,408 @@
[Definition]
titleIds = 000500001019C800,000500001019E600,000500001019E500
name = Cheats
path = "The Legend of Zelda: Twilight Princess HD/Cheats/Mega Cheats"
description = Cheats for Twilight Princess HD by n0ted.
version = 7
[Default]
$gravity = 0.0
$always_spin1 = 0x41820014
$always_spin2 = 0x41820020
$rup_mult = 1
$rup_inc = 0
$heart_dec = 0
$heart_dec_mult = 1.0
$arrow_dec = 0
$bomb_dec = 0
$oil_dec = 0
$seed_dec = 0
$climb_fast = 0
$climb_speed = 1.5
$roll_asm = 0x40810010
$roll_speed = 32.9
$drop1 = 240
$drop2 = 60
$controller = 0x12748630
$moon_jmp_btn_combo = 0x14
$climbspeed_custom = 0
$spin_enabled = 0
$never_decrease_custom = 0
$controller_custom = 0
#########
#Moon jump
#########
[Preset]
category = Moonjump ZR+A
name = Off
$gravity = 0.0
$controller_custom = 0
[Preset]
category = Moonjump ZR+A
name = On
$gravity = 55.0
$controller_custom = 1
#########
#Controller Type
#########
[Preset]
category = Controller Type
name = Gamepad
condition = $controller_custom
$controller = 0x1274803C
$moon_jmp_btn_combo = 0x8040
[Preset]
category = Controller Type
name = Pro
condition = $controller_custom
$controller = 0x12748630
$moon_jmp_btn_combo = 0x14
#########
#Always Great-Spin Attack
#########
[Preset]
category = Always Great-Spin Attack
name = Off
$always_spin2 = 0x41820020
$spin_enabled = 0
[Preset]
category = Always Great-Spin Attack
name = On
$always_spin2 = 0x48000020
$spin_enabled = 1
[Preset]
category = Always Great-Spin Attack Activation Type
name = Skill required
condition = $spin_enabled
$always_spin1 = 0x41820014
[Preset]
category = Always Great-Spin Attack Activation Type
name = Skill not required
condition = $spin_enabled
$always_spin1 = 0x40820014
#########
#Rupee Multiplier
#########
[Preset]
category = Rupee Multiplier
name = Default
$rup_mult = 1
[Preset]
category = Rupee Multiplier
name = 2x
$rup_mult = 2
[Preset]
category = Rupee Multiplier
name = 3x
$rup_mult = 3
[Preset]
category = Rupee Multiplier
name = 4x
$rup_mult = 4
[Preset]
category = Rupee Multiplier
name = 5x
$rup_mult = 4
[Preset]
category = Rupee Multiplier
name = 10x
$rup_mult = 10
#########
#Rupees Only Increase
#########
[Preset]
category = Rupees Only Increase
name = Off
$rup_inc = 0
[Preset]
category = Rupees Only Increase
name = On
$rup_inc = 1
#########
#Damage Received Multiplier
#########
[Preset]
category = Damage Received Multiplier
name = Default
$heart_dec_mult = 1.0
[Preset]
category = Damage Received Multiplier
name = 2x
$heart_dec_mult = 2.0
[Preset]
category = Damage Received Multiplier
name = 3x
$heart_dec_mult = 3.0
[Preset]
category = Damage Received Multiplier
name = 4x
$heart_dec_mult = 4.0
[Preset]
category = Damage Received Multiplier
name = 5x
$heart_dec_mult = 5.0
[Preset]
category = Damage Received Multiplier
name = 10x
$heart_dec_mult = 10.0
[Preset]
category = Damage Received Multiplier
name = INSTANT DEATH
$heart_dec_mult = 80.0
[Preset]
category = Everything Never Decreases
name = Off
$heart_dec = 0
$arrow_dec = 0
$bomb_dec = 0
$oil_dec = 0
$seed_dec = 0
$never_decrease_custom = 0
[Preset]
category = Everything Never Decreases
name = On
$heart_dec = 1
$arrow_dec = 1
$bomb_dec = 1
$oil_dec = 1
$seed_dec = 1
$never_decrease_custom = 0
[Preset]
category = Everything Never Decreases
name = Custom
$never_decrease_custom = 1
#########
#Hearts Never Decrease
#########
[Preset]
category = Hearts Never Decrease
name = Off
condition = $never_decrease_custom
$heart_dec = 0
[Preset]
category = Hearts Never Decrease
name = On
condition = $never_decrease_custom
$heart_dec = 1
##########
#Arrows Never Decrease
##########
[Preset]
category = Arrows Never Decrease
name = Off
condition = $never_decrease_custom
$arrow_dec = 0
[Preset]
category = Arrows Never Decrease
name = On
condition = $never_decrease_custom
$arrow_dec = 1
##########
#Bombs Never Decrease
##########
[Preset]
category = Bombs Never Decrease
name = Off
condition = $never_decrease_custom
$bomb_dec = 0
[Preset]
category = Bombs Never Decrease
name = On
condition = $never_decrease_custom
$bomb_dec = 1
##########
#Lantern Oil Never Decrease
##########
[Preset]
category = Lantern Oil Never Decreases
name = Off
condition = $never_decrease_custom
$oil_dec = 0
[Preset]
category = Lantern Oil Never Decreases
name = On
condition = $never_decrease_custom
$oil_dec = 1
##########
#Slingshot Seeds Never Decrease
##########
[Preset]
category = Slingshot Seeds Never Decrease
name = Off
condition = $never_decrease_custom
$seed_dec = 0
[Preset]
category = Slingshot Seeds Never Decrease
name = On
condition = $never_decrease_custom
$seed_dec = 1
##########
#Climb really fast
##########
[Preset]
category = Climb/Crawl Really Fast
name = Off
$climb_fast = 0
$climb_speed = 1.5
$climbspeed_custom = 0
[Preset]
category = Climb/Crawl Really Fast
name = On
$climb_fast = 1
$climbspeed_custom = 1
[Preset]
category = Climb/Crawl Really Fast Multiplier
name = 1x
condition = $climbspeed_custom
$climb_speed = 1.5
[Preset]
category = Climb/Crawl Really Fast Multiplier
name = 2x
condition = $climbspeed_custom
$climb_speed = 3
[Preset]
category = Climb/Crawl Really Fast Multiplier
name = 3x
condition = $climbspeed_custom
$climb_speed = 4.5
[Preset]
category = Climb/Crawl Really Fast Multiplier
name = 4x
condition = $climbspeed_custom
$climb_speed = 6
[Preset]
category = Climb/Crawl Really Fast Multiplier
name = 5x
condition = $climbspeed_custom
$climb_speed = 7.5
[Preset]
category = Climb/Crawl Really Fast Multiplier
name = 6x
condition = $climbspeed_custom
$climb_speed = 9
##########
#Roll Fast
##########
[Preset]
category = Roll Fast
name = Off
$roll_asm = 0x40810010
$roll_speed = 32.9
[Preset]
category = Roll Fast
name = 1.1x
$roll_asm = 0x60000000
$roll_speed = 36.2
[Preset]
category = Roll Fast
name = 1.25x
$roll_asm = 0x60000000
$roll_speed = 41.1
[Preset]
category = Roll Fast
name = 1.5x
$roll_asm = 0x60000000
$roll_speed = 50
[Preset]
category = Roll Fast
name = 2x
$roll_asm = 0x60000000
$roll_speed = 64
##########
#Infinite Drop Duration
##########
[Preset]
category = Drop Duration
name = Default
$drop1 = 240
$drop2 = 60
[Preset]
category = Drop Duration
name = 1.5x
$drop1 = 360
$drop2 = 90
[Preset]
category = Drop Duration
name = 2x
$drop1 = 480
$drop2 = 120
[Preset]
category = Drop Duration
name = 4x
$drop1 = 960
$drop2 = 240
[Preset]
category = Drop Duration
name = Infinite
$drop1 = 65520
$drop2 = 65520

View File

@@ -0,0 +1,17 @@
[ScreenMirroring]
moduleMatches = 0x1A03E108, 0xA3175EEA
.origin = codecave
_modifierValue:
.byte $orientation
orientationlogic:
lis r3,_modifierValue@ha
lbz r0, _modifierValue@l(r3)
stb r0, +0x667d(r11)
blr
0x029481AC = bla orientationlogic
0x1012667D = .byte $orientation

View File

@@ -0,0 +1,19 @@
[Definition]
titleIds = 000500001019C800,000500001019E600,000500001019E500
name = Screen Mirroring
path = "The Legend of Zelda: Twilight Princess HD/Graphics/Screen Mirroring"
description = Changes the orientation of the game (Mirrored or Normal) by n0ted.
version = 7
[Default]
$orientation = 1
[Preset]
name = Off/Normal (GameCube)
$orientation = 1
[Preset]
name = On/Mirrored (Wii)
$orientation = 0