From 69bba61dcfd9edfac4953af00e4ef839a173baa1 Mon Sep 17 00:00:00 2001 From: Daniel Borges Date: Mon, 31 Dec 2018 14:21:49 +0100 Subject: [PATCH] faster way of counting bits set. 12 => 11VBLs --- Code/main.asm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Code/main.asm b/Code/main.asm index eb06eab..bb1b941 100644 --- a/Code/main.asm +++ b/Code/main.asm @@ -40,8 +40,7 @@ AddLiveNeighbors: MACRO and a, b ; count bits set - ld de, BitsSet - add a, e + ld d, HIGH(BitsSet) ld e, a ld a, [de] @@ -643,7 +642,7 @@ TilesLeft: ds 1 ; number of tiles left to render in current line Video: ds 2 ; progressing pointer in tilemap (VRAM) Rendered: ds 2 ; progressing pointer in old buffer -SECTION "Bits Set", ROM0, ALIGN[4] +SECTION "Bits Set", ROM0, ALIGN[8] BitsSet: db 0; 0 = 0000 db 1; 1 = 0001