Can an NSF be inserted into a ROM?

Discuss NSF files, FamiTracker, MML tools, or anything else related to NES music.

Moderator: Moderators

Post Reply
User avatar
Albert1983
Posts: 14
Joined: Tue Aug 04, 2020 6:34 pm

Can an NSF be inserted into a ROM?

Post by Albert1983 » Wed Aug 05, 2020 7:28 am

Good morning.
Does anyone by chance know how to insert an NSF into a ROM?
It is that I want to insert an edited NSF to a ROM HACK that I am doing.

User avatar
Quietust
Posts: 1687
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: Can an NSF be inserted into a ROM?

Post by Quietust » Wed Aug 05, 2020 10:06 am

If the NSF you modified was originally from that same game, then it would just be a matter of making sure that the new data isn't larger than the original data (or that the original ROM has empty space into which the sound data can be expanded).

Otherwise, It's highly unlikely that an arbitrary NSF could be safely inserted into an arbitrary game - even if there's room to fit the sound engine and its data, you'd also have to worry about where it stores its variables in RAM (i.e. making sure it doesn't overwrite all of the variables used by the game itself).
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.

User avatar
Optomon
Posts: 15
Joined: Fri Apr 02, 2010 2:18 am

Re: Can an NSF be inserted into a ROM?

Post by Optomon » Mon Aug 17, 2020 10:13 pm

This is possible, under certain conditions relating to file / bank sizes, and memory addresses used by the host game and the nsf (if not from the same game). If it's from the same game, it should just be a matter of copy and pasting certain sections of the edited file into the rom file where the data effectively matches.

What is it exactly you are trying to add and into what game?

User avatar
Albert1983
Posts: 14
Joined: Tue Aug 04, 2020 6:34 pm

Re: Can an NSF be inserted into a ROM?

Post by Albert1983 » Sat Nov 14, 2020 8:17 pm

OK ... I already understood something ... But how do I get the NSF of a game?

tepples
Posts: 22284
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Can an NSF be inserted into a ROM?

Post by tepples » Sat Nov 14, 2020 8:38 pm

If someone hasn't already ripped the game, follow these steps:

1. Learn assembly language for the MOS 6502
2. Using a debugging emulator, find where the game writes to $4000-$4013 and $4015
3. Find all the code and data directly related to coming up with the values written to those addresses
4. Read the NSF spec
5. Cut out all other code and data from the ROM
6. Change the mapper writes to use the NSF mapper instead
7. Put together an NSF header and the music-related code

Resources:

User avatar
Albert1983
Posts: 14
Joined: Tue Aug 04, 2020 6:34 pm

Re: Can an NSF be inserted into a ROM?

Post by Albert1983 » Fri Nov 27, 2020 9:55 am

OK...

I urgently need an NSF extracted from an EarthBound Zero ROM.

That is for a ROM Hack of the same game that I am making.

Post Reply