Prev: A1ED Up: Map Next: A25C
A1F4: Print Compressed String
Prints a compressed text string using a dictionary lookup.
Input
HL Messaging string ID
PrintCompressedString A1F4 PUSH IX Stash IX, HL, DE, BC and AF on the stack.
A1F6 PUSH HL
A1F7 PUSH DE
A1F8 PUSH BC
A1F9 PUSH AF
A1FA ADD HL,HL Double the messaging string ID held in HL.
A1FB EX DE,HL Add the result to Table_MessagingOffsets.
A1FC LD IX,$CA2B
A200 ADD IX,DE
A202 LD L,(IX+$00) Fetch the address from the string pointer table and store it in HL.
A205 LD H,(IX+$01)
A208 LD DE,$C8E9 HL+=Data_Strings.
A20B ADD HL,DE
A20C JR PrintCompressedString_4 Jump to PrintCompressedString_4.
PrintCompressedString_0 A20E CP $60 Jump to PrintCompressedString_1 if A is less than 60.
A210 JR C,PrintCompressedString_1
A212 CALL PrintCompressedString_5 Call PrintCompressedString_5.
A215 JR PrintCompressedString_3 Jump to PrintCompressedString_3.
PrintCompressedString_1 A217 ADD A,$20 A+=20.
A219 CP $7E Jump to PrintCompressedString_2 if A is not equal to 7E.
A21B JR NZ,PrintCompressedString_2
A21D LD A,$0D A=0D.
PrintCompressedString_2 A21F CALL PrintCharacter Call PrintCharacter.
PrintCompressedString_3 A222 INC HL Increment HL by one.
PrintCompressedString_4 A223 LD A,(HL) A=*HL.
A224 CP $5F Jump to PrintCompressedString_0 if A is not equal to 5F.
A226 JR NZ,PrintCompressedString_0
A228 POP AF Restore AF, BC, DE, HL and IX from the stack.
A229 POP BC
A22A POP DE
A22B POP HL
A22C POP IX
A22E RET Return.
PrintCompressedString_5 A22F PUSH HL Stash HL, DE and BC on the stack.
A230 PUSH DE
A231 PUSH BC
A232 SUB $60 A-=60.
A234 LD L,A Create an offset in HL using A.
A235 LD H,$00
A237 ADD HL,HL Double the offset held in HL.
A238 LD DE,$C8EB HL+=C8EB.
A23B ADD HL,DE
A23C LD B,$02 B=02.
A23E JR PrintCompressedString_7 Jump to PrintCompressedString_7.
PrintCompressedString_6 A240 INC HL Increment HL by one.
PrintCompressedString_7 A241 LD A,(HL) A=*HL.
A242 CP $60 Jump to PrintCompressedString_8 if A is less than 60.
A244 JR C,PrintCompressedString_8
A246 CALL PrintCompressedString_5 Call PrintCompressedString_5.
A249 JR PrintCompressedString_10 Jump to PrintCompressedString_10.
PrintCompressedString_8 A24B ADD A,$20 A+=20.
A24D CP $7E Jump to PrintCompressedString_9 if A is not equal to 7E.
A24F JR NZ,PrintCompressedString_9
A251 LD A,$0D A=0D.
PrintCompressedString_9 A253 CALL PrintCharacter Call PrintCharacter.
PrintCompressedString_10 A256 DJNZ PrintCompressedString_6 Decrease counter by one and loop back to PrintCompressedString_6 until counter is zero.
A258 POP BC Restore BC, DE and HL from the stack.
A259 POP DE
A25A POP HL
A25B RET Return.
Prev: A1ED Up: Map Next: A25C