Pages: 12345 »
Posted on 09-30-12, 09:11 pm (rev. 4 by ImageBot on 11-21-16, 02:31 am)
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 8939
Posts: 2604/4433
Since: 06-08-11

^ Yup, that's right. these are Boos in MvsL mode!

I haven't tested most of the sprite sets, and some sprites are buggy because they weren't designed for interacting with multiple players. For example the boos only follow one player (or something like that...)

UPDATE: See new code (works BETTER!) here: http://nsmbhd.net/post/25336/



I was going to write an explanation of what this does but I'm fucking lazy and it's getting fucking late, so I'll write the fucking explanation tomorrow.

Enjoy!
Posted on 09-30-12, 09:34 pm
I am random… very random.

Karma: 720
Posts: 241/682
Since: 01-17-12
This is great! We can finally put other sprites that we couldn't put before!Nice Find  Dirbaio.
<Silvreus>It has been 1 month, 4 days, 2 hours, 21 minutes and 3 seconds since I last remember being lazy.

Posted on 10-01-12, 04:06 pm


Karma: 3667
Posts: 1539/2112
Since: 06-28-11
End of Level Flag makes the level crash, I guess.
Aside from that, this is GREAT!!!! I can finally make level that just existed in my dreams. :eyeshif
Posted on 10-01-12, 05:48 pm (rev. 1 by  Hiccup on 10-01-12, 05:49 pm)
Birdo


Karma: 2541
Posts: 199/2059
Since: 06-26-11
It's really great!

But does this allow you to use all sprites in single player? or just sprites in multiplayer that were unused and disabled with sprite sets?


_________________________
Will pay unspecified $ for NSMB beta.
Posted on 10-01-12, 07:21 pm
Roy Koopa


Karma: 3901
Posts: 2248/2722
Since: 06-26-11
All, since there are no unused/disabled sprites in Multiplayer. Because the sprites which are used have the files in the enemy folder. According to that, it would be possible that Dirbaio loads the Sprite files for the specific sprite directly into the carc or something. Just a guess
_________________________
See a lots of creative DS Hacking here
If you want to support me, you might check out my Patreon Page : )
Posted on 10-01-12, 07:28 pm
Birdo


Karma: 3165
Posts: 741/2004
Since: 06-28-11
Great news! It would be awesome if we could recreate/fix the unused MvsLuigi levels, since they seem interesting and fun to play
_________________________

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

Karma: 8939
Posts: 2607/4433
Since: 06-08-11
So here goes the explanation of how this works.

Files in NSMB are referenced by something I call the "Ext ID".
It contains two file IDs. One is used in singleplayer mode, and the other one is used in multiplayer mode. These two IDs can point to a normal file in ROM or a file in a NARC.

These IDs are used everywhere in the code. In all the File ID tables, and in all the code that loads files.

For example this is the ExtId stored in the overlay 0 table that refers to the castle tileset NCG:
0xC306008C

The second half is the ID used in singleplayer: 0x008C. This is 140 in dec. Add 131 (the overlay count) and you get the file id to the castle NCG.
The first half is the ID used in multiplayer. It refers to a file in the NARC.
IDs that point to the narc are like 0xCxyy. x is the NARC number in a table at 0x0203A6C0, and yy is the file ID inside the narc.

For most files used in the game's code, the first half of the ID is 0x0000 so the game crashes while trying to load them if MvsL mode. The files that are used from MvsL (tilesets, graphics, Maril models and animations, sprite files...) do have something set in the first half.

So what I did was modify the function that "chooses" which File ID is used (I called it calcFileID) to always use the second ID. So now NSMB can load any file in MvsL mode! It also means that there's no need to use the NARC patch buttons, all the files are loaded from the ROM!

BUT there was yet another problem: Overlays.

