It is currently Sat Nov 25, 2017 4:39 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 83 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject:
PostPosted: Thu Mar 10, 2011 5:27 am 
Offline

Joined: Mon Nov 16, 2009 5:59 am
Posts: 110
I think there's a bug on Famitone, at least on CA65 port.
On line 781: jsr FamiToneSampleStartS
Shouldn't this be a jmp like on line 776?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2011 7:39 am 
Offline

Joined: Sat Jan 23, 2010 11:41 pm
Posts: 1161
Seems it is just an unnecessary line, added by some reason. It still works the same.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 10, 2011 12:28 pm 
Offline
User avatar

Joined: Wed Dec 06, 2006 8:18 pm
Posts: 2804
I'll have to try this out when I get a chance. The demo ROM sounds nice.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 11, 2011 1:03 am 
Offline

Joined: Mon Nov 16, 2009 5:59 am
Posts: 110
Shiru wrote:
Seems it is just an unnecessary line, added by some reason. It still works the same.

I think it will do twice FamiToneSampleStartS.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 11, 2011 7:32 am 
Offline

Joined: Sat Jan 23, 2010 11:41 pm
Posts: 1161
Didn't noticed it is jsr, not jmp. Well, ManicGenius probably had reasons to add this. It wasn't like this in the original version.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 12, 2011 11:50 pm 
Offline

Joined: Fri Jul 09, 2010 5:37 pm
Posts: 42
Shiru wrote:
Didn't noticed it is jsr, not jmp. Well, ManicGenius probably had reasons to add this. It wasn't like this in the original version.


Dunno. My current version has progressed a little beyond what I submitted, uses structs n' such. However I'm moving my code over to NESHLA so anyone who want's to improve/fix the CA65 version go ahead. TBH I just tried to port it as fast as possible and potentially massacred the code in the process.

However that JSR I think is definitely a bug. Technically it looks like it could just fall-through.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 18, 2011 11:53 am 
Offline

Joined: Fri Jul 09, 2010 5:37 pm
Posts: 42
Just tested Famitone on a PowerPak. Works fantastically on real NES NTSC hardware at least.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 08, 2011 3:35 pm 
Offline

Joined: Sat Jan 23, 2010 11:41 pm
Posts: 1161
I've got a problem that not all the sound effects converts correctly, sometimes converter can't detect end of an effect (marked with Zxx). Also, this problem varied between NSFs made with different FamiTracker versions, so I decided to change detection method.

Now you should use C00 effect in end of every effect (C00 just stops playback). Converter changed, archive is updated.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 08, 2011 4:30 pm 
Offline

Joined: Sat Nov 17, 2007 8:44 pm
Posts: 385
I'm trying to convert Famitone to get it to work in asm6. Admittedly I am probably not the best person for this job, as I'm rusty with this stuff and also was never that smart to begin with. :P

There were four main things that stopped asm6 from compiling.

First was the labels - they're all meant to be local, but asm6 handles its local labels differently. I went through and added + and - to the beginning of all labels accordingly, and I think this problem is fixed.

Secondly, lines like lda [FT_TEMP],y resulted in a "label not found" error. I changed the brackets to parenthesis and the errors stopped. Still not sure whether this was a mistake because I'm having trouble prior to reaching one of these statements...

Third was NESASM's LOW() function. From what I can tell, asm6's version of this is the < operator, so I replaced instances of LOW with <. However, this may not be working correctly.

I tried to get Famitone working with an existing program of mine, but upon calling FamiToneInit, the program seems to hang. When I step through it, it gets to the line ldx #<(FT_CHANNELS) which evaluates to ldx #<($600+6)...and for some reason, this loads the value 6 into x, even though that RAM location is empty and I'd expect 0 from the low bits.

The final problem I had was that there were two lines with a "value out of range" error. This one from the envelopeStep routine:

Quote:
-readByte
lda ($40),y ;read byte of the envelope
iny ;increase pointer
ora #0
bpl +special ;if it is below 127, it is special code
clc ;otherwise it is an output value+192
adc #-192
*** Value out of range.

sta $0600+0,x
tya
sta $0600+4,x ;remember the pointer and return
rts


And this one from FamiToneSfxUpdate:

