From c61de150483b3b577f8e975c5ce8c4a989e63d74 Mon Sep 17 00:00:00 2001 From: "Matthias@Dell" Date: Mon, 15 Jan 2024 09:18:49 +0100 Subject: [PATCH] wip viu --- programs/viu.s65 | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 programs/viu.s65 diff --git a/programs/viu.s65 b/programs/viu.s65 new file mode 100644 index 0000000..24e07c8 --- /dev/null +++ b/programs/viu.s65 @@ -0,0 +1,47 @@ +.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 + 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: + ; go back + lda ' ' +.endproc