|  | Routines | 
| Prev: A28A | Up: Map | Next: A368 | 
| 
 | ||||||||||
| A2DF | PUSH BC | Save BC | ||||||||
| A2E0 | CALL $A307 | Print a line of text | ||||||||
| A2E3 | INC IX | Point IX to the address of the first byte of the next line | ||||||||
| A2E5 | POP BC | Save BC | ||||||||
| A2E6 | DJNZ $A2DF | Jump back while there are lines left to print | ||||||||
| A2E8 | RET | |||||||||
| 
Compute the address at the lookup table of the display file and the address of the graphic data for the character to display
 | ||||||||||
| A2E9 | LD A,($A097) | Set HL to the vertical position of the text | ||||||||
| A2EC | LD L,A | |||||||||
| A2ED | LD H,$00 | |||||||||
| A2EF | ADD HL,HL | Vertical position is in bit 7-3 so it's only necessari multiply by two | ||||||||
| A2F0 | LD DE,$ABDD | Point HL to the display file lookup table | ||||||||
| A2F3 | ADD HL,DE | |||||||||
| A2F4 | PUSH HL | Save HL | ||||||||
| A2F5 | LD L,(IX+$00) | Set HL to the character to display | ||||||||
| A2F8 | LD H,$00 | |||||||||
| A2FA | ADD HL,HL | Computes the address of the graphic data of the character into the charset data tabla at $5FE0 | ||||||||
| A2FB | ADD HL,HL | |||||||||
| A2FC | ADD HL,HL | |||||||||
| A2FD | LD DE,$5FE0 | |||||||||
| A300 | ADD HL,DE | |||||||||
| A301 | EX DE,HL | Exchange DE and HL | ||||||||
| A302 | POP IY | Restore IY | ||||||||
| A304 | LD B,$08 | Set B=8 | ||||||||
| A306 | RET | |||||||||
| 
Prints a line of text
 | ||||||||||
| A307 | LD A,(IX+$00) | Save color attribute of text at A093 | ||||||||
| A30A | LD ($A093),A | |||||||||
| A30D | LD A,(IX+$01) | Save horizontal position of text at A095 | ||||||||
| A310 | LD ($A095),A | |||||||||
| A313 | LD A,(IX+$02) | Save vertical position of text at A097 | ||||||||
| A316 | LD ($A097),A | |||||||||
| A319 | LD DE,$0003 | Point IX to the first character | ||||||||
| A31C | ADD IX,DE | |||||||||
| A31E | CALL $A2E9 | Computes addres into lookup table and address of the graphics data for the character | ||||||||
| 
Prints a character
 | ||||||||||
| A321 | LD L,(IY+$00) | Point at HL the address into the display file from the lookup table | ||||||||
| A324 | LD H,(IY+$01) | |||||||||
| A327 | PUSH DE | Save DE | ||||||||
| A328 | LD A,($A095) | Save the horizontal position of text at DE | ||||||||
| A32B | LD E,A | |||||||||
| A32C | LD D,$00 | |||||||||
| A32E | ADD HL,DE | Adds the horizontal position to the address into the display file | ||||||||
| A32F | POP DE | Restore DE | ||||||||
| A330 | LD A,(DE) | Read the next byte of the graphic data for the character | ||||||||
| A331 | LD (HL),A | Puts the byte in to the display file | ||||||||
| A332 | INC DE | Points to the next byte of the graphic data for the character | ||||||||
| A333 | INC IY | Points to the next address of the display file lookup table | ||||||||
| A335 | INC IY | |||||||||
| A337 | DJNZ $A321 | Jump back until displayed all of the eight bytes of the character | ||||||||
| A339 | LD A,(IX+$00) | The character is an space ($20)? | ||||||||
| A33C | CP $20 | |||||||||
| A33E | JR Z,$A359 | Jump if so | ||||||||
| 
Set the color attribute for the character if is not an SPACE ($20)
 | ||||||||||
| A340 | LD A,($A097) | Set HL to the vertical position of the text (only bits 7-3) | ||||||||
| A343 | AND $F8 | |||||||||
| A345 | LD L,A | |||||||||
| A346 | LD H,$00 | |||||||||
| A348 | ADD HL,HL | And computes the patial offset to the attribute file | ||||||||
| A349 | ADD HL,HL | |||||||||
| A34A | LD A,($A095) | Set DE to the horizontal position | ||||||||
| A34D | LD E,A | |||||||||
| A34E | LD D,$00 | |||||||||
| A350 | ADD HL,DE | And computes the offset to the attribute file | ||||||||
| A351 | LD DE,$5800 | Add the offset to the base address of the attribute file | ||||||||
| A354 | ADD HL,DE | |||||||||
| A355 | LD A,($A093) | Pick up the color attribute for the text | ||||||||
| A358 | LD (HL),A | And put this color attribute into the attribute file | ||||||||
| 
Prepares to print the next character until the end of marker (character $00)
 | ||||||||||
| A359 | INC IX | Point IX to the next character | ||||||||
| A35B | LD HL,$A095 | Increment the horizontal position for the next character | ||||||||
| A35E | INC (HL) | |||||||||
| A35F | LD A,(IX+$00) | Pick up the next character | ||||||||
| A362 | OR A | is an end of marker ($00)? | ||||||||
| A363 | JR Z,$A367 | Jump if so | ||||||||
| A365 | JR $A31E | Jump back and repeat for the next character | ||||||||
| A367 | RET | |||||||||
| Prev: A28A | Up: Map | Next: A368 |