Quote:
-readByte
lda ($40),y ;read byte of effect
iny
cmp #$10 ;if it is less than $10, it is register write
bcc +getData
cmp #$ff ;if it is $ff, it is end of the effect
bcs +eof
adc #-$10 ;otherwise it is number of repeats +$10
*** Value out of range.


Since they both appeared to be attempting to add a negative, I just changed each into subtracting a positive and that eliminated the error. I haven't gotten far enough that I can test this yet to make sure it's not causing any problems.

---

As a side note to this, using text2data to convert a song to asm6 format resulted in errors for me. The resulting file contained references to a nonexistent .env_default, when I'm sure it meant @env_default:

Quote:
...

@ins
dw @env_default,@env_default,@env_default
db $30,$00
dw @env_vol0,@env_arp2,.env_default
db $30,$00
dw @env_vol1,.env_default,@env_pitch0
db $70,$00
dw @env_vol2,@env_arp0,.env_default
db $70,$00
dw @env_vol2,@env_arp1,.env_default
db $70,$00
dw @env_vol3,.env_default,.env_default
db $30,$00
dw @env_vol4,@env_arp0,.env_default
db $70,$00
dw @env_vol4,@env_arp1,.env_default
db $70,$00
dw @env_vol5,.env_default,.env_default
db $30,$00

...


Possibly a bug in text2data? It compiled fine after I changed them to @s instead of .s.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 08, 2011 4:55 pm 
Offline

Joined: Sat Jan 23, 2010 11:41 pm
Posts: 1161
Actually, FamiTone is full of minor bugs (mostly in tools, not in the sound code), which aren't found and not fixed yet because no one used it in an actual project.

Today I'm fixed a problem with sound effects converter, some bugs in TextExporter (weren't noticeable on old computer by some reason), and a bug in text2data reported by UncleSporky above.

I still use NESASM, so don't know about Asm6 much. LOW/HI functions are value&255 and value/256. So, LOW($600+6) is $06.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 08, 2011 6:00 pm 
Offline

Joined: Sat Nov 17, 2007 8:44 pm
Posts: 385
That must not be the problem at all, then...I'll keep looking and see if I can get it to work.

Specifically what is happening now is that my main loop is supposed to spin on $2002, waiting for vblank. After I add in a line to call FamiToneInit during the regular initialization, after I turn IRQs on and read $2002 once it jumps to IRQ (which is just rti) and stays there forever.

Definitely something due to my own ignorance, I'll keep at it.

EDIT: Disabling IRQs gets past this, but I'd rather fix the problem than leave it like that. I'm assuming it's DMC related, though I thought I turned off Famitone's DMC related code.

In any case, in a few minutes I should be able to see if I can at least get the music playing.

EDIT: Awesome, I got the music working! Except my entire background is now bouncing up and down for some reason. Ah well.


Last edited by UncleSporky on Sun May 08, 2011 6:28 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun May 08, 2011 6:20 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19259
Location: NE Indiana, USA (NTSC)
One common cause of endless IRQs like that is an APU frame IRQ that isn't getting acknowledged. To disable that:
Code:
  lda #$40
  sta $4017


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 08, 2011 6:31 pm 
Offline

Joined: Sat Nov 17, 2007 8:44 pm
Posts: 385
Thanks a lot tepples, that was all it took to stop the IRQs. I'm surprised I never saw that in anyone's startup code before.

EDIT: My screen was jumping to the music because I was updating Famitone during vblank instead of the main loop.

Here is my port of FamiTone to asm6.

Thank you so much for this tool Shiru, it's going to be extremely helpful to people like me who don't want to mess with the nitty gritty of audio and just want to play some music and sound effects.


Top
 Profile  
 
 Post subject:
PostPosted: Sun May 08, 2011 7:55 pm 
Offline

Joined: Sat Jan 23, 2010 11:41 pm
Posts: 1161
Another bug in sound effects converter fixed, file is updated.

Link to UncleSporky's Asm6 port added to the first post of this thread.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2011 3:18 am 
Offline

Joined: Sat Nov 17, 2007 8:44 pm
Posts: 385
As the source states, all the FamiTone variables take up 112 + (15 * the number of SFX streams). By default (with 4 streams) this should be 172 bytes, which means that by default the first available byte after FamiTone's data is $3AC. Correct?

It's just not always immediately obvious what the limits are by checking a debugger. Just wanted to confirm it before I go changing stuff and end up with hard-to-fix bugs.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 83 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group