Posted: Thu Nov 18, 2010 11:55 am
The code from the Wiki works fine for me (testing on a PAL NES at the moment). I do notice that your code plays a very quiet noise either way, maybe that's the problem.
Odd. It plays full volume here. Definitely not a volume issue.blargg wrote:The code from the Wiki works fine for me (testing on a PAL NES at the moment). I do notice that your code plays a very quiet noise either way, maybe that's the problem.
Code: Select all
reset:
sei
ldx #$FF
txs
lda #$00
sta PPU0
sta PPU1
jsr init_APU
mainLoop:
jmp mainLoop
nmi: rti
irq: rti
init_APU:
lda #$00
sta $4015
ldx #$00
@a: lda @apu_regs,x
sta $4000,x
inx
cpx #$18
bne @a
lda #$0F
sta $4015
lda #%00111111
sta $400c
lda #$01
sta $400e
;sta $400f
rts
@apu_regs:
.BYTE $30,$08,$00,$00
.BYTE $30,$08,$00,$00
.BYTE $80,$00,$00,$00
.BYTE $30,$00,$00,$00
.BYTE $00,$00,$00,$00
.BYTE $00,$0F,$00,$40
Code: Select all
init_apu:
lda #$00 ; should be $0F
sta $4015Thanks! I wrote those tutorials to help people learn how to program the APU. The tech docs are great but dense. A lot of new homebrewers were coming in and posting ROMs of their games in progress, but they were all silent. I had just figured the APU out so I wanted to help out.tokumaru wrote: From what I've read so far, the Nerdy Nights sound tutorial is pretty straightforward and tells exactly what you have to do to get things going without much trouble, along with simple register descriptions. Assuming it's accurate, I guess it's a really good intro to sound programming.