Routines |
Prev: 28092 | Up: Map | Next: 28334 |
Used by the routine at 28092.
|
||||
28272 | LD A,71 | Store 71 (white INK, black PAPER, BRIGHT) at 23695... | ||
28274 | LD (23695),A | ... | ||
28277 | LD HL,54238 | Point HL to start of list of room names | ||
28280 | LD A,(65529) | Load index of Magic Knight's current room into A... | ||
28283 | LD B,A | ...and transfer to B (countdown for search loop) | ||
28284 | LD A,B | Copy value back into A | ||
28285 | OR A | If B is zero then... | ||
28286 | JR Z,28293 | ...skip ahead to 28293 | ||
28288 | CALL 36703 | Advance HL to start of next zero-terminated string | ||
28291 | DJNZ 28288 | Repeat until HL points to entry with index same as Magic Knight's current room | ||
28293 | LD A,(HL) | Get string length data... | ||
28294 | OR A | ... | ||
28295 | RET Z | ...and exit if string is zero-length | ||
28296 | INC HL | Move to first character | ||
28297 | PUSH HL | Store HL (points to Magic Knight's current room name text data) | ||
28298 | ADD A,8 | Add 8 to length (to get total length including and ) |
||
28300 | LD B,A | Store length in B | ||
28301 | LD A,32 | Subtract string length from total screen width (32 characters)... | ||
28303 | SUB B | ... | ||
28304 | RRCA | ...and divide by two to obtain number of blank characters to leave before writing room name | ||
28305 | AND 31 | Ensure value is limited to range 0-31 | ||
28307 | LD C,A | Load BC with number of blank characters to leave before printing start of string... | ||
28308 | LD B,0 | ... | ||
28310 | LD HL,16384 | ...and add it to 16384 (start of screen data) | ||
28313 | ADD HL,BC | HL now points to first display file byte to modify in printing room name | ||
28314 | LD (36488),HL | Store this at 36488 | ||
28317 | LD HL,28334 | Load HL with pointer to text |
||
28320 | CALL 36725 | Print text at location HL to screen | ||
28323 | POP HL | Restore HL (actual room name) | ||
28324 | CALL 36725 | Print text at location HL to screen | ||
28327 | LD HL,28339 | Load HL with pointer to text |
||
28330 | CALL 36725 | Print text at location HL to screen | ||
28333 | RET | Return |
Prev: 28092 | Up: Map | Next: 28334 |