Pages: 1
Posted on 08-18-17, 07:15 pm in Newer Super Mario Bros. DS


Karma: 462
Posts: 16/33
Since: 01-17-15
(cries in corner)
_________________________
The Newer Team


Karma: 462
Posts: 26/33
Since: 01-17-15
I've finally released ndspy, my Python library that was used to make many of the assets for Newer DS!

GitHubDocumentationPyPIDiscord

I haven't released any ndspy-powered tools yet, but rest assured that they're coming. Here are some of the things that I've done with ndspy for Newer DS, most or all of which will be released at some point:

  • The Magigoomba project management and code building system, which is way more advanced than NSMBe's build system
  • All of the SSAR editing for new/improved sound effects was done entirely with ndspy
  • Scripts for minimizing the sizes of SBNK and SWAR files, which saved Skawo hours of manual work and results in files smaller than ones made with his method
  • Scripts for putting together custom bottom-screen backgrounds
  • ndspy was used to adjust the game's sound groups (aka sound sets) and create completely new ones
  • ndspy was used to create custom instruments, such as the square wave in the Bonus theme
  • An IDA plugin for quickly loading Nintendo DS ROMs with all overlays
  • The "FNT Tool" tool on my GitHub is derived from part of ndspy's code
  • Scripts for making manual adjustments to music tracks, such as pitch bends, fade-ins and fade-outs, and more
  • A script for squeezing as many tiles as possible into a tileset NCG (used for the Magmatrack Getaway tileset)
  • Scripts for making multiple ENPGs with the same palette (used for the file select and others)

And more!

Here's what version 1.0.0 officially supports opening, editing, and creating from scratch:
  • ROM files
  • SDAT files and everything within them:
    • SBNKs
    • Groups
    • SSEQs
    • SSARs
    • Sequence players
    • STRMs
    • Stream players
    • SWAVs
    • SWARs
  • ARM9 and ARM7 code files, and overlay tables
  • NARC files
  • LZ10-compressed files
  • BMG files

Other file types, such as NCL, NCG, NSC, NSBMD, and NSBTX, have varying degrees of work-in-progress support.

This release took so long (it's been over a year since Newer DS's release) partly because I've tried to document the API as thoroughly as I possibly can. The documentation as a whole is still incomplete — the Tutorials section, for one, is completely empty — but the entire stable API is fully and carefully documented.

I hope it won't just be me who makes tools using this! If you need any help with it, I've made a Discord server where I'd be happy to answer questions.

Happy hacking!
_________________________
The Newer Team
Posted on 06-06-17, 07:06 am in FNT (File Name Table) Tool


Karma: 462
Posts: 13/33
Since: 01-17-15
https://github.com/RoadrunnerWMC/FNT-Tool

This is a pretty simple Python script I wrote about a month ago for Newer DS.

It lets you convert fnt.bin to JSON and back. This allows you to assign filenames to any new files you've added to the rom, as well as edit existing filenames however you want.
_________________________
The Newer Team
Posted on 02-01-19, 09:18 am in An explanation of BNBL / BNCL position values


Karma: 462
Posts: 27/33
Since: 01-17-15
Posted by ray
But still, the X and Y position can sometimes be buggy. Often its different how they work. Sometimes you have to make some complicated things, sometimes not.

Posted by Arisotura
Perhaps those files support setting a certain origin for coordinates, like, position this from the top-left corner, position that from the center... That may explain the 'subtraction with 128'.

Posted by skawo
It should be said about the BNBL that the "0x10 Y position - 2 Bytes" is actually counted from the bottom.
Also, 0x09 and 0x11 are something else.


There's been a lot of speculation in the past about the confusing x/y position values in BNBL files. (As it turns out, BNCL also works the same way in this regard, so everything I'm about to explain applies to both file formats.) As part of the process of adding support for these files to ndspy, I RE'd the functions that parse them (02055A0C and 20042D8 for BNBL and BNCL, respectively) to finally settle the matter once and for all. Turns out it's pretty simple once you understand what's going on:
  • As was already known, there's a 2-byte value that defines the x position, and another one for the y position. (The y position is relative to the top of the screen, despite Skawo's claim to the contrary in 2014.)
  • However, these are not just raw coordinate values. Each of them contains both a coordinate and an alignment value:
  • value & 0xFFF yields the true raw coordinate value, and
  • (value >> 12) & 3 yields the alignment value.

