X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=bootcard.asm;fp=bootcard.asm;h=4a2f3e426aaa26a58a87ec3e4179a725891db5fc;hb=428532c66787aa92bcff01f9d8febfb238b5a739;hp=1288c4a9d1a15380113d742cbfe5e20f8c16faf6;hpb=58fe680f15216bea684641de4cd94fc78f1582d5;p=bootcard 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]