Prev: 7468 Up: Map Next: 74AE
7488: Print String
Used by the routines at 5FE1, GameMenu, GameOver_1UP and PrintBanner.
Input
DE Pointer to string data
PrintString 7488 PUSH HL Stash HL on the stack.
7489 CALL ScreenAddress Call ScreenAddress.
748C LD A,(DE) Fetch the attribute byte.
748D EX AF,AF' Switch to the shadow AF register.
748E INC DE Increment DE by one to point to the text of the string.
748F EXX Switch to the shadow registers.
7490 POP HL Restore HL from the stack.
7491 CALL AttributeAddress Call AttributeAddress.
This entry point is used by the routine at MenuWriteText.
PrintString_Loop 7494 EXX Switch back to the normal registers.
7495 LD A,(DE) Fetch the character to print.
7496 BIT 7,A If bit 7 is set (which signifies the end of the string), jump to PrintString_LastCharacter.
7498 JR NZ,PrintString_LastCharacter
749A CALL PrintScreen Call PrintScreen.
749D INC DE Increment DE by one.
749E EXX Switch to the shadow registers.
749F EX AF,AF' Switch to the shadow AF register.
74A0 LD (HL),A Copy the attribute byte to the screen.
74A1 INC L Increment L by one.
74A2 EX AF,AF' Switch to the shadow AF register.
74A3 JR PrintString_Loop Jump to PrintString_Loop.
Because the last character contains the terminator, it needs to be handled separately.
PrintString_LastCharacter 74A5 AND %01111111 Keep only bits 0-6 (i.e. strip the bit 7 terminator).
74A7 CALL PrintScreen Call PrintScreen.
74AA EXX Switch to the shadow registers.
74AB EX AF,AF' Switch to the shadow AF register.
74AC LD (HL),A Copy the attribute byte to the screen.
74AD RET Return.
Prev: 7468 Up: Map Next: 74AE