6502-OS/programs/viu.s65

54 lines
934 B
Plaintext
Raw Normal View History

2024-08-08 20:15:50 +02:00
;;********************************************************************************
;; @module VIU - VI Unimproved
;;********************************************************************************
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
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:
lcd_DecrementCursor
lda #' '
jsr lcd::print_char
lcd_DecrementCursor
bra loop
2024-01-15 09:18:49 +01:00
.endproc