mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-09-14 02:46:55 +00:00
Updated Hardware: LiDAR (markdown)
parent
d057c0d151
commit
3414846141
@ -11,7 +11,7 @@ Hardware ID: `0x0003`
|
|||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| `1` | `LIDAR_GET_POS` | `0 kJ` | Copy the current (x,y) coordinates in the World in the X and Y registers |
|
| `1` | `LIDAR_GET_POS` | `0 kJ` | Copy the current (x,y) coordinates in the World in the X and Y registers |
|
||||||
| `2` | `LIDAR_GET_PATH` | `50 kJ` | Calculate the shortest path to the specified coordinates and copy it to memory|
|
| `2` | `LIDAR_GET_PATH` | `50 kJ` | Calculate the shortest path to the specified coordinates and copy it to memory|
|
||||||
| `3` | `LIDAR_GET_MAP` | `10 kJ` | Generate the current World's map and copy it to memory |
|
| `3` | `LIDAR_GET_MAP` | `10 kJ` | Generate the current World's map and copy it to memory starting at the address specified in the X register |
|
||||||
| `4` | `LIDAR_GET_WORLD_POS` | `0 kJ` | Copy the current (x,y) coordinates in the Universe in the X and Y registers |
|
| `4` | `LIDAR_GET_WORLD_POS` | `0 kJ` | Copy the current (x,y) coordinates in the Universe in the X and Y registers |
|
||||||
|
|
||||||
`LIDAR_GET_PATH` generates a path as a direction sequence of 1 word each starting at memory address `0x0000`. You indicate the coordinates of the destination with the X and Y registers, and specify the desired range (Manhattan distance from the destination) with the B register. For example, if you want to get within 1 tile of a biomass blob, specify a distance of `1`. The last word in the sequence is `0xAAAA` to indicate the end of the path. A single value of `0xFFFF` is set at memory address `0x0000` to indicate an invalid path.
|
`LIDAR_GET_PATH` generates a path as a direction sequence of 1 word each starting at memory address `0x0000`. You indicate the coordinates of the destination with the X and Y registers, and specify the desired range (Manhattan distance from the destination) with the B register. For example, if you want to get within 1 tile of a biomass blob, specify a distance of `1`. The last word in the sequence is `0xAAAA` to indicate the end of the path. A single value of `0xFFFF` is set at memory address `0x0000` to indicate an invalid path.
|
||||||
@ -21,7 +21,7 @@ Hardware ID: `0x0003`
|
|||||||
`WEST` = `0x0003`
|
`WEST` = `0x0003`
|
||||||
|
|
||||||
|
|
||||||
`LIDAR_GET_MAP` generates a map of the current world as a tile sequence of 256 words starting at memory address `0x0100`, each word representing a tile. The LiDAR starts reading the tiles west to east, north to south: (0,0) (1,0) (2,0) ... (15,0) (0,1) (1,1) ...
|
`LIDAR_GET_MAP` generates a map of the current world as a tile sequence of 256 words starting at the memory address in the X register, each word representing a tile. The LiDAR starts reading the tiles west to east, north to south: (0,0) (1,0) (2,0) ... (15,0) (0,1) (1,1) ...
|
||||||
|
|
||||||
Each tile is encoded as a bit field:
|
Each tile is encoded as a bit field:
|
||||||
`1000 0000 0000 0000` (`0x8000`) : Blocked (wall) tile
|
`1000 0000 0000 0000` (`0x8000`) : Blocked (wall) tile
|
||||||
|
Loading…
x
Reference in New Issue
Block a user