From 428532c66787aa92bcff01f9d8febfb238b5a739 Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Sun, 26 Jun 2022 00:01:40 +0300 Subject: [PATCH] rnd --- bootcard.asm | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) 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] -- 1.7.10.4