Every sprite set maps to an overlay. All the overlays that belong to a sprite set are loaded at the same RAM address, so only one of them can be loaded at a time. (This is why it's nearly impossible to "move" sprites from one sprite set to another. Moving code is hard as fuck)

I found the code that loads these sprites BTW. There's a table that maps sprite sets to overlay IDs. Yay.

But because in multiplayer, nearly no sprite sets are used, all that RAM area for sprite set overlays is unused. So Nintendo thought it was a good idea to not waste RAM, so they created an overlay that filled all this empty space and used it for a heap. This overlay was using the RAM region that's used for sprite set overlays, so NSMB crashed trying to load them.

This is overlay 53. It has only 128 bytes of code, but the BSS section of it is HUGE and occupies the RAM space used for sprite sets. And they used it to load something (I haven't checked what. I think it's the NARCs but I'm not sure).

(BSS section is like a part of the overlay that's used, but it's not stored in the overlay file. Overlays have two sizes: the overlay code size and the BSS size. The total size is the sum).

he code for the overlay just creates a heap occupying all this BSS area, and stores a pointer to it somewhere else. There are only 3 functions in the overlay. One for getting a pointer to the heap, another for destroying it, and another for creating it.

So what I did was to change these functions.
The create function does nothing and just returns a pointer to the main heap. The destroy function does nothing (It's a bad idea to destroy the main heap, lol).

So now all these "somethings" are loaded into the main RAM, and that BSS size is not used anymore. Good. So I went to the overlay table and set the BSS size to 0.

And now there's space to load the sprite set overlays, and it's possible to use all the sprite sets in MvsL. Cool

....

I haven't tested all the sprite sets, and I'm not sure if they all work.
And I no longer have access to two DS's
I'll maybe get my friend to lend it to me for some time and I'll test more stuff

Whoa this was a long post.
Posted on 10-02-12, 10:47 am
Birdo


Karma: 2541
Posts: 204/2059
Since: 06-26-11
Thanks for explaining.
How can other people use it?
_________________________
Will pay unspecified $ for NSMB beta.
Posted on 10-02-12, 06:35 pm (rev. 1 by  Dirbaio on 10-02-12, 06:36 pm)
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 8939
Posts: 2611/4433
Since: 06-08-11
Whoa lol I explained this somewhere.
Download the ASM patch template, add a file named something.s in the source folder, paste the ode in it. Then put a NSMB U rom in the folder, and compile and insert with NSMBe.

EDIT: You need to have devkitPro installed.
Posted on 10-05-12, 12:04 am


Karma: 33
Posts: 13/22
Since: 03-12-12
Is there a pre-patched version?
Posted on 10-05-12, 11:45 am
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 8939
Posts: 2632/4433
Since: 06-08-11
I could post the arm9.bin for people to use it, but it'd also require to hexedit the overlay table manually. So meh. Get DevkitPro and compile it
Posted on 10-05-12, 10:35 pm (rev. 1 by saturosias on 10-05-12, 10:36 pm)


Karma: 33
Posts: 14/22
Since: 03-12-12
Sorry if I'm just asking stupid questions.
I install DKP, made something.s with the code in it, "make and insert" in NSMBe, then I go to edit the overlay table and find "00" at 0x35, not sure if I'm in the wrong place? -- or if I'm supposed to delete it all?

Posted on 10-05-12, 10:52 pm
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 8939
Posts: 2646/4433
Since: 06-08-11
No. You have to edit the ARM9 overlay table, which is arm9ovt.bin. Every overlay entry is 32 bytes, and the BSS size is at offset 0xC.
So you have to go to
53*32 + 0xC = 0x6AC
and set to 0 the 4 bytes starting at that position.
Posted on 10-05-12, 11:41 pm (rev. 2 by saturosias on 10-05-12, 11:55 pm)


Karma: 33
Posts: 15/22
Since: 03-12-12
Did all of that, the sprites (thwomp, big boo, etc.) still showing up as red in editor, thought that was normal, added 'em in and replaced narcs etc. and they don't show up in multiplayer, really don't get where I'm going wrong

Attached patch file if anyone could look: http://puu.sh/1bMWu
Posted on 10-05-12, 11:46 pm
Birdo


Karma: 3165
Posts: 766/2004
Since: 06-28-11
saturosias, please dont post ROMS (.nds) files.
Its illegal to do so and I assume thats the nsmb game, so please remove the link.
_________________________

Posted on 10-05-12, 11:48 pm
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 8939
Posts: 2647/4433
Since: 06-08-11
Removed the ROM link..

Are you sure you have compiled and inserted the code? You should've clicked the "Make and insert" button.
Posted on 10-05-12, 11:55 pm (rev. 1 by saturosias on 10-05-12, 11:57 pm)


Karma: 33
Posts: 16/22
Since: 03-12-12
Sorry, replaced puu.sh link with .nmp -- that's legal right?

I clicked "Make and Insert", something.s was in the source folder and NSMB was in the root (asmpatch_template) folder. http://puu.sh/1bMYI
Posted on 10-05-12, 11:57 pm
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 8939
Posts: 2648/4433
Since: 06-08-11
And did it complete the patching without errors?...
Posted on 10-06-12, 12:17 am


Karma: 33
Posts: 17/22
Since: 03-12-12
Dunno', the cmd window keeps closing, though when I run it again it says it's "all complete" or something.
Posted on 10-06-12, 12:18 am
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 8939
Posts: 2650/4433
Since: 06-08-11
Then it worked
Are you using a USA rom!?
Also to check if it's patched properly: Run the thing on the NDS, and take the game card out. If the debug screen pops up instantly, it's patched.
Pages: 12345 »