inc a
ld [map_curr_row], a
- call mo_exec
-
ret
; inputs:
; [map]
map_page_full_draw:
+ call mo_exec
call next_vblank_wait
call map_advance_row
+ call mo_exec
call next_vblank_wait
call map_advance_row
+ call mo_exec
call next_vblank_wait
call map_advance_row
+ call mo_exec
call next_vblank_wait
call map_advance_row
+ call mo_exec
call next_vblank_wait
call map_advance_row
+ call mo_exec
call next_vblank_wait
call map_advance_row
+ call mo_exec
call next_vblank_wait
call map_advance_row
; last row will be out of visible scroll
+ call mo_exec
call next_vblank_wait
call map_advance_row
ret
l1_objs:
modef MOT_SET_PAT, 0, 8, pat_center_empty_wall
; rectangle at y/x 0/0 with height 32 width 64
- modef MOT_RECT, 0, 9, 0x0804
+ modef MOT_RECT, 0, 8, 0x0804
; center rectangle
- ; modef MOT_RECT, 0, 9, 0x8604
+ ; modef MOT_RECT, 0, 8, 0x8604
; rectangle at y/x 0/0 with height 32 width 48
- modef MOT_RECT, 0, 9, 0xE604
+ modef MOT_RECT, 0, 8, 0xE604
modef MOT_SET_PAT, 0, 10, pat_center_grass
modef MOT_SET_PAT, 0, 18, pat_center_empty_wall
ld b, BTNUP
input_held
jr z, @not_up REL
+ call player_try_scroll_up
ld b, PLAYER_SPEED
ld c, 0
call player_stage_move_n
call player_try_move
- call player_try_scroll_up
@not_up:
ld b, BTNDOWN
; if the player's real y position is over
; a certain value we should scroll the map
; if scrolling is allowed
- ; inputs:
- ; player setp up counter
player_try_scroll_up:
; do not scroll if the scroll timer is enabled
ld a, [scroll_timer]
ld a, [game_flags]
or a, GPF_SCROLL
ld [game_flags], a
+
+ ; run next objects
+ ; so they are loaded before a move is attempted
+ call mo_exec
@no_scroll:
ld de, r_size
add hl, de
jr nz, @rect_loop REL
+
+ ; adjust tmp rect
+ ; (just in case we missed a vblank)
+ ld a, [tmp_rect+r_pos_y]
+ inc a
+ ld [tmp_rect+r_pos_y], a
+
ret
; writes scroll to scroll registers