Help:Patching the motorcycle area checks: Difference between revisions

Jump to navigation Jump to search
no edit summary
imported>Leoetlino
No edit summary
imported>Leoetlino
No edit summary
Line 32: Line 32:
* On Wii U, the checks are implemented in the exact same way (which makes sense since it's the same codebase), but only a single instruction has to be patched because the Wii U compiler is not quite as good at inlining functions. Simply patch the instruction at <code>0x02A32A30</code> to <code>li r3, 1</code>.
* On Wii U, the checks are implemented in the exact same way (which makes sense since it's the same codebase), but only a single instruction has to be patched because the Wii U compiler is not quite as good at inlining functions. Simply patch the instruction at <code>0x02A32A30</code> to <code>li r3, 1</code>.


== Disappearing when entering a blacklisted climate ==
== Technical details ==
=== Disappearing when entering a blacklisted climate ===


Called from the Motorcycle AI root code.
Called from the Motorcycle AI root code.
Line 60: Line 61:


<pre>.text:0000007100679D84                MOV            W0, #1</pre>
<pre>.text:0000007100679D84                MOV            W0, #1</pre>
== Rune UI/sound effect ==
=== Rune UI/sound effect ===


Same climate based check as above, but done in a different RideMgr function. Just change:
Same climate based check as above, but done in a different RideMgr function. Just change:
Line 68: Line 69:


<pre>.text:0000007100679650 B              loc_710067965C</pre>
<pre>.text:0000007100679650 B              loc_710067965C</pre>
== Refusing to spawn when in a blacklisted climate ==
=== Refusing to spawn when in a blacklisted climate ===


=== Check 1 ===
==== Check 1 ====


Deep in some RideMgr function, called from the PlayerNormal AI:
Deep in some RideMgr function, called from the PlayerNormal AI:
Line 89: Line 90:
so that the game always executes the code inside of the if block.
so that the game always executes the code inside of the if block.


=== Check 2 ===
==== Check 2 ====


Found in another RideMgr member function and also called from the PlayerNormal AI code.
Found in another RideMgr member function and also called from the PlayerNormal AI code.
Line 117: Line 118:
to make the game always return “true”.
to make the game always return “true”.


== Disappearing when being away from the motorcycle ==
=== Disappearing when being away from the motorcycle ===


This is checked by Motorcycle AI root code (at 0x71004ADF28).
This is checked by Motorcycle AI root code (at 0x71004ADF28).
Line 127: Line 128:
It is easy to change this condition to be always false.
It is easy to change this condition to be always false.


== Other checks ==
=== Other checks ===


There are a few more conditions for spawning the motorcycle<ref>0x7100678E80 in Switch 1.5.0</ref>; however patching them is not recommended as they are implemented for good reasons.
There are a few more conditions for spawning the motorcycle<ref>0x7100678E80 in Switch 1.5.0</ref>; however patching them is not recommended as they are implemented for good reasons.


=== Actor check ===
==== Actor check ====


If the actor cannot be loaded, the game will not allow the player to use the motorcycle and will show the regular “You can’t use that here” message.
If the actor cannot be loaded, the game will not allow the player to use the motorcycle and will show the regular “You can’t use that here” message.


=== 6 or 7 other checks ===
==== 6 or 7 other checks ====


The RideMgr function at 0x7100678E80 (which can be identified with a xref to "GameROMMotorcycle") calls 6 member functions that must all return true; otherwise, the motorcycle cannot be used.
The RideMgr function at 0x7100678E80 (which can be identified with a xref to "GameROMMotorcycle") calls 6 member functions that must all return true; otherwise, the motorcycle cannot be used.
Anonymous user

Navigation menu