Prev: 6919 Up: Map Next: 6980
6949: Plot Map Points
Used by the routine at CreateWindow.
PlotMapPoints 6949 LD BC,$7811 BC=MapPoints.
PlotMapPoints_Loop 694C LD HL,$4708 HL=4708 (screen buffer location).
Handle the X co-ordinate.
694F LD A,(BC) A=X co-ordinate of map point.
6950 INC BC Increment the map pointer in BC by one.
Scale the X co-ordinate for the smaller map display output.
6951 SRL A A=A / 04.
6953 SRL A
6955 LD E,A Store the result in E.
Handle the Y co-ordinate.
6956 LD A,(BC) A=Y co-ordinate of map point.
6957 INC BC Increment the map pointer in BC by one.
Scale the Y co-ordinate for the smaller map display output.
6958 SRL A A=A / 08.
695A SRL A
695C SRL A
695E LD D,A Store the result in D.
Calculate the map screen address of our currently processed map point.
695F LD A,H H=H - D.
6960 SUB D
6961 LD H,A
6962 LD A,L L=L + E.
6963 ADD A,E
6964 LD L,A
Handle the map point "type" - place names are excluded.
6965 LD A,(BC) A=sprite ID of map point.
6966 INC BC Increment the map pointer in BC by one. Now pointing to the next record.
6967 PUSH BC Stash BC on the stack.
6968 LD BC,$0101 BC=0101 (used in HandlerTerrainDots_1).
Skip place names - they don't show a marker on the map.
696B BIT 6,A If bit 6 is set then this is a place name so skip and jump to PlotMapPoints_Continue.
696D JR Z,PlotMapPoints_Continue
696F CP $60 If A is 60 jump to PlotMapPoints_Continue.
6971 JR Z,PlotMapPoints_Continue
6973 CALL HandlerTerrainDots_1 Call HandlerTerrainDots_1.
Check if finished. The stack contains the start of the next record, or the first byte past the end of the map points.
PlotMapPoints_Continue 6976 POP BC Restore BC from the stack.
6977 LD HL,$7CD6 HL=7CD6 (one byte past the end of MapPoints).
697A AND A Reset the carry flag.
697B SBC HL,BC HL=HL - BC.
697D JR NZ,PlotMapPoints_Loop If the result is not zero then jump to PlotMapPoints_Loop.
697F RET Return.
Prev: 6919 Up: Map Next: 6980