And here are what the alignment values mean:
  • 0: the coordinate defines the left (or top) edge of the rectangle.
  • 1: the coordinate defines the center of the rectangle. To calculate the left (or top) edge, subtract (width + 1) / 2 from the coordinate. (For y coordinates, replace "width" with "height".) (The division is integer division, of course.)
  • 2: the coordinate defines the right (or bottom) edge of the rectangle. To calculate the left (or top) edge, subtract the width (or height) from the coordinate.
  • 3: same as 0.

Some miscellaneous notes:
  • In case it wasn't clear, x and y each have their own alignment value. Thus, you can combine them however you want, in order to position a rectangle by, say, the center of its right edge.
  • BNCL files don't contain any width/height values; these are obtained from the corresponding BNCD file.
  • The most significant two bits of each coordinate value are unused and ignored.

And that's all there is to it. In my opinion, alignment options like this should really be resolved at compile-time rather than at runtime, but this is how Nintendo chose to do it in this case. Hopefully this discovery will be useful!
_________________________
The Newer Team


Karma: 462
Posts: 3/33
Since: 01-17-15
Posted by Thierry
Make it fit the area borders, be perfectly randomised just like a person can make it, and make sure no tile is cut.

Now that would be interesting to see. But in all honesty I doubt someone will ever bother making such a tool.






It can fill arbitrarily-shaped areas, and export for either NSMB or NSMBW.
_________________________
The Newer Team
Posted on 01-01-17, 04:40 am in Path Node Structure


Karma: 462
Posts: 2/33
Since: 01-17-15
NSMBe's path node implementation is currently incomplete, so Skawo and I figured out the correct struct. Thus, here you go:

BytesPurpose
0x00 - 0x01X position
0x02 - 0x03Y position
0x04 - 0x07Speed (32-bit integer)
0x08 - 0x0BAcceleration (32-bit integer)
0x0C - 0x0DDelay (16-bit integer)
0x0E - 0x0FProbably pad

It's the same as the corresponding struct in NSMBW, except with speed and acceleration as integers instead of floats.
_________________________
The Newer Team
Posted on 09-07-17, 07:26 am in How to swap sound sequences in the SSARs?


Karma: 462
Posts: 19/33
Since: 01-17-15
Sure. I'll pick two arbitrary sound effects from the sound effects list on the wiki as an example...

Let's try to replace SE_PLY_FOOTNOTE (Mario's footstep sound while on the world map) with SE_SYS_NEW_POINT (the appearance of a new world map path).

The sound effects both need to be in the same SSAR for this technique to work. In this case, the sounds are both in SAR_MENU.ssar, so, first, we extract that from sound_data.sdat. There are lots of programs that can do this; I used Kiwi DS.

According to the sound effects list, these sounds' global IDs are 18 and 31 respectively; we can subtract the ID of the first sound in the SSAR we're interested in to find their IDs within that SSAR. In this case, that leaves us with 0 and 31.

We can find the offsets of their entries in the SSAR file with the formula offset = 32 + id * 12. For our two sounds, that gives us (written in hexadecimal) 0x20 and 0x194.

The twelve bytes beginning at SE_SYS_NEW_POINT's offset are:
DA 03 00 00 23 00 7F 60 50 0B 00 00
This defines stuff such as the starting event offset, the bank ID and the volume.

We can copy all of this information into SE_PLY_FOOTNOTE's entry to effectively make it an exact copy of SE_SYS_NEW_POINT. So we do.

After that, it's just a matter of inserting this SSAR back into the SDAT (I used DS Sound Studio for this) and inserting the SDAT back into the ROM. Once that's done...


_________________________
The Newer Team
Posted on 10-22-19, 05:07 am in Newer Super Mario Bros. DS


Karma: 462
Posts: 32/33
Since: 01-17-15
It's clear what he means by that, though -- that it's more substantial than most of the "hacks" you see on, say, YouTube these days (which are mostly cheat codes and small adjustments), and rather plays like a whole new game. Newer DS certainly isn't the only NSMBDS hack to have that property, but thank you for the compliment!

Sorry to hear about your experience with 2-4. Your problem here is probably that the minecart is prevented from jumping off of the loop-de-loops. You have to specifically jump off of the last few tiles on that platform for it to work. Try pressing the jump button a bit later?


_________________________
The Newer Team
Posted on 02-08-17, 09:33 am in Newer Super Mario Bros. DS


Karma: 462
Posts: 10/33
Since: 01-17-15
Hyperbole aside... I'm sure an 8% progress decrease sounds disappointing to all of you, but all the awesome brand-new stuff we're adding will absolutely make it worth the wait.
_________________________
The Newer Team
Posted on 05-03-17, 06:16 am in Newer Super Mario Bros. DS


