git-svn-id: http://svn.code.sf.net/p/netboot65/code@105 93682198-c243-4bdb-bd91-e943c89aac3b

This commit is contained in:
jonnosan 2009-04-15 20:54:11 +00:00
parent f0960e514a
commit ecca9f8b0e
7 changed files with 46 additions and 5 deletions

View File

@ -1,8 +1,22 @@
.export get_key
.export check_for_abort_key
.code
;use Apple 2 monitor ROM function to read from keyboard
;inputs: none
;outputs: A contains ASCII code of key pressed
get_key:
jmp $fd1b
jmp $fd1b
;check whether the escape key is being pressed
;inputs: none
;outputs: sec if escape pressed, clear otherwise
check_for_abort_key:
lda $c000 ;current key pressed
cmp #$9B
bne :+
sec
rts
:
clc
rts

View File

@ -3,6 +3,8 @@
.export filter_text
.export filter_ip
.export filter_dns
.export check_for_abort_key
.importzp copy_src
.include "../inc/common.i"
@ -18,6 +20,18 @@ get_key:
beq get_key
rts
;check whether the RUN/STOP key is being pressed
;inputs: none
;outputs: sec if RUN/STOP pressed, clear otherwise
check_for_abort_key:
lda $cb ;current key pressed
cmp #$3F
bne :+
sec
rts
:
clc
rts
;cribbed from http://codebase64.org/doku.php?id=base:robust_string_input
;======================================================================

View File

@ -80,5 +80,6 @@ NB65_ERROR_TRANSMIT_FAILED EQU $82
NB65_ERROR_TRANSMISSION_REJECTED_BY_PEER EQU $83
NB65_ERROR_INPUT_TOO_LARGE EQU $84
NB65_ERROR_DEVICE_FAILURE EQU $85
NB65_ERROR_ABORTED_BY_USER EQU $86
NB65_ERROR_OPTION_NOT_SUPPORTED EQU $FE
NB65_ERROR_FUNCTION_NOT_SUPPORTED EQU $FF

View File

@ -46,7 +46,7 @@ MAX_DHCP_MESSAGES_SENT=12 ;timeout after sending 12 messages will be about 1
.import udp_send_src_port
.import udp_send_dest_port
.import udp_send_len
.import check_for_abort_key
.import timer_read
.bss
@ -157,6 +157,12 @@ dhcp_init:
@inner_delay_loop:
jsr ip65_process
jsr check_for_abort_key
bcc @no_abort
lda #NB65_ERROR_ABORTED_BY_USER
sta ip65_error
rts
@no_abort:
lda #0
cmp dhcp_break_polling_loop
bne @break_polling_loop

View File

@ -34,7 +34,7 @@
.import udp_send_src_port
.import udp_send_dest_port
.import udp_send_len
.import check_for_abort_key
.import timer_read
.segment "IP65ZP" : zeropage
@ -219,6 +219,13 @@ dns_resolve:
@inner_delay_loop:
jsr ip65_process
jsr check_for_abort_key
bcc @no_abort
lda #NB65_ERROR_ABORTED_BY_USER
sta ip65_error
rts
@no_abort:
lda dns_state
cmp #dns_complete
beq @complete

View File

@ -182,7 +182,6 @@ main_menu:
cmp #KEYCODE_F7
beq @change_config
jsr print_hex
jmp @get_key
@exit_to_basic:

Binary file not shown.