Skip to content

Instantly share code, notes, and snippets.

@ObKo
Created March 19, 2012 08:47
Show Gist options
  • Save ObKo/2103526 to your computer and use it in GitHub Desktop.
Save ObKo/2103526 to your computer and use it in GitHub Desktop.
.WARMST equ $FF7C
.INCHAR equ $FFcD
EOT equ $04
CR equ $0d
TCTL1 equ $20
TOC2 equ $18
TOC1 equ $16
TFLG1 equ $23
OC1M equ $0C
OC1D equ $0D
ORG $100
ldx #$1000
ldd period
std TOC2,X
bset TCTL1,X #$40
loop:
ldaa #$40
bita TFLG1,X
beq loop
staa TFLG1,X
ldd TOC2,X
addd period
bvs increment_low
std TOC2,X
jmp loop
increment_low:
std TOC2,X
ldaa t
inca
staa t
cmpa #$01
beq change_freq
jmp loop
change_freq:
ldaa isincrement
cmpa #$00
beq inc_freq
dec_freq:
ldd freq
subd #$10
cmpd #$1f4
bhs save_freq
std freq
ldaa #00
staa isincrement
jmp change_end
inc_freq:
ldd freq
addd #$10
cmpd #$7d0
bls save_freq
std freq
ldaa #01
staa isincrement
jmp change_end
save_freq:
std freq
change_end:
ldx freq
ldd #$f424
idiv
xgdx
aslb
rola
aslb
rola
aslb
rola
aslb
rola
ldx #$1000
std period
ldaa #$00
staa t
jmp loop
;jsr .INCHAR
;cmpa #CR
;beq end
end:
jsr .WARMST
t:
FCB $00
period:
FCB $03, $e8
freq:
FCB $03, $e8
isincrement
FCB $01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment