Prev: D70C Up: Map Next: D7C6
D763: Handler: Bonus
Used by the routine at D352.
Handler_Bonus D763 LD A,($E75D) A=*Tile_Horizontal_Position.
D766 DEC A Decrease A by one.
D767 LD B,A B=A.
D768 LD A,($E75E) A=*Tile_Vertical_Position.
D76B DEC A Decrease A by one.
D76C LD C,A C=A.
D76D CALL Calculate_ScreenBlockAddress Call Calculate_ScreenBlockAddress.
D770 CALL Calculate_AttributeAddress Call Calculate_AttributeAddress.
D773 PUSH DE Stash DE on the stack.
D774 LD IX,($D88E) IX=*D88E.
D778 LD DE,$B765 IX+=GraphicsData_Items_02.
D77B ADD IX,DE
D77D LD D,$04 Set a counter in D for 04 rows.
Handler_Bonus_0 D77F PUSH BC Stash the co-ordinates on the stack.
D780 LD B,$08 Set a counter in B for 08 columns.
Handler_Bonus_1 D782 PUSH BC Stash the column counter on the stack.
D783 LD B,$04 Set a counter in B for 04 bytes per character.
D785 PUSH HL Stash the screen position on the stack.
Handler_Bonus_2 D786 LD A,(IX+$00) Write a byte from the object data to the screen buffer position.
D789 LD (HL),A
D78A INC IX Increment the object data pointer by one.
D78C INC HL Increment the screen position by one.
D78D DJNZ Handler_Bonus_2 Decrease the object byte counter by one and loop back to Handler_Bonus_2 until counter is zero.
D78F POP HL Restore the original screen position for this row from the stack.
D790 INC H Increment H by one.
D791 LD BC,$0010 IX+=0010.
D794 ADD IX,BC
D796 POP BC Restore the column counter from the stack.
D797 DJNZ Handler_Bonus_1 Decrease the column counter by one and loop back to Handler_Bonus_1 until the column counter is zero.
D799 POP BC Restore the co-ordinates from the stack.
D79A INC B Increment B by one.
D79B CALL Calculate_ScreenBlockAddress Call Calculate_ScreenBlockAddress.
D79E DEC D Decrease D by one.
D79F JR NZ,Handler_Bonus_0 Jump to Handler_Bonus_0 if D is not zero.
D7A1 LD IX,($D890) IX=*D890.
D7A5 LD DE,$B765 IX+=GraphicsData_Items_02.
D7A8 ADD IX,DE
D7AA POP HL Restore HL from the stack.
D7AB LD B,$04 B=04.
D7AD LD DE,$001C DE=001C.
Handler_Bonus_3 D7B0 PUSH BC Stash BC on the stack.
D7B1 LD B,$04 B=04.
Handler_Bonus_4 D7B3 LD A,(IX+$00) Write *IX+00 to *HL.
D7B6 LD (HL),A
D7B7 INC IX Increment IX by one.
D7B9 INC HL Increment HL by one.
D7BA DJNZ Handler_Bonus_4 Decrease counter by one and loop back to Handler_Bonus_4 until counter is zero.
D7BC ADD HL,DE HL+=DE.
D7BD LD BC,$0010 IX+=0010.
D7C0 ADD IX,BC
D7C2 POP BC Restore BC from the stack.
D7C3 DJNZ Handler_Bonus_3 Decrease counter by one and loop back to Handler_Bonus_3 until counter is zero.
D7C5 RET Return.
Prev: D70C Up: Map Next: D7C6