TheOfficialFloW / RemasteredControls

A collection of dual analog patches for PSP games on Adrenaline
GNU General Public License v3.0
247 stars 21 forks source link

Midnight Club LA Remix partially works #22

Open ThirteenAG opened 2 years ago

ThirteenAG commented 2 years ago

ULES01144

Was just trying to understand how to make these kind of patches, ended up looking at this function: sub_2A53F4 ("70 FF BD 27 84 00 B0 AF 25 80 80 00 0C 00 04 8E")

Seems a bit similar to GTA, so I hooked these:

.text:002A5444 02 00 A4 A3                             sb      $a0, 2($sp)
.text:002A5448 03 00 A4 A3                             sb      $a0, 3($sp)
.text:002A544C 02 00 A6 93                             lbu     $a2, 2($sp)
.text:002A5450 0D 00 00 10                             b       loc_2A5488
.text:002A5454 03 00 A5 93                             lbu     $a1, 3($sp)
.text:002A5458 0C 00 A5 93                             lbu     $a1, 0xC($sp)
.text:002A545C 0D 00 A6 93                             lbu     $a2, 0xD($sp)
.text:002A5460 02 00 A5 A3                             sb      $a1, 2($sp)
.text:002A5464 03 00 A6 A3                             sb      $a2, 3($sp)
.text:002A5468 02 00 A6 93                             lbu     $a2, 2($sp)
.text:002A546C 06 00 00 10                             b       loc_2A5488
.text:002A5470 03 00 A5 93                             lbu     $a1, 3($sp)
.text:002A5474 02 00 A4 A3                             sb      $a0, 2($sp)
.text:002A5478 03 00 A4 A3                             sb      $a0, 3($sp)
.text:002A547C 02 00 A6 93                             lbu     $a2, 2($sp)
.text:002A5480 00 00 07 34                             li      $a3, 0
.text:002A5484 03 00 A5 93                             lbu     $a1, 3($sp)

and of course

.text:002A5490 10 00 06 A2                             sb      $a2, 0x10($s0)
.text:002A5494 11 00 05 A2                             sb      $a1, 0x11($s0)

to basically do this:

sb(a2, s0,0x10),
sb(a1, s0,0x11),
sh(s5, s0, 0x10+2),
sh(s4, s0, 0x11+2)

Right stick started working in menu, where you can reassign most of the buttons:

https://user-images.githubusercontent.com/4904157/146701852-60064bb4-a18e-4ca8-87dc-21d0f7b61529.mp4

But in-game camera gets stuck and you can't move it. And at that point I'm out of ideas what to do with it ¯_(ツ)_/¯

ThirteenAG commented 2 years ago

So apparently I need to add some logic to sub_2A4900 as well...

https://user-images.githubusercontent.com/4904157/146751962-f61ae864-200c-41d2-b5ff-270663a07449.mp4