12-10-2024, 11:24 PM
(12-10-2024, 07:57 AM)Sora0Pi Wrote: This is good! What if I wanted to only do one or two instead of all 12, do I remove certain lines then?
This should work. Fill in any value with 00000000 to NOT have the code effect the respective slot.
NTSC-U
C273428C 0000000B
48000035 00000000
NNNNNNNN PPPPPPPP
QQQQQQQQ RRRRRRRR
SSSSSSSS TTTTTTTT
UUUUUUUU VVVVVVVV
XXXXXXXX YYYYYYYY
ZZZZZZZZ 7D6802A6
578C103A 7DAC5C2E
ED8C6028 FC8D6040
41860008 FFA06890
D3A3001C 00000000
PAL
C2744158 0000000B
48000035 00000000
NNNNNNNN PPPPPPPP
QQQQQQQQ RRRRRRRR
SSSSSSSS TTTTTTTT
UUUUUUUU VVVVVVVV
XXXXXXXX YYYYYYYY
ZZZZZZZZ 7D6802A6
578C103A 7DAC5C2E
ED8C6028 FC8D6040
41860008 FFA06890
D3A3001C 00000000
NTSC-J
C27437C4 0000000B
48000035 00000000
NNNNNNNN PPPPPPPP
QQQQQQQQ RRRRRRRR
SSSSSSSS TTTTTTTT
UUUUUUUU VVVVVVVV
XXXXXXXX YYYYYYYY
ZZZZZZZZ 7D6802A6
578C103A 7DAC5C2E
ED8C6028 FC8D6040
41860008 FFA06890
D3A3001C 00000000
NTSC-K
C2732518 0000000B
48000035 00000000
NNNNNNNN PPPPPPPP
QQQQQQQQ RRRRRRRR
SSSSSSSS TTTTTTTT
UUUUUUUU VVVVVVVV
XXXXXXXX YYYYYYYY
ZZZZZZZZ 7D6802A6
578C103A 7DAC5C2E
ED8C6028 FC8D6040
41860008 FFA06890
D3A3001C 00000000
Code:
#Address Ports (Original is PAL)
#NTSC-U 8073428C
#PALĀ 80744158
#NTSC-J 807437C4
#NTSC-K 80732518
#Create Lookup Table
bl soft_speed_limit_table
#CPU Soft Speed Limit Table
#Dummy/example values used, adjust this to what you want before assembling
.zero 4 #Need filler for slot 0 which won't be used
.float 220.0 #Speed for slot 1
.float 200.5 #Speed for slot 2
.float 0.0 #Zero means allow CPU to have game-assigned soft speed limit
.float 0.0
.float 0.0
.float 0.0
.float 0.0
.float 0.0
.float 0.0
.float 0.0
.float 0.0
#Place Table addr into r11
soft_speed_limit_table:
mflr r11
#Multiply Slot by 4
slwi r12, r28, 2
#Grab the CPU's assigned limit; place in scratch reg
lfsx f13, r12, r11
#Is float null (bypass)
fsubs f12, f12, f12
fcmpo cr1, f13, f12
beq cr1, original_instruction
#Move value into non-vol reg
fmr f29, f13
#Write the speed limit now, Original Instruction
original_instruction:
stfs f29, 0x001C (r3)