Pages: 1
Helios |
Posted on 05-20-18, 04:40 pm
|
So, I would like to use this ASM hack in just selected levels, or when event ID 72 is active.
#include "nsmb.h" void hook_0211F840() { MarioActor* mario = (MarioActor*)getPtrToPlayerActor(); mario->xVelocity = 0x2000; //Change this value to change how fast Mario/Luigi run. } I have found MeroMero's Time Stop if ID 40 is active, but that is only applicable in .s format. I have also searched ASM Hacks with Switch Activation, but I do not understand what to do and how to add to the code in the code block provided above. Any help would be appreciated. Thanks in advance. _________________________ Check out these awesome hacks! Beyond DS is now my major hack! |
RicBent |
Posted on 05-20-18, 05:58 pm (rev. 1 by RicBent on 05-20-18, 06:01 pm)
|
Mariomaster
Karma: 8528 Posts: 1234/1681 Since: 06-09-12 |
#include "nsmb.h"
void hook_0211F840() { u32 id = 42; u64* activatorBitmask = (u64*)(0x0208AF3C); if (!(*activatorBitmask >> (id-1)) & 1)) return; MarioActor* mario = (MarioActor*)getPtrToPlayerActor(); mario->xVelocity = 0xBAD1DEA; } Not tested but it should work fine. Edit: Nope, this won't work with any ID > 64 but should do it for all other ones. _________________________ GitHub - Kuribo64 - YouTube |
Dirbaio |
Posted on 05-20-18, 06:04 pm (rev. 1 by Dirbaio on 05-20-18, 06:05 pm)
|
Super Mario
( ͡° ͜ʖ ͡°) Karma: 9979 Posts: 4425/4456 Since: 06-08-11 |
The activator bitmask is only 64 bits though. ID 72 cant work there...
I don't know if the bitmask is actually an array, or the IDs higher than 64 have special meanings that are calculated from other stuff iirc..? Edit: you edit-ninja'd me lol. |
newluigidev |
Posted on 05-20-18, 09:22 pm
|
Nipper Plant
Karma: 2406 Posts: 352/417 Since: 08-17-15 |
Um, off-topic, but shouldn't the last 2 lines be in a else statement?
|
RicBent |
Posted on 05-20-18, 09:28 pm (rev. 1 by RicBent on 05-20-18, 09:30 pm)
|
Mariomaster
Karma: 8528 Posts: 1235/1681 Since: 06-09-12 |
Helios |
Posted on 05-21-18, 07:19 am (rev. 3 by Helios on 05-21-18, 09:12 am)
|
Funnily, I do not get the original code given by newluigidev and the code modified by RicBent work for me.
However, I do get the code here to work, and it makes Mario run insanely fast, because of the BAD1DEA thing. Actually, why is it a bad idea? I edited the code for it and now I get everything I wanted! #include "nsmb.h" void hook_0211F840(MarioActor* player) { u32 id = 30; u64* activatorBitmask = (u64*)(0x0208AF3C); if (!(*activatorBitmask >> (id-1)) & 1) return; player->xVelocity = 0x2000; } Activate this using event ID 31. Also, if you use this, be sure to credit newluigidev and RicBent, not me. _________________________ Check out these awesome hacks! Beyond DS is now my major hack! |
RicBent |
Posted on 05-21-18, 09:01 am
|
Mariomaster
Karma: 8528 Posts: 1236/1681 Since: 06-09-12 |
Helios |
Posted on 05-21-18, 10:43 am
|
I may sound very annoying, but... eh. I understand why you said BAD1DEA So, I am asking (again) for a way to just make the game think the player is holding KEY_RIGHT, and blocks input of KEY_LEFT. I have searched for the myKeysDown function, but it is an integer... Weird. _________________________ Check out these awesome hacks! Beyond DS is now my major hack! |
RicBent |
Posted on 05-21-18, 11:45 am
|
Mariomaster
Karma: 8528 Posts: 1237/1681 Since: 06-09-12 |
Well, the myKeysDown function just returns a bitmask of the currently held keys. Also you can't simply reverse that function and write to these ram places as they are read only hardware registers.
If you wanted to force key inputs you'd have to intercept the code of the player actor that fetches the key input. Though I have no idea where that is. _________________________ GitHub - Kuribo64 - YouTube |
Helios |
Posted on 05-21-18, 12:14 pm (rev. 2 by Helios on 05-21-18, 12:30 pm)
|
Is it able to set the default bitmask to the one when RIGHT is pressed? If no then I will just give up this idea and use the 5 coin challenge instead.
Oops I thought you mean the code I inserted before. Now I see. _________________________ Check out these awesome hacks! Beyond DS is now my major hack! |
RicBent |
Posted on 05-21-18, 12:24 pm
|
Mariomaster
Karma: 8528 Posts: 1238/1681 Since: 06-09-12 |
Helios |
Posted on 05-21-18, 04:40 pm
|
Pages: 1