correct length measurement of input line for CHRIN

This commit is contained in:
Paul Gardner-Stephen committed 2019-04-22 03:04:15 +09:30
1 parent 89f7f9ae55
commit 836f19e834
1 file changed
+4 -1
+4 -1
View File
@@ -50,6 +50,8 @@ read_from_keyboard:
jsr pop_keyboard_buffer jsr pop_keyboard_buffer
jsr hide_cursor_if_visible
;; It was enter. ;; It was enter.
;; Note that we have a line of input to return, and return the first byte thereof ;; Note that we have a line of input to return, and return the first byte thereof
;; after computing and storing its length. ;; after computing and storing its length.
@@ -66,10 +68,11 @@ read_from_keyboard:
tay tay
iny iny
* dey * dey
beq empty_line bmi empty_line
lda (current_screen_line_ptr),y lda (current_screen_line_ptr),y
cmp #$20 cmp #$20
beq - beq -
iny
sty end_of_input_line sty end_of_input_line
lda #$01 lda #$01
sta keyboard_input_ready sta keyboard_input_ready