Prev: EBF5 Up: Map Next: EC3B
EBFE: Print the string after the call
The game's text printer, the author's PRINT (the name the leftover source text calls it by). The string is the bytes after the CALL: characters of the font (FONT), $C8 and two bytes to move the printing position (PRINT_X, in pixels from the left, and PRINT_Y, in rows counted up from the bottom), and $A4 to end it; the printer returns to the byte after the $A4. A string can be only a $C8 and its position, to set it for PRINT_CHAR.
Each character is an 8 by 8 picture put on the screen by the compositor (COMPOSITE_TO_SCREEN, at its second entry point, 15 bytes in), 8 pixels to the right of the one before. With its first two planes (BUFFER_D800 and BUFFER_D900) cleared and nothing else to merge, the compositor puts the character over the 8 by 8 pixels under it and leaves its neighbours alone, so text need not sit on the character grid. The printer uses the room drawing's point variables for the place and size, which the drawing is finished with.
PRINT EBFE LD (IY+DRAW_WIDTH-V),$01 one byte wide; the first two planes cleared
EC02 LD HL,BUFFER_DA00
EC05 LD B,$40
EC07 CALL CLEAR_BELOW
EC0A LD (IY+WORK_DIRECTION-V),$00 nothing else to merge
This entry point is used by the routine at PRINT_FIND_GLYPH.
PRINT_NEXT_CHAR EC0E POP HL the next byte of the string; $A4 ends it, returning past it
PRINT_0 EC0F LD A,(HL)
EC10 INC HL
EC11 CP $A4
EC13 PUSH HL
EC14 RET Z
EC15 CP $C8 $C8: a new printing position
EC17 JR NZ,PRINT_1
EC19 POP HL
EC1A LD A,(HL)
EC1B INC HL
EC1C LD (PRINT_X),A
EC1F LD A,(HL)
EC20 INC HL
EC21 LD (PRINT_Y),A
EC24 JR PRINT_0
PRINT_1 EC26 LD DE,$0008 an 8 by 8 picture at the printing position
EC29 LD HL,$0808
EC2C LD (SECOND_POINT),HL
EC2F LD HL,(PRINT_X)
EC32 LD (POINT),HL
EC35 LD HL,FONT the character's 8 bytes in the font
EC38 INC A
EC39 JR PRINT_FIND_GLYPH_0
Prev: EBF5 Up: Map Next: EC3B