- For making cartridges of your Super NES games, see Reproduction.
after some months of work my first SNES game is ready in playable form and the only stuff left for it being a complete product is the sound/music.
I browsed through some docs but haven't found a ready routine for usage of non ripped misic. I mean I don't want to use stolen music, because I have already a big archive of Amiga and some sid musics which I have the permission to use, so I'd better use them. Then the problem came:
I saw a demo ROM with some MOD musics in it, but unfortunatelly I can't find the sourcecode and the needed converting tool. I tryied by converting the mods to MIDI with MOD2MIDI and similar programs, and then using the MIDI2MSS converting tool, but it always gives me error "Ran out of voices for MIDI channel x. Either allocate more voices or remove concurrent notes", but I have checked on all the voices, so no luck with this too. Same problem when converting SID music to MIDI. For directly playing SID musics I can't understand the SID replayer either. Where to put the .sid file, do I have to manually set all the tables, or there is a tool for this? Another option is using .nsf files, but I don't have the permission to use any of them, and the DemoROM with the NSF songs for SNES doesn't come with sourcecode, unfortunatelly. But if Memblers is willing to give me a hand with this, NES music is an option too.
Another stuff I wish to add which will be unique for the SNES version of this game (Despite of the doublesized [16*16] graphics) is that I think it will be better insead of writing the text about what the character says, to actually say it - for example when completing level to scream "Hurray", "Yeahaa" or "Yuppie", and when dying to scream "Arghhh", "Noooooooo" or "Ouch", so for this I would need sample replayer/converting tool, and someone wishing to have his voice recorded.
So far this is the most important for now. I am open for suggestions, bugreports, insults etc.. If someone is willing to help please reply here or contact me privately. Credit will be given.
Sorry if it's a mess to work with, I could probably assemble a stripped-down binary that you could use if that'd be better. But I am busy with a lot of stuff lately.
I can write sample playing code, I found that SPC is pretty easy to use (other than loading) and also really well documented. As long as all the samples can fit in SPC's memory (the NSF player doesn't use much at all).
Do you know any public domain nsf songs, and/or authours who can be contacted for approval? For the samples - there is a lots of empty space on the ROM, so I can put them there and copy the data to the SPC memory only when they are needed - i.e. right before the reply.
And also on the forums there, lots of people hang out and post their music.
For the sample loading dynamically, that'll be ok if the samples aren't played when real-time stuff is going on. Loading the SPC is kinda slow, and I don't think there are any interrupts on SPC to keep the music playing during loading.
Also, you probably know my NSF player doesn't play the DPCM channel. I could add support for that if you have a song that needs it.
You should have ram at $0000-$07FF free, to be safe.
Seems that will be better because I can't build a test rom. The Initsound routine is missing, probably it's in the sound.asm file (I could probably assemble a stripped-down binary that you could use if that'd be better
Code: Select all
You can build it like Amiga library, i.e. calling from different offsets contains jumptables to the actual code. For example:
Code: Select all
SPCReplayer: incbin "SPCReplayer.bin"
Code: Select all
Initsound: jmp (SPCReplayer) InitSong: jmp (SPCReplayer+2) TransferToSPC: jmp (SPCReplayer+4) StartReplay: jmp (SPCReplayer+6) StopReplay: jmp (SPCReplayer+8) etc...
Code: Select all
InitSound: jsr SPCReplayer + InitSoundOffset InitSong: jsr SPCReplayer + InitSongOffset TransferToSPC: jsr SPCReplayer + TransferToSPCOffset StartReplay: jsr SPCReplayer + StartReplayOffset StopReplay: jsr SPCReplayer + StopReplayOffset
I'll try to assemble a little version of the whole player, I can't test it right away though. You'll need to load the NSF intro RAM at bank $7E. (I think it was $7E? It's been a long time, but it was the bank that was a full 64kB of RAM).
Oh also, unless you say otherwise, I'll assume you're using LoROM. So I'll make the code origin $8000.
Here's a stripped down version of the NSF player, I haven't tested it at all though.. But it should work.
Include the file at $8000, at the end of the file you need a table of load/init addresses for the NSFs.
So just do like:
Get the init and play addresses from the NSF header (bytes 9 - 12 I think). And load the NSF program (based on the load address in the header) into bank $7F's RAM.
Look at the source or listing for the snes code addresses. There's JMPs at the beginning. You call spc_sound_init once. Then call spc_nsf_init with the song # in the accumulator, and the NSF number in X (just do LDX #0 if you only use one NSF)
Let me know if you have any questions. I hope you can use this program.
Oh, also be sure to disable NMIs and interrupts when the NSF play or init stuff is running. Because some NSFs might have their own vectors! heheh
Seems the host provider is playing tricks again. Is it possible to attach a file in the forum posts? Or I should change host again, grrrrr. Works fine from here though. The web1000 and edula accounts which I had, dissapeared for some reason.I haven't been able to download the game yet, I tried yesterday too. The connection either times out or gets to 10% or so and won't continue.
It's late now, I will look at the replayer tommorow.
Yes, I learned this the hard way - random crashes and hours of debugging, because of interrupts. SEI and CLI solved many headeaches.Oh, also be sure to disable NMIs and interrupts when the NSF play or init stuff is running. Because some NSFs might have their own vectors! heheh