Prev: 34684 Up: Map Next: 35016
34967: AnimateCrewA
Animates marker channel A — the walking crew figure that marks the viewed room on the deck map (placed by PlaceRoomMarkerA 35101). Skips if bit 7 of the animation-freeze flag at 31263 is set. Decrements the frame counter at 33739; when it reaches zero, resets the counter to 10 and XOR-blits two consecutive 3×12-byte sprite frames from the animation table at 26853 (indexed by the frame phase in 31263 bits 0-1) onto the display at the address stored in SprDestA (33686). Calling this routine twice per frame (once to erase, once to draw the next frame) produces flicker-free sprite animation via double-buffered XOR.
Input
Used by the routines at 36457, 38379 and 42821.
34967 LD A,(31263) A = animation-freeze / frame-phase byte (31263)
34970 BIT 7,A bit 7 = freeze flag
34972 RET NZ frozen: skip animation this frame
34973 LD HL,33691 HL = frame counter A (33739)
34976 DEC (HL) tick down counter
34977 RET NZ not expired: nothing to do
34978 LD (HL),10 reset counter to 10 frames per phase
34980 LD B,2 draw 2 sprite rows
This entry point is used by the routines at 35016 and 42821.
34982 PUSH BC save row counter
34983 LD E,A E = frame phase (0-3)
34984 LD D,0
34986 LD HL,26853 HL = base of crew-A animation table (26853)
34989 ADD HL,DE index by phase × 2
34990 ADD HL,DE
34991 LD A,(HL) read 16-bit sprite bitmap pointer
34992 INC HL
34993 LD H,(HL)
34994 LD L,A HL = pointer to 3-byte sprite row data
34995 EX DE,HL DE = sprite data source
34996 LD HL,(33686) HL = screen destination address (33686)
34999 CALL 35065 XOR-blit 3 bytes × 12 rows onto screen
35002 POP BC restore row counter
35003 DEC B
35004 RET Z done after 2 rows
35005 LD A,(31263) advance to next frame phase
35008 INC A
35009 AND 3 wrap phase 0-3
35011 LD (31263),A store updated phase
35014 JR 34982 blit second sprite row
Prev: 34684 Up: Map Next: 35016