From: Ryan <> Date: Mon, 13 Oct 2025 22:50:20 +0000 (-0500) Subject: Add blinking cursor to writer test program X-Git-Url: https://git.the-white-hart.net/?a=commitdiff_plain;h=2cae25a63d79af27b2be06ed4e07e5e0abe29e4b;p=vhdl Add blinking cursor to writer test program --- 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 )