mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-20 19:16:43 +00:00
Updated GET_MAP with newest commit
parent
e1641b4da1
commit
72d6efa539
@ -37,27 +37,31 @@ The memory of a 4 tile path consisting of moving the Cubot north twice, once wes
|
|||||||
#### LIDAR_GET_MAP
|
#### LIDAR_GET_MAP
|
||||||
Generates a map of the current world as a sequence of 256 words, each word representing a tile. The starting address of the generated map must be specified with the X register. The LiDAR reads the tiles west to east, north to south: (0,0) (1,0) (2,0) ... (15,0) (0,1) (1,1) ... The first 16 words will be the north-most row from west to east, the next 16 words will be the next row down (south), etc. Ending with the south-east most tile.
|
Generates a map of the current world as a sequence of 256 words, each word representing a tile. The starting address of the generated map must be specified with the X register. The LiDAR reads the tiles west to east, north to south: (0,0) (1,0) (2,0) ... (15,0) (0,1) (1,1) ... The first 16 words will be the north-most row from west to east, the next 16 words will be the next row down (south), etc. Ending with the south-east most tile.
|
||||||
|
|
||||||
Each tile is encoded as a bit field. Tiles may contain more than one thing, in which case the value is the bit fields of each thing it contains `OR`'d together. For example, a tile with copper and an NPC would have the bit field `0000 0001 0100 0000` (`0x0140`).
|
Each tile is encoded as a bit field with the following format `OOOOOOOO TTTTTTTB`. Starting from the left, the first byte specifies the object ID on this tile, the next 7 bits specifies the tile ID. The rightmost bit indicates if the tile is `blocked` or not.
|
||||||
|
|
||||||
##### Tile content bit fields
|
##### Object IDs:
|
||||||
| Bit field | Value | Content |
|
| Bit field | Value | Content |
|
||||||
| :---------------------| :------- | :------------------- |
|
| :---------------------| :------- | :------------------- |
|
||||||
| `1000 0000 0000 0000` | `0x8000` | Blocked (wall) tile |
|
| `0000 0001 0000 0001` | `0x0101` | [Biomass blob](https://github.com/simon987/Much-Assembly-Required/wiki/Biomass) |
|
||||||
| `0100 0000 0000 0000` | `0x4000` | Biomass |
|
| `0000 0010 0000 0001` | `0x0201` | [Cubot](https://github.com/simon987/Much-Assembly-Required/wiki/The-Cubot-Manuals) |
|
||||||
| `0010 0000 0000 0000` | `0x2000` | Factory* |
|
| `0000 0011 0000 0001` | `0x0301` | [Electric Box]() |
|
||||||
| `0001 0000 0000 0000` | `0x1000` | Radio Tower |
|
| `0000 0100 0000 0001` | `0x0401` | [Factory](https://github.com/simon987/Much-Assembly-Required/wiki/NPC-Factory) |
|
||||||
| `0000 1000 0000 0000` | `0x0800` | Vault |
|
| `0000 0101 0000 0001` | `0x0501` | [NPC](https://github.com/simon987/Much-Assembly-Required/wiki/Non-Player-Character-(NPC)) |
|
||||||
| `0000 0100 0000 0000` | `0x0400` | Electric Box |
|
| `0000 0110 0000 0001` | `0x0601` | Reserved |
|
||||||
| `0000 0010 0000 0000` | `0x0200` | Iron tile |
|
| `0000 0111 0000 0001` | `0x0701` | Reserved |
|
||||||
| `0000 0001 0000 0000` | `0x0100` | Copper tile |
|
| `0000 1000 0000 0001` | `0x0801` | [Portal]() |
|
||||||
| `0000 0000 1000 0000` | `0x0080` | Cubot |
|
| `0000 1001 0000 0001` | `0x0901` | [Radio Tower](https://github.com/simon987/Much-Assembly-Required/wiki/Radio-Tower) |
|
||||||
| `0000 0000 0100 0000` | `0x0040` | NPC |
|
| `0000 1010 0000 0001` | `0x0A01` | Reserved |
|
||||||
| `0000 0000 0010 0000` | `0x0020` | Portal |
|
| `0000 1011 0000 0000` | `0x0B00` | Reserved |
|
||||||
| `0000 0000 0001 0000` | `0x0010` | |
|
|
||||||
| `0000 0000 0000 1000` | `0x0008` | |
|
##### Tile IDs:
|
||||||
| `0000 0000 0000 0100` | `0x0004` | |
|
| Bit field | Value | Content |
|
||||||
| `0000 0000 0000 0010` | `0x0002` | |
|
| :---------------------| :------- | :------------------- |
|
||||||
| `0000 0000 0000 0001` | `0x0001` | |
|
| `0000 0000 1111 1111` | `0x00FF` | Void |
|
||||||
| `0000 0000 0000 0000` | `0x0000` | Nothing |
|
| `0000 0000 0000 0000` | `0x0000` | Plain |
|
||||||
|
| `0000 0000 0000 0011` | `0x0003` | Wall |
|
||||||
|
| `0000 0000 0000 0100` | `0x0004` | Iron tile |
|
||||||
|
| `0000 0000 0000 0110` | `0x0006` | Copper tile |
|
||||||
|
| `0000 0000 0000 1000` | `0x0008` | Vault floor |
|
||||||
|
| `0000 0000 0000 1011` | `0x000B` | Vault wall |
|
||||||
|
|
||||||
\* Factories are supposed to use the bit field `0x2000` but due to a bug they instead use the same bit field as iron tiles (`0x0200`). See [#170](https://github.com/simon987/Much-Assembly-Required/issues/170).
|
|
Loading…
x
Reference in New Issue
Block a user