Prev: BF2C Up: Map Next: BF87
BF35: Unused: Draw 3-Wide Sprite With Attributes
Unused alternative routine to draw a 3-wide sprite and apply its attributes in a single pass.
Unused_Draw_3Wide BF35 PUSH DE Copy DE to IX.
BF36 POP IX
BF38 LD L,(IX+$00) Load the screen address low byte from *IX+00.
BF3B INC IX Advance IX.
BF3D LD H,(IX+$00) Load the screen address high byte from *IX+00.
BF40 PUSH HL Stash the screen address on the stack.
BF41 INC IX Advance IX.
BF43 LD A,(IX+$00) Load the width flag from *IX+00.
BF46 INC IX Advance IX.
BF48 PUSH IX Copy IX to DE.
BF4A POP DE Advance DE past the data header.
BF4B INC DE
BF4C LD C,$07 Set the row boundary mask to 07 in C.
BF4E OR A Jump to Unused_Draw_3Wide_1Col if the width flag is zero (one column wide).
BF4F JR Z,$BF6F
Draw two columns per row.
BF51 LD B,$08 Set the row counter to 08 in B.
Unused_Draw_3Wide_Row_Loop BF53 LD A,(DE) OR the sprite data byte from *DE onto the first screen column at *HL.
BF54 OR (HL)
BF55 LD (HL),A
BF56 INC L Advance to the next column and OR the next byte onto the second column.
BF57 INC DE
BF58 LD A,(DE)
BF59 OR (HL)
BF5A LD (HL),A
BF5B DEC L Move back to the first column and advance the sprite data pointer.
BF5C INC DE
BF5D INC H Move down one pixel row in the screen buffer.
BF5E LD A,H Check if the pixel row has crossed a character boundary.
BF5F AND C
BF60 CALL Z,$BD85 Call BD67 to adjust the screen address if needed.
BF63 DJNZ $BF53 Decrease the row counter and loop back to Unused_Draw_3Wide_Row_Loop until all 08 rows are drawn.
Apply attributes for the 3-wide sprite (two columns).
BF65 LD D,$01 Set D to 01 (flag: two columns wide).
BF67 POP HL Restore the screen address from the stack.
BF68 LD E,(IX+$00) Load the sprite X position from *IX+00 into E.
BF6B CALL $BF87 Call Unused_Apply_3Wide_Attributes to apply the sprite attributes.
BF6E RET Return.
Draw one column per row.
Unused_Draw_3Wide_1Col BF6F LD B,$08 Set the row counter to 08 in B.
Unused_Draw_3Wide_1Col_Loop BF71 LD A,(DE) OR the sprite data byte from *DE onto the screen at *HL.
BF72 OR (HL)
BF73 LD (HL),A
BF74 INC H Move down one pixel row in the screen buffer.
BF75 LD A,H Check if the pixel row has crossed a character boundary.
BF76 AND C
BF77 CALL Z,$BD85 Call BD67 to adjust the screen address if needed.
BF7A INC DE Advance the sprite data pointer.
BF7B DJNZ $BF71 Decrease the row counter and loop back to Unused_Draw_3Wide_1Col_Loop until all 08 rows are drawn.
Apply attributes for the 3-wide sprite (one column).
BF7D POP HL Restore the screen address from the stack.
BF7E LD E,(IX+$00) Load the sprite X position from *IX+00 into E.
BF81 LD D,$00 Set D to 00 (flag: one column wide).
BF83 CALL $BF87 Call Unused_Apply_3Wide_Attributes to apply the sprite attributes.
BF86 RET Return.
Prev: BF2C Up: Map Next: BF87