Page 1 of 1

MSU1 for A Link To The Past Problem

Posted: Fri Oct 17, 2014 9:50 am
by Funky.Art
With all the tutorials on internet, i’ve tried to code in MSU1 for A Link to the Past, but i can’t listen the pcm music, there is only the soundfont of the title in spc ! D :
Could someone help me in making a xml code maybe, or do a tutorial for explain how to do a hack ?

Thank you very much ! :D

Re: MSU1 for A Link To The Past Problem

Posted: Fri Oct 17, 2014 2:26 pm
by qwertymodo
If you do manage to get this working, this might make for a good source of music files (though redistributing those tracks wouldn't be legal).

Re: MSU1 for A Link To The Past Problem

Posted: Sat Oct 18, 2014 3:08 am
by Funky.Art
Well, it's more the code part that doesn't work I think ^^'

Re: MSU1 for A Link To The Past Problem

Posted: Sat Oct 18, 2014 6:23 am
by juef
I have succeeded a while ago with Super Mario World, with the help from some technical documents. It's not much, but maybe this post can help you.

Re: MSU1 for A Link To The Past Problem

Posted: Sun Oct 19, 2014 3:49 pm
by qwertymodo

Re: MSU1 for A Link To The Past Problem

Posted: Mon Oct 20, 2014 11:58 am
by qwertymodo
Ok, so having finally managed to get it working, here's a step-by-step guide, since there isn't any documentation out there on the implementation details of the msu-1 in higan, e.g. the manifest markup or the file naming scheme. Thankfully, byuu helped me figure it out, so I'll pass it along here.

First of all, open higan and import your Zelda ROM. This should create a game folder inside [user home folder]\Emulation\Super Famicom. If you also want to have a non-MSU version in your higan library, make a copy of the game folder and rename it whatever you want in order to differentiate the two.

Now, use LunarIPS (or any other IPS patching tool) to apply the IPS patch in the release folder from that link (see the "Getting Started" page for a download) to apply the patch to the file named program.rom inside the game folder. Create an empty file inside the game folder named msu1.msu. Note that if you do this, you *don't* need to copy all of the files from the release package into the game folder.

Then, edit the manifest.bml, changing the title (if you want), the sha256 hash, and also adding the following lines:

Code: Select all

  msu1
    rom name=msu1.msu size=0x0000
    map id=io address=00-3f,80-bf:2000-2007
Or, if you prefer, here's my full manifest.bml file

Code: Select all

cartridge region=NTSC
  board type=1A3B revision=11,12,13
  rom name=program.rom size=0x100000
  ram name=save.ram size=0x2000
  map id=rom address=00-1f,80-9f:8000-ffff mask=0x8000
  map id=ram address=70-7d,f0-ff:0000-ffff

  msu1
    rom name=msu1.msu size=0x0000
    track number=1 name="01 Title - Link to the Past.pcm"
    track number=2 name="02 Hyrule Field Main Theme.pcm"
    track number=3 name=""
    track number=4 name=""
    track number=5 name="05 Forest of Mystery.pcm"
    track number=6 name=""
    track number=7 name="07 Kakariko Village.pcm"
    track number=8 name=""
    track number=9 name="09 Dark Golden Land.pcm"
    track number=10 name="10 Unsealing the Master Sword.pcm"
    track number=11 name="11 Beginning of the Journey.pcm"
    track number=12 name=""
    track number=13 name=""
    track number=14 name="14 Guessing Game House.pcm"
    track number=15 name=""
    track number=16 name="16 Majestic Castle.pcm"
    track number=17 name=""
    track number=18 name="18 Dank Dungeons.pcm"
    track number=19 name=""
    track number=20 name="20 Safety in the Sanctuary.pcm"
    track number=21 name=""
    track number=22 name=""
    track number=23 name="23 Fortune Teller.pcm"
    track number=24 name="24 Dank Dungeons.pcm"
    track number=25 name=""
    track number=26 name=""
    track number=27 name="27 The Goddess Appears.pcm"
    track number=28 name=""
    track number=29 name=""
    track number=30 name=""
    track number=31 name=""
    track number=32 name=""
    track number=33 name=""
    track number=34 name=""
    track number=35 name=""
    map id=io address=00-3f,80-bf:2000-2007

information
  title:    The Legend of Zelda: A Link to the Past (MSU-1)
  name:     Legend of Zelda - A Link to the Past (MSU-1), The
  region:   NA
  revision: 1.0
  board:    SHVC-1A3B-12
  serial:   SNS-ZL-USA
  sha256:   e975381a0a07ba655469b2384e1c8a9f00f814a6c46468dcfa4e1f3ae96c9639
  configuration
    rom name=program.rom size=0x100000
    ram name=save.ram size=0x2000
Notice all of the track number=x name="" lines. These can be deleted if you want, in which case the .pcm files should be named track-1.pcm, track-2.pcm, etc. If you leave those lines there, you can name the music files whatever you want and just put the file name in the manifest (as you can see, I'm just getting started). The .pcm files go inside the game folder (i.e. in the same folder as manifest.bml, program.rom, msu1.msu, etc).

Now to convert the audio files. First you need to convert whatever source files you have into 16-bit, 44100 PCM .wav files. Once you've done that, you can use the wav2msu program in the release folder you downloaded previously to add the required msu header. Copy the files into the game folder and name them appropriately (and update the manifest if necessary), and you should be good to go. Use the track list to get an idea of what song is what track number (NB, the songs at the beginning with the rain sound effect during the storm seem to be separate tracks, and I can't find their track index just yet). My suggestion is to start with the title track to be sure that you actually have it working before starting to work on the rest of the tracks.

There are a few issues with that patch, so I'm not sure if you actually want to work on the .asm to improve it or if you were just looking for a drop-in solution. For one, if you're missing a track and it falls back to the original .spc, it doesn't properly stop the .spc track when it switches to a new track that does have a .pcm replacement (e.g. try replacing the file selection song without replacing the title track, you'll see what I mean). Also, opening the map completely breaks all audio, and you just get white noise. Not sure what's up with that. There may be other bugs too, but that's what I found in about 20 minutes playing around with it.

