Hello. I was working on my sound engine today and I ran into a problem. On my squares, the lowest notes on these charts aren't working. For example, the low G has a period $0475. If I pop these into $4002/3, there is no sound output. Here is a minimal ca65 example based on an example from blargg's minimal ca65 example thread:
When I assemble this and play it in emulators, I get no sound. If I lower the high 3 bits to a number less than #$04, a sound will play. What gives?
Code:
.segment "CHARS"
;.incbin "chr.bin" ; if you have one
.segment "HEADER"
.byte "NES",26,2,1 ; 32K PRG, 8K CHR
.segment "VECTORS"
.word 0, 0, 0, nmi, reset, irq
.segment "STARTUP" ; avoids warning
.segment "CODE"
nmi:
irq:
reset:
lda #$01 ; play short tone
sta $4015
lda #$9F
sta $4000
lda #$75
sta $4002
lda #$04
sta $4003
forever:
jmp forever
;.incbin "chr.bin" ; if you have one
.segment "HEADER"
.byte "NES",26,2,1 ; 32K PRG, 8K CHR
.segment "VECTORS"
.word 0, 0, 0, nmi, reset, irq
.segment "STARTUP" ; avoids warning
.segment "CODE"
nmi:
irq:
reset:
lda #$01 ; play short tone
sta $4015
lda #$9F
sta $4000
lda #$75
sta $4002
lda #$04
sta $4003
forever:
jmp forever
When I assemble this and play it in emulators, I get no sound. If I lower the high 3 bits to a number less than #$04, a sound will play. What gives?