Prev: B560 Up: Map Next: B77B
B715: Print Colour String
Used by the routines at PrintEarnings and PrintString.
Input
C Attribute colour
PrintStringColour B715 PUSH AF Stash AF, IX, HL, BC and DE on the stack.
B716 PUSH IX
B718 PUSH HL
B719 PUSH BC
B71A PUSH DE
B71B EX DE,HL Exchange the DE and HL registers.
B71C PUSH HL Stash HL on the stack.
B71D LD D,$58 D=58.
B71F LD E,L E=L.
B720 LD L,H L=H.
B721 LD H,$00 H=00.
B723 ADD HL,HL
B724 ADD HL,HL
B725 ADD HL,HL
B726 ADD HL,HL
B727 ADD HL,HL
B728 ADD HL,DE
B729 LD (HL),C
B72A PUSH DE Stash DE on the stack.
B72B LD DE,$0020 HL+=0020.
B72E ADD HL,DE
B72F POP DE Restore DE from the stack.
B730 LD (HL),C Write C to *HL.
B731 POP HL Restore HL from the stack.
B732 LD L,H L=H.
B733 LD D,$00 D=00.
B735 LD H,D H=D.
B736 LD C,E C=E.
B737 LD B,D B=D.
B738 ADD HL,HL HL*=10.
B739 ADD HL,HL
B73A ADD HL,HL
B73B ADD HL,HL
B73C LD DE,$81F8 BC=ScreenBuffer_Locations.
B73F ADD HL,DE
B740 PUSH HL
B741 POP IX
B743 LD L,A
B744 LD H,$00
B746 ADD HL,HL
B747 ADD HL,HL
B748 ADD HL,HL
B749 LD DE,$DFDC HL+=Font.
B74C ADD HL,DE
B74D EX DE,HL
B74E LD A,$08
PrintStringColour_0 B750 LD L,(IX+$00)
B753 LD H,(IX+$01)
B756 ADD HL,BC
B757 INC IX
B759 INC IX
B75B EX DE,HL
B75C LDI
B75E EX DE,HL
B75F INC BC
B760 LD L,(IX+$00)
B763 LD H,(IX+$01)
B766 ADD HL,BC
B767 INC IX
B769 INC IX
B76B DEC DE
B76C EX DE,HL
B76D LDI
B76F EX DE,HL
B770 INC BC
B771 DEC A
B772 JR NZ,PrintStringColour_0
B774 POP DE Restore DE, BC, HL, IX and AF from the stack.
B775 POP BC
B776 POP HL
B777 POP IX
B779 POP AF
B77A RET Return.
Prev: B560 Up: Map Next: B77B