From: Lukas Krickl Date: Tue, 24 Dec 2024 10:56:29 +0000 (+0100) Subject: Added optional vblank wait to room row draw X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=03a6382b48445eba420383648e20a5b443abf9ef;p=gbrg%2F.git Added optional vblank wait to room row draw This allows us to load a room without turning off the screen :^) --- diff --git a/src/map.s b/src/map.s index 3bddb82..fccc323 100644 --- a/src/map.s +++ b/src/map.s @@ -159,7 +159,7 @@ room_goto: ; TODO: save current tables back call disableinterrutpts call vblank_wait - call lcd_off + ;call lcd_off ld hl, curr_room_exits ; ptr to exit table ld a, [hl+] @@ -183,7 +183,7 @@ room_goto: ld a, WHO_PLAYER ld [who], a - call lcd_on + ;call lcd_on call enableinterrupts ret @@ -236,6 +236,11 @@ room_load_actors: ; de: next row ; hl: next screen address room_row_draw: + ; wait for vlbank for every row if the screen is not off + ld a, [RLCD] + cp a, 0 + call nz, vblank_wait + ld b, ROOM_W ; we'll need @@ -271,7 +276,13 @@ room_row_draw: add hl, bc ld b, ROOM_W - + + + ; wait for vlbank for every row if the screen is not off + ld a, [RLCD] + cp a, 0 + call nz, vblank_wait + ; almost the same loop again ; for the second row ; of the meta tile