From: John Tsiombikas Date: Sat, 25 Jun 2022 21:01:40 +0000 (+0300) Subject: rnd X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=bootcard;a=commitdiff_plain;h=428532c66787aa92bcff01f9d8febfb238b5a739 rnd --- diff --git a/bootcard.asm b/bootcard.asm index 1288c4a..4a2f3e4 100644 --- a/bootcard.asm +++ b/bootcard.asm @@ -9,6 +9,7 @@ nticks equ 7e00h tmoffs equ 7e04h musptr equ 7e08h +ppos equ 7e0ch %macro setcur 2 mov dx, %1 | (%2 << 8) @@ -42,7 +43,7 @@ start: xor ax, ax mov sp, 7c00h mov di, nticks - mov cx, 6 + mov cx, 8 rep stosw mov word [32], tintr @@ -75,6 +76,8 @@ mainloop: call drawbg + call psys + jmp mainloop drawbg: @@ -115,6 +118,28 @@ drawbg: ret +psys: cmp word [ppos + 2], 0 + ja .skipspawn + + call rnd + add ax, 128 + mov [ppos + 2], ax + call rnd + add ax, 32 + mov [ppos], ax +.skipspawn: + dec word [ppos + 2] + mov ax, [ppos + 2] + shr ax, 2 + imul bx, ax, 320 + add bx, [ppos] + mov byte [es:bx], 0eh + +rnd: in al, 40h + mov ah, al + in al, 40h + shr ax, 8 + ret textout: mov al, [si]