Routines |
Prev: 64C7 | Up: Map | Next: 6518 |
Used by the routine at 6FAC.
|
||||||||
DisplayPlaceName | 64F0 | BIT 6,A | Return if bit 6 of A is not set (i.e. not a place name). | |||||
64F2 | RET Z | |||||||
Strip out the bit which indicates the need to display the place name.
|
||||||||
64F3 | AND %00111111 | Keep only bits 0-5. | ||||||
64F5 | LD DE,$0005 | DE=0005 (the minimum length of a place name without the "end-of-string" bit e.g. "TUCSO(N)"). | ||||||
64F8 | LD HL,$722F | HL=PlaceNames. | ||||||
64FB | INC A | Write A + 01 to CurrentPlaceID. | ||||||
64FC | LD ($5E39),A | |||||||
64FF | DEC A | B=original value of A (used as a counter for finding the place name text). | ||||||
6500 | LD B,A | |||||||
6501 | JR Z,DisplayPlaceName_Print | If A is zero there's no need to search so jump immediately to DisplayPlaceName_Print. | ||||||
Speed up (slightly) searching through place names by adding DE (0005) to the start address.
|
||||||||
DisplayPlaceName_Search | 6503 | ADD HL,DE | Adds DE (0005) to the place name pointer. | |||||
Search for the end of the current place name.
|
||||||||
DisplayPlaceName_Loop | 6504 | BIT 7,(HL) | If bit 7 (the "end-of-string" flag) is not set... | |||||
6506 | INC HL | Increment HL by one. | ||||||
6507 | JR Z,DisplayPlaceName_Loop | ...then jump to DisplayPlaceName_Loop. | ||||||
B stores the entry number of the place name, so keep going until we find it.
|
||||||||
6509 | DJNZ DisplayPlaceName_Search | Decrease counter by one and loop back to DisplayPlaceName_Search until counter is zero. | ||||||
Output the place name to the screen.
|
||||||||
DisplayPlaceName_Print | 650B | EX DE,HL | Switch the DE and HL registers. | |||||
650C | LD HL,$B868 | HL=B868 (screen location). | ||||||
650F | PUSH HL | Stash HL on the stack. | ||||||
6510 | CALL ScreenAddress | Call ScreenAddress. | ||||||
6513 | LD A,$70 | A=70 (attribute byte - BLACK ink on YELLOW paper). | ||||||
6515 | EX AF,AF' | Switch to the shadow AF register. | ||||||
6516 | JR PrintStringColour_0 | Jump to PrintStringColour_0. |
Prev: 64C7 | Up: Map | Next: 6518 |