nesdev.com
http://forums.nesdev.com/

FamiTone - audio library (release)
http://forums.nesdev.com/viewtopic.php?f=6&t=7329
Page 6 of 6

Author:  thefox [ Sat Jan 30, 2016 8:11 pm ]
Post subject:  Re: FamiTone - audio library (release)

sdm wrote:
FT_BASE_ADR = $0300 ;page in RAM, should be $xx00

In my code, I noticed that it is about 128 bytes.

The documentation (readme.txt) lists the non-zp memory usage as 186 bytes for FamiTone2 (v1.15).

Author:  sdm [ Sun Jul 02, 2017 8:20 am ]
Post subject:  Re: FamiTone - audio library (release)

Is it possible to have all the famitone code with music and sfx in the UNROM bank? (one of those switchable). Currently I have in $ E000 (bank not switchable). Do not know if it's possible at all in the famitone?

Author:  dougeff [ Sun Jul 02, 2017 9:10 am ]
Post subject:  Re: FamiTone - audio library (release)

Personally, I would prefer the famitone code in the fixed bank, and the data in switchable banks. But I suppose you could also put the code in the switchable bank.

The only thing you CAN'T put in the switchable bank (UNROM style) is DPCM samples.

Author:  sdm [ Wed Jul 05, 2017 6:29 am ]
Post subject:  Re: FamiTone - audio library (release)

I have a problem running Famitone, which has music/sfx data in the switch bank:

Code:
   .bank 12      ;UNROM bank switchable
   .org $8000
MUSIC:
   .include "music.asm"
SFX:
   .include "sfx.asm"
;------------------------------------------------
   .bank 14      ;UNROM bank fixed (last, non-switchable)
   .org $C000

   .include "famitone2.asm"
;------------------------------------------------
NMI:                 ;NMI code in the last bank

   JSR FamiToneUpdate
:------------------------------------------------
;This code is also in the last bank:
   LDA #$6
   STA Bank_TBL+6      ;Change to bank contains MUSIC & SFX

   lda #01         ;FAMITONE INIT.
   ldx #low(Muzyka)
   ldy #high(Muzyka)
   jsr FamiToneInit

   ldx #LOW(SFX)
   ldy #HIGH(SFX)
   jsr FamiToneSfxInit

   lda #0         ;FAMITONE (song nr.)
   JSR FamiToneMusicPlay

   LDA #$0
   STA Bank_TBL      ;back to code bank


Author:  dougeff [ Wed Jul 05, 2017 7:40 am ]
Post subject:  Re: FamiTone - audio library (release)

Quote:
JSR FamiToneUpdate


You should be switching music data banks IN before you call FamiToneUpdate. Are you?

Author:  sdm [ Thu Jul 06, 2017 8:44 am ]
Post subject:  Re: FamiTone - audio library (release)

I do not know what's wrong: / Can you check the code?

Attachments:
famitone_unrom.zip [48.06 KiB]
Downloaded 26 times

Author:  dougeff [ Mon Jul 10, 2017 12:14 pm ]
Post subject:  Re: FamiTone - audio library (release)

What was your problem again?

Did you resolve it?

Author:  dougeff [ Thu Jul 13, 2017 7:02 am ]
Post subject:  Re: FamiTone - audio library (release)

I looked at your code, and (as I suggested), you need to switch banks before calling FamiToneUpdate. Using your code...



Code:
Forever:

   JSR VBWait
   JSR ReadPad
   JSR SeeCTRL
LDA #$6 ;has the music data
STA Bank_TBL+6
   JSR FamiToneUpdate
LDA #$0
STA Bank_TBL
   JMP Forever


because, it currently gets stuck in an infinite loop the first time it jumps to FamiToneUpdate, because the music data isn't in place.

Page 6 of 6 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/