mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-10 14:26:45 +00:00
Modify LIDAR_GET_MAP to write to a given memory address
This commit is contained in:
parent
217c997788
commit
e62a51ee2e
@ -114,7 +114,8 @@ public class CubotLidar extends CpuHardware implements JSONSerialisable {
|
||||
if (cubot.spendEnergy(10)) {
|
||||
char[][] mapInfo = cubot.getWorld().getMapInfo();
|
||||
|
||||
int i = MEMORY_MAP_START;
|
||||
//Write map data to the location specified by register X
|
||||
int i = getCpu().getRegisterSet().getRegister("X").getValue();
|
||||
for (int y = 0; y < cubot.getWorld().getWorldSize(); y++) {
|
||||
for (int x = 0; x < cubot.getWorld().getWorldSize(); x++) {
|
||||
getCpu().getMemory().set(i++, mapInfo[x][y]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user