Prev: 9132 Up: Map Next: 91AC
915F: Creates and prints a factoring message.
Used by the routine at Locker_DisplayMsg.
Input
STACK Holds addrees of string
Print_FactorMessage 915F POP HL Get address from stack.
9160 LD DE,Terminal_Buffer Copy string into buffer.
9163 LD A,$5E
Print_FactorMessage_0 9165 CP (HL)
9166 JR Z,Print_FactorMessage_1
9168 LDI
916A JR Print_FactorMessage_0
Print_FactorMessage_1 916C INC HL Put address after string onto stack as return address.
916D PUSH HL
916E LD A,$2B Replace end of string with a newline character.
9170 LD (DE),A
9171 INC DE
9172 LD C,(IX+$02) Get index of locker message belongs to.
9175 LD B,$00
9177 LD HL,(Handle_Lockers) Use index to get address of locker.
917A ADD HL,BC
917B LD B,$05 Number of slots in a Factor.
Print_FactorMessage_2 917D LD A,(HL) Get object index from next slot.
917E AND A Ignore slot if empty.
917F JR Z,Print_FactorMessage_5
9181 LD A,$2B Start with a newline for next character.
9183 LD (DE),A
9184 INC DE
9185 LD A,$A0 Add a gap to the buffer string.
9187 LD (DE),A
9188 INC DE
9189 LD A,(HL) Get the string for the object in the slot.
918A PUSH BC
918B PUSH HL
918C PUSH DE
918D CALL ObjStr_FindByIndex
9190 POP DE
Print_FactorMessage_3 9191 LD A,(HL) Copy string into buffer.
9192 CP $5E
9194 JR Z,Print_FactorMessage_4
9196 CP $2B
9198 JR Z,Print_FactorMessage_4
919A LDI
919C JR Print_FactorMessage_3
Print_FactorMessage_4 919E POP HL Repeat for next slot.
919F INC HL
91A0 POP BC
91A1 DJNZ Print_FactorMessage_2
Print_FactorMessage_5 91A3 LD A,$5E Put an end of string at the end.
91A5 LD (DE),A
91A6 LD HL,Terminal_Buffer Now print it.
91A9 JP Message_ClearIfNoPlans
Prev: 9132 Up: Map Next: 91AC