From a3491697a5b59c74fcc33159a31ce3d32c595691 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Wed, 24 Sep 2025 11:20:14 +0200 Subject: [PATCH] video: fixed oam flickering when frame is skipped --- src/defs.s | 4 ++-- src/video.s | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/defs.s b/src/defs.s index 235030b..5a722cc 100644 --- a/src/defs.s +++ b/src/defs.s @@ -13,9 +13,9 @@ #define NULL 0 -#define ACTS_MAX 32 +#define ACTS_MAX 12 #define MAP_OBJ_MAX 32 -#define RECT_MAX 32 +#define RECT_MAX 12 #define MAP_ROW_H 16 ; pixels per row diff --git a/src/video.s b/src/video.s index ec390d0..833dafb 100644 --- a/src/video.s +++ b/src/video.s @@ -5,19 +5,20 @@ ; vblank handler vblank: push_all + + ; enable objects + ld a, [RLCD] + or a, LCDCF_OBJON + ld [RLCD], a - ; get inputs - call poll_inputs ; skip if update has not yet finished ld a, [frame_ready] cp a, 1 jp z, @skip_rest - ; enable objects - ld a, [RLCD] - or a, LCDCF_OBJON - ld [RLCD], a + ; get inputs + call poll_inputs call video_map_perform_scroll -- 2.30.2