Room loading now disables lcd to draw new room.
authorLukas Krickl <lukas@krickl.dev>
Mon, 23 Dec 2024 16:30:05 +0000 (17:30 +0100)
committerLukas Krickl <lukas@krickl.dev>
Mon, 23 Dec 2024 16:30:05 +0000 (17:30 +0100)
This should eventually become a smooth transition

src/map.s
src/video.s

index fa030de106654b2692c294a57f06a085d8ea5fa4..ff6481ebbe24f5a51c7f040c51f1f60d8910b132 100644 (file)
--- a/src/map.s
+++ b/src/map.s
@@ -112,7 +112,9 @@ room_goto_player_pos:
 room_goto:
 
   ; TODO: save current tables back 
-  ; TODO: weird oob reads when calling room_load_from
+  call disableinterrutpts
+  call vblank_wait
+  call lcd_off
 
   ld hl, curr_room_exits ; ptr to exit table 
   ld a, [hl+]
@@ -129,14 +131,18 @@ room_goto:
   ld d, a
   ld a, [hl]
   ld e, a
-
   call room_load_from
 
   ; its player's turn again
   ld a, WHO_PLAYER
   ld [who], a 
+  
+  call lcd_on
+  call enableinterrupts
 
   ret
+  
 
   ; loads actors from 
   ; [curr_room_init_act] 
index 21a42444e85585f0ac89d26482e194264a2e856e..d80eb5d70426caaf197278efb0e8c58835ad2b62 100644 (file)
@@ -119,3 +119,4 @@ copy_tiles:
   call memcpy
 
   ret
+