![]() |
Routines |
| Prev: 25840 | Up: Map | Next: 25918 |
|
Prints a string of characters and sets the attribute of each one. The first byte of the string is the attribute and the last character of the string has bit 7 set.
|
||||||||||||||
| PrintStringColour | 25880 | PUSH HL | Stash the pixel co-ordinates on the stack. | |||||||||||
| 25881 | CALL ScreenAddress | Convert them to a screen address using ScreenAddress. | ||||||||||||
| 25884 | LD A,(DE) | Fetch the attribute from the first byte of the string. | ||||||||||||
| 25885 | EX AF,AF' | Keep the attribute in the shadow AF register. | ||||||||||||
| 25886 | INC DE | Increment DE by one to point to the text of the string. | ||||||||||||
|
This entry point is used by the routines at DisplayPlaceName and DisplayNightDriver.
|
||||||||||||||
| PrintStringColour_UseAttribute | 25887 | EXX | Switch to the shadow registers. | |||||||||||
| 25888 | POP HL | Restore the pixel co-ordinates from the stack. | ||||||||||||
| 25889 | CALL AttributeAddress | Find the attribute address of the cell using AttributeAddress. | ||||||||||||
|
This entry point is used by the routine at MenuWriteText.
Print each character, and set its attribute.
|
||||||||||||||
| PrintString_Loop | 25892 | EXX | Switch back to the normal registers. | |||||||||||
| 25893 | LD A,(DE) | Fetch the character to print. | ||||||||||||
| 25894 | BIT 7,A | If bit 7 is set (which signifies the end of the string), jump to PrintString_LastCharacter. | ||||||||||||
| 25896 | JR NZ,PrintString_LastCharacter | |||||||||||||
| 25898 | CALL PrintScreen | Print the character using PrintScreen. | ||||||||||||
| 25901 | INC DE | Move on to the next character of the string. | ||||||||||||
| 25902 | EXX | Switch to the shadow registers. | ||||||||||||
| 25903 | EX AF,AF' | Switch to the shadow AF register. | ||||||||||||
| 25904 | LD (HL),A | Copy the attribute byte to the screen. | ||||||||||||
| 25905 | INC L | Move on to the next cell on the row. | ||||||||||||
| 25906 | EX AF,AF' | Switch to the shadow AF register. | ||||||||||||
| 25907 | JR PrintString_Loop | Jump to PrintString_Loop. | ||||||||||||
|
Because the last character contains the terminator, it needs to be handled separately.
|
||||||||||||||
| PrintString_LastCharacter | 25909 | AND %01111111 | Keep only bits 0-6 (i.e. strip the bit 7 terminator). | |||||||||||
| 25911 | CALL PrintScreen | Print the last character using PrintScreen. | ||||||||||||
| 25914 | EXX | Switch to the shadow registers. | ||||||||||||
| 25915 | EX AF,AF' | Switch to the shadow AF register. | ||||||||||||
| 25916 | LD (HL),A | Copy the attribute byte to the screen. | ||||||||||||
| 25917 | RET | Return. | ||||||||||||
|
View the equivalent code in;
|
||||||||||||||
| Prev: 25840 | Up: Map | Next: 25918 |