more progress on the rewrite

This commit is contained in:
2026-02-02 15:40:49 +01:00
parent ab22feec69
commit 89f3527147
10 changed files with 640 additions and 1869 deletions

28
rewrite/main.c Normal file
View File

@@ -0,0 +1,28 @@
// The main file of the test emulator
// This is not a serious emulator intended for practical use,
// it is simply just to test stuff and showcase the API.
#include "neonucleus.h"
int main() {
nn_Context ctx;
nn_initContext(&ctx);
// create the universe
nn_Universe *u = nn_createUniverse(&ctx);
nn_ComponentMethod sandboxMethods[] = {
{"log", "log(msg: string) - Log to stdout", true},
NULL,
};
nn_ComponentType *ctype = nn_createComponentType(u, "sandbox", NULL, sandboxMethods, NULL);
nn_Computer *c = nn_createComputer(u, NULL, "computer0", 8 * NN_MiB, 256, 256);
cleanup:;
nn_destroyComponentType(ctype);
nn_destroyComputer(c);
// rip the universe
nn_destroyUniverse(u);
return 0;
}