Pages: 1
Posted on 07-17-17, 01:31 pm (rev. 4 by  Hiccup on 07-17-17, 04:14 pm)
Birdo


Karma: 2754
Posts: 1979/2091
Since: 06-26-11
I turned on this filesystem access logging feature in desmume (go into the Slot 1 config and choose the debug thing then look at desmume's command line window - you may have to increase the window scrolling buffer thing in cmd window properties) and it seems that NSMB loads files for unnecessary things at the start of different scenes. e.g. "Bullet Bill" model at the title screen and "Blockhopper - ? Block" model at the World Map. Though strangely after replacing the bullet bill file with a random bytes file with Every File Explorer, the desmume log thing says that different files are loaded at the title screen. Maybe an issue with Every File Explorer or desmume tool?

Could somebody who is familiar with looking at NSMB's code (e.g. someone who is working on Newer DS ASM) have a look at the code for these scenes to see if they actually try and load these files, and if so - in what context.

I appreciate that the file offsets/IDs/whatevers might have changed, so the developers may not have intended for the Bullet Bill to load on the title screen, but rather something else that use to be in its place, but it is still interesting.
Posted on 07-17-17, 03:19 pm


Karma: 19752
Posts: 1000/1100
Since: 04-02-13
Did you add 0x83 to every file ID you saw?
Posted on 07-17-17, 04:16 pm (rev. 1 by  Hiccup on 07-17-17, 04:16 pm)
Birdo


Karma: 2754
Posts: 1980/2091
Since: 06-26-11
No, why? I can't try it right now, sorry.
Posted on 07-17-17, 04:51 pm


Karma: 19752
Posts: 1001/1100
Since: 04-02-13
Because that's how you get the NSMBe File ID. The game does not count the overlays as files.
Posted on 07-17-17, 04:59 pm
☭ coffee and cream


Karma: 10415
Posts: 2409/2768
Since: 06-26-11
I have a theory:

the files aren't aligned to a specific boundary, but cart reads are aligned to a boundary (512 bytes iirc)

so when it reads the beginning or end of a file, it ends up reading a bit of the neighbor file

maybe that's what desmume is picking up (and would explain why it changes after replacing a file, if EFE changes the order of the files)
_________________________
Kuribo64 - RH-fucking-cafe - Kafuka

zrghij
Posted on 07-17-17, 05:04 pm


Karma: 19752
Posts: 1002/1100
Since: 04-02-13
Oh, Desmume gets the physical adresses? hum
Posted on 07-17-17, 05:07 pm (rev. 3 by  Hiccup on 03-10-18, 02:29 pm)
Birdo


Karma: 2754
Posts: 1981/2091
Since: 06-26-11
Desmume actually displays the filenames, as well as what are presumably addresses - I didn't check if they were.

I tried it with other games and it didn't seem to log any weird files.

Posted by StapleButter
so when it reads the beginning or end of a file, it ends up reading a bit of the neighbor file

That'd explain it.

edit 10/03/2018: it definitely looks like its doing that.
Posted on 07-18-17, 08:16 am
☭ coffee and cream


Karma: 10415
Posts: 2410/2768
Since: 06-26-11
Posted by skawo
Oh, Desmume gets the physical adresses? hum

yeah. on the DS, the ROM is accessed by specifying an address to read from -- filename resolving is done by the game itself.
_________________________
Kuribo64 - RH-fucking-cafe - Kafuka

zrghij
Posted on 07-24-17, 05:00 pm
Super Mario
( ͡° ͜ʖ ͡°)

Karma: 10000
Posts: 4388/4457
Since: 06-08-11
@ Hiccup: you will have more accuracy if you hook the actual functions reading files: FS_OpenFile, FS_OpenFileFast, FS_OpenFileDirect. IIRC NSMB uses mostly FS_OpenFileFast, which is by file ID (?) but I'd hook them all just in case, maybe some files are loaded by name.
Posted on 07-24-17, 05:12 pm


Karma: 19752
Posts: 1003/1100
Since: 04-02-13
The only files loaded by name are BUILDTIME and sound_data.sdat
Posted on 07-24-17, 08:22 pm
Mariomaster

Karma: 8528
Posts: 924/1681
Since: 06-09-12
Typical Nintendo coding. Consistent coding? Nah.

We worked hard to get the fancypants loading by name working so we at least have to use it once!
_________________________
GitHub - Kuribo64 - YouTube
Posted on 07-24-17, 08:32 pm
☭ coffee and cream


Karma: 10415
Posts: 2413/2768
Since: 06-26-11
if that makes you feel better, SM64DS has a list of filenames, that it uses to build a list of NitroFS file IDs upon startup

it seems that in NSMB the process was done before compilation, so it directly uses the NitroFS file ID list
_________________________
Kuribo64 - RH-fucking-cafe - Kafuka

zrghij
Pages: 1