2024-01-15 09:18:49 +01:00
|
|
|
.include "lcd.h65"
|
|
|
|
.include "ps2_keyboard_text_handler.h65"
|
|
|
|
|
|
|
|
.import home:absolute
|
|
|
|
|
|
|
|
.zeropage
|
|
|
|
ptr: .res 2
|
|
|
|
.bss
|
|
|
|
buffer: .res 256
|
|
|
|
|
|
|
|
.code
|
|
|
|
.proc init
|
|
|
|
stz ptr
|
|
|
|
stz ptr+1
|
|
|
|
stz buffer
|
|
|
|
|
|
|
|
.endproc
|
|
|
|
|
|
|
|
.proc insert_mode
|
|
|
|
jsr lcd::clear
|
|
|
|
jsr kb::init
|
|
|
|
loop:
|
|
|
|
lda kb::char
|
2024-08-08 00:11:15 +02:00
|
|
|
ldx ptr
|
2024-01-15 09:18:49 +01:00
|
|
|
beq @no_char
|
|
|
|
stz kb::char
|
|
|
|
jsr lcd::print_char
|
|
|
|
bra loop
|
|
|
|
@no_char:
|
|
|
|
lda kb::keycode
|
|
|
|
beq loop
|
|
|
|
|
|
|
|
cmp #kb::K::ESCAPE
|
|
|
|
beq k_esacpe
|
|
|
|
cmp #kb::K::PRINT
|
|
|
|
beq clear_display
|
|
|
|
cmp #kb::K::BACKSPACE
|
|
|
|
beq k_backspace
|
|
|
|
bra loop
|
|
|
|
k_esacpe:
|
|
|
|
jmp home
|
|
|
|
clear_display:
|
|
|
|
jsr lcd::clear
|
|
|
|
bra loop
|
|
|
|
k_backspace:
|
2024-08-08 00:11:15 +02:00
|
|
|
lcd_DecrementCursor
|
|
|
|
lda #' '
|
|
|
|
jsr lcd::print_char
|
|
|
|
lcd_DecrementCursor
|
|
|
|
bra loop
|
2024-01-15 09:18:49 +01:00
|
|
|
.endproc
|