; curr_room_exits: ptr to exits table
; a: direction EAST, WEST, NORTH, SOUTH, EXIT_SPECIAL
room_goto:
+ ; TODO: save current tables back
; save a for later
push af
-
- ; TODO: save current tables back
call disableinterrutpts
- call vblank_wait
+
+ ; disable objects
+ ld a, LCDCF_ON | LCDCF_BGON | LCDF_OBJ_SIZE
+ ld [RLCD], a
+
;call lcd_off
; its player's turn again
ld a, WHO_PLAYER
ld [who], a
-
- ;call lcd_on
+
+ ; restore palette
+ ld a, BGP
+ ld [RBGP], a
+
+ ; clear soam
+ call shadow_oam_clear
+
+ call lcd_on
call enableinterrupts
ret
; wait for vlbank for every row if the screen is not off
ld a, [RLCD]
cp a, 0
- call nz, vblank_wait
+ call nz, next_vblank_wait
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
+ call nz, next_vblank_wait
; almost the same loop again
; for the second row