![]() |
Routines |
| Prev: 35311 | Up: Map | Next: 35383 |
|
Print a bit-7-terminated string using the attribute byte stored in front of the text.
|
||||||||||
| PrintStringColour | 35345 | PUSH HL | Stash HL on the stack. | |||||||
| 35346 | CALL ScreenAddress | Call ScreenAddress. | ||||||||
| 35349 | LD A,(DE) | Fetch the attribute byte. | ||||||||
| 35350 | EX AF,AF' | Switch to the shadow AF register. | ||||||||
| 35351 | INC DE | Increment DE by one to point to the text of the string. | ||||||||
| 35352 | EXX | Switch to the shadow registers. | ||||||||
| 35353 | POP HL | Restore HL from the stack. | ||||||||
| 35354 | CALL AttributeAddress | Call AttributeAddress. | ||||||||
|
Print each character with its attribute until the string terminator is reached.
|
||||||||||
| PrintString_Loop | 35357 | EXX | Switch back to the normal registers. | |||||||
| 35358 | LD A,(DE) | Fetch the character to print. | ||||||||
| 35359 | BIT 7,A | Jump to PrintString_LastCharacter if bit 7 is set (end of the string). | ||||||||
| 35361 | JR NZ,PrintString_LastCharacter | |||||||||
| 35363 | CALL PrintScreen | Call PrintScreen. | ||||||||
|
Move to the next character and write this cell's attribute.
|
||||||||||
| 35366 | INC DE | Increment DE by one. | ||||||||
| 35367 | EXX | Switch to the shadow registers. | ||||||||
| 35368 | EX AF,AF' | Switch to the shadow AF register. | ||||||||
| 35369 | LD (HL),A | Copy the attribute byte to the screen. | ||||||||
| 35370 | INC L | Increment L by one. | ||||||||
| 35371 | EX AF,AF' | Switch to the shadow AF register. | ||||||||
| 35372 | JR PrintString_Loop | Jump to PrintString_Loop. | ||||||||
|
Because the last character contains the terminator, it needs to be handled separately.
|
||||||||||
| PrintString_LastCharacter | 35374 | AND %01111111 | Keep only bits 0-6 (i.e. strip the bit 7 terminator). | |||||||
| 35376 | CALL PrintScreen | Call PrintScreen. | ||||||||
| 35379 | EXX | Switch to the shadow registers. | ||||||||
| 35380 | EX AF,AF' | Switch to the shadow AF register. | ||||||||
| 35381 | LD (HL),A | Copy the attribute byte to the screen. | ||||||||
| 35382 | RET | Return. | ||||||||
| Prev: 35311 | Up: Map | Next: 35383 |