Prev: B52D Up: Map Next: B563
B53D: Print Colour String
Used by the routines at DisplayPoem, GameOver_1UP and PrintBanner.
Input
DE Pointer to string data
PrintStringColour B53D PUSH HL Stash HL on the stack.
B53E CALL ScreenAddress Call ScreenAddress.
B541 LD A,(DE) Fetch the attribute byte.
B542 EX AF,AF' Switch to the shadow AF register.
B543 INC DE Increment DE by one to point to the text of the string.
B544 EXX Switch to the shadow registers.
B545 POP HL Restore HL from the stack.
B546 CALL AttributeAddress Call AttributeAddress.
This entry point is used by the routine at MenuWriteText.
PrintString_Loop B549 EXX Switch back to the normal registers.
B54A LD A,(DE) Fetch the character to print.
B54B BIT 7,A If bit 7 is set (which signifies the end of the string), jump to PrintString_LastCharacter.
B54D JR NZ,PrintString_LastCharacter
B54F CALL PrintScreen Call PrintScreen.
B552 INC DE Increment DE by one.
B553 EXX Switch to the shadow registers.
B554 EX AF,AF' Switch to the shadow AF register.
B555 LD (HL),A Copy the attribute byte to the screen.
B556 INC L Increment L by one.
B557 EX AF,AF' Switch to the shadow AF register.
B558 JR PrintString_Loop Jump to PrintString_Loop.
Because the last character contains the terminator, it needs to be handled separately.
PrintString_LastCharacter B55A AND %01111111 Keep only bits 0-6 (i.e. strip the bit 7 terminator).
B55C CALL PrintScreen Call PrintScreen.
B55F EXX Switch to the shadow registers.
B560 EX AF,AF' Switch to the shadow AF register.
B561 LD (HL),A Copy the attribute byte to the screen.
B562 RET Return.
View the equivalent code in;
Prev: B52D Up: Map Next: B563