every byte as a single update call
This caused out of bounds writes to seemingly random addresses.
push bc
pop hl ; hl = ptr to tile
ld a, BUILDING_ROAD_NORTH_SOUTH
-
- assert nc, h, 0x80
- assert c, h, 0xA0
call bg_update_queue_push
.de BT_FARM, 1
.de BT_LUMBER, 1
-#define BGE_MAX 32
+#define BGE_MAX 64
; max bg updates per frame
#define BG_UPDATE_MAX 8
; it processess all tile updates
; until the bg_update_index is 0
bg_update_queue_process:
- ld hl, bg_update_index
-
; read index
ld a, [bg_update_index]
ld e, a
@loop:
push af
; index--
+ ; sub length of an entry
+ dec de
+ dec de
dec de
; write to vram