Prev: 696A Up: Map Next: 6B31
6A23: Routine at 6A23
Used by the routine at 7616.
6A23 LD DE,$40CF DE=40CF (screen buffer location).
6A26 PUSH DE Stash DE on the stack.
6A27 LD HL,$6541 HL=6541.
6A2A LD BC,$0232 BC=0232.
6A2D CALL CustomFont_PrintString Call CustomFont_PrintString.
6A30 POP HL Restore HL from the stack.
6A31 LD A,($66D4) A=*66D4.
6A34 PUSH AF Stash AF on the stack.
6A35 SRA A Shift A right (with carry).
6A37 AND %00000111 Keep only bits 0-2.
6A39 XOR %00000111 Flip bits 0-2.
6A3B ADD A,H A+=H.
6A3C LD H,A H=A.
6A3D LD (HL),$03 Write 03 to *HL.
6A3F INC HL Increment HL by one.
6A40 LD (HL),$C0 Write C0 to *HL.
6A42 POP AF Restore AF from the stack.
6A43 AND %00000011 Keep only bits 0-1.
6A45 JR NZ,$6A69 Jump to 6A69 if HL is not equal to 00.
6A47 LD HL,$4837 HL=4837 (screen buffer location).
6A4A LD DE,$4838 DE=4838 (screen buffer location).
6A4D LD B,$08 B=08.
6A4F PUSH BC Stash BC on the stack.
6A50 LD A,(DE) A=*DE.
6A51 PUSH HL Stash HL and DE on the stack.
6A52 PUSH DE
6A53 LD BC,$0011 BC=0011.
6A56 LDDR LDDR.
6A58 LD (DE),A Write A to *DE.
6A59 POP DE Restore DE and HL from the stack.
6A5A POP HL
6A5B INC H Increment H by one.
6A5C INC D Increment D by one.
6A5D POP BC Restore BC from the stack.
6A5E DJNZ $6A4F Decrease counter by one and loop back to 6A4F until counter is zero.
6A60 LD D,$59 D=59.
6A62 LD H,D H=D.
6A63 LD C,$11 C=11.
6A65 LD A,(DE) A=*DE.
6A66 LDDR LDDR.
6A68 LD (DE),A Write A to *DE.
6A69 LD HL,$66D4 HL=66D4.
6A6C LD A,(HL) A=*HL.
6A6D INC (HL) Increment *HL by one.
6A6E AND %00001111 Keep only bits 0-3.
6A70 JR NZ,$6A99 Jump to 6A99 if *HL is not equal to 11.
6A72 BIT 4,(HL) Test bit 4 of *HL.
6A74 LD HL,$5FD4 HL=Graphics_MothershipAlien_01.
6A77 JR Z,$6A7C Jump to 6A7C if *HL is equal to 11.
6A79 LD HL,$5FF4 HL=Graphics_MothershipAlien_02.
6A7C LD DE,$40EF DE=40EF (screen buffer location).
6A7F LD B,$02 B=02.
6A81 PUSH BC Stash BC on the stack.
6A82 LD B,$02 B=02.
6A84 PUSH BC Stash BC and DE on the stack.
6A85 PUSH DE
6A86 LD B,$08 Set a line counter in B (08 lines in a UDG).
6A88 LD A,(HL) Copy the UDG data to the screen buffer.
6A89 LD (DE),A
6A8A INC D Move down one pixel line in the screen buffer.
6A8B INC HL Move to the next UDG graphic data byte.
6A8C DJNZ $6A88 Decrease the line counter by one and loop back to 6A88 until all 08 lines of the UDG character have been drawn.
6A8E POP DE Restore DE from the stack.
6A8F INC DE Increment DE by one.
6A90 POP BC Restore BC from the stack.
6A91 DJNZ $6A84 Decrease counter by one and loop back to 6A84 until counter is zero.
6A93 LD DE,$480F DE=480F (screen buffer location).
6A96 POP BC Restore BC from the stack.
6A97 DJNZ $6A81 Decrease counter by one and loop back to 6A81 until counter is zero.
6A99 LD A,($6695) Return if *6695 is not zero.
6A9C OR A
6A9D RET NZ
6A9E LD HL,$0003 HL=0003.
6AA1 PUSH HL Stash HL on the stack.
6AA2 PUSH HL IX=HL (using the stack).
6AA3 POP IX
6AA5 LD BC,$66BA BC=66BA.
6AA8 ADD HL,HL HL+=HL.
6AA9 ADD HL,BC HL+=BC.
6AAA PUSH HL Stash HL on the stack.
6AAB LD E,(HL) E=*HL.
6AAC INC HL Increment HL by one.
6AAD LD D,(HL) D=*HL.
6AAE LD A,D A=D.
6AAF EX DE,HL Exchange the DE and HL registers.
6AB0 OR A Jump to 6AC9 if A is not zero.
6AB1 JR NZ,$6AC9
6AB3 CALL $670E Call 670E.
6AB6 AND %00001111 Keep only bits 0-3.
6AB8 OR A Set the bits from A.
6AB9 JR NZ,$6AC0 Jump to 6AC0 if HL is not equal to A.
6ABB LD HL,$594F HL=594F (attribute buffer location).
6ABE JR $6AF2 Jump to 6AF2.
6AC0 CP $03 Jump to 6B25 if A is not equal to 03.
6AC2 JR NZ,$6B25
6AC4 LD HL,$5950 HL=5950 (attribute buffer location).
6AC7 JR $6AF2 Jump to 6AF2.
6AC9 LD A,(HL) A=*HL.
6ACA AND %01000111 Keep only bits 0-2, 6.
6ACC CP $06 Jump to 6AE0 if A is not equal to 06.
6ACE JR NZ,$6AE0
6AD0 LD A,(HL) A=*HL.
6AD1 AND %11111000 Keep only bits 3-7.
6AD3 LD (HL),A Write A to *HL.
6AD4 PUSH HL Stash HL on the stack.
6AD5 CALL ConvertAttributeToScreenBufferAddress Call ConvertAttributeToScreenBufferAddress.
6AD8 LD B,$08 B=08.
6ADA XOR A Write 00 to *HL.
6ADB LD (HL),A
6ADC INC H Increment H by one.
6ADD DJNZ $6ADB Decrease counter by one and loop back to 6ADB until counter is zero.
6ADF POP HL Restore HL from the stack.
6AE0 LD BC,$0020 HL+=0020.
6AE3 ADD HL,BC
6AE4 PUSH HL Stash HL on the stack.
6AE5 LD BC,$5AFF BC=5AFF (attribute buffer location).
6AE8 AND A HL-=BC.
6AE9 SBC HL,BC
6AEB POP HL Restore HL from the stack.
6AEC JR C,$6AF2 Jump to 6AF2 if H is less than A.
6AEE LD H,$00 H=00.
6AF0 JR $6B25 Jump to 6B25.
6AF2 LD A,(HL) Jump to 6B25 if *HL is equal to 02.
6AF3 CP $02
6AF5 JR Z,$6B25
6AF7 CP $46 Jump to 6B05 if *HL is not equal to 46.
6AF9 JR NZ,$6B05
6AFB LD A,($6693) Jump to 6AEE if *6693 is not zero.
6AFE OR A
6AFF JR NZ,$6AEE
6B01 LD (HL),$06 Write 06 to *HL.
6B03 JR $6B0D Jump to 6B0D.
6B05 AND %00000111 Keep only bits 0-2.
6B07 JR NZ,$6AEE Jump to 6AEE if A is not equal to A.
6B09 LD A,(HL) A=*HL.
6B0A ADD A,$06 A+=06.
6B0C LD (HL),A Write A to *HL.
6B0D PUSH HL Stash HL on the stack.
6B0E CALL ConvertAttributeToScreenBufferAddress Call ConvertAttributeToScreenBufferAddress.
6B11 EX DE,HL Exchange the DE and HL registers.
6B12 LD BC,$6026 BC=Graphics_LivesIcon.
6B15 PUSH IX HL=IX (using the stack).
6B17 POP HL
6B18 ADD HL,HL Multiply HL by 08.
6B19 ADD HL,HL
6B1A ADD HL,HL
6B1B ADD HL,BC HL+=BC.
6B1C LD B,$08 Set a line counter in B (08 lines in a UDG).
6B1E LD A,(HL) Copy the UDG data to the screen buffer.
6B1F LD (DE),A
6B20 INC D Move down one pixel line in the screen buffer.
6B21 INC HL Move to the next UDG graphic data byte.
6B22 DJNZ $6B1E Decrease the line counter by one and loop back to 6B1E until all 08 lines of the UDG character have been drawn.
6B24 POP HL Restore HL from the stack.
6B25 EX DE,HL Exchange the DE and HL registers.
6B26 POP HL Restore HL from the stack.
6B27 LD (HL),E Write E to *HL.
6B28 INC HL Increment HL by one.
6B29 LD (HL),D Write D to *HL.
6B2A INC HL Increment HL by one.
6B2B POP HL Restore HL from the stack.
6B2C DEC L Decrease L by one.
6B2D JP NZ,$6AA1 Jump to 6AA1 if L is not equal to A.
6B30 RET Return.
Prev: 696A Up: Map Next: 6B31