From e410cee4738a4343308be88295af0abca8c9f1a2 Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Wed, 26 Feb 2020 21:11:16 +0200 Subject: [PATCH] shrinking c.asm --- dos1/Makefile | 2 +- dos1/a.asm | 1 + dos1/c.asm | 31 ++++--------------------------- 3 files changed, 6 insertions(+), 28 deletions(-) diff --git a/dos1/Makefile b/dos1/Makefile index 7c805f5..0a3ae98 100644 --- a/dos1/Makefile +++ b/dos1/Makefile @@ -16,5 +16,5 @@ clean: rm -f a.com .PHONY: boot -boot: b.img +boot: c.img qemu-system-i386 -fda $< diff --git a/dos1/a.asm b/dos1/a.asm index 5b8f6ea..646069b 100644 --- a/dos1/a.asm +++ b/dos1/a.asm @@ -1,6 +1,7 @@ bits 16 org 100h +start: ; call video bios (10h) to set video mode (call 00h), to mode ; 13h (320x200 8bpp). mov ax, 13h ; call number in ah (0), call argument in al (13h) diff --git a/dos1/c.asm b/dos1/c.asm index fdba3c0..d7a228f 100644 --- a/dos1/c.asm +++ b/dos1/c.asm @@ -1,4 +1,4 @@ -; Lowest yet: 312 +; Lowest yet: 277 bits 16 %ifdef BOOTSECT @@ -16,10 +16,6 @@ RANDVAL equ code_end + 4 %macro WAIT_VBLANK 0 mov dx, 3dah -.inblank: - in al, dx - and al, 8 - jnz .inblank ; loop while vblank bit is 1 (in vblank) .notblank: in al, dx and al, 8 @@ -49,39 +45,20 @@ start: ; - bg color (0) ; - shadow color (1) ; - fractal color (2) - mov dx, 0x3c8 - xor al, al - out dx, al - inc dx - mov al, 10 ; 0: 40, 40, 80 - out dx, al - out dx, al - shl al, 1 - out dx, al - mov al, 4 ; 1: 16, 16, 32 - out dx, al - out dx, al - shl al, 1 - out dx, al - mov al, 18h ; 2: 96, 192, 96 - out dx, al - mov al, 48 - out dx, al - mov al, 18h - out dx, al + mainloop: call animate ; clear the framebuffer - xor al, al + mov al, 128 mov cx, 64000 xor di, di rep stosb ; draw shadow mov si, 5 - mov byte [setcol + 1], 1 ; shadow color + mov byte [setcol + 1], 199 ; shadow color call drawsierp ; draw fractal xor si, si -- 1.7.10.4