Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 620
» Latest member: Aucratic
» Forum threads: 1,771
» Forum posts: 13,465

Full Statistics

Online Users
There are currently 70 online users.
» 0 Member(s) | 67 Guest(s)
Applebot, Bing, Google

Latest Threads
Make it to 10,000
Forum: General Discussion
Last Post: Fifty
40 minutes ago
» Replies: 6,945
» Views: 5,166,950
"Double Dash!!" Speedomet...
Forum: Visual & Sound Effects
Last Post: Sponge
1 hour ago
» Replies: 8
» Views: 2,146
Don't Hide Character When...
Forum: Visual & Sound Effects
Last Post: Vega
5 hours ago
» Replies: 0
» Views: 18
[Request] Visually hide V...
Forum: Code Support / Help / Requests
Last Post: Vega
5 hours ago
» Replies: 7
» Views: 9,580
Hide VR / BR Text [B_squo...
Forum: Visual & Sound Effects
Last Post: Vega
5 hours ago
» Replies: 0
» Views: 16
Print BMG IDs [_tZ]
Forum: Visual & Sound Effects
Last Post: Vega
5 hours ago
» Replies: 2
» Views: 1,042
Statues/Posters/Signs Are...
Forum: Visual & Sound Effects
Last Post: _Ro
Today, 12:53 AM
» Replies: 0
» Views: 35
Minimap Character Icons R...
Forum: Visual & Sound Effects
Last Post: _Ro
Yesterday, 06:13 AM
» Replies: 0
» Views: 73
Show Kart Statuses on Min...
Forum: Visual & Sound Effects
Last Post: _Ro
Yesterday, 03:46 AM
» Replies: 2
» Views: 115
Grow Loop [Ro, JoshuaMK]
Forum: Offline Non-Item
Last Post: _Ro
Yesterday, 02:28 AM
» Replies: 2
» Views: 175

 
  Enable Item Boxes in Time Trials [vabold, Cotni]
Posted by: Vega - 09-02-2024, 02:20 PM - Forum: Time Trials & Battle - Replies (1)

Enable Item Boxes in Time Trials [vabold, Cotni]

vabold - "improved version of seeky and melg's, as this one does not affect other object behavior (e.g. cataquacks)
they are uncredited because I did not use theirs as a base - I used Cotni's recent work instead
notably, though, it has the side effect of enabling bomb cars as well"

NTSC-U
02790CC4 00004800
047AB5A8 60000000
02813A70 00004800

PAL
02799CD0 00004800
047BA008 60000000
02827584 00004800

NTSC-J
0279933C 00004800
047B9674 60000000
02826BF0 00004800

NTSC-K
02788090 00004800
047A83C8 60000000
02815944 00004800

Code creators: vabold, Cotni

Print this item

  Code request: Bullet Bill item limit
Posted by: JerryHatrick - 09-02-2024, 12:30 PM - Forum: Code Support / Help / Requests - Replies (2)

I know CTGP has done this, I don't know how to implement this myself.
Ideally I would prefer to change it in StaticR.rel but I'm a noob and I don't know what address I'm looking for beyond 0x396E88 (NTSC).

Alternatively a simple code request would be ideal, if possible.

Print this item

  CPU Control Cycler [Ro]
Posted by: _Ro - 09-02-2024, 06:42 AM - Forum: Offline Non-Item - Replies (2)

CPU Control Cycler [Ro]

This code allows playing as other CPUs, you can cycle the camera thru all CPUs and you will be able to play as the one that the camera is targetting, you can drive and throw items as if you were really them. Once you change the CPU, the CPU you were previously controlling will return back to normal and will start driving by itself again. Your real player will not move or use items while you control CPUs.

This code can be fun in many ways, you can mess with CPUs, use it for testing and pictures (you can use Joshua's Disable CPU Driving code to make all CPUs not move and then control each individually to position them for a picture) or even changing CPUs combos with Vega's code and then using it for different things.

Most of the HUD is still based on your real player but minimap icon for controlled CPU was coded in.

Here's an example of a picture that I took using the code:
[Image: image.png?ex=66d6b1cb&is=66d5604b&hm=7a2...y=lossless]

XXXX: Controller Address Second Half [Example: 14C2 for Classic Controller NTSC-U]
YYYY: Both cycle buttons masked together (Button to cycle to previous+ Button to cycle to next button = YYYY) [Example: 8002 for D-Pad Left/Right for Classic Controller ]
ZZZZ: Button to cycle to previous [Example: 0002 for D-Pad Left for Classic Controller ]

No need to input button to cycle to next, YYYY logic does it, plus, makes code shorter and cleaner.

This code makes uses of addresses 0x80001620 thru 0x80001621. Make sure no other codes use these addresses.

NTSC-U
C2581B2C 00000006
819D0000 818C0000
898C0010 3D608000
896B1620 2C0B0000
4182000C 2C0C0000
4D820020 9421FFF0
60000000 00000000
C258E058 00000006
819D0000 818C0000
898C0010 3D608000
896B1620 2C0B0000
4182000C 2C0C0000
4D820020 9421FFD0
60000000 00000000
C2589BE4 00000004
88030010 3D808000
898C1620 7C006000
40820008 38000000
60000000 00000000
C25971F8 00000010
3FC08000 889E1620
3D808034 A06CXXXX
3D80809C 818CEE20
898C0010 398CFFFF
7063YYYY 41820044
897E1621 2C0B0000
40820038 706BZZZZ
41820018 2C040000
3884FFFF 4082001C
7D846378 48000014
7C0C2000 38840001
40820008 38800000
989D009C 989E1620
7063YYYY 39600001
40820008 39600000
997E1621 00000000
C2728F84 00000007
3D808000 898C1620
817D0000 814B0000
894A0010 7C0C5000
40820018 818B0004
816C0014 556B003C
916C0014 4E800020
9421FFF0 00000000
C278ED0C 00000005
A01D000C 3D808000
898C1620 2C0C0000
41820010 2C1B0000
40820008 38000000
60000000 00000000
C27E1CA8 00000002
3D808000 898C1620
7C046000 00000000
C27E2018 0000000A
80030B90 3D808000
898C1620 817CFFFC
2C0B0000 41820038
816B0000 816B0000
896B0010 396B0001
7C0B6000 40820020
38000002 819C01BC
39600001 996C00BB
819C01C0 39600005
996C00BB 00000000

PAL
C2588350 00000006
819D0000 818C0000
898C0010 3D608000
896B1620 2C0B0000
4182000C 2C0C0000
4D820020 9421FFF0
60000000 00000000
C257AB68 00000006
819D0000 818C0000
898C0010 3D608000
896B1620 2C0B0000
4182000C 2C0C0000
4D820020 9421FFD0
60000000 00000000
C2590408 00000004
88030010 3D808000
898C1620 7C006000
40820008 38000000
60000000 00000000
C25A2230 00000010
3FC08000 889E1620
3D808034 A06CXXXX
3D80809C 818C3618
898C0010 398CFFFF
7063YYYY 41820044
897E1621 2C0B0000
40820038 706BZZZZ
41820018 2C040000
3884FFFF 4082001C
7D846378 48000014
7C0C2000 38840001
40820008 38800000
989D009C 989E1620
7063YYYY 39600001
40820008 39600000
997E1621 00000000
C27255F8 00000007
3D808000 898C1620
817D0000 814B0000
894A0010 7C0C5000
40820018 818B0004
816C0014 556B003C
916C0014 4E800020
9421FFF0 00000000
C2797D18 00000005
A01D000C 3D808000
898C1620 2C0C0000
41820010 2C1B0000
40820008 38000000
60000000 00000000
C27EB554 00000002
3D808000 898C1620
7C046000 00000000
C27EB8C4 0000000A
80030B90 3D808000
898C1620 817CFFFC
2C0B0000 41820038
816B0000 816B0000
896B0010 396B0001
7C0B6000 40820020
38000002 819C01BC
39600001 996C00BB
819C01C0 39600005
996C00BB 00000000

NTSC-J
C2587CD0 00000006
819D0000 818C0000
898C0010 3D608000
896B1620 2C0B0000
4182000C 2C0C0000
4D820020 9421FFF0
60000000 00000000
C257A4E8 00000006
819D0000 818C0000
898C0010 3D608000
896B1620 2C0B0000
4182000C 2C0C0000
4D820020 9421FFD0
60000000 00000000
C258FD88 00000004
88030010 3D808000
898C1620 7C006000
40820008 38000000
60000000 00000000
C25A1BB0 00000010
3FC08000 889E1620
3D808034 A06CXXXX
3D80809C 818C2678
898C0010 398CFFFF
7063YYYY 41820044
897E1621 2C0B0000
40820038 706BZZZZ
41820018 2C040000
3884FFFF 4082001C
7D846378 48000014
7C0C2000 38840001
40820008 38800000
989D009C 989E1620
7063YYYY 39600001
40820008 39600000
997E1621 00000000
C2724C64 00000007
3D808000 898C1620
817D0000 814B0000
894A0010 7C0C5000
40820018 818B0004
816C0014 556B003C
916C0014 4E800020
9421FFF0 00000000
C2797384 00000005
A01D000C 3D808000
898C1620 2C0C0000
41820010 2C1B0000
40820008 38000000
60000000 00000000
C27EABC0 00000002
3D808000 898C1620
7C046000 00000000
C27EAF30 0000000A
80030B90 3D808000
898C1620 817CFFFC
2C0B0000 41820038
816B0000 816B0000
896B0010 396B0001
7C0B6000 40820020
38000002 819C01BC
39600001 996C00BB
819C01C0 39600005
996C00BB 00000000

NTSC-K
C25763A8 00000006
819D0000 818C0000
898C0010 3D608000
896B1620 2C0B0000
4182000C 2C0C0000
4D820020 9421FFF0
60000000 00000000
C2568BC0 00000006
819D0000 818C0000
898C0010 3D608000
896B1620 2C0B0000
4182000C 2C0C0000
4D820020 9421FFD0
60000000 00000000
C257E460 00000004
88030010 3D808000
898C1620 7C006000
40820008 38000000
60000000 00000000
C2590288 00000010
3FC08000 889E1620
3D808033 A06CXXXX
3D80809B 818C1C58
898C0010 398CFFFF
7063YYYY 41820044
897E1621 2C0B0000
40820038 706BZZZZ
41820018 2C040000
3884FFFF 4082001C
7D846378 48000014
7C0C2000 38840001
40820008 38800000
989D009C 989E1620
7063YYYY 39600001
40820008 39600000
997E1621 00000000
C27139A0 00000007
3D808000 898C1620
817D0000 814B0000
894A0010 7C0C5000
40820018 818B0004
816C0014 556B003C
916C0014 4E800020
9421FFF0 00000000
C27860D8 00000005
A01D000C 3D808000
898C1620 2C0C0000
41820010 2C1B0000
40820008 38000000
60000000 00000000
C27D9914 00000002
3D808000 898C1620
7C046000 00000000
C27D9C84 0000000A
80030B90 3D808000
898C1620 817CFFFC
2C0B0000 41820038
816B0000 816B0000
896B0010 396B0001
7C0B6000 40820020
38000002 819C01BC
39600001 996C00BB
819C01C0 39600005
996C00BB 00000000

Code creator: Ro
Code credits: JoshuaMK and B_squo (Both had important addresses that helped me find CPU AI functions), acaruso (Player camera address) and probably more people

Print this item

  Change Mii Shirt Color In Between Online Races [Sponge]
Posted by: Sponge - 08-29-2024, 11:39 PM - Forum: Online Non-Item - No Replies

Change Mii Shirt Color In Between Online Races [Sponge]

"Randomly" changes your Mii's shirt color between races. Changes appear on both your screen and other people's screens

Old code I made years ago and decided to release now

Credits to Vega for Change Mii Names In Between Online Races, which this code is based off

NOTE: This code uses memory addresses 0x800007D4 thru 0x800007D9. Make sure no other codes are using these addresses

PAL
C2663178 00000002
3FC08000 93FE07D0
83E1001C 00000000
C25FB094 00000003
3C808000 38030067
900407D4 8003006C
60000000 00000000
C0000000 00000015
3D808000 816C07D0
2C0B0000 4D820020
896C07D9 696B0001
996C07D9 2C0B0001
4C820020 7D8802A6
9421FF80 BC610008
3CA08000 388007D8
7C832B78 8B630000
3B7B0001 2C1B000B
40810008 3B600000
9B630000 1C9B0002
806507D4 9B630000
806507D0 38630011
98830000 3863FFFF
7C7F1B78 3880004C
38000000 B003004A
3D80800C 618C78D0
7D8803A6 4E800021
B07F004A B8610008
38210080 7D8803A6
4E800020 00000000

NTSC-U
C2661094 00000002
3FC08000 93FE07D0
83E1001C 00000000
C25DA7B0 00000003
3C808000 38030067
900407D4 8003006C
60000000 00000000
C0000000 00000015
3D808000 816C07D0
2C0B0000 4D820020
896C07D9 696B0001
996C07D9 2C0B0001
4C820020 7D8802A6
9421FF80 BC610008
3CA08000 388007D8
7C832B78 8B630000
3B7B0001 2C1B000B
40810008 3B600000
9B630000 1C9B0002
806507D4 9B630000
806507D0 38630011
98830000 3863FFFF
7C7F1B78 3880004C
38000000 B003004A
3D80800C 618C7830
7D8803A6 4E800021
B07F004A B8610008
38210080 7D8803A6
4E800020 00000000

NTSC-J
C26627E4 00000002
3FC08000 93FE07D0
83E1001C 00000000
C25FA970 00000003
3C808000 38030067
900407D4 8003006C
60000000 00000000
C0000000 00000015
3D808000 816C07D0
2C0B0000 4D820020
896C07D9 696B0001
996C07D9 2C0B0001
4C820020 7D8802A6
9421FF80 BC610008
3CA08000 388007D8
7C832B78 8B630000
3B7B0001 2C1B000B
40810008 3B600000
9B630000 1C9B0002
806507D4 9B630000
806507D0 38630011
98830000 3863FFFF
7C7F1B78 3880004C
38000000 B003004A
3D80800C 618C77F0
7D8803A6 4E800021
B07F004A B8610008
38210080 7D8803A6
4E800020 00000000

NTSC-K
C2651490 00000002
3FC08000 93FE07D0
83E1001C 00000000
C25E94B4 00000003
3C808000 38030067
900407D4 8003006C
60000000 00000000
C0000000 00000015
3D808000 816C07D0
2C0B0000 4D820020
896C07D9 696B0001
996C07D9 2C0B0001
4C820020 7D8802A6
9421FF80 BC610008
3CA08000 388007D8
7C832B78 8B630000
3B7B0001 2C1B000B
40810008 3B600000
9B630000 1C9B0002
806507D4 9B630000
806507D0 38630011
98830000 3863FFFF
7C7F1B78 3880004C
38000000 B003004A
3D80800C 618C7930
7D8803A6 4E800021
B07F004A B8610008
38210080 7D8803A6
4E800020 00000000

Print this item

  CPU Bot (Online) v1.5 [marito_yo]
Posted by: marito_yo - 08-29-2024, 08:07 PM - Forum: Online Non-Item - Replies (3)

CPU Bot (Online) v1.5 [marito_yo]

Change: Changed C2 hook to one liner. The C2 hook set it to 1 regardless of case.
Addition: Made "isCpu" bool true. This bool sets some important stuff that CPUs have and it fixes the respawn route issue. Also, it was modified in a way that it will only affect human players so it will not cause online players to have CPU stuff (example: turning).
Change and Addition by Ro

NTSC-U
0452AA1C 60000000
04721E4C 38600001
04589E4C 70030003

PAL
0452F564 60000000
0472627C 38600001
04590670 70030003

NTSC-J
0452EEE4 60000000
047258e8 38600001
0458FFF0 70030003

NTSC-K
0451D5BC 60000000
04714624 38600001
0457E6C8 70030003

Code creator: marito_yo
Code credits: Dea00 [CPU bot[Dea]]
Code credits: Ro (isCPU fix)

Print this item

  Item Effect Randomizer [TheLordScruffy]
Posted by: Unnamed - 08-28-2024, 09:47 AM - Forum: Offline; Item - No Replies

Item Effect Randomizer [ TheLordScruffy ]

When you drive over a dropped item, you will have a random item effect.


NTSC-U
C256D91C 00000024
7D8C42E6 718B00F0
718C000F 3CA0809C
80A58F68 80A50B70
2C050003 4082001C
2C0C000D 38600001
418200F4 2C0C000E
40820008 39800008
2C0C000E 40820010
2C0B0080 40800008
39800008 2C0C000C
38600006 418200C8
2C0C0009 38600007
418200BC 2C0C0005
3860000B 418200B0
2C0C000F 3860000C
418200A4 48000015
00010204 09070803
0B060C0D 0A0F0E00
7CE802A6 7E038378
3D00809B 6108EEB0
7CE760AE 1CE7001C
7D88382E 2C0C0000
40820028 3D00808B
61080D30 1CEC000C
7D874214 3CA08002
60A508F0 7CA903A6
4E800421 48000048
80D00004 3C80809C
8084EE20 80840014
38600000 80A40000
7C053000 41820018
38840248 38630001
2C03000C 41820014
4BFFFFE4 7C832378
7D8903A6 4E800421
3860FFFF 00000000

PAL
C257276C 00000024
7D8C42E6 718B00F0
718C000F 3CA0809C
80A5D728 80A50B70
2C050003 4082001C
2C0C000D 38600001
418200F4 2C0C000E
40820008 39800008
2C0C000E 40820010
2C0B0080 40800008
39800008 2C0C000C
38600006 418200C8
2C0C0009 38600007
418200BC 2C0C0005
3860000B 418200B0
2C0C000F 3860000C
418200A4 48000015
00010204 09070803
0B060C0D 0A0F0E00
7CE802A6 7E038378
3D00809C 610836B8
7CE760AE 1CE7001C
7D88382E 2C0C0000
40820028 3D00808B
61085468 1CEC000C
7D874214 3CA08002
60A51450 7CA903A6
4E800421 48000048
80D00004 3C80809C
80843618 80840014
38600000 80A40000
7C053000 41820018
38840248 38630001
2C03000C 41820014
4BFFFFE4 7C832378
7D8903A6 4E800421
3860FFFF 00000000

NTSC-J
C25720EC 00000024
7D8C42E6 718B00F0
718C000F 3CA0809C
80A5C788 80A50B70
2C050003 4082001C
2C0C000D 38600001
418200F4 2C0C000E
40820008 39800008
2C0C000E 40820010
2C0B0080 40800008
39800008 2C0C000C
38600006 418200C8
2C0C0009 38600007
418200BC 2C0C0005
3860000B 418200B0
2C0C000F 3860000C
418200A4 48000015
00010204 09070803
0B060C0D 0A0F0E00
7CE802A6 7E038378
3D00809C 61082718
7CE760AE 1CE7001C
7D88382E 2C0C0000
40820028 3D00808B
610845C8 1CEC000C
7D874214 3CA08002
60A51374 7CA903A6
4E800421 48000048
80D00004 3C80809C
80842678 80840014
38600000 80A40000
7C053000 41820018
38840248 38630001
2C03000C 41820014
4BFFFFE4 7C832378
7D8903A6 4E800421
3860FFFF 00000000

NTSC-K
C25607C4 00000024
7D8C42E6 718B00F0
718C000F 3CA0809B
80A5BD68 80A50B70
2C050003 4082001C
2C0C000D 38600001
418200F4 2C0C000E
40820008 39800008
2C0C000E 40820010
2C0B0080 40800008
39800008 2C0C000C
38600006 418200C8
2C0C0009 38600007
418200BC 2C0C0005
3860000B 418200B0
2C0C000F 3860000C
418200A4 48000015
00010204 09070803
0B060C0D 0A0F0E00
7CE802A6 7E038378
3D00809B 61081CF8
7CE760AE 1CE7001C
7D88382E 2C0C0000
40820028 3D00808A
610838E0 1CEC000C
7D874214 3CA08002
60A514B8 7CA903A6
4E800421 48000048
80D00004 3C80809B
80841C58 80840014
38600000 80A40000
7C053000 41820018
38840248 38630001
2C03000C 41820014
4BFFFFE4 7C832378
7D8903A6 4E800421
3860FFFF 00000000


Code Creator: TheLordScruffy

Print this item

  How to port more complex codes with non standard porting
Posted by: Unnamed - 08-28-2024, 09:44 AM - Forum: Coding (Non-ASM) and Dolphin - No Replies

How to port more complex codes with non standard porting




NOTE: This Tutorial is for intermediate to advanced coders. Beginners should view THIS Tutorial first.


Introduction

When porting more complex codes with auto porters, it can happen that the finished codes do not work or crash the game. Then this code will almost certainly need non-standard porting.

Non-standard porting is when not only the hook address has to be ported, but there are also addresses in the (ASM) code that have to be ported. These can be pointers or in-game functions, for example. Non-standard porting is more time-consuming, as it is more difficult to find the ported address. Especially if it is in an environment that also contains function addresses or pointers.

This tutorial will show you some attempts how to port such codes.

What you will need:
-This Forum
-Hex Editor (I will choose online hex Editor HexEd.it)
-Decent knowledge about ASM (some instructions, see THIS tutorial how to learn ASM)
-RAM Dumps (you neet at least the RAM Dump of the region the code is from and the region you want to port to, see THIS tutorial how to get RAM Dumps)
-Disassembler (I will use online Disassembler disasm pro)
-{Optional} Hex Calculator

 


Chapter 1: The Code we want to port

For our test I have chosen a code that is not finished porting yet, it is called "Item Effect Randomizer" by TheLordScruffy. The code is given in PAL region and we want to port it to NTSC-U.

Here is our code in PAL:

Code:
C257276C 00000024
7D8C42E6 718B00F0
718C000F 3CA0809C
80A5D728 80A50B70
2C050003 4082001C
2C0C000D 38600001
418200F4 2C0C000E
40820008 39800008
2C0C000E 40820010
2C0B0080 40800008
39800008 2C0C000C
38600006 418200C8
2C0C0009 38600007
418200BC 2C0C0005
3860000B 418200B0
2C0C000F 3860000C
418200A4 48000015
00010204 09070803
0B060C0D 0A0F0E00
7CE802A6 7E038378
3D00809C 610836B8
7CE760AE 1CE7001C
7D88382E 2C0C0000
40820028 3D00808B
61085468 1CEC000C
7D874214 3CA08002
60A51450 7CA903A6
4E800421 48000048
80D00004 3C80809C
80843618 80840014
38600000 80A40000
7C053000 41820018
38840248 38630001
2C03000C 41820014
4BFFFFE4 7C832378
7D8903A6 4E800421
3860FFFF 00000000



Chapter 2: Finding Location of the Hook adress in RAM

What we want to do is find the Code's RAM Address (offset & column location) within the RAM Dump. To figure this out, simply remove the first 2 digits off the first line (the C2, 06 or 04 line) of the code.  If you did the conversion correctly, you should come up with a value of "57276C".

Now open HexEdIt and open your PAL RAM dump with the option "open file". On the right you find "go to". Click on the box and type in the adress with "0x" as prefix. Click Enter.

[Image: NSPTut-P01.png]

You should navigate to the adress now, that means the cursor should be at this adress.


Chapter 3, Section 1: Decide which bytes to search for

To find the correct adress on other region RAMs, you need to decide for what bytes you want to search for. Some good instructions are cmpwi, li, stw, sth, mulli or also mr. Bad instructions to search for are bl (function calls), lwz (sometimes, not always), lis. The reason why this instruction are bad to search for is that they vary in different ports and you will not be able to find the correct adress.

So before we continue, let's disassemble the environment of this adress. I will choose the bytes from 0x572740 to 0x57279F.

The 4 bytes at our adress are 4BAAECE5. This is a bl instruction, which means that is likely to be a function call. So this is not a good instruction to search for. But we have some mulli and mr instructions in a row, so lets take the three instructions

mr r3, r16
mr r4, r31
mulli r0, r0, 0xc

to search for, in bytes that would be 7E0383787FE4FB781C00000C starting at adress 0x0057275C. That will be our bytes to search for.

[Image: NSPTut-P02.png]


Chapter 3, Section 2: Searching the bytes

Now we search this bytes in the NTSC-U RAM Dump. Open this Dump. On the right of HexEdIt you will see a "search for" box, type* this bytes with spaces in. Then make sure only "Hexadecimal Values" is checked on Data Types and "List all occurences" is also checked.

[Image: NSPTut-P03.png]

Finally click on "Search now" - You should find one adress.

0x0056D90C

*NOTE: Seems like HexEd.it has no copy Function, so you have to type the bytes, but that shouldn't be a problem at all.

That means we found one adress matching with our bytes. Now we want to get our ported adress, for this, we need first the difference of our search start adress and our adress we want to port. The adress we want to port is 0x0057276C, and our search start adress was 0x0057275C, means that our port adress is 0x10 bytes after the search start adress.
Now we have found the adress matching with our bytes. To get our ported adress (which is 0x10 after the adress of our bytes), we add the difference of 0x10 and find our adress:

0x0056D91C

Navigate to this adress in HexEd.it. You will see the Bytes 4BAB2FD5. This is a bl instruction and means that we probably found the correct adress.
I will tell you that this is our hook adress ported to NTSC-U!


Chapter 4: Find addresses contained in the ASM code

We already have our hook adress ported. Now we want to port the adresses in the ASM code. Before we can do this, we have to find them before. For this, we need to disassemble our code.

Code:
mftb r12, 0x10c
andi. r11, r12, 0xf0
andi. r12, r12, 0xf
lis r5, 0x809c
lwz r5, -0x28d8(r5)
lwz r5, 0xb70(r5)
cmpwi r5, 3
bne 0x38
cmpwi r12, 0xd
li r3, 1
beq 0x11c
cmpwi r12, 0xe
bne 0x38
li r12, 8
cmpwi r12, 0xe
bne 0x4c
cmpwi r11, 0x80
bge 0x4c
li r12, 8
cmpwi r12, 0xc
li r3, 6
beq 0x11c
cmpwi r12, 9
li r3, 7
beq 0x11c
cmpwi r12, 5
li r3, 0xb
beq 0x11c
cmpwi r12, 0xf
li r3, 0xc
beq 0x11c
bl 0x90
.word 0x00010204
.word 0x09070803
.word 0x0B060C0D
.word 0x0A0F0E00
mflr r7
mr r3, r16
lis r8, 0x809c
ori r8, r8, 0x36b8
lbzx r7, r7, r12
mulli r7, r7, 0x1c
lwzx r12, r8, r7
cmpwi r12, 0
bne 0xd8
lis r8, 0x808b
ori r8, r8, 0x5468
mulli r7, r12, 0xc
add r12, r7, r8
lis r5, 0x8002
ori r5, r5, 0x1450
mtctr r5
bctrl
b 0x11c
lwz r6, 4(r16)
lis r4, 0x809c
lwz r4, 0x3618(r4)
lwz r4, 0x14(r4)
li r3, 0
lwz r5, 0(r4)
cmpw r5, r6
beq 0x10c
addi r4, r4, 0x248
addi r3, r3, 1
cmpwi r3, 0xc
beq 0x118
b 0xec
mr r3, r4
mtctr r12
bctrl
li r3, -1


Most ASM or string write codes that will load adresses (of functions or pointers) that need to be ported have the following structure:

lis rX, 0x80GG
lwz rY, 0xSIMM(rX)
or
lis rX, 0x80GG
ori rY, rX, 0xUIMM

where GG can be from 02 to 9C, rX and rY arbitary GPR. That means a lis instruction followed by a lwz or an ori instruction mostly indicates function calls or the use of pointers. If we search for these in our disassembled code, we find 5 occurences:

1.
lis r5, 0x809C
lwz r5, -0x28D8(r5)
2.
lis r8, 0x809C
ori r8, r8, 0x36B8
3.
lis r8, 0x808B
ori r8, r8, 0x5468
4.
lis r5, 0x8002
ori r5, r5, 0x1450
5.
lis r4, 0x809C
lwz r4, 0x3618(r4)

That means these five adresses needs to be ported now.

0x809BD728
0x809C36B8
0x808B5468
0x80021450
0x809C3618


Chapter 5. Using the Forum as help

If you are lucky, some of the codes of the forum have already used (and ported) adresses. For example, if you use the forum search for "D728", you will look at the sources of other codes that this pointer is called "race_data".
Indeed, the first two adresses and the last adress were already used by other codes. We can extract these adresses e.g. from my "Call Item Function Anytime" code. The NTSC-U adresses are:

PAL --> NTSC-U

0x809BD728 --> 809B8F68 (race_data)
0x809C36B8 --> 809BEEB0 (item_functions)
0x809C3618 --> 809BEE20 (player_holder)


Chapter 6. Porting the rest

Two adresses are missing, and we need to port them manually. The adress 808B5468 is harder to port. If you go to this adress you will see the bytes 00000000, but also surrounding values starting with 0x80.

[Image: NSPTut-P04.png]

That means these are most likely function adresses, and a search with these values on other RAM Dumps will not work. Also, there is no ASM code in environment. So what you can do is to scroll up or down a bit, to find either assembly or some text. If you scroll down a bit you will notice some text appearing, starting with

"FSqrt: Input is..."

[Image: NSPTut-P05.png]

Ok, we have a string at starting adress 0x808B56D0 we can search for. Do a search for at least 6 of the bytes on the NTSC-U RAM Dump, so we do a search for "46537172743a".

If you do this you should come up with 13 occurences. Obviously, if there is more than one occurence, it will be hard to find the correct one.

[Image: NSPTut-P06.png]

To do so, run the search on the PAL RAM Dump too. The occurences are listed in order, so take a look at the position of your adress. You will notice: On PAL, the first occurence holds the bytes you use to search.

[Image: NSPTut-P07.png]

That means: On NTSCU Dump, also the first adress 0x008B0F98 is the one we want to look at. Now to get our ported adress, we need to calculate the difference of our search start adress and our adress we want to port, like in Chapter 3 again. This is a bit harder, you might need a hex calculator for this.

You will find the difference of -0x268. If we now add this to our found adress 0x008B0F98, we get the result 0x008B0D30, so 808B0D30 is our ported adress.

To check it, open NTSC-U dump and look at the adress 0x008B0D30, you will find 00000000 as bytes after a bunch of 0x80 adresses, so chances are high that this is the correct adress.


The adress 80021450 is easier to port, so you might try this one alone. HINT: Use the 12 bytes at adress 0x002145C in PAL dump as search bytes.

If you have done all correctly, you must find 800208F0 as the correct adress.


Chapter 7: Setup the Ported code

So we have all adresses ported now.

0x8057276C --> 0x8056D91C (hook adress)
0x809BD728 --> 0x809B8F68 (race_data)
0x809C36B8 --> 0x809BEEB0 (item_functions)
0x808B5468 --> 0x808B0D30
0x80021450 --> 0x800208F0
0x809C3618 --> 0x809BEE20 (player_holder)


To setup the new ported code, replace all the old adresses with the new adresses, be careful to also replace the lis-instructions.

[Image: NSPTut-P08.png]


Chapter 8: Testing

Now test the code on console and on dolphin to make sure it works. If the code isn't working or crashing, you have either made a mistake when porting or you have overlooked an address that needs to be ported. Then look at the code again and check whether you may have made a mistake or overlooked something.



Conclusion


Two main problems occur with porting more complex codes:

1. Find the instructions that will need porting
2. When attempting to port, choose the correct bytes to search for

I hope this tutorial helps you to figure these two things out in future and with that to port more complex code to other regions, as auto porters do not support (yet) non standard porting.


Happy Coding!


Tutorial written by: Unnamed; Credits: Vega for further tutorials

Print this item

  Force First Place
Posted by: andreMKW - 08-16-2024, 09:56 PM - Forum: Incomplete & Outdated Codes - Replies (5)

Hi, I made this code and I wanted to share with yall. It forces the player to be in first place (Grand Prix and VS) by pressing a button before the 5 seconds at the start of a game.
Sorry if it is made not well, but i'm new to Gecko code creation.
I wanted to do special thanks to Vega for writing an awesome guides to learn Code Coding, PPC ASM, Controllers in memory and Anarion's Force Respawn, where I looked how to use statements with buttons state.
I only could make PAL code bc I don't have other regions ISO.

rrrr = 8034 (Nunhuck, Wheel, Classic)
rrrr =  8035 (GameCube)

XXXX = Controller address value
ZZZZ = Activator button value

(PAL) 
C2533AC4 00000006
3D60rrrr A14BXXXX
280AZZZZ 40A20018
39000001 99040020
816C0014 656B0001
916C0014 7F83E378
60000000 00000000

Print this item

  Leaf Piles Freeze the Timer [LucioWins]
Posted by: LucioWins - 08-13-2024, 08:13 PM - Forum: Time Trials & Battle - No Replies

Leaf Piles Freeze the Timer [LucioWins]

This code makes any leaf piles hit freeze the timer as well as stopping leaf piles from respawning.

This code makes uses address 0x800009D0. Make sure no other codes use this address.

PAL:
0476ED40 38000000
C2535C78 00000007
3FC08000 83FE09D0
2C1F0000 41820024
2C030000 4181000C
3BE00001 38600001
3BFFFFFF 93FE09D0
38030000 48000008
38030001 00000000
C2555620 00000004
3C808000 80A409D0
2C050000 4182000C
38600000 48000008
7C601A14 00000000
C2767554 00000003
3FC08000 83FE09D0
3BFFXXXX 93FE09D0
3C60808D 00000000

NTSC-U:
0477b218 38000000
C2531130 00000007
3FC08000 83FE09D0
2C1F0000 41820024
2C030000 4181000C
3BE00001 38600001
3BFFFFFF 93FE09D0
38030000 48000008
38030001 00000000
C254f600 00000004
3C808000 80A409D0
2C050000 4182000C
38600000 48000008
7C601A14 00000000
C2777288 00000003
3FC08000 83FE09D0
3BFFXXXX 93FE09D0
3C60808D 00000000

NTSC-J:
0476e3ac 38000000
C25355f8 00000007
3FC08000 83FE09D0
2C1F0000 41820024
2C030000 4181000C
3BE00001 38600001
3BFFFFFF 93FE09D0
38030000 48000008
38030001 00000000
C2554fa0 00000004
3C808000 80A409D0
2C050000 4182000C
38600000 48000008
7C601A14 00000000
C2766bc0 00000003
3FC08000 83FE09D0
3BFFXXXX 93FE09D0
3C60808D 00000000

NTSC-K:
0475d100 38000000
C2523cd0 00000007
3FC08000 83FE09D0
2C1F0000 41820024
2C030000 4181000C
3BE00001 38600001
3BFFFFFF 93FE09D0
38030000 48000008
38030001 00000000
C2543678 00000004
3C808000 80A409D0
2C050000 4182000C
38600000 48000008
7C601A14 00000000
C2755914 00000003
3FC08000 83FE09D0
3BFFXXXX 93FE09D0
3C60808D 00000000

XXXX = Number of frames the timer will freeze for when a leaf pile is hit

Some Possible X Values:
0.1 Seconds = 0006
0.5 Seconds = 001E
1 Second = 003C (Recommended)
2 Seconds = 0078
3 Seconds = 00B4
5 Seconds = 012C


Code Credits: Gaberboo (providing a code to disable randomisation in the milliseconds)

Print this item

  KCL Flag Modifier [Unnamed]
Posted by: Unnamed - 08-09-2024, 09:05 AM - Forum: Offline Non-Item - No Replies

KCL Flag Modifier [Unnamed]

With this code you can replace a KCL Flag you are driving on with one of your choice. Simply put in the KCL Flag you want to replace with the one you wish.


NTSC-U
C27B26B8 00000004
A165000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D635B78 00000000
C27B1FE4 00000004
A176000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D645B78 00000000
C27B2C70 00000004
A179000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D635B78 00000000
C27B242C 00000004
A176000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D605B78 00000000
C27B3038 00000004
A179000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D605B78 00000000

PAL
C27C1118 00000004
A165000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D635B78 00000000
C27C0A44 00000004
A176000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D645B78 00000000
C27C16D0 00000004
A179000E KKKKKKKK
280CSSSS 4182000C
3D600000 616BTTTT
7D635B78 00000000
C27C0E8C 00000004
A176000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D605B78 00000000
C27C1A98 00000004
A179000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D605B78 00000000

NTSC-J
C27C0784 00000004
A165000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D635B78 00000000
C27C00B0 00000004
A176000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D645B78 00000000
C27C0D3C 00000004
A179000E KKKKKKKK
280CSSSS 4182000C
3D600000 616BTTTT
7D635B78 00000000
C27C04F8 00000004
A176000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D605B78 00000000
C27C1104 00000004
A179000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D605B78 00000000

NTSC-K
C27AF4D8 00000004
A165000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D635B78 00000000
C27AEE04 00000004
A176000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D645B78 00000000
C27AFA90 00000004
A179000E KKKKKKKK
280CSSSS 4182000C
3D600000 616BTTTT
7D635B78 00000000
C27AF24C 00000004
A176000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D605B78 00000000
C27AFE58 00000004
A179000E KKKKKKKK
280CSSSS 4082000C
3D600000 616BTTTT
7D605B78 00000000


Values
SSSS: KCL Flag you want to replace
TTTT: KCL Flag replaced with

For more information about KCL flags go here.


KKKKKKKK: an assembly instruction you can choose what you want to replace
Default Value is 7D6C5B78 (mr r12, r11)

If you want to modify KCL Flags e.g. having all the same Base Type, you have to mask out bits. The instruction should follow this structure

rlwinm r12, r11, 0, m, n

For this, you need to learn PowerPC assembly to assemble your instruction and how to and a register with a mask. Helpful Tutorials for this you find in Vegas Assembly Tutorial and in Tutorial about Bit Rotation.


Here are some Examples
SSSS = 0004, TTTT = 0006, KKKKKKKK = 7D6C5B78 (Heavy offroad "Sand" is now Boost Panel)
SSSS = 0006, TTTT = 0000, KKKKKKKK = 7D6C5B78 (Boost Panel is now normal road, this way, you disable boost panels)
SSSS = 2000, TTTT = 0000, KKKKKKKK = 556C04A4 (Disable all trickable KCL Flags)

If you get more knowledge about assembly language, you can also extend this code to make it work for more than one KCL flag.


Code Creator: Unnamed

Print this item