diff --git a/src/components/hologram.c b/src/components/hologram.c index 599c284..65f087b 100644 --- a/src/components/hologram.c +++ b/src/components/hologram.c @@ -1,6 +1,13 @@ #include "hologram.h" -void nn_hologram_clear() { +// safety: +// For valid indexes to be valid, +// stuff must be from 0 to limit - 1 +nn_size_t nn_positionToIndex(nn_hologram *h, unsigned x, unsigned y, unsigned z) { + return x + y * h->width_x + z * h->width_x * h->height; +} + +void nn_hologram_clear(nn_hologram *h) { } diff --git a/src/emulator.c b/src/emulator.c index f9a6bc6..baa9e5a 100644 --- a/src/emulator.c +++ b/src/emulator.c @@ -618,7 +618,7 @@ void ne_log(void *_, void *__, nn_component *component, nn_computer *computer) { } } -int main() { +int main(int argc, char **argv) { printf("Setting up universe\n"); nn_Context ctx = nn_libcContext(); nn_Alloc alloc = ctx.allocator; @@ -665,7 +665,7 @@ int main() { nn_addEEPROM(computer, NULL, 0, genericEEPROM); - nn_address fsFolder = "OpenOS"; + nn_address fsFolder = argc > 1 ? argv[1] : "OpenOS"; nn_filesystemTable genericFSTable = { .userdata = fsFolder, .deinit = NULL, diff --git a/src/neonucleus.h b/src/neonucleus.h index 4bc28a6..351ee3f 100644 --- a/src/neonucleus.h +++ b/src/neonucleus.h @@ -1056,8 +1056,6 @@ nn_bool_t nn_destroyHologram(nn_hologram *hologram); nn_component *nn_addHologram(nn_computer *computer, nn_address address, int slot, nn_hologram *hologram); -int nn_XYZtoIndex(int x, int y, int z); - void nn_hologram_clear(nn_hologram *hologram); int nn_hologram_get(nn_hologram *hologram, int x, int y, int z); void nn_hologram_set(nn_hologram *hologram, int x, int y, int z, int value);