( -- )
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 )
( -- )
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 )