Welcome, Guest |
You have to register before you can post on our site.
|
Forum Statistics |
» Members: 646
» Latest member: Luca1337
» Forum threads: 1,815
» Forum posts: 14,002
Full Statistics
|
Online Users |
There are currently 89 online users. » 1 Member(s) | 85 Guest(s) Bing, Google, Yandex, bigginer_course
|
Latest Threads |
MKW Coder/Developer of th...
Forum: Coding & Hacking General Discussion
Last Post: Fifty
8 hours ago
» Replies: 11
» Views: 13,879
|
Make it to 10,000
Forum: General Discussion
Last Post: Fifty
8 hours ago
» Replies: 7,339
» Views: 5,673,264
|
Allow Pausing Before Race...
Forum: Offline Non-Item
Last Post: Vega
Yesterday, 07:47 PM
» Replies: 0
» Views: 25
|
Top 10 Most Influential C...
Forum: Coding & Hacking General Discussion
Last Post: Vega
Yesterday, 03:27 PM
» Replies: 2
» Views: 7,363
|
Show Ice Cube on Online P...
Forum: Online Non-Item
Last Post: _Ro
Yesterday, 08:23 AM
» Replies: 0
» Views: 39
|
CPU Control Cycler [Ro]
Forum: Offline Non-Item
Last Post: _Ro
Yesterday, 07:56 AM
» Replies: 7
» Views: 1,023
|
Thunder Cloud Effect Modi...
Forum: Offline; Item
Last Post: JerryHatrick
01-10-2025, 11:13 PM
» Replies: 11
» Views: 1,100
|
Miniturbos and Inside Dri...
Forum: Coding & Hacking General Discussion
Last Post: JerryHatrick
01-10-2025, 09:54 AM
» Replies: 1
» Views: 861
|
Code request???
Forum: Code Support / Help / Requests
Last Post: DrTap
01-09-2025, 06:06 PM
» Replies: 3
» Views: 4,966
|
CPUs/Online Players Have ...
Forum: Visual & Sound Effects
Last Post: Zeraora
01-09-2025, 02:26 AM
» Replies: 2
» Views: 516
|
|
|
Randomized CC Online [TheNinjaKingOW] |
Posted by: Zeraora - 01-20-2021, 02:21 AM - Forum: Online Non-Item
- Replies (7)
|
|
This code randomizes what CC the game chooses online, you must be the host of the room to have this code work. The code uses a simple C0 randomizer that changes the byte value every frame.
NTSC-U:
c2659d7c 00000003
3d808000 618c01b0
8b8c0000 9b9d003f
60000000 00000000
c0000000 00000004
3d808000 896c01b0
396b0001 280b0004
41a00008 39600000
996c01b0 4e800020
PAL:
c2661CB8 00000003
3d808000 618c01b0
8b8c0000 9b9d003f
60000000 00000000
c0000000 00000004
3d808000 896c01b0
396b0001 280b0004
41a00008 39600000
996c01b0 4e800020
NTSC-J:
c2661324 00000003
3d808000 618c01b0
8b8c0000 9b9d003f
60000000 00000000
c0000000 00000004
3d808000 896c01b0
396b0001 280b0004
41a00008 39600000
996c01b0 4e800020
NTSC-K:
c264FFD0 00000003
3d808000 618c01b0
8b8c0000 9b9d003f
60000000 00000000
c0000000 00000004
3d808000 896c01b0
396b0001 280b0004
41a00008 39600000
996c01b0 4e800020
Special thanks to XeR, Vega, and Seeky for Basic help
Code: lis r12, 0x8000 <--- Randomizer with applied values
lbz r11, 0x01b0 (r12)
addi r11, r11, 1
cmplwi r11, 0x04
blt+ dont_reset
li r11, 0x0
dont_reset:
stb r11, 0x01b0 (r12)
Code: loc_0x0:
lis r12, 0x8000 } <---- Adds address of randomizer into r12
ori r12, r12, 0x1B0 }
lbz r28, 0(r12) <----- Takes byte from r12 and sets it in r28
stb r28, 63(r29) <---- Stores byte from r28 to 63 + r29
|
|
|
Pretty Speedometer [stebler] |
Posted by: stebler - 01-16-2021, 09:47 PM - Forum: Visual & Sound Effects
- Replies (82)
|
|
Pretty Speedometer 2.0 [stebler]
Features:
* Works on Dolphin without reducing image quality or performance (xfb hacks can stay enabled).
* Native look and feel.
* Supports both 16:9 and 4:3, as well as split-screen multiplayer.
Screenshot:
PAL:
C2857CA0 00000002
7C63F214 83E1001C
60000000 00000000
04857EDC 56B50630
C25E88F0 00000006
4E800421 80930000
3CA0636F 60A5696E
7C042800 40820014
3C804370 90830190
38800020 B0830198
60000000 00000000
C2857F4C 0000001A
72A00001 408200BC
7CA802A6 4800003D
4358C30C C30CC365
436CC365 436CC336
41D0C343 42DC42DC
C2D2C2D2 4398C366
C366C3A6 43ACC3A6
43ACC33E 41C8C347
42E642E6 C2E6C2E6
7C6802A6 88810016
3884FFCF 7C848A14
5484083C 7C632214
3C808038 80846000
80840058 1C84001C
7C632214 A0830000
B094001C A083000E
B0940020 807400BC
80630014 80630010
3C803E80 90830040
90830044 38800002
988300FC 3865006C
2C150000 4182000C
3865FF94 62B50001
7C6803A6 4E800020
98140081 38600208
60000000 00000000
C27ED1D8 00000021
887E0081 2C030000
408200F8 8BFE0190
3C60809C 8063D728
7C63FA14 88830B84
3C60809C 806318F8
80630020 5484103A
7C63202E 80630000
80630028 C0230020
38610008 3880000D
48000019 001A0800
00010030 0025002E
00320066 00000000
7CA802A6 4CC63242
3D808001 618C7814
7D8903A6 4E800421
38810010 387F0030
3CA0809C 80A5D728
1CDF00F0 7CA53214
80A500F4 2C050002
41820008 38650020
B064FFFE A0640000
2C030000 41820038
2C03002D 40820008
3860246D 2C03002E
40820008 3860246B
38A3FFD0 28050009
41810008 38652460
B0640000 38840001
4BFFFFC4 7FC3F378
38810008 38A00000
3D808063 618CDDB4
7D8903A6 4E800421
800100E4 00000000
C25F8C88 00000003
2C040000 4080000C
7C832378 4E800020
80A30010 00000000
045F8D08 7C832378
045F8D44 386DBFC4
045CDDAC 2C14FFFF
045CDDB0 4082000C
NTSC-U:
C2836210 00000002
7C63F214 83E1001C
60000000 00000000
0483644C 56B50630
C25D2204 00000006
4E800421 80930000
3CA0636F 60A5696E
7C042800 40820014
3C804370 90830190
38800020 B0830198
60000000 00000000
C28364BC 0000001A
72A00001 408200BC
7CA802A6 4800003D
4358C30C C30CC365
436CC365 436CC336
41D0C343 42DC42DC
C2D2C2D2 4398C366
C366C3A6 43ACC3A6
43ACC33E 41C8C347
42E642E6 C2E6C2E6
7C6802A6 88810016
3884FFCF 7C848A14
5484083C 7C632214
3C808038 80841C80
80840058 1C84001C
7C632214 A0830000
B094001C A083000E
B0940020 807400BC
80630014 80630010
3C803E80 90830040
90830044 38800002
988300FC 3865006C
2C150000 4182000C
3865FF94 62B50001
7C6803A6 4E800020
98140081 38600208
60000000 00000000
C27E392C 00000021
887E0081 2C030000
408200F8 8BFE0190
3C60809C 80638F68
7C63FA14 88830B84
3C60809C 8063D110
80630020 5484103A
7C63202E 80630000
80630028 C0230020
38610008 3880000D
48000019 001A0800
00010030 0025002E
00320066 00000000
7CA802A6 4CC63242
3D808001 618C6CB4
7D8903A6 4E800421
38810010 387F0030
3CA0809C 80A58F68
1CDF00F0 7CA53214
80A500F4 2C050002
41820008 38650020
B064FFFE A0640000
2C030000 41820038
2C03002D 40820008
3860246D 2C03002E
40820008 3860246B
38A3FFD0 28050009
41810008 38652460
B0640000 38840001
4BFFFFC4 7FC3F378
38810008 38A00000
3D808060 618CC994
7D8903A6 4E800421
800100E4 00000000
C25D83A4 00000003
2C040000 4080000C
7C832378 4E800020
80A30010 00000000
045D8424 7C832378
045D8460 386DBFC4
045C128C 2C14FFFF
045C1290 4082000C
NTSC-J:
C285730C 00000002
7C63F214 83E1001C
60000000 00000000
04857548 56B50630
C25E81CC 00000006
4E800421 80930000
3CA0636F 60A5696E
7C042800 40820014
3C804370 90830190
38800020 B0830198
60000000 00000000
C28575B8 0000001A
72A00001 408200BC
7CA802A6 4800003D
4358C30C C30CC365
436CC365 436CC336
41D0C343 42DC42DC
C2D2C2D2 4398C366
C366C3A6 43ACC3A6
43ACC33E 41C8C347
42E642E6 C2E6C2E6
7C6802A6 88810016
3884FFCF 7C848A14
5484083C 7C632214
3C808038 80845980
80840058 1C84001C
7C632214 A0830000
B094001C A083000E
B0940020 807400BC
80630014 80630010
3C803E80 90830040
90830044 38800002
988300FC 3865006C
2C150000 4182000C
3865FF94 62B50001
7C6803A6 4E800020
98140081 38600208
60000000 00000000
C27EC844 00000021
887E0081 2C030000
408200F8 8BFE0190
3C60809C 8063C788
7C63FA14 88830B84
3C60809C 80630958
80630020 5484103A
7C63202E 80630000
80630028 C0230020
38610008 3880000D
48000019 001A0800
00010030 0025002E
00320066 00000000
7CA802A6 4CC63242
3D808001 618C7738
7D8903A6 4E800421
38810010 387F0030
3CA0809C 80A5C788
1CDF00F0 7CA53214
80A500F4 2C050002
41820008 38650020
B064FFFE A0640000
2C030000 41820038
2C03002D 40820008
3860246D 2C03002E
40820008 3860246B
38A3FFD0 28050009
41810008 38652460
B0640000 38840001
4BFFFFC4 7FC3F378
38810008 38A00000
3D808063 618CD420
7D8903A6 4E800421
800100E4 00000000
C25F8564 00000003
2C040000 4080000C
7C832378 4E800020
80A30010 00000000
045F85E4 7C832378
045F8620 386DBFC4
045CD688 2C14FFFF
045CD68C 4082000C
NTSC-K:
C2846060 00000002
7C63F214 83E1001C
60000000 00000000
0484629C 56B50630
C25D6A8C 00000006
4E800421 80930000
3CA0636F 60A5696E
7C042800 40820014
3C804370 90830190
38800020 B0830198
60000000 00000000
C284630C 0000001A
72A00001 408200BC
7CA802A6 4800003D
4358C30C C30CC365
436CC365 436CC336
41D0C343 42DC42DC
C2D2C2D2 4398C366
C366C3A6 43ACC3A6
43ACC33E 41C8C347
42E642E6 C2E6C2E6
7C6802A6 88810016
3884FFCF 7C848A14
5484083C 7C632214
3C808037 80844020
80840058 1C84001C
7C632214 A0830000
B094001C A083000E
B0940020 807400BC
80630014 80630010
3C803E80 90830040
90830044 38800002
988300FC 3865006C
2C150000 4182000C
3865FF94 62B50001
7C6803A6 4E800020
98140081 38600208
60000000 00000000
C27DB598 00000021
887E0081 2C030000
408200F8 8BFE0190
3C60809B 8063BD68
7C63FA14 88830B84
3C60809B 8063FF38
80630020 5484103A
7C63202E 80630000
80630028 C0230020
38610008 3880000D
48000019 001A0800
00010030 0025002E
00320066 00000000
7CA802A6 4CC63242
3D808001 618C787C
7D8903A6 4E800421
38810010 387F0030
3CA0809B 80A5BD68
1CDF00F0 7CA53214
80A500F4 2C050002
41820008 38650020
B064FFFE A0640000
2C030000 41820038
2C03002D 40820008
3860246D 2C03002E
40820008 3860246B
38A3FFD0 28050009
41810008 38652460
B0640000 38840001
4BFFFFC4 7FC3F378
38810008 38A00000
3D808062 618CC0CC
7D8903A6 4E800421
800100E4 00000000
C25E70A8 00000003
2C040000 4080000C
7C832378 4E800020
80A30010 00000000
045E7128 7C832378
045E7164 386DBFE4
045BBD6C 2C14FFFF
045BBD70 4082000C
Source code:
Code: # inject at 80857ca0 (PAL)
# inject at 80836210 (NTSC-U)
# inject at 8085730c (NTSC-J)
# inject at 80846060 (NTSC-K)
add r3, r3, r30 # increase the control count by one speedometer per local player
lwz r31, 0x1c (r1) # original instruction
Code: # replace at 80857edc (PAL)
# replace at 8083644c (NTSC-U)
# replace at 80857548 (NTSC-J)
# replace at 8084629c (NTSC-K)
# always create (at least) one CtrlRaceBattlePoint per player
# also reset the lsb which is used to know if the control is regular
rlwinm r21, r21, 0, 24, 24
Code: # inject at 805e88f0 (PAL)
# inject at 805d2204 (NTSC-U)
# inject at 805e81cc (NTSC-J)
# inject at 805d6a8c (NTSC-K)
.set coin, 0x636f696e
bctrl # original instruction
lwz r4, 0x0 (r19) # get the brlyt name
lis r5, coin@h
ori r5, r5, coin@l
cmpw r4, r5 # check if it starts with "coin"
bne end # if not, we are done
# otherwise, patch the brlyt
# change the text pane size
lis r4, 0x4370 # 240.0f
stw r4, 0x190 (r3)
# change the maximum string size of the text pane
li r4, 0x20
sth r4, 0x198 (r3)
end:
Code: # inject at 80857f4c (PAL)
# inject at 808364bc (NTSC-U)
# inject at 808575b8 (NTSC-J)
# inject at 8084630c (NTSC-K)
.set region, ''
.if (region == 'P')
.set SystemManager_s_instance, 0x80386000
.elseif (region == 'E')
.set SystemManager_s_instance, 0x80381c80
.elseif (region == 'J')
.set SystemManager_s_instance, 0x80385980
.elseif (region == 'K')
.set SystemManager_s_instance, 0x80374020
.else
.err
.endif
andi. r0, r21, 0x1 # check if we are creating a custom control
bne end # if not, we are (almost) done
mflr r5 # backup the lr
bl positions
# 4:3 x
.short 0x4358 # 1/1: 216.0f
.short 0xc30c # 1/2: -140.0f
.short 0xc30c # 2/2: -140.0f
.short 0xc365 # 1/4: -229.0f
.short 0x436c # 2/4: 236.0f
.short 0xc365 # 3/4: -229.0f
.short 0x436c # 4/4: 236.0f
# 4:3 y
.short 0xc336 # 1/1: -182.0f
.short 0x41d0 # 1/2: 26.0f
.short 0xc343 # 2/2: -195.0f
.short 0x42dc # 1/4: 110.0f
.short 0x42dc # 2/4: 110.0f
.short 0xc2d2 # 3/4: -105.0f
.short 0xc2d2 # 4/4: -105.0f
# 16:9 x
.short 0x4398 # 1/1: 304.0f
.short 0xc366 # 1/2: -230.0f
.short 0xc366 # 2/2: -230.0f
.short 0xc3a6 # 1/4: -332.0f
.short 0x43ac # 2/4: 344.0f
.short 0xc3a6 # 3/4: -332.0f
.short 0x43ac # 4/4: 344.0f
# 16:9 y
.short 0xc33e # 1/1: -190.0f
.short 0x41c8 # 1/2: 25.0f
.short 0xc347 # 2/2: -199.0f
.short 0x42e6 # 1/4: 115.0f
.short 0x42e6 # 2/4: 115.0f
.short 0xc2e6 # 3/4: -115.0f
.short 0xc2e6 # 4/4: -115.0f
positions:
mflr r3
# compute the address
lbz r4, 0x8 + 0xe (r1)
subi r4, r4, 0x30 + 0x1
add r4, r4, r17
slwi r4, r4, 1
add r3, r3, r4
lis r4, SystemManager_s_instance@ha
lwz r4, SystemManager_s_instance@l (r4)
lwz r4, 0x58 (r4)
mulli r4, r4, 0x1c
add r3, r3, r4
# set the x position
lhz r4, 0x0 (r3)
sth r4, 0x1c (r20)
# set the y position
lhz r4, 0xe (r3)
sth r4, 0x20 (r20)
# access the layout
lwz r3, 0xbc (r20)
lwz r3, 0x14 (r3)
lwz r3, -0x4 + 0x14 (r3)
# set the scale
lis r4, 0x3e80
stw r4, -0x4 + 0x44 (r3)
stw r4, -0x4 + 0x48 (r3)
# align the text to the right
li r4, 0x2
stb r4, -0x4 + 0x100 (r3)
addi r3, r5, 0x6c # setup the lr to skip the creation of the CtrlRaceBattleAddPoint
cmpwi r21, 0x0 # check if the battle point controls are disabled
beq jump
subi r3, r5, 0x6c # setup the lr to create the second CtrlRaceBattlePoint
ori r21, r21, 0x1 # mark the custom control as created
jump:
mtlr r3
blr
end:
stb r0, 0x81 (r20) # mark the control as regular
li r3, 0x208 # original instruction
Code: # inject at 807ed1d8 (PAL)
# inject at 807e392c (NTSC-U)
# inject at 807ec844 (NTSC-J)
# inject at 807db598 (NTSC-K)
.set region, ''
.if (region == 'P')
.set swprintf, 0x80017814
.set LayoutUIControl_setMessageAll, 0x8063ddb4
.set RaceConfig_s_instance, 0x809bd728
.set KartManager_s_instance, 0x809c18f8
.elseif (region == 'E')
.set swprintf, 0x80016cb4
.set LayoutUIControl_setMessageAll, 0x8060c994
.set RaceConfig_s_instance, 0x809b8f68
.set KartManager_s_instance, 0x809bd110
.elseif (region == 'J')
.set swprintf, 0x80017738
.set LayoutUIControl_setMessageAll, 0x8063d420
.set RaceConfig_s_instance, 0x809bc788
.set KartManager_s_instance, 0x809c0958
.elseif (region == 'K')
.set swprintf, 0x8001787c
.set LayoutUIControl_setMessageAll, 0x8062c0cc
.set RaceConfig_s_instance, 0x809abd68
.set KartManager_s_instance, 0x809aff38
.else
.err
.endif
lbz r3, 0x81 (r30)
cmpwi r3, 0x0 # check if the control is custom
bne end # if not, we are done
# get the local player id
lbz r31, 0x190 (r30)
# get the player id
lis r3, RaceConfig_s_instance@ha
lwz r3, RaceConfig_s_instance@l (r3)
add r3, r3, r31
lbz r4, 0xb84 (r3)
# get the speed
lis r3, KartManager_s_instance@ha
lwz r3, KartManager_s_instance@l (r3)
lwz r3, 0x20 (r3)
slwi r4, r4, 2
lwzx r3, r3, r4
lwz r3, 0x0 (r3)
lwz r3, 0x28 (r3)
lfs f1, 0x20 (r3)
# format the string
addi r3, r1, 0x8
li r4, 0xd
bl format
.short 0x001a, 0x0800, 0x0001, 0x0030 # color
.string16 "%.2f"
.balign 4
format:
mflr r5
crset 4 * cr1 + eq
lis r12, swprintf@h
ori r12, r12, swprintf@l
mtctr r12
bctrl
addi r4, r1, 0x10
# change the color depending on the local player id and the team
addi r3, r31, 0x30
lis r5, RaceConfig_s_instance@ha
lwz r5, RaceConfig_s_instance@l (r5)
mulli r6, r31, 0xf0
add r5, r5, r6
lwz r5, 0xf4 (r5)
cmpwi r5, 0x2
beq no_team
addi r3, r5, 0x20
no_team:
sth r3, -0x2 (r4)
# replace digits, dashes and dots with the timer versions
loop:
lhz r3, 0x0 (r4)
cmpwi r3, 0x0
beq out
cmpwi r3, 0x2d
bne not_a_dash
li r3, 0x246d
not_a_dash:
cmpwi r3, 0x2e
bne not_a_dot
li r3, 0x246b
not_a_dot:
subi r5, r3, 0x30
cmplwi r5, 0x9
bgt not_a_digit
addi r3, r5, 0x2460
not_a_digit:
sth r3, 0x0 (r4)
addi r4, r4, 0x1
b loop
out:
# update the message
mr r3, r30
addi r4, r1, 0x8
li r5, 0x0
lis r12, LayoutUIControl_setMessageAll@h
ori r12, r12, LayoutUIControl_setMessageAll@l
mtctr r12
bctrl
end:
lwz r0, 0xe4 (r1) # original instruction
Code: # inject at 805f8c88 (PAL)
# inject at 805d83a4 (NTSC-U)
# inject at 805f8564 (NTSC-J)
# inject at 805e70a8 (NTSC-K)
cmpwi r4, 0x0 # check if the message id is a pointer
bge end # is not, we are done
# otherwise return it as a slot
mr r3, r4
blr
end:
lwz r5, 0x10 (r3) # original instruction
Code: # replace at 805f8d08 (PAL)
# replace at 805d8424 (NTSC-U)
# replace at 805f85e4 (NTSC-J)
# replace at 805e7128 (NTSC-K)
mr r3, r4 # if the slot is a pointer, return it as the message
Code: # replace at 805f8d44 (PAL)
# replace at 805d8460 (NTSC-U)
# replace at 805f8620 (NTSC-J)
# replace at 805e7164 (NTSC-K)
.set region, ''
.if (region == 'P')
.set offset, 0x403c
.elseif (region == 'E')
.set offset, 0x403c
.elseif (region == 'J')
.set offset, 0x403c
.elseif (region == 'K')
.set offset, 0x401c
.else
.err
.endif
# if the slot is a pointer, return a pointer to the attributes
# we have the wanted value somewhere in sdata2
subi r3, r13, offset
Code: # replace at 805cddac (PAL)
# replace at 805c128c (NTSC-U)
# replace at 805cd688 (NTSC-J)
# replace at 805bbd6c (NTSC-K)
# only consider -1 as "no slot found"
cmpwi r20, -0x1
bne 0xc
Version 1.1:
Quote:NTSC-U:
c25ddb7c 00000008
80a30004 2c05000c
41820028 2c05000e
41820020 2c050012
41820018 2c050040
41820010 2c050042
41820008 48000008
38840001 7c852378
60000000 00000000
c2836a48 00000007
560004e7 40820030
806f0004 2c03000c
41820020 2c03000e
41820018 2c030012
41820010 2c030040
41820008 2c030042
4c421042 00000000
c25c1214 00000009
2c040000 4082003c
3d004330 91010070
91010078 7c721b78
3a600000 3f008089
3b18eed0 90a10020
38a00001 90a10010
3ca0805c 60a512e8
7ca803a6 4e800020
80040000 00000000
c2575b44 0000002c
48000019 001a0800
00010030 0025002e
00320066 00000000
807d0000 80630000
88630010 3c80809c
80848f68 88840b84
7c032000 40820120
3c60809c 8063d508
80630000 83830038
2c1c0000 40820044
8383003c 2c1c0000
40820038 83830040
2c1c0000 4082002c
83830050 2c1c0000
40820020 83830108
2c1c0000 40820014
83830110 2c1c0000
40820008 480000c8
3821ffd8 c03d0020
4cc63242 38610008
38800010 7ca802a6
3d808001 618c6cb4
7d8903a6 4e800421
38a10008 38850008
a0640000 2c030000
4182003c 2c03002d
40820008 3860246d
2c03002e 40820008
3860246b 2c030030
41800010 2c03003a
40800008 38632430
b0640000 38840001
4bffffc0 807c005c
3c8042f0 3cc08038
80c61c80 80c60058
2c060001 41820008
3c8041f0 9083004c
38800000 98830080
38c00002 80630114
80e30000 98c70100
3d80805c 618c11e0
7d8903a6 4e800421
38210028 83e1007c
60000000 00000000
PAL:
c260245c 00000008
80a30004 2c05000c
41820028 2c05000e
41820020 2c050012
41820018 2c050040
41820010 2c050042
41820008 48000008
38840001 7c852378
60000000 00000000
c28584d8 00000007
560004e7 40820030
806f0004 2c03000c
41820020 2c03000e
41820018 2c030012
41820010 2c030040
41820008 2c030042
4c421042 00000000
c25cdd34 00000009
2c040000 4082003c
3d004330 91010070
91010078 7c721b78
3a600000 3f008089
3b183e70 90a10020
38a00001 90a10010
3ca0805c 60a5de08
7ca803a6 4e800020
80040000 00000000
c257c3a8 0000002c
48000019 001a0800
00010030 0025002e
00320066 00000000
807d0000 80630000
88630010 3c80809c
8084d728 88840b84
7c032000 40820120
3c60809c 80631e38
80630000 83830038
2c1c0000 40820044
8383003c 2c1c0000
40820038 83830040
2c1c0000 4082002c
83830050 2c1c0000
40820020 83830108
2c1c0000 40820014
83830110 2c1c0000
40820008 480000c8
3821ffd8 c03d0020
4cc63242 38610008
38800010 7ca802a6
3d808001 618c7814
7d8903a6 4e800421
38a10008 38850008
a0640000 2c030000
4182003c 2c03002d
40820008 3860246d
2c03002e 40820008
3860246b 2c030030
41800010 2c03003a
40800008 38632430
b0640000 38840001
4bffffc0 807c005c
3c8042f0 3cc08038
80c66000 80c60058
2c060001 41820008
3c8041f0 9083004c
38800000 98830080
38c00002 80630114
80e30000 98c70100
3d80805c 618cdd00
7d8903a6 4e800421
38210028 83e1007c
60000000 00000000
NTSC-J:
c2601bd0 00000008
80a30004 2c05000c
41820028 2c05000e
41820020 2c050012
41820018 2c050040
41820010 2c050042
41820008 48000008
38840001 7c852378
60000000 00000000
c2857b44 00000007
560004e7 40820030
806f0004 2c03000c
41820020 2c03000e
41820018 2c030012
41820010 2c030040
41820008 2c030042
4c421042 00000000
c25cd610 00000009
2c040000 4082003c
3d004330 91010070
91010078 7c721b78
3a600000 3f008089
3b1834c0 90a10020
38a00001 90a10010
3ca0805c 60a5d6e4
7ca803a6 4e800020
80040000 00000000
c257bd28 0000002c
48000019 001a0800
00010030 0025002e
00320066 00000000
807d0000 80630000
88630010 3c80809c
8084c788 88840b84
7c032000 40820120
3c60809c 80630e98
80630000 83830038
2c1c0000 40820044
8383003c 2c1c0000
40820038 83830040
2c1c0000 4082002c
83830050 2c1c0000
40820020 83830108
2c1c0000 40820014
83830110 2c1c0000
40820008 480000c8
3821ffd8 c03d0020
4cc63242 38610008
38800010 7ca802a6
3d808001 618c7738
7d8903a6 4e800421
38a10008 38850008
a0640000 2c030000
4182003c 2c03002d
40820008 3860246d
2c03002e 40820008
3860246b 2c030030
41800010 2c03003a
40800008 38632430
b0640000 38840001
4bffffc0 807c005c
3c8042f0 3cc08038
80c65980 80c60058
2c060001 41820008
3c8041f0 9083004c
38800000 98830080
38c00002 80630114
80e30000 98c70100
3d80805c 618cd5dc
7d8903a6 4e800421
38210028 83e1007c
60000000 00000000
NTSC-K:
c25f087c 00000008
80a30004 2c05000c
41820028 2c05000e
41820020 2c050012
41820018 2c050040
41820010 2c050042
41820008 48000008
38840001 7c852378
60000000 00000000
c2846898 00000007
560004e7 40820030
806f0004 2c03000c
41820020 2c03000e
41820018 2c030012
41820010 2c030040
41820008 2c030042
4c421042 00000000
c25bbcf4 00000009
2c040000 4082003c
3d004330 91010070
91010078 7c721b78
3a600000 3f008088
3b182280 90a10020
38a00001 90a10010
3ca0805b 60a5bdc8
7ca803a6 4e800020
80040000 00000000
c256a400 0000002c
48000019 001a0800
00010030 0025002e
00320066 00000000
807d0000 80630000
88630010 3c80809b
8084bd68 88840b84
7c032000 40820120
3c60809b 80630478
80630000 83830038
2c1c0000 40820044
8383003c 2c1c0000
40820038 83830040
2c1c0000 4082002c
83830050 2c1c0000
40820020 83830108
2c1c0000 40820014
83830110 2c1c0000
40820008 480000c8
3821ffd8 c03d0020
4cc63242 38610008
38800010 7ca802a6
3d808001 618c787c
7d8903a6 4e800421
38a10008 38850008
a0640000 2c030000
4182003c 2c03002d
40820008 3860246d
2c03002e 40820008
3860246b 2c030030
41800010 2c03003a
40800008 38632430
b0640000 38840001
4bffffc0 807c005c
3c8042f0 3cc08037
80c64020 80c60058
2c060001 41820008
3c8041f0 9083004c
38800000 98830080
38c00002 80630114
80e30000 98c70100
3d80805b 618cbcc0
7d8903a6 4e800421
38210028 83e1007c
60000000 00000000
Source code:
Increment the child count of the single player gameplay screens other than time trial:
Code: # inject at 8060245c (PAL)
# inject at 805ddb7c (NTSC-U)
# inject at 80601bd0 (NTSC-J)
# inject at 805f087c (NTSC-K)
lwz r5, 0x4 (r3)
cmpwi r5, 0xc # grand prix
beq increment
cmpwi r5, 0xe # 1 player offline vs
beq increment
cmpwi r5, 0x12 # 1 player battle
beq increment
cmpwi r5, 0x40 # 1 player ww/regional vs
beq increment
cmpwi r5, 0x42 # 1 player friend room vs
beq increment
b end
increment:
addi r4, r4, 0x1
end:
mr r5, r4 # original instruction
Add the "GHOST DATA CANNOT BE SAVED" element to single player gameplay screens other than time trial:
Code: # inject at 808584d8 (PAL)
# inject at 80836a48 (NTSC-U)
# inject at 80857b44 (NTSC-J)
# inject at 80846898 (NTSC-K)
rlwinm. r0, r16, 0x0, 19, 19 # original instruction
bne end
lwz r3, 0x4 (r15)
cmpwi r3, 0xc # grand prix
beq invert
cmpwi r3, 0xe # 1 player offline vs
beq invert
cmpwi r3, 0x12 # 1 player battle
beq invert
cmpwi r3, 0x40 # 1 player ww/regional vs
beq invert
cmpwi r3, 0x42 # 1 player friend room vs
invert:
crnot 4 * cr0 + eq, 4 * cr0 + eq
end:
Extend the setTextSrc method to load text from an arbitrary string instead of a bmg, if the argument in r4 is null:
Code: # inject at 805cdd34 (PAL)
# inject at 805c1214 (NTSC-U)
# inject at 805cd610 (NTSC-J)
# inject at 805bbcf4 (NTSC-K)
.set region, ''
.if (region == 'P')
.set ptr_consts, 0x80893e70
.set target, 0x805cde08
.elseif (region == 'E')
.set ptr_consts, 0x8088eed0
.set target, 0x805c12e8
.elseif (region == 'J')
.set ptr_consts, 0x808934c0
.set target, 0x805cd6e4
.elseif (region == 'K')
.set ptr_consts, 0x80882280
.set target, 0x805bbdc8
.else
.err
.endif
# check if custom text is enabled
cmpwi r4, 0x0
bne end
# some registers are initialized in the middle of the bmg loading stuff we are skipping, so we have
# to do it here instead
lis r8, 0x4330
stw r8, 0x70 (r1)
stw r8, 0x78 (r1)
mr r18, r3
li r19, 0x0
lis r24, ptr_consts@ha
addi r24, r24, ptr_consts@l
# load the custom string
stw r5, 0x20 (r1)
li r5, 0x1
stw r5, 0x10 (r1)
# jump to the end of the bmg loading stuff
lis r5, target@h
ori r5, r5, target@l
mtlr r5
blr
end:
lwz r0, 0x0 (r4) # original instruction
Make the element visible, and set its value to the current speed:
Code: # inject at 8057c3a8 (PAL)
# inject at 80575b44 (NTSC-U)
# inject at 8057bd28 (NTSC-J)
# inject at 8056a400 (NTSC-K)
.set region, ''
.if (region == 'P')
.set ptr_raceData, 0x809bd728
.set ptr_menuData, 0x809c1e38
.set swprintf, 0x80017814
.set ptr_unk, 0x80386000
.set ScreenElement_setTextSrc, 0x805cdd00
.elseif (region == 'E')
.set ptr_raceData, 0x809b8f68
.set ptr_menuData, 0x809bd508
.set swprintf, 0x80016cb4
.set ptr_unk, 0x80381c80
.set ScreenElement_setTextSrc, 0x805c11e0
.elseif (region == 'J')
.set ptr_raceData, 0x809bc788
.set ptr_menuData, 0x809c0e98
.set swprintf, 0x80017738
.set ptr_unk, 0x80385980
.set ScreenElement_setTextSrc, 0x805cd5dc
.elseif (region == 'K')
.set ptr_raceData, 0x809abd68
.set ptr_menuData, 0x809b0478
.set swprintf, 0x8001787c
.set ptr_unk, 0x80374020
.set ScreenElement_setTextSrc, 0x805bbcc0
.else
.err
.endif
bl format
.short 0x001a, 0x0800, 0x0001, 0x0030 # bmg escape sequence for yellow text
.string16 "%.2f\0"
format:
# get the player index of the player on which the hooked function is working
lwz r3, 0x0 (r29)
lwz r3, 0x0 (r3)
lbz r3, 0x10 (r3)
# get the player index from the first hud slot
lis r4, ptr_raceData@ha
lwz r4, ptr_raceData@l (r4)
lbz r4, 0xb84 (r4)
# if they don't match, the speedometer will not be updated
cmpw r3, r4
bne end
# check if a single player gameplay screen is active
lis r3, ptr_menuData@ha
lwz r3, ptr_menuData@l (r3)
lwz r3, 0x0 (r3)
lwz r28, 0x38 (r3) # grand prix
cmpwi r28, 0x0
bne found
lwz r28, 0x3c (r3) # time trial
cmpwi r28, 0x0
bne found
lwz r28, 0x40 (r3) # 1 player offline vs
cmpwi r28, 0x0
bne found
lwz r28, 0x50 (r3) # 1 player battle
cmpwi r28, 0x0
bne found
lwz r28, 0x108 (r3) # 1 player ww/regional vs
cmpwi r28, 0x0
bne found
lwz r28, 0x110 (r3) # 1 player friend room vs
cmpwi r28, 0x0
bne found
b end
found:
# allocate stack memory:
# * 0x8 needed by swprintf
# * 0x20 for the formatted string
addi r1, r1, -0x28
# prepare the arguments for swprintf
lfs f1, 0x20 (r29)
crset 4 * cr1 + eq
addi r3, r1, 0x8
li r4, 0x10
mflr r5
lis r12, swprintf@h
ori r12, r12, swprintf@l
mtctr r12
bctrl
addi r5, r1, 0x8 # beginning of the formatted string
addi r4, r5, 0x8 # we do not want to process the bmg escape sequence
# replace digits, dashes and dots with the timer versions
loop:
lhz r3, 0x0 (r4)
cmpwi r3, 0x0
beq out
cmpwi r3, 0x2d
bne not_a_dash
li r3, 0x246d
not_a_dash:
cmpwi r3, 0x2e
bne not_a_dot
li r3, 0x246b
not_a_dot:
cmpwi r3, 0x30
blt not_a_digit
cmpwi r3, 0x3a
bge not_a_digit
addi r3, r3, 0x2430
not_a_digit:
sth r3, 0x0 (r4)
addi r4, r4, 0x1
b loop
out:
lwz r3, 0x5c (r28)
# set the position of the hud element
lis r4, 0x42f0 # 120.0f for 16:9
lis r6, ptr_unk@ha
lwz r6, ptr_unk@l (r6)
lwz r6, 0x58 (r6)
cmpwi r6, 0x1
beq widescreen
lis r4, 0x41f0 # 30.0f for 4:3
widescreen:
stw r4, 0x4c (r3)
# make the element visible
li r4, 0x0
stb r4, 0x80 (r3)
# align the text to the right
li r6, 0x2
lwz r3, 0x114 (r3)
lwz r7, 0x0 (r3)
stb r6, 0x100 (r7)
lis r12, ScreenElement_setTextSrc@h
ori r12, r12, ScreenElement_setTextSrc@l
mtctr r12
bctrl
addi r1, r1, 0x28
end:
lwz r31, 0x7c (r1) # original instruction
|
|
|
Randomized CC Grand Prix [TheNinjaKingOW, Vega] |
Posted by: Zeraora - 01-15-2021, 06:37 PM - Forum: Offline Non-Item
- Replies (3)
|
|
This code will set the CC to a random CC no matter what you pick. It will also randomize if you get mirror or not, which means you can get mirror on unintended slots.
NTSC-U:
c0000000 00000007
3d808000 896c1500
894c1501 396b0001
280b0003 41a00008
39600000 996c1500
394a0001 280a0002
41a00008 39400000
994c1501 4e800020
C2825098 00000003
3D808000 880C1501
90051780 880C1500
60000000 00000000
PAL:
c0000000 00000007
3d808000 896c1500
894c1501 396b0001
280b0003 41a00008
39600000 996c1500
394a0001 280a0002
41a00008 39400000
994c1501 4e800020
C283FAF8 00000003
3D808000 880C1501
90051780 880C1500
60000000 00000000
NTSC-J:
c0000000 00000007
3d808000 896c1500
894c1501 396b0001
280b0003 41a00008
39600000 996c1500
394a0001 280a0002
41a00008 39400000
994c1501 4e800020
C283F164 00000003
3D808000 880C1501
90051780 880C1500
60000000 00000000
NTSC-K:
c0000000 00000007
3d808000 896c1500
894c1501 396b0001
280b0003 41a00008
39600000 996c1500
394a0001 280a0002
41a00008 39400000
994c1501 4e800020
C282DEB8 00000003
3D808000 880C1501
90051780 880C1500
60000000 00000000
Source (C0) Randomizer
Code: lis r12, 0x8000
lbz r11, 0x1500 (r12)
lbz r10, 0x1501 (r12)
addi r11, r11, 1
cmplwi r11, 3
blt+ dont_reset
li r11, 0
dont_reset:
stb r11, 0x1500 (r12)
addi r10, r10, 1
cmplwi r10, 2
blt+ dont_reset_this
li r10, 0
dont_reset_this:
stb r10, 0x1501 (r12)
#blr #Uncomment if not using Pyii
Source (C2) Apply the generated byte values
Code: lis r12, 0x8000
lbz r0, 0x1501 (r12) #Load Mirror Mode byte
stw r0, 0x1780 (r5) #Write it
lbz r0, 0x1500 (r12) #Load CC byte (next instruction in static memory will write the CC byte to its proper location; no need for default instruction)
|
|
|
XYZ Position Swapper [Vega] |
Posted by: Vega - 01-15-2021, 03:28 AM - Forum: Offline Non-Item
- No Replies
|
|
XYZ Position Swapper [Vega]
Code creator: Vega
Code credits: Seeky (mkw structure github), Stebler (extra position documentation)
https://github.com/SeekyCt/mkw-structure...r/player.h
A very rudimentary code that allows you to instantly swap your XYZ position (where you are on the track) with any desired CPU during an offline race/battle. I added in a small check to the code to ensure that XYZ's were not constantly swapping when holding down the activator or else it will cause unwanted/weird moonjumping effects. Don't swap too fast or else those weird effects will start to occur.
Please keep in mind this code does not include...
- Checks if you are in a race/battle (will freeze if you activate at something like the main license menu)
- Checks if doing TTs (will probably just freeze if you tried or end up doing nothing)
- Camera Angling adjustments (be prepared to be facing in an odd direction after swapping)
S = CPU slot value to switch with (anything from 1 thru B). I haven't tested setting the slot value to 0 (yourself), should just end up doing nothing.
XXXX = Controller Address
ZZZZ = Button Activator
Handy reference page for X and Z values - https://mkwii.com/showthread.php?tid=44
W values:
5 = PAL w/ GCN controller
3 = NTSC-K (any controller)
4 = All other region+controller combos
Final NOTE: This code makes use of Memory Address 0x800003FF. Make sure no other codes in your GCT/Cheat-Manager are using that address, or if you are a coder/dev, then feel free to modify the code to use a different Memory Address.
Region-Free
C0000000 0000001A
3D80803W A18CXXXX
3960ZZZZ 7D606038
7C005800 3D808000
41820010 38000000
980C03FF 4E800020
880C03FF 2C000001
4D820020 38000001
980C03FF 3800000S
898C5F27 3D60809C
2C0C008C 806BD110
41820024 2C0C00EC
806B18F8 41820018
2C0C0010 806B0958
4182000C 3D60809B
806BFF38 80A30020
80A50000 81230020
5400103A 7D29002E
80A50000 80A50008
80A50090 80A50004
38A50068 81290000
81290008 81290090
81290004 39290068
7D4564AA 3861FFF4
7D4365AA 7D4964AA
7D4565AA 7D4364AA
7D4965AA 4E800020
#START ASSEMBLY (C0 Codetype)
#Memory Notes
#0x800003FF = Button Status
#0 = Not Pressed
#1 = Pressed
#Register Notes
#r5 = You
#r9 = CPU
#Check Button Activation
lis r12, 0x8033 #NTSC-K GCN Y button for compilation purposes, adjust this accordingly
lhz r12, 0x6200 (r12)
li r11, 0x0880
and r0, r11, r12
cmpw r0, r11
lis r12, 0x8000
beq- button_pressed
#Nothing Pressed, Reset Button Status, End C0
li r0, 0
stb r0, 0x3FF (r12)
blr
#Button Pressed, Adjust Button Status
#0 = Not Pressed
#1 = Pressed
button_pressed:
lbz r0, 0x3FF (r12)
cmpwi r0, 1
beqlr-
li r0, 1
stb r0, 0x3FF (r12)
#Set User Desired CPU Slot
li r0, 1 #Set to 1 for compilation purposes, adjust this accordingly
#Determine Game Region, Grab Initial Pointer
lbz r12, 0x5F27 (r12) #Instruction here is vital. Virtually impossible for this to be modded by something unrelated.
lis r11, 0x809C
cmpwi r12, 0x8C
lwz r3, 0xFFFFD110 (r11)
beq- usa
cmpwi r12, 0xEC
lwz r3, 0x18F8 (r11)
beq- pal
cmpwi r12, 0x10
lwz r3, 0x0958 (r11)
beq- japan
#korea;r12 = 0x54
lis r11, 0x809B
lwz r3, 0xFFFFFF38 (r11)
#Load Your Player Data Pointer
usa:
pal:
japan:
lwz r5, 0x0020 (r3)
lwz r5, 0 (r5)
#Load CPU Player Data Pointer
lwz r9, 0x0020 (r3)
rlwinm r0, r0, 2, 0, 29
lwzx r9, r9, r0
#Load Your XYZ Coordinate Pointer
lwz r5, 0 (r5)
lwz r5, 0x8 (r5)
lwz r5, 0x90 (r5)
lwz r5, 0x4 (r5)
addi r5, r5, 104
#Load CPU XYZ Coordinate Pointer
lwz r9, 0 (r9)
lwz r9, 0x8 (r9)
lwz r9, 0x90 (r9)
lwz r9, 0x4 (r9)
addi r9, r9, 104
#Load Your XYZ's, save to negative stack
lswi r10, r5, 12
addi r3, sp, -0xC
stswi r10, r3, 12
#Load CPU XYZ's
lswi r10, r9, 12
#Write CPU XYZ's to your Pointer
stswi r10, r5, 12
#Reload Your XYZ's back into r10 thru r12
lswi r10, r3, 12
#Write Your XYZ's to CPU's Pointer
stswi r10, r9, 12
#End C0
#blr #Uncomment if not compiling with pyii
#END ASSEMBLY
|
|
|
Code Request: Orange MT on Bikes |
Posted by: BlueStreak - 01-13-2021, 05:28 AM - Forum: Code Support / Help / Requests
- Replies (8)
|
|
I'm not even sure if this would be possible, but I am requesting a gecko code that gives bikes the ability to perform super mini-turbos (orange mini-turbos). Ideally this would function the same way as karts, after drifting for a short period you charge a blue mini-turbo but if you drift for longer you get an orange one, with a better duration.
|
|
|
TC Shock Time Modifier [1superchip] |
Posted by: 1superchip - 01-08-2021, 12:46 AM - Forum: Offline; Item
- No Replies
|
|
TC Shock Time Modifier [1superchip]
This code modifies how long the Thundercloud shocks players. This does not prevent spinouts.
NTSC-U
02579DB6 0000XXXX
PAL
0258061A 0000XXXX
NTSC-J
0257FF9A 0000XXXX
NTSC-K
0256E672 0000XXXX
Values:
0x04C8 - 2x as long
0x0264 - Default
0x0132 - 1/2 as long
0x0000 - No shock, spinout still occurs
Code Creator: 1superchip
|
|
|
Reverse Battle Timer [Geekid] |
Posted by: Geekid - 01-06-2021, 03:34 PM - Forum: Time Trials & Battle
- Replies (2)
|
|
Reverse Battle Timer [Geekid]
This code makes the battle timer count up to 3:00 instead of down to 0:00.
Side effects: - Timer flashes red during the battle
- The final minute music will not trigger
Only affects the visual timer. Other modes are not affected.
NTSC-U
C2531164 00000002
38A5FFF4 A0050014
60000000 00000000
PAL
C2535CAC 00000002
38A5FFF4 A0050014
60000000 00000000
NTSC-J
C253562C 00000002
38A5FFF4 A0050014
60000000 00000000
NTSC-K
C2523D04 00000002
38A5FFF4 A0050014
60000000 00000000
ASM source:
Code: subi r5, r5, 0xC
lhz r0, 0x0014 (r5)
Code created by: Geekid
|
|
|
Concerns about porting |
Posted by: Geekid - 01-06-2021, 02:24 PM - Forum: Code Support / Help / Requests
- Replies (7)
|
|
Now that I have created a few decent codes, I have to consider porting them. However, porting requires RAM dumps and making dumps for all regions requires owning an ISO for each of them (which I don't). I did find this patching option on Wiimm's ISO tools and tried to patch my PAL copy, but it didn't seem to affect the game like I intended.
Is there a solution to this?
|
|
|
Is there anything you'd go back to 2008 and change in MKWii? |
Posted by: Zeraora - 01-06-2021, 12:34 PM - Forum: General Discussion
- Replies (2)
|
|
This is another basic question. If you could go back into the development of MKWii and change something for release, what would you change, and why?
For me, I would change the way VR and BR is matchmaked and Gained/Loss. In my opinion, I think that its very loose and doesn't really portray skill correctly.(Which is another reason why I'm learning ASM)
|
|
|
|