Prev: 714C Up: Map Next: 7192
716C: Print String
Used by the routines at PlayerReset, GameMenu and PrintBanner.
Input
DE Pointer to string data
PrintString 716C PUSH HL Stash HL on the stack.
716D CALL ScreenAddress Call ScreenAddress.
7170 LD A,(DE) Fetch the attribute byte.
7171 EX AF,AF' Switch to the shadow AF register.
7172 INC DE Increment DE by one to point to the text of the string.
7173 EXX Switch to the shadow registers.
7174 POP HL Restore HL' from the stack.
7175 CALL AttributeAddress Call AttributeAddress.
This entry point is used by the routine at PrintMenuItem.
PrintString_Loop 7178 EXX Switch back to the normal registers.
7179 LD A,(DE) Fetch the character to print.
717A BIT 7,A If bit 7 is set (which signifies the end of the string), jump to PrintString_LastCharacter.
717C JR NZ,PrintString_LastCharacter
717E CALL PrintScreen Call PrintScreen.
7181 INC DE Increment DE by one.
7182 EXX Switch to the shadow registers.
7183 EX AF,AF' Switch to the shadow AF register.
7184 LD (HL),A Copy the attribute byte to the screen.
7185 INC L Increment L by one.
7186 EX AF,AF' Switch to the shadow AF register.
7187 JR PrintString_Loop Jump to PrintString_Loop.
Because the last character contains the terminator, it needs to be handled separately.
PrintString_LastCharacter 7189 AND %01111111 Keep only bits 0-6 (i.e. strip the bit 7 terminator).
718B CALL PrintScreen Call PrintScreen.
718E EXX Switch to the shadow registers.
718F EX AF,AF' Switch to the shadow AF register.
7190 LD (HL),A Copy the attribute byte to the screen.
7191 RET Return.
View the equivalent code in;
Prev: 714C Up: Map Next: 7192