[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Single tones on the Mockingboard?
On Jan 30, 9:14 am, Steve Nickolas
<lyricalnan...@usotsuki.hoshinet.org> wrote:
> Replying to myself.
>
> I figured out the data the 8910 wants (using the Mockingboard exerciser),
> but I seem not to be implementing the code right.
>
> Here's my code, it's supposed to initialize the board when entered from
> 36864/$9000 and then beep the 8910 when entered from 36867/$9003. The
> second call just does a short pause - no sound. :<
>
> -uso.
>
> ;these values were determined empirically with the MockingBoard exerciser:
> ;
> ;Tone Control Fine 80($50) (register 0/2/4)
> ;Tone Control Coarse 0 (register 1/3/5)
> ;Noise Period 0 (register 6)
> ;Enable Mask 62($3E) (register 7)
> ;Amplitude 15($0F) (register 8/9/A)
> ;Envelope Fine 0 (register B)
> ;Envelope Coarse 0 (register C)
> ;Envelope Shape 0 (register D)
>
> ADR6522 = $C400
>
> .org $9000
> signon: jmp init
> entry: ldx #$00
> ldy #$80
> jsr push
> ldx #$02
> jsr push
> ldx #$04
> jsr push
> ldx #$07
> ldy #$3E
> jsr push
> ldy #$0F
> inx
> jsr push
> inx
> jsr push
> inx
> jsr push
> ldy #$00
> ldx #$01
> jsr push
> ldx #$03
> jsr push
> ldx #$05
> jsr push
> inx
> jsr push
> ldx #$0B
> jsr push
> inx
> jsr push
> inx
> jsr push
> lda #$00
> tax
> tay
> @1: inx
> bne @1
> iny
> bne @1
> @2: jsr push
> inx
> cpx #$B
> bcc @2
> rts
>
> push: sty ADR6522+1
> jsr setreg
> stx ADR6522+1
> jsr setdata
> rts
> init: lda #$FF
> sta ADR6522+2
> sta ADR6522+3
> reset: lda #$00
> sta ADR6522
> beq common
> setreg: lda #$07
> sta ADR6522
> bne common
> setdata: lda #$06
> sta ADR6522
> common: lda #$04
> sta ADR6522
> rts
I believe you have the PUSH wrong. The register is supposed to be set
first with what's in the x register.
So it should be
push: stx ADR6522+1
jsr setreg
sty ADR6522+1
jsr setdata
rts