Creating NSF from scratch problems
Moderator: Moderators
Creating NSF from scratch problems
I'm having issues with creating an NSF from my friends music (and I'm an nsf-newbie). Neither Mesen or WinAmp plugin will play it so probably have done something wrong.
I'm pretty sure the header is correct but I am a bit uncertain about the init/play-functionality.
The play-functionality is called at regular intervals by the NSF-driver and I don't need to handle that myself?
The start of my NSF sort of looks like this, init/load address is $8000 and playaddress is $8003
.ORG 8000,0
Init: Jmp InitMusic
Play: Jmp PlayMusic
<rest of the code>
The "PlayMusic" is usually called from the NMI...
I'm pretty sure the header is correct but I am a bit uncertain about the init/play-functionality.
The play-functionality is called at regular intervals by the NSF-driver and I don't need to handle that myself?
The start of my NSF sort of looks like this, init/load address is $8000 and playaddress is $8003
.ORG 8000,0
Init: Jmp InitMusic
Play: Jmp PlayMusic
<rest of the code>
The "PlayMusic" is usually called from the NMI...
Re: Creating NSF from scratch problems
What do you mean by “from scratch”? Is the source material from an existing NES game, or are you planning to take a music score or audio recording and manually create an NSF from it by hand? If it’s the latter, you could use famitracker both to write the music and generate your NSF, and then not even deal with the details of NSF format.
Re: Creating NSF from scratch problems
I have the source code + data for some music but it isn’t in nsf-format. It is hand coded and not from any tracker.
Re: Creating NSF from scratch problems
You basically want to rip an NSF from an existing ROM file that already plays correctly in an emulator? And you are saying that you have the benefit of also having the source code?
Is there any reason you don’t want to share the files with us? Maybe we can review it and point out the errors.
Is there any reason you don’t want to share the files with us? Maybe we can review it and point out the errors.
Re: Creating NSF from scratch problems
Here's my little experiment..
Here's the NSF-header:
And the NSF itself (well, sort of), player is in another file..
Here's the NSF-header:
Code: Select all
Header:
dc.b "NESM"
dc.b $1A
dc.b 1 ;Version
dc.b 1
dc.b 1
dc.w $8000 ;Load address
dc.w $8000 ;Init
dc.w $8003 ;Play
dc.b "Storm ",0
dc.b "Fredrik 'Wizard' Schultz ",0
dc.b " ",0
dc.b $1A,$41 ;Speed
dc.b 0,0,0,0,0,0,0,0 ;Bankswitch
dc.w 0 ;PALSpeed
dc.b 0 ;NTSC-tune
dc.b 0 ;No extra chips
dc.b 0,0,0,0 ;Expansion
Code: Select all
PROCESSOR 6502
.ORG 8000,0
include "include/Constants.asm"
InitMusicX: jmp Init ;$8000
PlayMusicX: jmp PlayMusic ;$8003
Init: lda #64
sta OS_REGION
jmp InitMusic
include "include/os.asm"
include "include/stormplayer.asm"
.ORG $C000,0
Sample: incbin "sfx/sample.dmc"
Re: Creating NSF from scratch problems
I am still not completely clear what you are trying to do. Do you have an existing NES file that already plays? If you post (or PM me) your compiled NES file that does play, and you compiled NSF file that doesn't play, I will take a look at them and see if I can find the error.
Re: Creating NSF from scratch problems
I have a musicreplayer (asm-source) complete with a song (asm-source aswell) that I want to "convert" to an NSF-file.
Re: Creating NSF from scratch problems
Does your music replayer + song run in an emulator when you compile it? Or does that not work either?
I haven’t played with NSFs in a while so I don’t immediately know what could be wrong. If you post a non-working, compiled NSF file, I can help debug it, which can then point us to what you did wrong in the source code.
I haven’t played with NSFs in a while so I don’t immediately know what could be wrong. If you post a non-working, compiled NSF file, I can help debug it, which can then point us to what you did wrong in the source code.
Re: Creating NSF from scratch problems
I got it working actually. Rearranged my sourcefiles a bit and then it just worked. Some type of compilation-problem...
I attach the result if anyone's interested.
I attach the result if anyone's interested.
- Attachments
-
- Storm.nsf
- (2.19 KiB) Downloaded 55 times