From 820efb5b1e9e68781482470778053ac47282c4b7 Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Wed, 16 Dec 2020 03:56:20 +0200 Subject: [PATCH] attempt to blur up --- Makefile | 4 ++++ bootsplash.asm | 21 +++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 2ae07cf..11d9094 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,10 @@ $(bin): bootsplash.asm nuclear.rle nuclear.rle: nuclear.img cat $< | rle/rle >$@ 2>rle.log +.PHONY: clean +clean: + rm -f $(bin) + .PHONY: run run: $(img) qemu-system-i386 -fda $< diff --git a/bootsplash.asm b/bootsplash.asm index 03e3a50..130073d 100644 --- a/bootsplash.asm +++ b/bootsplash.asm @@ -137,15 +137,32 @@ splash: ; effect main loop .mainloop: - mov cx, spawn_rate ; spawn 10 points per frame + mov cx, spawn_rate .spawn: call rand xor edx, edx div dword [num_spawn_pos] ; edx <- rand % num_spawn_pos mov bx, [es:edx * 2] ; grab one of the spawn positions - mov byte [fs:bx], 1 ; plot a pixel there + mov byte [fs:bx], 0xff ; plot a pixel there dec cx jnz .spawn + ; blur the screen upwards + mov ax, fs + mov ds, ax ; let's use ds for this to avoid long instructions + xor bx, bx ; use: pointer + xor ax, ax ; use: pixel accum + xor dx, dx ; use: second pixel +.blurloop: + mov al, [bx] + mov dl, [bx + 320] + add ax, dx + shr ax, 1 + mov [bx], al + inc bx + cmp bx, 64000 - 320 + jnz .blurloop + + ; wait until the start of vblank .waitvblank: mov dx, 3dah -- 1.7.10.4