Prev: B9A7 Up: Map Next: BAC2
BA34: Show the carried things on the panel, if they have changed
Used by the routine at RENDER_DYNAMIC_OBJECTS.
Called every turn by RENDER_DYNAMIC_OBJECTS; it acts only when PANEL_DUE is set, as TAKE_OR_LEAVE sets it when what he carries changes. The main loop comes in at SHOW_CARRIED_NOW on entering a room, to draw them regardless.
The panel shows three of the four carried entries, CARRIED_SHOWN's two and CARRIED_LAST (four bytes each: the graphic first), in three boxes 24 pixels square along the bottom of the screen, at pixel x 16, 40 and 64. For each, the box is cleared in the screen buffer, the thing's sprite drawn there through the spare record at PANEL_RECORD (DRAW_SPRITE in DRAW_OBJECT, with no projection, and no flip bits so the sprite is turned back to face its stored way), and the box copied to the screen (BLIT_TO_SCREEN); then its three by three attribute cells are coloured by the graphic's low three bits, from CARRIED_COLOURS. An empty entry is cleared, and coloured as if graphic 0.
SHOW_CARRIED BA34 LD A,(PANEL_DUE) nothing has changed; or clear the flag
BA37 AND A
BA38 RET Z
BA39 XOR A
BA3A LD (PANEL_DUE),A
This entry point is used by the routine at OBJECT_DONE.
SHOW_CARRIED_NOW BA3D PUSH IX IX = the spare record; three boxes; HL = the first entry shown
BA3F LD IX,PANEL_RECORD
BA43 LD B,$03
BA45 LD HL,CARRIED_SHOWN
SHOW_CARRIED_0 BA48 PUSH BC the box's pixel x: 16 + 24 times its number
BA49 PUSH HL
BA4A LD A,B
BA4B NEG
BA4D ADD A,$03
BA4F SLA A
BA51 SLA A
BA53 SLA A
BA55 LD C,A
BA56 SLA A
BA58 ADD A,C
BA59 ADD A,$10
BA5B LD (IX+$1A),A
BA5E LD (IX+$1B),$00 pixel y 0: the bottom of the screen
BA62 LD C,(IX+$1A) clear three bytes by 24 rows of the buffer
BA65 LD B,(IX+$1B)
BA68 PUSH HL
BA69 CALL CALC_VIDBUF_ADDR
BA6C LD L,C
BA6D LD H,B
BA6E LD BC,$0318
BA71 XOR A
BA72 CALL FILL_RECT
BA75 POP HL something there: its sprite into the buffer
BA76 LD A,(HL)
BA77 AND A
BA78 JR Z,SHOW_CARRIED_1
BA7A LD (IX+$00),A
BA7D CALL DRAW_SPRITE
SHOW_CARRIED_1 BA80 LD C,(IX+$1A) copy the box from the buffer to the screen
BA83 LD B,(IX+$1B)
BA86 CALL CALC_VRAM_ADDR
BA89 CALL CALC_VIDBUF_ADDR
BA8C LD L,C
BA8D LD H,B
BA8E LD BC,$1803
BA91 CALL BLIT_TO_SCREEN
BA94 POP HL C = the colour for the entry's graphic
BA95 POP BC
BA96 PUSH BC
BA97 PUSH HL
BA98 LD A,(HL)
BA99 AND $07
BA9B LD E,A
BA9C LD D,$00
BA9E LD HL,CARRIED_COLOURS
BAA1 ADD HL,DE
BAA2 LD C,(HL)
BAA3 LD L,(IX+$1A) DE = the attribute address of the box's top row
BAA6 LD A,(IX+$1B)
BAA9 ADD A,$17
BAAB LD H,A
BAAC CALL CALC_ATTRIB_ADDR
BAAF EX DE,HL colour three cells by three
BAB0 LD A,C
BAB1 LD BC,$0303
BAB4 CALL FILL_RECT
BAB7 POP HL the next entry, four bytes on
BAB8 POP BC
BAB9 INC HL
BABA INC HL
BABB INC HL
BABC INC HL
BABD DJNZ SHOW_CARRIED_0
BABF POP IX IX back
BAC1 RET
Prev: B9A7 Up: Map Next: BAC2