Prev: 8B1B Up: Map Next: 8B3C
8B1E: Render a sprite at position from previous_object_coordinates.
Selects the pre-shifted sprite frame based on X position bits 1-2 (4 frames at 2-pixel alignment intervals) and renders it.
Input
A Sprite width in tiles
BC Sprite frame size
D Sprite height in pixels
E Screen attributes
HL Pointer to the sprite array
render_sprite 8B1E PUSH DE Save attributes/height, store sprite width.
8B1F LD ($8B1A),A
8B22 LD DE,($8B0A) Calculate animation frame index from X position bits 1-2.
8B26 LD A,E
8B27 AND $07
8B29 SRL A
8B2B INC A
8B2C PUSH HL Prepare for frame calculation loop.
8B2D OR A
8B2E SBC HL,BC
render_sprite_frame_loop 8B30 ADD HL,BC Add frame offset to sprite pointer, loop until done.
8B31 DEC A
8B32 JR NZ,render_sprite_frame_loop
8B34 LD ($8B0E),HL Store result to render_sprite_ptr.
8B37 POP HL Reload width and restore attributes/height, fall through to render_object.
8B38 LD A,($8B1A)
8B3B POP DE
Prev: 8B1B Up: Map Next: 8B3C