![]() |
Routines |
Prev: 26905 | Up: Map | Next: 27008 |
Used by the routine at CreateWindow.
|
||||
PlotMapPoints | 26953 | LD BC,30737 | BC=MapPoints. | |
PlotMapPoints_Loop | 26956 | LD HL,18184 | HL=18184 (screen buffer location). | |
Handle the X co-ordinate.
|
||||
26959 | LD A,(BC) | A=X co-ordinate of map point. | ||
26960 | INC BC | Increment the map pointer in BC by one. | ||
Scale the X co-ordinate for the smaller map display output.
|
||||
26961 | SRL A | A=A / 4. | ||
26963 | SRL A | |||
26965 | LD E,A | Store the result in E. | ||
Handle the Y co-ordinate.
|
||||
26966 | LD A,(BC) | A=Y co-ordinate of map point. | ||
26967 | INC BC | Increment the map pointer in BC by one. | ||
Scale the Y co-ordinate for the smaller map display output.
|
||||
26968 | SRL A | A=A / 8. | ||
26970 | SRL A | |||
26972 | SRL A | |||
26974 | LD D,A | Store the result in D. | ||
Calculate the map screen address of our currently processed map point.
|
||||
26975 | LD A,H | H=H - D. | ||
26976 | SUB D | |||
26977 | LD H,A | |||
26978 | LD A,L | L=L + E. | ||
26979 | ADD A,E | |||
26980 | LD L,A | |||
Handle the map point "type" - place names are excluded.
|
||||
26981 | LD A,(BC) | A=sprite ID of map point. | ||
26982 | INC BC | Increment the map pointer in BC by one. Now pointing to the next record. | ||
26983 | PUSH BC | Stash BC on the stack. | ||
26984 | LD BC,257 | BC=0257 (used in HandlerTerrainDots_1). | ||
Skip place names - they don't show a marker on the map.
|
||||
26987 | BIT 6,A | If bit 6 is set then this is a place name so skip and jump to PlotMapPoints_Continue. | ||
26989 | JR Z,PlotMapPoints_Continue | |||
26991 | CP 96 | If A is 96 jump to PlotMapPoints_Continue. | ||
26993 | JR Z,PlotMapPoints_Continue | |||
26995 | 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 | 26998 | POP BC | Restore BC from the stack. | |
26999 | LD HL,31958 | HL=31958 (one byte past the end of MapPoints). | ||
27002 | AND A | Reset the carry flag. | ||
27003 | SBC HL,BC | HL=HL - BC. | ||
27005 | JR NZ,PlotMapPoints_Loop | If the result is not zero then jump to PlotMapPoints_Loop. | ||
27007 | RET | Return. |
Prev: 26905 | Up: Map | Next: 27008 |