From 996bd9ab6f26e318e4b678f4b11d81bb8a8c5164 Mon Sep 17 00:00:00 2001 From: phfr24 Date: Sat, 13 Dec 2025 18:13:48 -0300 Subject: [PATCH] cleanup --- lifeboot.asm | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/lifeboot.asm b/lifeboot.asm index e44a671..8f11b87 100644 --- a/lifeboot.asm +++ b/lifeboot.asm @@ -6,15 +6,17 @@ org 7c00h ; settings -------------------------------------------------------------------- %define DEAD ' ' ; char to represent a dead cell -%define ALIVE '#' ; char to represent an alive cell +%define ALIVE '.' ; char to represent an alive cell %define PRINT_COLOR 07h ; grey on black -%define WAIT_DELAY 02h ; 0.131072 seconds + +%define WAIT_DELAY_CX 01h ; cx:dx = delay in microseconds +%define WAIT_DELAY_DX 00h ; constants ------------------------------------------------------------------- %define COLS 80 %define ROWS 25 -%define VGAPGSZ (COLS * ROWS * 2 + 96) ; why 96 ?????? +%define VGAPGSZ 1000h ; memory layout --------------------------------------------------------------- @@ -78,7 +80,7 @@ next_state: call vsync_wait call write_next_vga_page -call wait_keypress +call delay call flip_vga_page jmp next_state @@ -93,25 +95,14 @@ jmp next_state delay: -mov cx, WAIT_DELAY ; cx:dx = interval in microseconds -mov dx, 0 +mov cx, WAIT_DELAY_CX +mov dx, WAIT_DELAY_DX mov ah, 86h int 15h ; wait ret -; wait_keypress() - wait for any keypress ------------------------------------- - -; clobbers: ax - -wait_keypress: - -mov ah, 00h ; read key press -int 16h ; keyboard services - -ret - ; vsync_wait() - wait for display to enter the next VBlank cycle -------------- ; clobbers ax, dx -- 2.54.0