Instant Transmission Switch [Anarion]
#1
Instant Transmission Switch [Anarion]

NOTE: Only works consistently on Dolphin Emulator.

Works for both online and offline. You can change transmissions/drift-modes live in race.  The race/battle starts with a default state of being in Manual. So if you choose Auto and the race/battle starts, you will start off as Manual still until you hit your button activator/deactivator.

NTSC-U
2834XXXX YYYYZZZZ
C258FDC0 00000003
7C8C2378 80840014
60840010 908C0014
60000000 00000000
CC000000 00000000
C258FDC0 00000003
7C8C2378 80840014
54840734 908C0014
60000000 00000000
E0000000 80008000

PAL
2834XXXX YYYYZZZZ
C25965E4 00000003
7C8C2378 80840014
60840010 908C0014
60000000 00000000
CC000000 00000000
C25965E4 00000003
7C8C2378 80840014
54840734 908C0014
60000000 00000000
E0000000 80008000

NTSC-J
2834XXXX YYYYZZZZ
C2595F64 00000003
7C8C2378 80840014
60840010 908C0014
60000000 00000000
CC000000 00000000
C2595F64 00000003
7C8C2378 80840014
54840734 908C0014
60000000 00000000
E0000000 80008000

NTSC-K
2833XXXX YYYYZZZZ
C258463C 00000003
7C8C2378 80840014
60840010 908C0014
60000000 00000000
CC000000 00000000
C258463C 00000003
7C8C2378 80840014
54840734 908C0014
60000000 00000000
E0000000 80008000

Sources:
#Set Auto
mr r12, r4
lwz r4, 0x0014 (r4)
ori r4, r4, 0x0010 #Turn on Bit, auto is enabled
stw r4, 0x0014 (r12)

#Set Manual
mr r12, r4
lwz r4, 0x0014 (r4)
rlwinm r4, r4, 0, 28, 26 #Turn off Bit, manual is enabled
stw r4, 0x0014 (r12)

Code creator: Anarion
Code credits: JoshuaMK (figured out bit flips, added ability for code to also work online)
Reply
#2
Does this address only break offline? Or is it simply that the pointer changes in a way that makes this unusable online?
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply
#3
This breaks online. This code doesn't work online but it I think that's because Anarion made it incorrectly. He sets r4 to either 0x12 or 0x02. However, when I broke this address then stepped once, my r4 value is 0x16. It's obvious there are more values, and there's some bit reading going on in the next instructions.
Reply
#4
hai jooshua, wen sd ghosts kod??
Reply
#5
Thank you. Do you know of any code that only breaks offline? Also, bit 27 is for auto/manual flag. I'm still unsure what bits 28-31 are used for. Bit 20 if set to 1 disables everything except wheelies. Iirc bit 21 is an on/off flag for the end race camera/cpu control of the player (setting this in race sets the camera, but makes your position cease updating) So in theory, XORing the bit should work:

(NTSC-U)
C258FDC0 00000005
3D80XXXX A18CYYYY
718CZZZZ 41820010
81840014 698C0010
91840014 80840014
60000000 00000000

(PAL)
C25965E4 00000005
3D80XXXX A18CYYYY
718CZZZZ 41820010
81840014 698C0010
91840014 80840014
60000000 00000000

(NTSC-J)
C2595F64 00000005
3D80XXXX A18CYYYY
718CZZZZ 41820010
81840014 698C0010
91840014 80840014
60000000 00000000

(NTSC-K)
C258463C 00000005
3D80XXXX A18CYYYY
718CZZZZ 41820010
81840014 698C0010
91840014 80840014
60000000 00000000

.set region, '' #Must set region value, or else source will not compile

.if (region == 'E' || region == 'e') # RMCE
.macro controller_address
lis r12, 0x8034
.endm
.elseif (region == 'P' || region == 'p') # RMCP
.macro controller_address
lis r12, 0x8034
.endm
.elseif (region == 'J' || region == 'j') # RMCJ
.macro controller_address
lis r12, 0x8034
.endm
.elseif (region == 'K' || region == 'k') # RMCK
.macro controller_address
lis r12, 0x8033
.endm
.else # Invalid Region
.abort
.endif

lis r12, controller_address
lhz r12, 0x3E80 (r12)
andi. r12, r12, 0x90 #Z button
beq noPress
lwz r12, 0x14 (r4)
xori r12, r12, 0x10
stw r12, 0x14 (r4)
noPress:
lwz r4, 0x14 (r4)

XXXX = Upper Controller Address
YYYY = Lower Controller Address
ZZZZ = Button to Press
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply
#6
It works, updated thread. Added you to credits.

Great job!
Reply
#7
The code in the thread doesn't need the 28 type if statement. The code is built so when you press the button, it automatically toggles it on/off/on/off What I put is all that i needed Tongue
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply
#8
I tried your version initially and there were odd effects going on. Example, every now and then I was forced into a never ending sliding effect.
Reply
#9
Weird. I wonder if r12 is reeeally safe. I will do more testing cause I want this to work without 28 type
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply
#10
The source for the 28 codetype uses r12 and there's no issues.

I think the issue with your ASM source is that it causes the transmission to switch almost every frame til the user lets go of the button. Maybe this causes some corruption in the game.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)