Prev: 29800 Up: Map Next: 29870
29832: Print String
Used by the routines at 24545, GameMenu, GameOver_1UP and PrintBanner.
Input
DE Pointer to string data
PrintString 29832 PUSH HL Stash HL on the stack.
29833 CALL ScreenAddress Call ScreenAddress.
29836 LD A,(DE) Fetch the attribute byte.
29837 EX AF,AF' Switch to the shadow AF register.
29838 INC DE Increment DE by one to point to the text of the string.
29839 EXX Switch to the shadow registers.
29840 POP HL Restore HL from the stack.
29841 CALL AttributeAddress Call AttributeAddress.
This entry point is used by the routine at MenuWriteText.
PrintString_Loop 29844 EXX Switch back to the normal registers.
29845 LD A,(DE) Fetch the character to print.
29846 BIT 7,A If bit 7 is set (which signifies the end of the string), jump to PrintString_LastCharacter.
29848 JR NZ,PrintString_LastCharacter
29850 CALL PrintScreen Call PrintScreen.
29853 INC DE Increment DE by one.
29854 EXX Switch to the shadow registers.
29855 EX AF,AF' Switch to the shadow AF register.
29856 LD (HL),A Copy the attribute byte to the screen.
29857 INC L Increment L by one.
29858 EX AF,AF' Switch to the shadow AF register.
29859 JR PrintString_Loop Jump to PrintString_Loop.
Because the last character contains the terminator, it needs to be handled separately.
PrintString_LastCharacter 29861 AND %01111111 Keep only bits 0-6 (i.e. strip the bit 7 terminator).
29863 CALL PrintScreen Call PrintScreen.
29866 EXX Switch to the shadow registers.
29867 EX AF,AF' Switch to the shadow AF register.
29868 LD (HL),A Copy the attribute byte to the screen.
29869 RET Return.
Prev: 29800 Up: Map Next: 29870