Pages: 12 »
Posted on 08-25-12, 10:10 pm (rev. 2 by ImageBot on 11-21-16, 02:26 am)
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 9979
Posts: 2376/4456
Since: 06-08-11
So, yay. I got to spawn a Luigi clone!



The code:
@Spawn 2 players repl_020069B4: mov r2, #3 str r2, [r13, #0x28] bx lr @ Force 2nd player to use player 1's view data @ (Or something like that...?) hook_02108E14: mov r3, #0 strb r3, [r1, #0x1E] bx lr




Posted on 08-25-12, 10:12 pm
Birdo


Karma: 3304
Posts: 576/2021
Since: 06-28-11
Its awesome to finally see luigi and mario at the same time, despite even if its acts like a clone.
Good job  Dirbaio!
_________________________

Posted on 08-25-12, 10:29 pm
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 9979
Posts: 2377/4456
Since: 06-08-11

Well, the usual bugs about the clones still remain.
- Luigi grabs a shell, it gets teleported to Mario.
- Luigi stomps a goomba, Mario gets the jump boost.
- Fireballs go through each other.

And also, there are some graphical glitches. I think it's because the game gets confused and loads some MvsL graphics instead (lol). The "score markers" that appear when grabbing coins, powerups or stomping stuff don't appear, and there's garbage instead. I wonder why.
Posted on 08-26-12, 12:11 am
☭ coffee and cream


Karma: 10398
Posts: 636/2766
Since: 06-26-11
Perhaps it's loading MvsL data because the variable you changed has to do with the MvsL mode?
_________________________
Kuribo64 - RH-fucking-cafe - Kafuka

zrghij
Posted on 08-26-12, 12:14 am
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 9979
Posts: 2378/4456
Since: 06-08-11
Yeah, it must be something like that. It's failing to load a file or something. I dunno how to find out what's wrong, because there are very many variables that control this stuff. There's one at 02085A84 isMvsLMode, that seems to be the "main" one. There's lots and lots of code all over the game that check that variable and do different things based on its value. But I haven't changed this one...

The one I changed is another one that seems to just control spawning... But it seems it controls more stuff
Posted on 08-26-12, 12:15 am
☭ coffee and cream


Karma: 10398
Posts: 637/2766
Since: 06-26-11
I'd say it controls code/data loading in general. Try to find all the refs to it in the code?
_________________________
Kuribo64 - RH-fucking-cafe - Kafuka

zrghij
Posted on 08-26-12, 12:20 am
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 9979
Posts: 2379/4456
Since: 06-08-11
The stuff that could be causing it is:

02020280 getPlayersToSpawnBitmask
020202A0 getPlayerCount

(These are funcs that read from a var, but all the code seems to use these funcs)

getPlayerCount has many many xrefs
*sigh*
Posted on 08-26-12, 12:25 am
☭ coffee and cream


Karma: 10398
Posts: 638/2766
Since: 06-26-11
Hmm, seems interesting...

(this is the kind of situation that makes me wish IDA would let you view xrefs as a list instead of a hugeass graph)
_________________________
Kuribo64 - RH-fucking-cafe - Kafuka

zrghij
Posted on 08-26-12, 12:26 am (rev. 1 by ImageBot on 11-21-16, 02:26 am)
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 9979
Posts: 2380/4456
Since: 06-08-11
It does, press X (Or Control+X sometimes) and you get a list of all xrefs.
Posted on 08-26-12, 01:00 am
Cheep-cheep


Karma: 46
Posts: 74/182
Since: 07-02-12
It would be just plain awesome if you found a way to make it where a different input controls Luigi.
_________________________
Community Remix Stuff:

World 3-C: 99% Complete (Released)

World 4-Tower: Not started yet
Posted on 08-26-12, 10:48 am
☭ coffee and cream


Karma: 10398
Posts: 640/2766
Since: 06-26-11
This way already exists, it's the MvsL mode itself.

Get it to load more sprites and you get coop gameplay.
_________________________
Kuribo64 - RH-fucking-cafe - Kafuka

zrghij
Posted on 08-26-12, 01:59 pm (rev. 1 by  Hiccup on 08-26-12, 02:00 pm)
Birdo


Karma: 2754
Posts: 159/2091
Since: 06-26-11
It's cool seeing Mario and Luigi on screen at the same time.
It is interesting the unused desert levels use the midway entrance for the 2nd player starting point.

EDIT:
What do you mean? "Who'll get to see something like this first?"
Posted on 08-26-12, 02:07 pm
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 9979
Posts: 2382/4456
Since: 06-08-11
Uhm, I meant, who'd be the first to try out the code
Posted on 08-27-12, 07:50 am (rev. 1 by coolas1 on 08-27-12, 08:05 am)
Porcupo
Did you win the game?

Karma: 211
Posts: 277/322
Since: 06-28-11
Posted by Dirbaio
So, yay. I got to spawn a Luigi clone!

The code:
repl_020069B4:
mov r2, #3
str r2, [r13, #0x28]
bx lr

@ Force 2nd player to use player 1's view data
@ (Or something like that...?)
hook_02108E14:
mov r3, #0
strb r3, [r1, #0x1E]
bx lr



Wait, what?

Am i right in assmuming that repl is a replace hook?
Posted on 08-27-12, 06:42 pm
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 9979
Posts: 2391/4456
Since: 06-08-11
These are the types of hooks that NSMBe can do:

repl: Replaces the instruction at the address with the instructions you give. Destroys LR because it uses BL instruction.
hook: Inserts the instructions you give after the address. Doesn't destroy any register. (Saves them all to stack)
nsub: Replaces the address with a jump instruction to your code. Useful for replacing entire functions.

I should go document this somewhere, but I'll probably change the hook types a bit more. repl can be made to not destroy LR too. And we need also hooks that don't save registers to stack, because there are times you do want to modify the registers to affect how the function runs
Posted on 08-28-12, 09:35 am
Porcupo
Did you win the game?

Karma: 211
Posts: 279/322
Since: 06-28-11
Posted by Dirbaio
And we need also hooks that don't save registers to stack, because there are times you do want to modify the registers to affect how the function runs

True, but with the knowledge of the above post, we can pop those values, edit them and then push them again.
Posted on 08-28-12, 03:18 pm
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 9979
Posts: 2398/4456
Since: 06-08-11
Or modify them directly in the stack using STR Rx, [SP, #xx].
But it's not a very good idea, and it requires to know where are they in the stack, which requires to look at how the patch is inserted. Not good
Posted on 08-29-12, 05:08 pm
Flurry


Karma: 724
Posts: 135/258
Since: 10-14-11
Does this mean you could load MvsL star mode in single player?
Posted on 08-29-12, 09:14 pm
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 9979
Posts: 2410/4456
Since: 06-08-11
Probably not.

...not yet, at least.
Posted on 09-09-12, 05:35 pm
Cheep-cheep


Karma: 46
Posts: 87/182
Since: 07-02-12
Very sad Nintendo didn't take the effort to put in this kind of Multiplayer into the game.
_________________________
Community Remix Stuff:

World 3-C: 99% Complete (Released)

World 4-Tower: Not started yet
Pages: 12 »