From: Lukas Krickl Date: Sun, 20 Apr 2025 18:12:00 +0000 (+0200) Subject: cells: Added update loop X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=36a79b2999c9226bc28744c5d8a9036a4aba28b3;p=gbrg%2F.git cells: Added update loop The simulation update loop currently updates all cells in a single frame. This is way too slow and will need to be split up. --- diff --git a/src/cells.s b/src/cells.s index 84f8ca2..afffd51 100644 --- a/src/cells.s +++ b/src/cells.s @@ -9,7 +9,7 @@ cell_update: ld a, [de] ; a = head offset and a, CF_HEAD ; if not head cell return - ret nz + ret z ; save cell ptr dec de ; de is c_type @@ -44,9 +44,9 @@ cell_update: ; de = c_st_routine ; store next routine - ld a, b - ld [de], a ld a, c + ld [de], a + ld a, b inc de ld [de], a diff --git a/src/macros.inc b/src/macros.inc index 0703018..a4f6367 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -36,7 +36,7 @@ #define NEGATE -1 & 0xFF #define LO & 0xFF -#define HI >> 4 & 0xFF +#define HI >> 8 & 0xFF #macro dblo .db $1 & 0xFF diff --git a/src/update.s b/src/update.s index 2e6c2d5..422383a 100644 --- a/src/update.s +++ b/src/update.s @@ -9,7 +9,7 @@ update_game: ld de, actor_player call st_update - ; call sim_update + call sim_update ldnull bc ret