mirror of
https://github.com/fumiama/c64-snake.git
synced 2026-06-05 00:32:39 +08:00
24 lines
419 B
NASM
24 lines
419 B
NASM
; DELAY routine. Takes values from the Accumulator and pauses
|
|
; for that many jiffies (1/60th of a second).
|
|
.scope
|
|
.data zp
|
|
.space _tmp 1
|
|
.space _target 1
|
|
.text
|
|
|
|
delay: sta _tmp ; save argument (rdtim destroys it)
|
|
jsr rdtim
|
|
clc
|
|
adc _tmp ; add current time to get target
|
|
sta _target
|
|
* jsr rdtim
|
|
cmp _target
|
|
php
|
|
jsr getin
|
|
beq +
|
|
sta d
|
|
* plp
|
|
bmi -- ; Buzz until target reached
|
|
rts
|
|
.scend
|