.db TF_SE ; NORTH
.db TF_EE ; WEST
.db TF_WE ; EAST
-
+ ; loads an actor table into ram
+ ; actors are loaded until the type byte of
+ ; the next actor is set to 0
+ ; inputs:
+ ; hl: actor table
+act_table_load:
+ ret
+
+ ; updates the entire current actor table
+act_all_update:
+ ret
; updates and draws an actor
; calls different routines fro combat and map state
; and call
ret
+ ; draws an actor if they are near
+ ; usuall act_nearby or prop_nearby
+ ; to the camera
+ ; inputs:
+ ; hl: actor ptr
+act_draw_nearby:
+ ret
+
; clears tact at the current actors position
; inputs:
; de: actor
ret
-act_bat:
- actdef ACT_T_BAT, 0, 10, 10, 0, 0
l1:
mapdef MAP_F_DO_FULL_REDRAW, map_r_nop, 0, tile_banks_default
#include "l1.inc"
+
+ ; l1 actor table
+l1_acts:
+ actdef ACT_T_BAT, 0, 10, 10, 0, 0
+ .db 0 ; terminate
+
tile_banks_default:
dw bank8000
@done:
.endscope
#endmacro
+
+ ; writes the input tiles
+ ; act and prop into act_nearby and prop_nearby
+ ; inputs:
+ ; hl: tile
+ ; preserves:
+ ; all registers
+map_write_nearby_act_prop:
+ push_all
+ ld de, t_act
+ add hl, de
+
+ ; write act
+ ld a, [hl+]
+ ld [act_nearby], a
+ ld a, [hl+]
+ ld [act_nearby+1], a
+
+ ; write prop
+ ld a, [hl+]
+ ld [prop_nearby], a
+ ld a, [hl]
+ ld [prop_nearby+1], a
+
+ pop_all
+ ret
; counts the tiles the player can move forward
; inputs:
ld [tmp_map_far_left_door], a
ld [tmp_map_far_right_door], a
+ ; clear nearby prop and act
+ ld [act_nearby], a
+ ld [act_nearby+1], a
+ ld [prop_nearby], a
+ ld [prop_nearby+1], a
+
ld a, [player+act_pos_y]
ld b, a
ld a, [player+act_pos_x]
dec b ; move one tile back
call map_get_tile
+ call map_write_nearby_act_prop
+
map_full_draw_door_state TF_NE, TF_WE, TF_EE
map_full_draw_write_door_state 3, 2, ret
ret
inc b ; move one tile forward
call map_get_tile
+ call map_write_nearby_act_prop
+
map_full_draw_door_state TF_SE, TF_WE, TF_EE
map_full_draw_write_door_state 3, 2, ret
ret
inc c ; move one tile east
call map_get_tile
+ call map_write_nearby_act_prop
+
map_full_draw_door_state TF_EE, TF_NE, TF_SE
map_full_draw_write_door_state 3, 2, ret
ret
dec c ; move one tile west
call map_get_tile
+ call map_write_nearby_act_prop
+
map_full_draw_door_state TF_WE, TF_SE, TF_NE
map_full_draw_write_door_state 3, 2, ret
ret
tmp_map_near_right_door: .adv 1
tmp_map_far_left_door: .adv 1
tmp_map_far_right_door: .adv 1
+
+ ; actor that is adjacent
+ ; to the players current facing
+ ; direction
+ ; populated when map is drawn
+act_nearby: .adv 2
+ ; prop actor that is adjacent
+ ; to the current players facing direction
+ ; populated when map is drawn
+prop_nearby: .adv 2