From 2cae25a63d79af27b2be06ed4e07e5e0abe29e4b Mon Sep 17 00:00:00 2001 From: Ryan <> Date: Mon, 13 Oct 2025 17:50:20 -0500 Subject: [PATCH] Add blinking cursor to writer test program --- projects/cpu_0/asm/timers.asm | 11 ++++++----- projects/cpu_0/asm/vga_console.asm | 6 ++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/projects/cpu_0/asm/timers.asm b/projects/cpu_0/asm/timers.asm index 5557878..b3f5f4a 100644 --- a/projects/cpu_0/asm/timers.asm +++ b/projects/cpu_0/asm/timers.asm @@ -2,17 +2,18 @@ ( -- ) timer_reset: ( Enable timer 0 with 1s period, auto-restart ) - ( #8 0x02i8 #32 timer0_count_h !8 drop ) - ( #8 0xfai8 #32 timer0_count_m !8 drop ) - ( #8 0xf0i8 #32 timer0_count_l !8 drop ) - ( #8 0x0fi8 #32 timer0_ctrl !8 drop ) + #8 0x00i8 #32 timer0_count_h !8 drop + #8 0x5fi8 #32 timer0_count_m !8 drop + #8 0x5ei8 #32 timer0_count_l !8 drop + #8 0x0fi8 #32 timer0_ctrl !8 drop ; ( Timer 0 interrupt ) ( -- ) timer0_int: - ; + #32 timer0_ctrl @8 #32 timer0_ctrl !8 drop + call vga_draw_cursor ; ( Timer 1 interrupt ) diff --git a/projects/cpu_0/asm/vga_console.asm b/projects/cpu_0/asm/vga_console.asm index b095eb3..0aa3fc0 100644 --- a/projects/cpu_0/asm/vga_console.asm +++ b/projects/cpu_0/asm/vga_console.asm @@ -143,22 +143,24 @@ vga_update_cursor: ( -- ) vga_undraw_cursor: + idis #32 vga_cursor_col @8 #32 vga_cursor_by @8 #8 80i8 call mul_uu #32 vga_cursor_bx @8 + shl #8 1i8 + #32 vga_scr + !8 drop - ; + ien ; ( -- ) vga_draw_cursor: + idis #32 vga_cursor_y @8 #32 vga_cursor_by !8 #8 80i8 call mul_uu #32 vga_cursor_x @8 #32 vga_cursor_bx !8 + shl #8 1i8 + #32 vga_scr + >r r@ @8 dup >r lsr lsr lsr lsr r> #8 0x0fi8 & shl shl shl shl | r> !8 drop - ; + ien ; ( Print an ASCIIZ string out the VGA display ) -- 2.43.0