Karma: 462
Posts: 12/33
Since: 01-17-15
Posted by naknow
Also, welcome back (I guess I should say.) I haven't seen you in like 4 months.

I haven't had much to post here recently, but I've been doing lots of stuff for Newer DS all the same. So... thanks?

(Maybe I should post here more in general.)


Posted by hamza62240
I'm talking about everything else that has lighting, not just the powerups or even the 2D sprites. For example... Mario. Or pretty much every 3d model.
What I'm saying is that it looks too low-contrasted when compared to... almost everything else, really. Because all the things that use 3d models have a very dark undertone/shading style to them.

[...]

(Unless the shaders could somehow be changed to look more modern/lighter?)

I recognize that NSMB has that harsh lighting style, but I don't feel like it's really a problem to move away from that, especially when we've updated so many sprites that way.


Posted by hamza62240
(Also... it bothers me a little that the planets in the background seem to be a bit too...close. This might be the nitpickiest thing I've said in, like, the entire month, though.)

We might be able to decrease the scroll rate for that background. I'll ask skawo.
_________________________
The Newer Team


Karma: 462
Posts: 14/33
Since: 01-17-15
(Ninja'd, but posting this anyway since it might still be useful...)

I wrote an SDAT library that we've used to backport NSMBW sound effects to Newer DS, as well as for a few other sound-related tasks. It doesn't actually play anything, but it could be used to convert SSAR sound effects to SSEQs, which can be played in DSSS. You'll have to wait for it to be released, though.
_________________________
The Newer Team
Posted on 07-15-17, 06:40 pm in Disabling enemy movement from music?


Karma: 462
Posts: 15/33
Since: 01-17-15
As I recall, enemy jumping is triggered by the SSEQ setting variable 2 to "1", or something like that. DSSS can display the raw SSEQ command streams; you can use that to investigate further if you want. If you want to disable enemy jumping for the entire game, though, it'd probably be easier to do it via assembly hacking.
_________________________
The Newer Team
Posted on 12-05-17, 10:31 pm in Tool for Recalculating Savefile Checksums


Karma: 462
Posts: 23/33
Since: 01-17-15
nsmb-checksums.py

newluigidev asked me for some help today in figuring out how the checksums in NSMB savefiles work. After RE'ing the game's checksum algorithm, I decided that it'd be a good idea to make a little tool that updates all ten checksums in a savefile. Here it is!
_________________________
The Newer Team
Posted on 03-15-19, 10:09 pm in NSMB IDA Pro Database


Karma: 462
Posts: 28/33
Since: 01-17-15
Done!

https://nsmbhd.net/file/RUpdbSHxBXSV5t8y/nsmb.gar
(Created with Ghidra 9.0's XML Exporter plugin for IDA 6.x (used with IDA 6.8))

This is an copy of the public IDA database, in Ghidra project archive format (.gar). .gar is the preferred format for sharing Ghidra projects because it's a single file rather than a folder, and because it's highly compatible with various versions of Ghidra (neither of which are true of regular Ghidra projects).

For more info about Ghidra archives, see:
[Ghidra main window] -> Help -> Contents -> Ghidra Projects -> Archive Current Project
And for the official help page describing how to load them, see:
[Ghidra main window] -> Help -> Contents -> Ghidra Projects -> Restore Project

Here's a quick step-by-step summary of how to create a project from nsmb.gar, though:
  • Launch Ghidra
  • If it doesn't say "NO ACTIVE PROJECT", do File -> Close Project
  • File -> Restore Project
  • Select nsmb.gar that you downloaded, choose a folder you'd like Ghidra to put your new project in, and choose a project name ("nsmb" is fine)
  • Wait a minute for it to create the new project from nsmb.gar

Once the project is created, just double click on "nsmb" in the middle of the window to see the disassembly of NSMB's code!
_________________________
The Newer Team
Posted on 10-15-19, 08:25 am in Misc. patches thread


Karma: 462
Posts: 31/33
Since: 01-17-15

Signboard (sprite 93 / actor 77) "In front of Mario" setting


repl_02001CF4: @ with MeroMero hack
repl_02130C70: @ without MeroMero hack
    LDR     R1, [R4,#0x8]
    ANDS    R1, R1, #0x20000000
    MOVNE   R1, #0x200000
    MOVEQ   R1, #0
    STR     R1, [R4,#0x68]
    MOVNE   R1, #0
    BX      LR


And corresponding spritedata.xml field:

<field id="4" type="checkbox" name="In front of Mario" values="2" notes="" />

Compatible with MeroMero's signboard hack.
_________________________
The Newer Team
Pages: 1