aboutsummaryrefslogtreecommitdiff
path: root/timed_getch.s
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2015-12-29 23:10:50 -0500
committerB. Watson <yalhcru@gmail.com>2015-12-29 23:10:50 -0500
commit2300d2813a524cbfeabac794335e7abe99263df6 (patch)
treed729ca4f99634788cbb3a2101a5b5854a4bc2d06 /timed_getch.s
downloadtaipan-2300d2813a524cbfeabac794335e7abe99263df6.tar.gz
initial commit
Diffstat (limited to 'timed_getch.s')
-rw-r--r--timed_getch.s26
1 files changed, 26 insertions, 0 deletions
diff --git a/timed_getch.s b/timed_getch.s
new file mode 100644
index 0000000..8675290
--- /dev/null
+++ b/timed_getch.s
@@ -0,0 +1,26 @@
+
+ .export _timed_getch, _set_jiffy_timer
+ .import _cgetc
+
+_set_jiffy_timer:
+ sei
+ sta 540
+ stx 541
+ cli
+ rts
+
+_timed_getch:
+ jsr _set_jiffy_timer
+wait4key:
+ lda 540
+ ora 541
+ beq done
+ ldx 764
+ inx
+ beq wait4key
+ jmp _cgetc
+
+done:
+ lda #$ff ; return -1
+ tax
+ rts