Legend of Zelda (NES) HD Audio: Help
Page 1 of 1
Legend of Zelda (NES) HD Audio: Help
Hi, I am requesting some help on this forum, which looks the best place for this
(I will maybe try romHacking.net too later on...)
I am starting the project to propose a Mesen HD pack for the Legend of Zelda (NES).
I know BS Zelda exists on SNES... but I wanted to try this for fun!
I could soon propose a beta release (1st dungeon almost done, some sprites and overworld tiles also).
I am not good at graphic design so I am in a phase of testing something, taking things from the web and Zelda 3 (SNES).
But...I am missing some info and guidance on the Audio part, which I would like to be managed before sharing the first beta release of the HD pack:
I have read from Mesen docs that some operation should be done to define some albums pointers to produce album definition.
For musics and also SFX. Like $4104: Album Number or $4103: SFX Volume
and then produce an IPS patch to be applied on the rom to then being able to use ogg files to get HD audio replacement.
Could some of you help me in doing this? I would like to know how to do that as I have some other projects on other NES games (Zelda 2, Punchout..)
I found some resources that could I am sure be helpful... but I do not know what to do with this...
- https://www.mesen.ca/docs/hdpacks.html#register-read-operations
- http://www.romhacking.net/documents/781/ : The Legend of Zelda (NES) Music Hacking Doc By ActionGamer (see attached txt file)
- http://thealmightyguru.com/Games/Hacking/Wiki/index.php?title=The_Legend_of_Zelda
- https://datacrystal.romhacking.net/wiki/The_Legend_of_Zelda:Tutorials
Thanks a lot if you can help me. I will credit you of course !!!
(I hope I published this post in the good section?)
Gwenolo
(I will maybe try romHacking.net too later on...)
I am starting the project to propose a Mesen HD pack for the Legend of Zelda (NES).
I know BS Zelda exists on SNES... but I wanted to try this for fun!
I could soon propose a beta release (1st dungeon almost done, some sprites and overworld tiles also).
I am not good at graphic design so I am in a phase of testing something, taking things from the web and Zelda 3 (SNES).
But...I am missing some info and guidance on the Audio part, which I would like to be managed before sharing the first beta release of the HD pack:
I have read from Mesen docs that some operation should be done to define some albums pointers to produce album definition.
For musics and also SFX. Like $4104: Album Number or $4103: SFX Volume
and then produce an IPS patch to be applied on the rom to then being able to use ogg files to get HD audio replacement.
Could some of you help me in doing this? I would like to know how to do that as I have some other projects on other NES games (Zelda 2, Punchout..)
I found some resources that could I am sure be helpful... but I do not know what to do with this...
- https://www.mesen.ca/docs/hdpacks.html#register-read-operations
- http://www.romhacking.net/documents/781/ : The Legend of Zelda (NES) Music Hacking Doc By ActionGamer (see attached txt file)
- http://thealmightyguru.com/Games/Hacking/Wiki/index.php?title=The_Legend_of_Zelda
- https://datacrystal.romhacking.net/wiki/The_Legend_of_Zelda:Tutorials
Thanks a lot if you can help me. I will credit you of course !!!
(I hope I published this post in the good section?)
Gwenolo
- Attachments
Last edited by gwenolo on Thu 20 Aug 2020 - 16:55; edited 2 times in total (Reason for editing : adding screenshots of the beta HD Pack)
gwenolo- Newcomer
- Since : 2020-07-05
Re: Legend of Zelda (NES) HD Audio: Help
Hello!
Unfortunately, there is no common way of replacing audio in NES games. You have to find the location in the game's assembly code, where it starts a new music track, or a new sound effect, and overwrite that code with a call to one of those Mesen registers, you mentioned above. However, for Zelda it is now much easier. An HD pack has been recently released, that overrides the original music and sound effects.
http://www.romhacking.net/forum/index.php?topic=31559.0
You may take an ips patch from that HD pack and use it in yours.
Unfortunately, there is no common way of replacing audio in NES games. You have to find the location in the game's assembly code, where it starts a new music track, or a new sound effect, and overwrite that code with a call to one of those Mesen registers, you mentioned above. However, for Zelda it is now much easier. An HD pack has been recently released, that overrides the original music and sound effects.
http://www.romhacking.net/forum/index.php?topic=31559.0
You may take an ips patch from that HD pack and use it in yours.
kya- Newcomer
- Since : 2020-10-14
Re: Legend of Zelda (NES) HD Audio: Help
Hi Kya. Thanks a lot for your reply!
Yes, I saw the HD remaster release two days ago! I saw you are in the team who released the pack, impressive work !
Yes, I did that and it worked very fine! (it's not the same Rom I used, so I will probably have to rework part of my HD pack, but, it's allright!).
But the patch does not only apply HD sound redirection.... anyway, I will go with it, it helps me a lot.
Even if the process to apply HD sound is not straighforward, I understand, I would be very intereted to see a simple example of how such a patch is done: Would you mind to share the code of creating one BGM and one SFX album, and setting values in a few registers, as done for zelda or any other game? If you have this and if you don't mind to share?
In any case, thanks a lot, please continue your work on the NES HD Scene!!
Gwenolo
Yes, I saw the HD remaster release two days ago! I saw you are in the team who released the pack, impressive work !
Yes, I did that and it worked very fine! (it's not the same Rom I used, so I will probably have to rework part of my HD pack, but, it's allright!).
But the patch does not only apply HD sound redirection.... anyway, I will go with it, it helps me a lot.
Even if the process to apply HD sound is not straighforward, I understand, I would be very intereted to see a simple example of how such a patch is done: Would you mind to share the code of creating one BGM and one SFX album, and setting values in a few registers, as done for zelda or any other game? If you have this and if you don't mind to share?
In any case, thanks a lot, please continue your work on the NES HD Scene!!
Gwenolo
gwenolo- Newcomer
- Since : 2020-07-05
Re: Legend of Zelda (NES) HD Audio: Help
Unfortunately, I was too lazy to make notes while working on Zelda. But I once worked on a NES game Legacy of the Wizard.
Kurrono (the famous MSU-1 hacker) has found an exact place in the code, where that game starts a new track, and I've altered that code a bit, to play an HD music track. Here's the code:
Original part of a start track routine (starts at 01FC2B):
; at this point the accumulator (A) contains the number of the track to start playing (1-9)
ASL A ; multiply A by 2
TAX ; put A into X
LDA $8000,X ; read some important music byte from ROM address $8000 + (track_number)*2 into A
STA $0E ; store this important byte to RAM address $0E
LDA $8001,X ; read some other important music byte from ROM address $8000 + (track_number)*2 + 1 into A
STA $0F ; store this important byte to RAM address $0F
; by experiment Kurrono has learned that putting #$AB into $0E and $0F produces silence instead of music
; SFX are not affected by this
Modified part of a start track routine (starts at 01FC2B):
STA $4105 ; tell Mesen to play the HD track number from A
LDA #$AB ; put music shutdown byte into A
STA $0E ; store music shutdown byte into $0E. If we don't do that the original music will play along with the HD track.
STA $0F ; store music shutdown byte into $0F
NOP ; No operation to match the size of the original routine
NOP ; No operation to match the size of the original routine
NOP ; No operation to match the size of the original routine
Here the "original part" of the game's ROM assembly code gets replaced with the "modified part" of the same size.
As you can see, it takes just one assembly command to start playing a track (STA $4105), when the accumulator (the main NES CPU regitser) contains the number of that track. But you also have to find out, how to silence the original track, no one will do this for you. In this case it was relatively easy, you'd have to store a special byte into two locations of RAM. But this is game specific.
Kurrono (the famous MSU-1 hacker) has found an exact place in the code, where that game starts a new track, and I've altered that code a bit, to play an HD music track. Here's the code:
Original part of a start track routine (starts at 01FC2B):
; at this point the accumulator (A) contains the number of the track to start playing (1-9)
ASL A ; multiply A by 2
TAX ; put A into X
LDA $8000,X ; read some important music byte from ROM address $8000 + (track_number)*2 into A
STA $0E ; store this important byte to RAM address $0E
LDA $8001,X ; read some other important music byte from ROM address $8000 + (track_number)*2 + 1 into A
STA $0F ; store this important byte to RAM address $0F
; by experiment Kurrono has learned that putting #$AB into $0E and $0F produces silence instead of music
; SFX are not affected by this
Modified part of a start track routine (starts at 01FC2B):
STA $4105 ; tell Mesen to play the HD track number from A
LDA #$AB ; put music shutdown byte into A
STA $0E ; store music shutdown byte into $0E. If we don't do that the original music will play along with the HD track.
STA $0F ; store music shutdown byte into $0F
NOP ; No operation to match the size of the original routine
NOP ; No operation to match the size of the original routine
NOP ; No operation to match the size of the original routine
Here the "original part" of the game's ROM assembly code gets replaced with the "modified part" of the same size.
As you can see, it takes just one assembly command to start playing a track (STA $4105), when the accumulator (the main NES CPU regitser) contains the number of that track. But you also have to find out, how to silence the original track, no one will do this for you. In this case it was relatively easy, you'd have to store a special byte into two locations of RAM. But this is game specific.
kya- Newcomer
- Since : 2020-10-14
Similar topics
» The Legend Of Zelda, The Legend Returns
» The Legend of Zelda HD
» The Legend of Zelda - DX
» The Legend of Zelda
» The Legend Of Zelda (infidelity)
» The Legend of Zelda HD
» The Legend of Zelda - DX
» The Legend of Zelda
» The Legend Of Zelda (infidelity)
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum