; returns:
; hl: next oam ptr (if reserved!)
actor_draw:
+ push hl
+ ld hl, act_pos_y
+ add hl, de
+ push hl
+ pop de ; de = pos y
+ pop hl
+
+ ; hl = oam ptr again
+
+ ; deal with y position
+ push bc
+ push af
+
+ ; get y offset
+ and a, 0xF0
+ swap a ; a = y offset
+ ld b, a
+ ld a, [de]
+ add a, b ; a = y postion
+ ld b, a
+ ld a, [scroll_y]
+ add a, b
+
+ ; TODO: deal with row offset
+
+
+ inc de ; de = x pos
+
+ ld [hl+], a
+
+ pop af
+
+ ; deal with x position
+
+ and a, 0xF ; a = x offset
+ ld b, a
+ ld a, [de]
+ add a, b ; b = x position
+
+ ld [hl+], a
+
+ pop bc
+
+ ; tile
+ ld a, b
+ ld [hl+], a
+
+ ; oam flags
+ ld a, c
+ ld [hl+], a
+
+
ret
; sets up the player actor
player_init:
; initial position
- ld a, 232
+ ld a, 132
ld [player+act_pos_y], a
- ld a, 64
+ ld a, 24
ld [player+act_pos_x], a
ret
player_update:
ret
-#define PLAYER_SPRITE_IDLE1 0x8A
+#define PLAYER_SPRITE_IDLE1 0x88
; draws the special player actor
player_draw:
ld a, 0
call actor_draw
+ ld de, player
+ ld b, PLAYER_SPRITE_IDLE1+2
+ ld c, 0
+ ld a, 8
+ call actor_draw
ret