Register | Login
Views: 19364387
Main | Memberlist | Active users | ACS | Commons | Calendar | Online users
Ranks | FAQ | Color Chart | Photo album | IRC Chat
11-02-05 12:59 PM
1 user currently in Rom Hacking: hukka | 2 guests
Acmlm's Board - I2 Archive - Rom Hacking - How can I insert NSF into rom? | |
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
User Post
DurfarC

Beezo
Level: 33

Posts: 94/483
EXP: 218551
For next: 10628

Since: 09-04-04
From: Norway

Since last post: 20 days
Last activity: 12 hours
Posted on 10-23-04 11:30 PM Link | Quote
Yes, that's the question. I'm creating a hack (of Mega Man 2), and since I'm a music master, it would be cool with my own music in it...

I know how to convert midis into NSF-files (ask me if you don't know and want to do it), but I don't know how to find the music data in the ROM and how to insert.

Is there a program which can do this? Or do I have to use a hex editor? Then, what's the code? I'm not a pro with hex and all that stuff, but if someone knows something, I'd better make it...

Any help is appreciated, I would be VERY thankful... I know people helps each other at this board, so if you know, please tell me!

Thanks...
Jaspile

Red Koopa
Level: 20

Posts: 61/133
EXP: 37467
For next: 4972

Since: 03-15-04
From: Paris, France

Since last post: 20 hours
Last activity: 11 hours
Posted on 10-23-04 11:52 PM Link | Quote
As far as I know, you can't insert a nsf into a rom, because each game has its own music routine and there isn't any universal music format for the nes.
However, this document by kuwata seems to explain megaman2's music format, but it's in japanese. I uploaded a translation I found in chickenlump's offset archive (thanks to him), here.
DurfarC

Beezo
Level: 33

Posts: 95/483
EXP: 218551
For next: 10628

Since: 09-04-04
From: Norway

Since last post: 20 days
Last activity: 12 hours
Posted on 10-24-04 12:49 AM Link | Quote
I think that was a raw translation of the japanese site. Anyway, I found that the hex numbers is the same in the ROM as in the megaman2.nsf file. The problem now is to find out the value when every song starts... I don't know if all the songs takes the same amount of bytes or not... But I will continue trying to figure it out..


(edited by DurfarC on 10-24-04 06:23 AM)
Chickenlump

Level: 41

Posts: 399/722
EXP: 474192
For next: 5953

Since: 03-15-04
From: Columbia City Indiana

Since last post: 3 hours
Last activity: 4 min.
Posted on 10-24-04 01:12 AM Link | Quote
Yes, it was a raw translation of a japanese site.
What were you expecting?

Also, in both IE and Firefox your layout has black text against a dark blue background, making your posts almost impossible to read without highlighting the text. Could you fix that? A little better contrast of colors would make my eyes not cross as much.

DurfarC

Beezo
Level: 33

Posts: 96/483
EXP: 218551
For next: 10628

Since: 09-04-04
From: Norway

Since last post: 20 days
Last activity: 12 hours
Posted on 10-24-04 02:27 AM Link | Quote
Originally posted by Chickenlump
Yes, it was a raw translation of a japanese site.
What were you expecting?

Also, in both IE and Firefox your layout has black text against a dark blue background, making your posts almost impossible to read without highlighting the text. Could you fix that? A little better contrast of colors would make my eyes not cross as much.




This shouldn't be posted here, but since we're on it: My layout consists of a grey background with black text. I'm using internet explorer, and the background is always there. But if it was gone, it may possibly that my site ran out of bandwith (again)...I'll gonna fix that now...

About the NSF files: still haven't got it
Dish

Spiny
Level: 38

Posts: 142/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 10-24-04 03:37 AM Link | Quote
Common misconception here.

NSFs are NOT normal music files. In fact... they're not even music files at all. They're completely self-contained executables, which contain 6502 code that gradually writes to audio registers to produce changing sound (aka music). The concept of the relationship between NSF and NSF players is similar (if not identical) to the relationship between NES ROMs and NES emus. NSFs are just stripped down ROMs which [ideally] contain only music related code/data (however, sometimes incomplete rips often contain PPU and other unneeded stuff as well, which NSF players ignore).

That said... inserting an NSF into a ROM is not a simple copy/paste deal. That'd be like trying to copy paste not only level data from one game to another... but also the code which runs to load and display that level data .

Now it's not -impossible- to put an NSF in a ROM (in fact... i made an NSF from scratch and inserted into FF1 as a project a while back). You might be able to put the NSF in a big chunk of unused space in the ROM and have the game interact with the new NSF code instead of the old music code every frame (but to do this, you'd have to have a pretty decent grasp of 6502 and NES architecture and you'd have to be pretty familiar with the game you're working with). However, even this has problems... since NSFs use RAM just like full ROMs... and if the NSF tries to use RAM that the game is using for something else... the music won't play right and the game will be messed up and probably even crash. (In my project... I custom built the NSF to use RAM I knew to be unused in FF1)

Now you might be thinking "okay, what if I don't copy the code, but just the music data from the NSF to the ROM?". Well that won't work either, because each game stores its music data differently... and each engine is built to play notes a certain way. Again I'm going to relate this to trying to copy/paste level data from one game to another. You might be able to get away with it in 2 games which were coded by the same guy, but 9999 times out of 10000, it just ain't gonna work. And it definatly won't work if you're using an NSF which was made by a convertion tool.

So basically... what you're wanting to do is possible. But unless you REALLY know what you're doing, you're better off finding how MM2 music data is stored and editing it by hand. And yeah... it's going to be a pain in the ass (which is why there's so few NES music hacks).


(edited by Disch on 10-23-04 06:40 PM)
DurfarC

Beezo
Level: 33

Posts: 97/483
EXP: 218551
For next: 10628

Since: 09-04-04
From: Norway

Since last post: 20 days
Last activity: 12 hours
Posted on 10-24-04 04:38 AM Link | Quote
You're right, converted nsf's takes much more bytes than the regular ones.

I guess I'll have to give up that project... But I know there is another mm2 hack (rockman exile) where they took music from another megaman games and inserted it in the hack... I may do that...
Dish

Spiny
Level: 38

Posts: 143/596
EXP: 355646
For next: 14801

Since: 03-15-04
From: Disch

Since last post: 18 days
Last activity: 18 days
Posted on 10-24-04 04:55 AM Link | Quote
I'm positive Rockman: Exile was done by recomposing the music and inserting the data by hand (ie, without using any other NSFs/SPCs/etc, without simple copy/pastes). Putting in music from other games is no easier than putting in your own music (except of course for the extra work that comes with composing your own music)... I mean it's the exact same process for putting in music, regardless of where the music is coming from.

To take this road... follow up on those links Jaspile posted. Or try to decipher the music format on your own.


(edited by Disch on 10-23-04 07:56 PM)
Add to favorites | "RSS" Feed | Next newer thread | Next older thread
Acmlm's Board - I2 Archive - Rom Hacking - How can I insert NSF into rom? | |


ABII


AcmlmBoard vl.ol (11-01-05)
© 2000-2005 Acmlm, Emuz, et al



Page rendered in 0.015 seconds.