Editing music in Zelda 2 - The Adventure Of Link

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

Moderator: Moderators

Post Reply
UltimaWeapon
Posts: 3
Joined: Fri Jan 11, 2019 11:54 pm

Editing music in Zelda 2 - The Adventure Of Link

Post by UltimaWeapon »

I want to replace some of the music and sounds in Zelda 2. I have the game disassembled, but I don't know how to go about editing the music. I need help.
Bavi_H
Posts: 193
Joined: Sun Mar 03, 2013 1:52 am
Location: Texas, USA
Contact:

Re: Editing music in Zelda 2 - The Adventure Of Link

Post by Bavi_H »

Romhacking.net's Data Crystal wiki page for Zelda II: The Adventure of Link has a "Zelda II Music Document". The hex locations in that document are offsets in the .NES file.
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Editing music in Zelda 2 - The Adventure Of Link

Post by dougeff »

2 methods.

Figure out exactly what the music code does.

or.

Find the music data, and just corrupt it and see what happens.


another thought. go somewhere where nothing is going on, but music plays such as the title screen., and look at the RAM in a debugger. The zeropage RAM almost certainly has some pointers to music data, they tell you where the data is.
nesdoug.com -- blog/tutorial on programming for the NES
UltimaWeapon
Posts: 3
Joined: Fri Jan 11, 2019 11:54 pm

Re: Editing music in Zelda 2 - The Adventure Of Link

Post by UltimaWeapon »

I have the Music document from RHDN, and I have a disassembly. I can find the music, but the info only talks about how to change pitch and tones. What I need to figure out is how to replace a song with a different song not currently in the game.
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: Editing music in Zelda 2 - The Adventure Of Link

Post by Memblers »

According to that doc, the songs are built from a sequence of phrases. You'll need to divide your music into phrases, then make that "phrase order" table that points to your phrases so they'll play in the order you want.
ccovell
Posts: 1045
Joined: Sun Mar 19, 2006 9:44 pm
Location: Japan
Contact:

Re: Editing music in Zelda 2 - The Adventure Of Link

Post by ccovell »

UltimaWeapon wrote:I have the Music document from RHDN, and I have a disassembly. I can find the music, but the info only talks about how to change pitch and tones. What I need to figure out is how to replace a song with a different song not currently in the game.
The doc is explaining it in Lego block detail, and you want it as a pre-made Lego building. I'm afraid you'll have to build your song up in Lego block detail in the format and arrangement that Zelda 2's music engine expects.

By the way, almost every old game system games' music engine / driver is unique from one another. There is no standard music format for them, let alone a human-readable one.
User avatar
Jedi QuestMaster
Posts: 688
Joined: Thu Sep 07, 2006 1:08 pm
Location: United States
Contact:

Re: Editing music in Zelda 2 - The Adventure Of Link

Post by Jedi QuestMaster »

ccovell wrote:The doc is explaining it in Lego block detail, and you want it as a pre-made Lego building. I'm afraid you'll have to build your song up in Lego block detail in the format and arrangement that Zelda 2's music engine expects.
Or...

You can do something like this and replace the music engine with your own:

https://youtu.be/_Hx4QUNsTiw
UltimaWeapon
Posts: 3
Joined: Fri Jan 11, 2019 11:54 pm

Re: Editing music in Zelda 2 - The Adventure Of Link

Post by UltimaWeapon »

Jedi QuestMaster wrote:
ccovell wrote:The doc is explaining it in Lego block detail, and you want it as a pre-made Lego building. I'm afraid you'll have to build your song up in Lego block detail in the format and arrangement that Zelda 2's music engine expects.
Or...

You can do something like this and replace the music engine with your own:

https://youtu.be/_Hx4QUNsTiw
How do I go about replacing the music engine with my own?
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: Editing music in Zelda 2 - The Adventure Of Link

Post by dougeff »

with my own?
Are you going to rewrite one from scratch? Or use one of the existing homebrew music engines?

Also, adding VRC7 support would require more changes than just the music code.
Last edited by dougeff on Wed Jan 23, 2019 11:29 am, edited 1 time in total.
nesdoug.com -- blog/tutorial on programming for the NES
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Editing music in Zelda 2 - The Adventure Of Link

Post by tepples »

Replacing a game's entire audio driver is a fairly invasive hack that requires you to know, among other things, how to program in 6502 assembly language and how to use ROM and RAM maps (or, if they don't exist, how to make one). The appropriate description of the process depends on your level of assembly experience.
User avatar
Marscaleb
Posts: 240
Joined: Fri Sep 11, 2015 10:39 am
Contact:

Re: Editing music in Zelda 2 - The Adventure Of Link

Post by Marscaleb »

dougeff wrote: Find the music data, and just corrupt it and see what happens.

Do it! DO IT!!!!
Post Reply