; hl: pointer to player memory
player_update:
; update
+ ld a, [who]
+ cp a, WHO_PLAYER
+ jp nz, @skip_input
; set collision mask
ld a, RF_WALL
ld [ct_mask], a
-
- ; d: player_y
- ; e: player_x
- ; b: obj flags mask
; input handling
; hl is ok to use again
; bc is free
; de is still used
+ dec hl ; hl = player_y = player start
+
+@skip_input:
+ ; hl should be player_y here
+
+ ; d: player_y
+ ; e: player_x
+ ; b: obj flags mask
+ ld a, [hl+] ; hl = player_x
+ ld d, a ; d = player_y
+ ld a, [hl]
+ ld e, a ; e = player_x
+ dec hl ; hl = player_y
; check if i-frame
; if iframe is divisible by 2
; flash all sprites off
; otherwise continue with regular code
; hl = player_x
- dec hl ; hl = player_y = player start
ld bc, player_timer_i
add hl, bc ; hl = timer now
ld a, [hl]