Prev: 25799 Up: Map Next: 25880
25840: Display Place Name
Used by the routine at 28588.
Input
A Bits 0-6 of ActiveObject
DisplayPlaceName 25840 BIT 6,A Return if bit 6 of A is not set (i.e. not a place name).
25842 RET Z
Strip out the bit which indicates the need to display the place name.
25843 AND %00111111 Keep only bits 0-5.
25845 LD DE,5 DE=0005 (the minimum length of a place name without the "end-of-string" bit e.g. "TUCSO(N)").
25848 LD HL,29231 HL=PlaceNames.
25851 INC A Write A + 1 to CurrentPlaceID.
25852 LD (24121),A
25855 DEC A B=original value of A (used as a counter for finding the place name text).
25856 LD B,A
25857 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 25859 ADD HL,DE Adds DE (0005) to the place name pointer.
Search for the end of the current place name.
DisplayPlaceName_Loop 25860 BIT 7,(HL) If bit 7 (the "end-of-string" flag) is not set...
25862 INC HL Increment HL by one.
25863 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.
25865 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 25867 EX DE,HL Switch the DE and HL registers.
25868 LD HL,47208 HL=47208 (screen location).
25871 PUSH HL Stash HL on the stack.
25872 CALL ScreenAddress Call ScreenAddress.
25875 LD A,112 A=112 (attribute byte - BLACK ink on YELLOW paper).
25877 EX AF,AF' Switch to the shadow AF register.
25878 JR PrintStringColour_0 Jump to PrintStringColour_0.
Prev: 25799 Up: Map Next: 25880