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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 127
» Latest member: Elias
» Forum threads: 1,125
» Forum posts: 2,535

Full Statistics

Online Users
There are currently 33 online users.
» 0 Member(s) | 30 Guest(s)
Baidu, Google, Yandex

Latest Threads
Make it to 1000!
Forum: General Discussion
Last Post: JoshuaMK
8 hours ago
» Replies: 682
» Views: 72,213
RAM Dump [Vega]
Forum: Misc/Other
Last Post: Vega
Yesterday, 07:47 PM
» Replies: 4
» Views: 87
Disable CPU Driving [Josh...
Forum: Offline Non-Item
Last Post: Vega
Yesterday, 07:40 PM
» Replies: 1
» Views: 21
Force Looking Backwards [...
Forum: Visual & Sound Effects
Last Post: JoshuaMK
Yesterday, 08:49 AM
» Replies: 0
» Views: 13
Dynamic Gravity v1.1 (GCN...
Forum: Offline Non-Item
Last Post: JoshuaMK
09-19-2019, 09:46 PM
» Replies: 0
» Views: 8
Disable All In-Race Effec...
Forum: Visual & Sound Effects
Last Post: JoshuaMK
09-19-2019, 06:45 AM
» Replies: 0
» Views: 7
Kill Lakitu [JoshuaMK]
Forum: Offline Non-Item
Last Post: JoshuaMK
09-19-2019, 06:39 AM
» Replies: 0
» Views: 7
No Items Mode [JoshuaMK]
Forum: Offline; Item
Last Post: JoshuaMK
09-19-2019, 06:33 AM
» Replies: 0
» Views: 12
Scalable Speed [JoshuaMK]
Forum: Offline Non-Item
Last Post: JoshuaMK
09-19-2019, 06:10 AM
» Replies: 0
» Views: 10
Wheelie Threshold Modifie...
Forum: Offline Non-Item
Last Post: JoshuaMK
09-19-2019, 05:43 AM
» Replies: 0
» Views: 10

 
  Force Looking Backwards [JoshuaMK]
Posted by: JoshuaMK - Yesterday, 08:49 AM - Forum: Visual & Sound Effects - No Replies

Force Looking Backwards [JoshuaMK]

Compared to old version this works even when respawning.



(NTSC-U)
0459721C 4800003C

(PAL)
045A2254 4800003C

(NTSC-J)
045A1BD4 4800003C

(NTSC-K)
045902AC 4800003C



Code Creator: JoshuaMK

Print this item

  Dynamic Gravity v1.1 (GCN) [JoshuaMK]
Posted by: JoshuaMK - 09-19-2019, 09:46 PM - Forum: Offline Non-Item - No Replies

Dynamic Gravity v1.1 (GCN) [JoshuaMK]

This version takes your analog input and adds it onto the gravity float, meaning this is far more fluent/precise than the original. It also allows the code to be almost half the length it used to be. X and Y values simply determine how drastic the gravity changes are. This code affects CPUs too.



(NTSC-U)
C2576FC0 00000002
901D0218 3D808142
900C0200 00000000
C2590400 0000000B
3D808034 618CC203
3D608142 3C803F80
908B0204 808B0200
2C04001E 41800034
898C0000 398CFF78
38A0000X 28050001
41820010 38A0000Y
7D8C2BD6 48000008
1D8C000Y A0AB0204
7CA56214 B0AB0204
C02B0204 00000000

(PAL)
C257D824 00000002
901D0218 3D808142
900C0200 00000000
C2596C24 0000000B
3D808034 618CC203
3D608142 3C803F80
908B0204 808B0200
2C04001E 41800034
898C0000 398CFF78
38A0000X 28050001
41820010 38A0000Y
7D8C2BD6 48000008
1D8C000Y A0AB0204
7CA56214 B0AB0204
C02B0204 00000000

(NTSC-J)
C257D1A4 00000002
901D0218 3D808142
900C0200 00000000
C25965A4 0000000B
3D808034 618CC203
3D608142 3C803F80
908B0204 808B0200
2C04001E 41800034
898C0000 398CFF78
38A0000X 28050001
41820010 38A0000Y
7D8C2BD6 48000008
1D8C000Y A0AB0204
7CA56214 B0AB0204
C02B0204 00000000

(NTSC-K)
C256B87C 00000002
901D0218 3D808142
900C0200 00000000
C2584C7C 0000000B
3D808034 618CC203
3D608142 3C803F80
908B0204 808B0200
2C04001E 41800034
898C0000 398CFF78
38A0000X 28050001
41820010 38A0000Y
7D8C2BD6 48000008
1D8C000Y A0AB0204
7CA56214 B0AB0204
C02B0204 00000000



Guide

X = 0/1 (0 = Divide, 1 = Multiply)
Y = 1 to 9 (How much to multiply/divide by)

It is recommended to do X = 0, Y = 2, to achieve something that feels the most like CTGP's.



#~~~~~~~~~~~~~~~~~#
#Inject > 80576FC0#
#~~~~~~~~~~~~~~~~~#

stw r0, 0x0218 (r29)
lis r12, 0x8142
stw r0, 0x0200 (r12)

#~~~~~~~~~~~~~~~~~#
#Inject > 80590400#
#~~~~~~~~~~~~~~~~~#

lis r12, 0x8034
ori r12, r12, 0xC203
lis r11, 0x8142
lis r4, 0x3F80
stw r4, 0x0204 (r11)
lwz r4, 0x0200 (r11)
cmpwi r4, 30
blt skip_gravity_mod
lbz r12, 0 (r12)
subi r12, r12, 0x88
li r5, X
cmplwi r5, 1
beq multiply
li r5, Y
divw r12, r12, r5
b maths
multiply:
mulli r12, r12, Y
maths:
lhz r5, 0x0204 (r11)
add r5, r5, r12
sth r5, 0x0204 (r11)
skip_gravity_mod:
lfs f1, 0x0204 (r11)



Code Creator: JoshuaMK
Code Contributors: Hamster35000vr (Gravity Address)

Print this item

  Disable All In-Race Effects [JoshuaMK]
Posted by: JoshuaMK - 09-19-2019, 06:45 AM - Forum: Visual & Sound Effects - No Replies

Disable All In-Race Effects [JoshuaMK]

Things like flames, smoke, exhaust... anything in-race that is an effect gets removed.



(NTSC-U)
0454ECC8 60000000

(PAL)
04554CE8 60000000

(NTSC-J)
04554668 60000000

(NTSC-K)
04542D40 60000000



Code Creator: JoshuaMK

Print this item

  Kill Lakitu [JoshuaMK]
Posted by: JoshuaMK - 09-19-2019, 06:39 AM - Forum: Offline Non-Item - No Replies

Kill Lakitu [JoshuaMK]

Compared to davidevgen's version, this also "kills" him during the countdown, and probably other places he appears in as well.



(NTSC-U)
0454EBDC 60000000

(PAL)
04554BFC 60000000

(NTSC-J)
0455457C 60000000

(NTSC-K)
04542C54 60000000



Code Creator: JoshuaMK

Print this item

  No Items Mode [JoshuaMK]
Posted by: JoshuaMK - 09-19-2019, 06:33 AM - Forum: Offline; Item - No Replies

No Items Mode [JoshuaMK]

When you hit the item box, the item roulette will work, but you will never get an item. If using offline, this also effects the CPUs.



(NTSC-U)
0478F12C 60000000

(PAL)
04798138 60000000

(NTSC-J)
047977A4 60000000

(NTSC-K)
047864F8 60000000



Code Creator: JoshuaMK

Print this item

  Disable CPU Driving [JoshuaMK]
Posted by: JoshuaMK - 09-19-2019, 06:24 AM - Forum: Offline Non-Item - Replies (1)

Disable CPU Driving [JoshuaMK]

Compared to Hamster's version, this is far more useful as it is not confined to editing speed values when crossing the start/finish line. This code in contrast, works anytime, anywhere.
A great code if you want to explore in 1P VS without CPUs finishing the race on you.



(NTSC-U)
04727510 60000000

(PAL)
047308C0 60000000

(NTSC-J)
0472FF2C 60000000

(NTSC-K)
0471EC68 60000000



With Act/Deactivator:

(NTSC-U)
2834XXXX YYYYZZZZ
04727510 60000000
CC000000 00000000
04727510 4BFFBE5D
E0000000 80008000

(PAL)
2834XXXX YYYYZZZZ
047308C0 60000000
CC000000 00000000
047308C0 4BFF9CB1
E0000000 80008000

(NTSC-J)
2834XXXX YYYYZZZZ
0472FF2C 60000000
CC000000 00000000
0472FF2C 4BFF9CB1
E0000000 80008000

(NTSC-K)
2833XXXX YYYYZZZZ
0471EC68 60000000
CC000000 00000000
0471EC68 4BFF9CB1
E0000000 80008000



Code Creator: JoshuaMK

Print this item

  Scalable Speed [JoshuaMK]
Posted by: JoshuaMK - 09-19-2019, 06:10 AM - Forum: Offline Non-Item - No Replies

Scalable Speed [JoshuaMK]

Like my Scalable Gravity code, this lets you freely scale your speed. Negative values have some interesting effects.
To control your speed simply tilt the c-stick up to increase speed, and tilt the c-stick down to decrease speed. I designed the controls to be compatible with most other codes.



(NTSC-U)
C25743C8 00000011
D01D0020 3C608153
81430C00 280A0000
40A2000C 3CE03FC0
90E30C00 C0030C00
C03D0014 3D808034
618BC205 896B0000
618C3E80 A18C0000
718C0890 280C0890
41820024 2C0B00C0
41810014 2C0B0040
4181002C EC210028
48000024 EC21002A
4800001C 3CE042AB
38E73333 90FD0014
3CE042F0 90FD002C
4800000C D03D0014
D03D002C 00000000

(PAL)
C257AC2C 00000011
D01D0020 3C608153
81430C00 280A0000
40A2000C 3CE03FC0
90E30C00 C0030C00
C03D0014 3D808034
618BC205 896B0000
618C3E80 A18C0000
718C0890 280C0890
41820024 2C0B00C0
41810014 2C0B0040
4181002C EC210028
48000024 EC21002A
4800001C 3CE042AB
38E73333 90FD0014
3CE042F0 90FD002C
4800000C D03D0014
D03D002C 00000000

(NTSC-J)
C257A5AC 00000011
D01D0020 3C608153
81430C00 280A0000
40A2000C 3CE03FC0
90E30C00 C0030C00
C03D0014 3D808034
618BC205 896B0000
618C3E80 A18C0000
718C0890 280C0890
41820024 2C0B00C0
41810014 2C0B0040
4181002C EC210028
48000024 EC21002A
4800001C 3CE042AB
38E73333 90FD0014
3CE042F0 90FD002C
4800000C D03D0014
D03D002C 00000000

(NTSC-K)
C2568C84 00000011
D01D0020 3C608153
81430C00 280A0000
40A2000C 3CE03FC0
90E30C00 C0030C00
C03D0014 3D808034
618BC205 896B0000
618C3E80 A18C0000
718C0890 280C0890
41820024 2C0B00C0
41810014 2C0B0040
4181002C EC210028
48000024 EC21002A
4800001C 3CE042AB
38E73333 90FD0014
3CE042F0 90FD002C
4800000C D03D0014
D03D002C 00000000



#~~~~~~~~~~~~#
#Inject > 805743C8#
#~~~~~~~~~~~#

#Params
#r11 = C-Stick Vertical Axis
#r12 = Controller Button Value
#r0 = L+R+Z Logical AND
#r3 = Mem81 Address
#r7 = Value Set
#r10 = Flag
#f0 = Original Instruction, Value to be Added
#f1 = Value to be Added to
#f5 = Value to be Added to

stfs f0, 0x0020 (r29)
lis r3, 0x8153
lwz r10, 0x0C00 (r3)
cmplwi r10, 0
bne+ already_set_values
lis r7, 0x3FC0
stw r7, 0x0C00 (r3)
already_set_values:
lfs f0, 0x0C00 (r3)
lfs f1, 0x0014 (r29)
lis r12, 0x8034
ori r11, r12, 0xC205
lbz r11, 0 (r11)
ori r12, r12, 0x3E80
lhz r12, 0 (r12)
andi. r12, r12, 0x0890
cmplwi r12, 0x0890
beq reset
cmpwi r11, 0xC0
bgt grow_speed
cmpwi r11, 0x40
bgt the_end
fsubs f1, f1, f0
b the_end
grow_speed:
fadds f1, f1, f0
b the_end
reset:
lis r7, 0x42AB
addi r7, r7, 0x3333
stw r7, 0x0014 (r29)
lis r7, 0x42F0
stw r7, 0x002C (r29)
b past_end
the_end:
stfs f1, 0x0014 (r29)
stfs f1, 0x002C (r29)
past_end:



Code Creator: JoshuaMK
Code Contributors: Volderbeek (Speed Address)

Print this item

  Wheelie Threshold Modifier [JoshuaMK]
Posted by: JoshuaMK - 09-19-2019, 05:43 AM - Forum: Offline Non-Item - No Replies

Wheelie Threshold Modifier [JoshuaMK]



(NTSC-U)
048B1220 XXXXXXXX

(PAL)
048B5AE0 XXXXXXXX

(NTSC-J)
048B4C40 XXXXXXXX

(NTSC-K)
048A3F58 XXXXXXXX



Normal Value = 3E99999A



Code Creator: JoshuaMK

Print this item

  RAM Dump [Vega]
Posted by: Vega - 09-17-2019, 12:57 AM - Forum: Misc/Other - Replies (4)

RAM Dump [Vega]

This code will make a RAM Dump for you (Mem80 - 81 only) and dump the contents to your Wii's NAND.

This code is only useful if you don't have Dolphin to do a RAM Dump.

How to Use the Code:
Whenever you want to initiate the RAM Dump, just press your activator. The game will freeze/stall for around 25-30 full seconds (be patient). Afterwards, you will be returned to the Wii Main Menu.

Launch HBC, use an app such as WiiXplorer. There will be a new directory created at the root of NAND, and it will be named after your game's Game ID. There should be a total of 128 files in the directory (000 - 127). The files will have no specific file extension. Copy paste the directory to your SD/USB, and back them up on your computer. Once you have them backed up on your computer, delete the directory off of your NAND.

Use a Hex Editor (such as HxD) to append all the files in order. Once completed, you will have an entire Mem80-81 RAM Dump. Congratz!

It's recommended to only run this code a few times for whatever Wii you are using this on (do whatever Dumps you need and be done with it). Using this code numerous times can cause premature wear to the Wii's NAND.

NTSC-U
2834XXXX YYYYZZZZ
C20095F4 00000031
3EC08000 3F96FFFD
3B600080 80960000
4800000D 2F585858
58000000 7C6802A6
90830001 BBC30000
BFC10008 3F408016
38800000 38A00003
38C00003 38E00003
63599DD4 7F2803A6
4E800021 2C03FF97
4182000C 2C030000
418000C4 3BA0FFFF
4800000D 2F253033
64000000 7C8802A6
7C972378 3BBD0001
7FA5EB78 7EE4BB78
3861000D 3D808001
618C0ECC 7D8803A6
4E800021 2C030000
4180007C 38610008
38800000 38A00003
38C00003 38E00003
6359ABD4 7F2803A6
4E800021 2C030000
41800054 38610008
38800002 6359ADBC
7F2803A6 4E800021
2C030000 41800038
7C781B78 3F9C0003
7F84E378 3CA00003
2C1D0000 41820039
6359B220 7F2803A6
4E800021 7F03C378
6359B2E4 7F2803A6
4E800021 377BFFFF
4082FF5C 3D80801A
618C87B8 7D8803A6
4E800020 7FC802A6
7C651B78 38800020
80ADA358 80A50024
3D808022 618C9490
7D8803A6 4E800021
38E3FFFC 3896FFFC
3CA0C000 54A5843E
84C40004 94C70004
34A5FFFF 4082FFF4
3CA00003 7C641B78
7F03C378 7FC803A6
4E800020 00000000
E0000000 80008000

PAL
2834XXXX YYYYZZZZ
C2009634 00000031
3EC08000 3F96FFFD
3B600080 80960000
4800000D 2F585858
58000000 7C6802A6
90830001 BBC30000
BFC10008 3F408016
38800000 38A00003
38C00003 38E00003
63599E74 7F2803A6
4E800021 2C03FF97
4182000C 2C030000
418000C4 3BA0FFFF
4800000D 2F253033
64000000 7C8802A6
7C972378 3BBD0001
7FA5EB78 7EE4BB78
3861000D 3D808001
618C1A2C 7D8803A6
4E800021 2C030000
4180007C 38610008
38800000 38A00003
38C00003 38E00003
6359AC74 7F2803A6
4E800021 2C030000
41800054 38610008
38800002 6359AE5C
7F2803A6 4E800021
2C030000 41800038
7C781B78 3F9C0003
7F84E378 3CA00003
2C1D0000 41820039
6359B2C0 7F2803A6
4E800021 7F03C378
6359B384 7F2803A6
4E800021 377BFFFF
4082FF5C 3D80801A
618C8858 7D8803A6
4E800020 7FC802A6
7C651B78 38800020
80ADA360 80A50024
3D808022 618C9814
7D8803A6 4E800021
38E3FFFC 3896FFFC
3CA0C000 54A5843E
84C40004 94C70004
34A5FFFF 4082FFF4
3CA00003 7C641B78
7F03C378 7FC803A6
4E800020 00000000
E0000000 80008000

NTSC-J
2834XXXX YYYYZZZZ
C2009590 00000031
3EC08000 3F96FFFD
3B600080 80960000
4800000D 2F585858
58000000 7C6802A6
90830001 BBC30000
BFC10008 3F408016
38800000 38A00003
38C00003 38E00003
63599D94 7F2803A6
4E800021 2C03FF97
4182000C 2C030000
418000C4 3BA0FFFF
4800000D 2F253033
64000000 7C8802A6
7C972378 3BBD0001
7FA5EB78 7EE4BB78
3861000D 3D808001
618C1950 7D8803A6
4E800021 2C030000
4180007C 38610008
38800000 38A00003
38C00003 38E00003
6359AB94 7F2803A6
4E800021 2C030000
41800054 38610008
38800002 6359AD7C
7F2803A6 4E800021
2C030000 41800038
7C781B78 3F9C0003
7F84E378 3CA00003
2C1D0000 41820039
6359B1E0 7F2803A6
4E800021 7F03C378
6359B2A4 7F2803A6
4E800021 377BFFFF
4082FF5C 3D80801A
618C8778 7D8803A6
4E800020 7FC802A6
7C651B78 38800020
80ADA360 80A50024
3D808022 618C9734
7D8803A6 4E800021
38E3FFFC 3896FFFC
3CA0C000 54A5843E
84C40004 94C70004
34A5FFFF 4082FFF4
3CA00003 7C641B78
7F03C378 7FC803A6
4E800020 00000000
E0000000 80008000

NTSC-K
2833XXXX YYYYZZZZ
C200973C 00000031
3EC08000 3F96FFFD
3B600080 80960000
4800000D 2F585858
58000000 7C6802A6
90830001 BBC30000
BFC10008 3F408016
38800000 38A00003
38C00003 38E00003
63599F10 7F2803A6
4E800021 2C03FF97
4182000C 2C030000
418000C4 3BA0FFFF
4800000D 2F253033
64000000 7C8802A6
7C972378 3BBD0001
7FA5EB78 7EE4BB78
3861000D 3D808001
618C1A94 7D8803A6
4E800021 2C030000
4180007C 38610008
38800000 38A00003
38C00003 38E00003
6359AD10 7F2803A6
4E800021 2C030000
41800054 38610008
38800002 6359AEF8
7F2803A6 4E800021
2C030000 41800038
7C781B78 3F9C0003
7F84E378 3CA00003
2C1D0000 41820039
6359B35C 7F2803A6
4E800021 7F03C378
6359B420 7F2803A6
4E800021 377BFFFF
4082FF5C 3D80801A
618C8BB4 7D8803A6
4E800020 7FC802A6
7C651B78 38800020
80ADA380 80A50024
3D808022 618C9B88
7D8803A6 4E800021
38E3FFFC 3896FFFC
3CA0C000 54A5843E
84C40004 94C70004
34A5FFFF 4082FFF4
3CA00003 7C641B78
7F03C378 7FC803A6
4E800020 00000000
E0000000 80008000



Code creator: Vega
Code credits: Megazig (ISFS Functions, Return to Menu function)



Source:

#~~~~~~~~~~~~~~~~#
# START ASSEMBLY #
#~~~~~~~~~~~~~~~~#

#

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Compilation Region Setting #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

.set region, '' #Fill in E, P, J, or K within the quotes for your region when Compiling! Lowercase letters can also be used.

#~~~~~~~~~~~~~~~~~~~~#
# Macros & Variables #
#~~~~~~~~~~~~~~~~~~~~#

.macro call_link address
    lis r12, \address@h
    ori r12, r12, \address@l
    mtlr r12
    blrl
.endm

.macro call_isfs address
    ori r25, r26, \address@l
    mtlr r25
    blrl
.endm

.macro call_nolink address
    lis r12, \address@h
    ori r12, r12, \address@l
    mtlr r12
    blr
.endm

.if    (region == 'E' || region == 'e') # RMCE
    .set sprintf, 0x80010ECC
    .set ISFS_CreateDir, 0x9DD4
    .set ISFS_CreateFile, 0xABD4
    .set ISFS_Open, 0xADBC
    .set ISFS_Write, 0xB220
    .set ISFS_Close, 0xB2E4
    .set Egg_Alloc, 0x80229490
    .set Wii_Menu, 0x801A87B8
.elseif (region == 'P' || region == 'p') # RMCP
    .set sprintf, 0x80011A2C
    .set ISFS_CreateDir, 0x9E74
    .set ISFS_CreateFile, 0xAC74
    .set ISFS_Open, 0xAE5C
    .set ISFS_Write, 0xB2C0
    .set ISFS_Close, 0xB384
    .set Egg_Alloc, 0x80229814
    .set Wii_Menu, 0x801A8858
.elseif (region == 'J' || region == 'j') # RMCJ
    .set sprintf, 0x80011950
    .set ISFS_CreateDir, 0x9D94
    .set ISFS_CreateFile, 0xAB94
    .set ISFS_Open, 0xAD7C
    .set ISFS_Write, 0xB1E0
    .set ISFS_Close, 0xB2A4
    .set Egg_Alloc, 0x80229734
    .set Wii_Menu, 0x801A8778
.elseif (region == 'K' || region == 'k') # RMCK
    .set sprintf, 0x80011A94
    .set ISFS_CreateDir, 0x9F10
    .set ISFS_CreateFile, 0xAD10
    .set ISFS_Open, 0xAEF8
    .set ISFS_Write, 0xB35C
    .set ISFS_Close, 0xB420
    .set Egg_Alloc, 0x80229B88
    .set Wii_Menu, 0x801A8BB4
.else # Invalid Region
    .err
.endif

#~~~~~~~~~~~~~~~~#
# Register Notes #
#~~~~~~~~~~~~~~~~#

#Code ends in blr, no need to save anything

# r31 = file name within directory-file name string (for sprintf formatting)
# r30 = LR for file fix subroutine
# r29 = file name incrementer
# r28 = Write address (r4 arg) for ISFS_Write
# r27 = Mega Loop Counter
# r26 = 0x8016 for ISFS calls
# r25 = For ISFS Macros
# r24 = fd for ISFS_Close
# r23 - Backup r4 sprintf arg
# r22 - 0x80000000
# r1 + 8 = Start of file pathway string
# r1 + 0xD = File Name within file pathway string

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Load Game ID, Setup ISFS_Write r4's arg for later, Set Mega Loop Counter #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

lis r22, 0x8000
addis r28, r22, -3 #Sets r28 as 0x7FFD0000
li r27, 0x80 #128 total files

#0x817FFFFF - 0x80000000 (then plus 1) = 0x1800000. 0x180000 / 0x80 = 0x30000
#0x80 is the mega loop counter
#0x30000 is ISFS_Write Amount

lwz r4, 0x0 (r22)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Make incomplete file path, Store to Stack #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

bl make_dir

.string "/XXXX\0\0"

make_dir:
mflr r3

stw r4, 0x1 (r3) #Fill in Game ID Ascii for String

#~~~~~~~~~~~~~~~~~~~~~~~~#
# Store Pathway to Stack #
#~~~~~~~~~~~~~~~~~~~~~~~~#

lmw r30, 0x0 (r3)
stmw r30, 0x8 (r1)

#~~~~~~~~~~~~~~~~~~~~~~~#
# Set ISFS Macro Prefix #
#~~~~~~~~~~~~~~~~~~~~~~~#

lis r26, 0x8016

#~~~~~~~~~~~~~~~~~~~~~~#
# Create the Directory #
#~~~~~~~~~~~~~~~~~~~~~~#

li r4, 0
li r5, 3
li r6, 3
li r7, 3

call_isfs ISFS_CreateDir

cmpwi r3, -105
beq- dir_already_exists

cmpwi r3, 0
blt- big_error

dir_already_exists:
li r29, -1

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Create File Name, Append it to File Pathway String #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

bl the_integer

.string "/%03d\0\0"

the_integer:
mflr r4
mr r23, r4

#~~~~~~~~~~~#
# Mega Loop #
#~~~~~~~~~~~#

#~~~~~~~~~~~~~~~~~~~~~~~~~#
# SprintF Setup Then Call #
#~~~~~~~~~~~~~~~~~~~~~~~~~#

mega_loop:
addi r29, r29, 1 #Increment File Name
mr r5, r29 #Move updated file name to r5's sprintf arg
mr r4, r23 #Place in Sprintf r4 arg
addi r3, r1, 0xD #This will point right after '/RMCX'

call_link sprintf
cmpwi r3, 0
blt- __error

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Create New File Based off new Name #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

addi r3, r1, 8
li r4, 0
li r5, 3
li r6, 3
li r7, 3

call_isfs ISFS_CreateFile
cmpwi r3, 0
blt- __error

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Open the newly created File with Write Permissions #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

addi r3, r1, 8
li r4, 2

call_isfs ISFS_Open
cmpwi r3, 0
blt- __error

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Write the File (Dump current 0x30000 bytes of Mem80) #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

#r3 already set from fd return
mr r24, r3 #Backup fd for ISFS_Close

addis r28, r28, 3 #ISFS_Write mem location r4 arg incrementer
mr r4, r28

lis r5, 3 #Sets r5 to 0x30000, bytes to write

#~~~~~~~~~~~~~#
# File Checks #
#~~~~~~~~~~~~~#

#For some reason the Wii Console (Dolphin not an issue) doesn't like to use ISFS_Write r4 Arg of 0x80000000
#This is a quick hacky way to bypass the problem. This can easily be optimized like crazy, but I'm lazy
#and threw this together really quick.

#Subroutine will have customized r3, r4, r5 return values suited for ISFS_Write

cmpwi r29, 0
beql- file_fix

call_isfs ISFS_Write

#~~~~~~~~~~~~#
# Close File #
#~~~~~~~~~~~~#

mr r3, r24
call_isfs ISFS_Close

#~~~~~~~~~~~~~~~~~~~~~#
# Decrement Mega Loop #
#~~~~~~~~~~~~~~~~~~~~~#

__error:
subic. r27, r27, 1
bne+ mega_loop

#~~~~~~~~~~~~~~~~~~~~#
# Return to Wii Menu #
#~~~~~~~~~~~~~~~~~~~~#

big_error:
call_nolink Wii_Menu

#~~~~~~~~~~~~~~~~~~~~~~~~#
# Fix for 000 Subroutine #
#~~~~~~~~~~~~~~~~~~~~~~~~#

file_fix:
mflr r30

mr r5, r3
li r4, 0x20

.if (region == 'E' || region == 'e')
lwz r5, -0x5CA8(r13)
.elseif (region == 'P' || region == 'p')
lwz r5, -0x5CA0(r13)
.elseif (region == 'J' || region == 'j')
lwz r5, -0x5CA0(r13)
.elseif (region == 'K' || region == 'k')
lwz r5, -0x5C80(r13)
.endif

lwz r5, 0x0024 (r5)

call_link Egg_Alloc

addi r7, r3, -4 #Set Storing Address
addi r4, r22, -4 #Set Loading Address

lis r5, 0xC000 #0xC000 words is 0x30000 bytes
srwi r5, r5, 16 #r5 = 0x0000C000

silly_loop:
lwzu r6, 0x4 (r4)
stwu r6, 0x4 (r7)
subic. r5, r5, 1
bne+ silly_loop

lis r5, 3
mr r4, r3 #Put Heap pointer in r4 for ISFS_Write arg
mr r3, r24 #Put fd back into r3

mtlr r30
blr #Exit subroutine

#

#~~~~~~~~~~~~~~#
# END ASSEMBLY #
#~~~~~~~~~~~~~~#

Print this item

  Disable Tricking [JoshuaMK]
Posted by: JoshuaMK - 09-16-2019, 11:19 PM - Forum: Misc/Other - No Replies

Disable tricking [JoshuaMK]



(NTSC-U)
0456F348 28050000
0456F34C 4080005C
0456F364 2C007FFF

(PAL)
04575BAC 28050000
04575BB0 4080005C
04575BC8 2C007FFF

(NTSC-J)
0457552C 28050000
04575530 4080005C
04575548 2C007FFF

(NTSC-K)
04563C04 28050000
04563C08 4080005C
04563C20 2C007FFF



Code Creator: JoshuaMK

Print this item