Anywho... there ya go. Have at it. And if you do happen to improve the patch to fix some of the issues (I've read elsewhere that track fading probably isn't handled, so that probably needs to be added), please go ahead and release your improvements :)

Re: MSU1 for A Link To The Past Problem

Posted: Thu Oct 23, 2014 6:59 am
by Funky.Art
With all your help, now it's works fine ! :D But i was thinking, with this tutorial : https://github.com/mwreichelt/Zelda3-MS ... ng-Started , can we use it for making a patch for another rom ? Like Castlevania ?

Re: MSU1 for A Link To The Past Problem

Posted: Thu Oct 23, 2014 1:54 pm
by qwertymodo
It's possible, but what I've learned is that the way that patch works is rather simple and naive, which is what causes the issues I've seen. This thread has a better patch without the issues, but it isn't portable to other games (also, it requires you to expand the ROM because it's too large to fit within the limited empty space in the original aLttP ROM)

Re: MSU1 for A Link To The Past Problem

Posted: Sun Oct 26, 2014 8:08 am
by Funky.Art
I can't use the patch with other games, Higan doesn't make a bml file complete, and i can't use it ! D:

Re: MSU1 for A Link To The Past Problem

Posted: Tue Oct 28, 2014 2:31 pm
by qwertymodo
I'm not sure exactly what the issue is you're having. You can't just apply the .ips to another ROM and have it work, if that's what you're thinking.

Re: MSU1 for A Link To The Past Problem

Posted: Tue Oct 28, 2014 3:08 pm
by juef
You want to use the patch with other games? Well, I don't think a "universal MSU1 patch" can be made... You'll have to find or make one for each game with which you want to use MSU1.

Re: MSU1 for A Link To The Past Problem

Posted: Tue Oct 28, 2014 3:59 pm
by tepples
Perhaps the ease of ripping GBA music with saptapper gave some people unrealistic expectations of how much can be done with automated music tools.

Re: MSU1 for A Link To The Past Problem

Posted: Wed Oct 29, 2014 1:28 pm
by Funky.Art
I wanted to know how is made the ips patch of Zelda, to know how to remade it ! :D

Re: MSU1 for A Link To The Past Problem

Posted: Thu Oct 30, 2014 2:26 pm
by qwertymodo
The patch is made by writing assembly code (well... apparently Conn wrote it directly in a hex sheet, but I wouldn't suggest it unless you really know what you're doing) which overwrites the parts in the game's original code that controls the audio track switching, then hijacking the code to run your own code instead. Then, you write the code to check for the existence of the MSU-1 chip, attempt to load the MSU-1 track that corresponds to the track the game was originally trying to play, then checking whether or not the track loaded properly. If it didn't (e.g. there's no .pcm file for that track, or maybe the storage device broke), then you should probably fall back to loading the original spc track instead. Also, you'll need to handle audio fade-in/out events. As far as asm hacks go, it's not that complicated, but if you haven't written SNES assembly before, chances are this is more complicated than you realize.

Re: MSU1 for A Link To The Past Problem

Posted: Tue Nov 04, 2014 12:40 pm
by Funky.Art
Unfortunetly, it's too difficult for myself, so in can't made it....