- fixed vsync routine redrawing while waiting
- shaved off a couple of bytes
%define DIV_ROUND(a, b) ((a) / (b) + ((a) % (b)) / ((b) / 2))
%macro setcursor 2
- mov dl, %1
- mov dh, %2
+ mov dx, %1 | (%2 << 8)
xor bx, bx
mov ah, 2
int 10h
mainloop:
call drawbg
- mov dx, 3dah
-.invb: in al, dx
- and al, 8
- jnz mainloop
-.novb: in al, dx
- and al, 8
- jz .novb
-
push ds
push es
push es
xor di, di
xor si, si
mov cx, 32000
+
+ mov dx, 3dah
+.invb: in al, dx
+ and al, 8
+ jnz .invb
+.novb: in al, dx
+ and al, 8
+ jz .novb
+
rep movsw
pop es
pop ds
timer_intr:
pusha
+ push ds
+ push word 0
+ pop ds
mov ax, [nticks]
inc ax
mov [nticks], ax
.eoi: mov al, 20h
out 20h, al ; EOI
+ pop ds
popa
iret