Some minor changes.

This commit is contained in:
Oliver Schmidt 2017-05-07 20:53:04 +02:00
parent 344d76829a
commit 2566a26253
4 changed files with 14 additions and 18 deletions

View File

@ -1,7 +1,7 @@
.export get_key
.export check_for_abort_key
.export get_key_ip65
.export get_key_if_available
.export get_key_ip65
.import ip65_process
@ -11,17 +11,23 @@
; use Apple 2 monitor ROM function to read from keyboard
; inputs: none
; outputs: A contains ASCII code of key pressed
get_key:
jmp $fd0c
get_key = $fd0c
; inputs: none
; outputs: A contains ASCII value of key just pressed (0 if no key pressed)
get_key_if_available:
lda $c000 ; current key pressed
bmi :+
bmi got_key
lda #0
rts
: bit $c010 ; clear the keyboard strobe
; process inbound ip packets while waiting for a keypress
get_key_ip65:
jsr ip65_process
lda $c000 ; key down?
bpl get_key_ip65
got_key:
bit $c010 ; clear the keyboard strobe
and #$7f
rts
@ -38,13 +44,6 @@ check_for_abort_key:
: clc
rts
; process inbound ip packets while waiting for a keypress
get_key_ip65:
jsr ip65_process
bit $c000 ; key down?
bpl get_key_ip65
jmp get_key
; -- LICENSE FOR a2input.s --

View File

@ -3,8 +3,7 @@
.code
exit_to_basic:
jmp $3d0
exit_to_basic = $3d0

View File

@ -4,8 +4,7 @@
.code
; jump to BASIC interpreter loop
exit_to_basic:
jmp $a7ae
exit_to_basic = $a7ae

View File

@ -4,8 +4,7 @@
.code
; jump to BASIC interpreter loop
exit_to_basic:
jmp $c7ae
exit_to_basic = $c7ae