int 0x10 ; video services
; initialize xss
+
+set_xss_seed:
+
mov ah, 0x00 ; get
int 0x1a ; system time
+
+cmp dx, 0
+je set_xss_seed ; if seed is 0, xs wont work properly
+
mov [xss], dx ; cx:dx = number of clock ticks since midnight
; initialize currvgapg
next_state:
+call vsync_wait
call write_next_vga_page
call wait_keypress
call flip_vga_page
xor word [currvgapg], VGAPGSZ ; flip currvgapg
setnz al ; al = !(currvgapg == 0)
-mov di, [currvgapg] ; es:di -> current page
-mov dh, PRINT_COLOR
-
-mov dl, 'P'
-mov [es:di], dx
-
-mov dl, al
-add dl, 48
-add di, 2
-
-mov [es:di], dx
-
mov ah, 0x05 ; select active display page
int 0x10 ; video services