X-Git-Url: https://eleni.mutantstargoat.com/git/?p=bootboot;a=blobdiff_plain;f=bb.asm;h=c28880edbec2b0680843c3ce277c4840e010890b;hp=4eb536e154e258f9672441d4b194c6e996b1f8f5;hb=dadb382c0f79465a561ba53b64ed24472c5f6900;hpb=024fd74bc033f01b826f6cea4d426a609e4c08ff diff --git a/bb.asm b/bb.asm index 4eb536e..c28880e 100644 --- a/bb.asm +++ b/bb.asm @@ -175,7 +175,17 @@ main_loop: jnz .static_loop ; draw lovebug - mov di, 32000 + mov di, (200 - 32) * 320 + 160 - 16 + mov ax, [num_frames] + mov bx, ax + shl ax, 8 + shl bx, 6 + add ax, bx + sub di, ax + call rand + and ax, 3 ; random value in 0, 15 + sub ax, 1 ; random value in -3, 12 + add di, ax mov si, lovebug call blit32 @@ -201,12 +211,15 @@ main_loop: pop es inc word [num_frames] + cmp word [num_frames], 200 - 32 + jz .end in al, 64h ; 60h = keyb data port, 64h = keyb status port and al, 1 ; 1 = OUTBUF_FULL = the keyb controller out buf is full jz main_loop ; no key pressed, loop back in al, 60h ; reads the keyb that was pressed to reset the flag +.end: ; re-enable all interrupts sti