Play NSF ingame

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

Moderator: Moderators

Denine
Posts: 397
Joined: Wed Feb 17, 2010 5:42 pm

Post by Denine »

Remember bug from video?
It's removed! :)
Ok,i was able to apply Music Driver to my game,however...i just get empty screen with music playing!
Later,i was able to make my game play,but...music was gone(Except for "BEEEEPP" sound...) any ideas how i should put games code to make it working with game?
(Later,when BBEEP sound appeared I noticed that NMI is executed only ONCE,no idea WHY...)
User avatar
Banshaku
Posts: 2404
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Post by Banshaku »

I'm just guessing but you must have more than one bank. The VRC6 require the setting of the banks to be done properly. In the sample I gave, there is good chance the settings for the mapper are wrong for PRG ones since only one bank is set and emulators didn't complain about it.

From what I understand of your message, once you move code around either the music work or the game. This mean while the game is running, there is good chances that the wrong bank was selected in the region were the code doesn't work.

I did one sample in the past for VRC6 and tested on hardware but I don't think it was for nesasm. I can't find it anymore. So for now I don't know how to set properly the banks in nesasm then set VRC6 mapper settings. This is probably the only issue.
Denine
Posts: 397
Joined: Wed Feb 17, 2010 5:42 pm

Post by Denine »

I plan to start adding music driver again from start,but:
-You have some kind of list of used RAM adresses?
-Sound effects can be added?(I tried,but failed...)
-What about VRC6 bank setting?
Denine
Posts: 397
Joined: Wed Feb 17, 2010 5:42 pm

Post by Denine »

Hey,Banshaku...I got it working with my game! :D
But...only if it is in last (fixed)bank...so..let's say i want to store music in different bank(bank 3 for example)How in the world i can switch from bank0(main game code) to bank 3,read music data,and hop back into bank 0 without screwing antyhing?I know how to switch banks,but i don't know how to load code from different bank than0(bank 0 have main loop...) :oops:
User avatar
Banshaku
Posts: 2404
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Post by Banshaku »

This is a good question. I don't know enough about VRC6 at the moment. I'm checking the wiki to see the bank configuration. Maybe by that time someone may be able to answer you.

But how is your program set? All code is in the fixed bank, driver included? I just want to have a better understanding of location of data/code and maybe I could (or someone else) figure out what is better to do in that case.
Denine
Posts: 397
Joined: Wed Feb 17, 2010 5:42 pm

Post by Denine »

Code: Select all

	.include "./common/NES.inc" 
Is in start of bank 0,just before VRC6 flag,and Zero page variables.
Everything else is in fixed bank($E000)except for music data-It's in $C000.
Also to make driver work you need to put this code after "player init"

Code: Select all

	; init default value for ppu_crtl flags + activate NMI
	lda #PPU_CTRL_NMI
	sta zpPpuCtrlFlags
	sta PPU_CTRL
Kunio
Posts: 16
Joined: Tue Dec 22, 2009 8:40 am
Location: Hungary

Post by Kunio »

Banshaku wrote:Here a release that you can play with it:

Famitracker Soundriver (FT3.0) for ca65 and nesasm

Nothing new in this driver (from me) except that I fixed a bug that occur when you use multiple binary file. The memory was not reset anymore, causing all kind of issues.

I started to make a quick sample for VRC6. The sample is not finish yet: the rom size and mapper setting are probably wrong but will work with emulators (nintendulator and nestopia). Once I have time, I will try to make a sample that work on the real hardware. For now, it should be enough to insert music in your game.

Have fun ;)
What did you use to make bin files? I used FamiTracker 0.27 to export as bin, and not worked. :(
User avatar
Banshaku
Posts: 2404
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Post by Banshaku »

Kunio wrote:What did you use to make bin files? I used FamiTracker 0.27 to export as bin, and not worked. :(
Since the driver is for Famitracker 3.0, version 0.27 will not work. The binary format of previous version is not compatible with the latest driver.
Kunio
Posts: 16
Joined: Tue Dec 22, 2009 8:40 am
Location: Hungary

Post by Kunio »

Banshaku wrote:
Kunio wrote:What did you use to make bin files? I used FamiTracker 0.27 to export as bin, and not worked. :(
Since the driver is for Famitracker 3.0, version 0.27 will not work. The binary format of previous version is not compatible with the latest driver.
I also tried the 0.3.5. Ok, then let's see with the 0.3.

One more question: How did you import the whole Ninja Gaiden soundtrack, even with DPCM?
User avatar
Banshaku
Posts: 2404
Joined: Tue Jun 24, 2008 8:38 pm
Location: Japan
Contact:

Post by Banshaku »

Kunio wrote:One more question: How did you import the whole Ninja Gaiden soundtrack, even with DPCM?
For the song, I didn't import it: I did a cover of the song only. I found the DPCM drum that someone extracted (Maybe it was Bucky if my memory is good) and tried to make it as faithful as the original.
Denine
Posts: 397
Joined: Wed Feb 17, 2010 5:42 pm

Post by Denine »

HI!
I was about 7 month since I was doing anything in DRD(Dizzy Rainy Day).
The problem was that I'm bad at grafic making,and game development was halted...
But miracle happend-About week ago one guy responded to my request and said that he will make some grafics.
I'm back with development.(Actually I returned with it today,after seeing first grafic..)
But there's another reason for me to write a post here:
Of course,I have a roblem.
And yes,It's music driver.
Last time music was playing really good,now it's playing same,however,back then I wasn't doing anything serious about music.
Now I have really nice remix of Yolkfolk village.
The problem?
Sound driver plays VRC6 channels incorrectly.
It plays fine in Banshaku sample,but not in mine game...
Maybe I shouldn't post it-There's a little chance of finding why it happens without source code,however...ONLY VRC6 channels are glitched,other "normal" channels plays fine.
I was trying to solve it by myself,but I miserably failed.
Maybe there's some kind of glitch that is known by community?
And,I was using Famitracker 3.0 to build bin files,not latest one.
Can anyone help?
User avatar
Gil-Galad
Posts: 321
Joined: Sat Nov 13, 2004 9:43 pm
Location: Ohio, USA
Contact:

Post by Gil-Galad »

Maybe there is a memory collision somewhere. If you're using Famitracker to create the NSF, I don't recall anything right off hand that tells you the RAM usage unless maybe you look at the driver source code. Could be any number of things, possibly.
Denine
Posts: 397
Joined: Wed Feb 17, 2010 5:42 pm

Post by Denine »

I don't collide RAM...
Maybe Banshaku can help.
The strange thing-just after RESET interrupt I init music and then make infinte loop...and music is still messed...
This mean that code of my game is not colliding with music driver(right?)
And I don't use IRQ...
hmm..NMI also don't mess it up...so why..?
(Maybe I should provide whole source code?...but it may be a lot of work with checking it..)

EDIT:
ARGHHH!!
I fixed it...
Just don't laugh at me,ok...?
I never seen it in Famitracker documentation,but i gave it a try-
Music driver is NOT compatible with mapper 26(I'm using mapper 26...)ONLY with 24.
I changed mapper number and it started to work,magic?
Yeah,it's a little funny-i lost whole day,but at least learned something:)
Post Reply