; hl = tile now
ret
+
+ ; prepares tile draw
+ ; by writing the expected tiles
+ ; to tile_to_draw[0] to [3]
+ ; inputs:
+ ; b/c: y/x position
+map_draw_tile_prep:
+ call map_get_tile
+ ; hl = tile
+
+ ld de, update_tile_to_draw
+
+ ; TODO:
+ ret
#macro map_draw_row_inc_c
+ push bc
+ call map_draw_tile_prep
+ pop bc
push bc
call map_draw_tile
pop bc
call tile_update
+ ; prepare the tile for drawing
+ ld a, [update_tile_y]
+ ld b, a
+ ld a, [update_tile_x]
+ ld c, a
+ call map_draw_tile_prep
+
ret
; draws the recently updated tile
add hl, de
ld a, [hl]
inc a
- ld [hl], a
- ret
+ ; ld [hl], a
ret
; updates controlled tile
#define UI_TILE_HP_2 0xCA
#define UI_TILE_HP_1 0xCB
+#define UI_TILE_PLUS 0x01
+#define UI_TILE_MINUS 0x11
+
; inits UI
ui_init:
ld hl, ui_draw_nop
update_tile_y: .adv 1
update_tile_x: .adv 1
update_tile: .adv 2
- ; previpus frame's update tile
- ; used for drawing the recently updated tile
-update_tile_prev_y: .adv 1
-update_tile_prev_x: .adv 1
+
+ ; space for 4 tile ids
+ ; that represent the current tile
+ ; this gets drawn during the next blank
+update_tile_to_draw: .adv 4
; tile 1
.chr 00000000
.chr 00000000
-.chr 00000000
-.chr 00000000
-.chr 00000000
+.chr 00030000
+.chr 00333000
+.chr 00030000
.chr 00000000
.chr 00000000
.chr 00000000
.chr 00000000
.chr 00000000
.chr 00000000
-.chr 00000000
+.chr 00333000
.chr 00000000
.chr 00000000
.chr 00000000