From: John Tsiombikas Date: Tue, 21 Jun 2022 01:04:06 +0000 (+0300) Subject: - fixed potentially incorrect ds in timer interrupt X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=bootcard;a=commitdiff_plain;h=bf0a04281163284416bcb248357ac40ba4cc263c - fixed potentially incorrect ds in timer interrupt - fixed vsync routine redrawing while waiting - shaved off a couple of bytes --- diff --git a/bootcard.asm b/bootcard.asm index 9f70b59..f823219 100644 --- a/bootcard.asm +++ b/bootcard.asm @@ -25,8 +25,7 @@ KB_CTRL equ 61h %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 @@ -75,14 +74,6 @@ start: xor ax, ax 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 @@ -92,6 +83,15 @@ mainloop: 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 @@ -157,6 +157,9 @@ textout: timer_intr: pusha + push ds + push word 0 + pop ds mov ax, [nticks] inc ax mov [nticks], ax @@ -183,6 +186,7 @@ timer_intr: .eoi: mov al, 20h out 20h, al ; EOI + pop ds popa iret