Prev: 73CD Up: Map Next: 7413
73ED: Print String
Used by the routines at DrawPlayArea, GameOver1UP, GameMenu and PrintBanner.
Input
DE Pointer to string data
PrintString 73ED PUSH HL Stash HL on the stack.
73EE CALL ScreenAddress Call ScreenAddress.
73F1 LD A,(DE) Fetch the attribute byte.
73F2 EX AF,AF' Switch to the shadow AF register.
73F3 INC DE Increment DE by one to point to the text of the string.
73F4 EXX Switch to the shadow registers.
73F5 POP HL Restore HL' from the stack.
73F6 CALL AttributeAddress Call AttributeAddress.
This entry point is used by the routine at MenuWriteText.
PrintString_Loop 73F9 EXX Switch back to the normal registers.
73FA LD A,(DE) Fetch the character to print.
73FB BIT 7,A If bit 7 is set (which signifies the end of the string), jump to PrintString_LastCharacter.
73FD JR NZ,PrintString_LastCharacter
73FF CALL PrintScreen Call PrintScreen.
7402 INC DE Increment DE by one.
7403 EXX Switch to the shadow registers.
7404 EX AF,AF' Switch to the shadow AF register.
7405 LD (HL),A Copy the attribute byte to the screen.
7406 INC L Increment L by one.
7407 EX AF,AF' Switch to the shadow AF register.
7408 JR PrintString_Loop Jump to PrintString_Loop.
Because the last character contains the terminator, it needs to be handled separately.
PrintString_LastCharacter 740A AND %01111111 Keep only bits 0-6 (i.e. strip the bit 7 terminator).
740C CALL PrintScreen Call PrintScreen.
740F EXX Switch to the shadow registers.
7410 EX AF,AF' Switch to the shadow AF register.
7411 LD (HL),A Copy the attribute byte to the screen.
7412 RET Return.
Prev: 73CD Up: Map Next: 7413