Prev: 9FFB Up: Map Next: A064
A00E: Note where a thing is, then draw it
Used by the routines at DRAW_LIST and DRAW_TITLE_ICONS.
Copies the position out of the record into $5E16 and $5E17 before falling into the drawing proper. Those two are what the erase pass reads to find where something was last frame, so recording them here is what lets the next pass rub it out cleanly.
Input
IX The thing to draw
WORKSPACE_AND_DRAW A00E LD A,(IX+$03) Where it is now...
A011 LD ($5E16),A
A014 LD A,(IX+$04) ...kept for the pass that will erase it.
A017 LD ($5E17),A
This entry point is used by the routines at SPIN_SPELL, MOVE_FACE, UPDATE_KNIGHT, DRAW_AT_POSITION and REMEMBER_CARRIED.
DRAW_FROM_RECORD A01A LD L,(IX+$03)
A01D LD H,(IX+$04)
A020 LD D,(IX+$05)
A023 LD A,($5E1A)
A026 LD E,A
A027 LD A,($5E10)
A02A LD B,A
A02B LD A,($5E11)
A02E RRCA
A02F RRCA
A030 INC A
A031 RRCA
A032 AND $1F
A034 INC A
A035 LD C,A
A036 PUSH BC
A037 LD B,$00
A039 LD A,($5E16)
A03C CP L
A03D JR Z,WORKSPACE_AND_DRAW_1
A03F JR C,WORKSPACE_AND_DRAW_0
A041 INC B
WORKSPACE_AND_DRAW_0 A042 INC B
WORKSPACE_AND_DRAW_1 A043 LD A,($5E17)
A046 CP H
A047 LD A,B
A048 JR Z,WORKSPACE_AND_DRAW_3
A04A JR C,WORKSPACE_AND_DRAW_2
A04C ADD A,$04
WORKSPACE_AND_DRAW_2 A04E ADD A,$04
WORKSPACE_AND_DRAW_3 A050 LD B,A
A051 CALL PIXEL_TO_ATTR
A054 LD A,B
A055 POP BC
A056 PUSH HL
A057 LD HL,COLOUR_FILLERS
A05A SLA A
A05C CALL ADD_A_TO_HL
A05F LD A,(HL)
A060 INC HL
A061 LD H,(HL)
A062 LD L,A
A063 JP (HL)
Prev: 9FFB Up: Map Next: A064