]> git.the-white-hart.net Git - vhdl/commitdiff
Add blinking cursor to writer test program
authorRyan <>
Mon, 13 Oct 2025 22:50:20 +0000 (17:50 -0500)
committerRyan <>
Mon, 13 Oct 2025 22:50:20 +0000 (17:50 -0500)
projects/cpu_0/asm/timers.asm
projects/cpu_0/asm/vga_console.asm

index 55578789ccb3bd9f7b7fadd07a202eafcef38055..b3f5f4a6be7bcd9493eb22025a9d5a25a9e05e0f 100644 (file)
@@ -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 )
index b095eb380f4cb04dc63a35c1f253f1e467be7a6f..0aa3fc08f50b38bb94a3aab81c9a572d6f5b9a17 100644 (file)
@@ -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 )