diff --git a/README.org b/README.org index bf978d4..59f9fa9 100644 --- a/README.org +++ b/README.org @@ -51,14 +51,12 @@ * Technical Details ** VM Architecture - - Von Neumann style bytecode interpreter written in C89. + - register based bytecode interpreter written in C89. - Portable to new systems, microcontrollers, and web via Emscripten. ** Memory Management - Reference counting for globally scoped objects. - =weak= keyword to avoid cyclical references. - - garbage collection as a system call (choose when to free memory) - - Arena allocators for short-lived, scoped memory (e.g., function-local objects). ** Rendering & I/O - SDL2-based abstraction for input, audio, and rendering. diff --git a/docs/MACHINE.org b/docs/MACHINE.org index 4e02d75..56b429e 100644 --- a/docs/MACHINE.org +++ b/docs/MACHINE.org @@ -14,7 +14,7 @@ one large uint32 array :PROPERTIES: :CUSTOM-ID: types :END: -real (fixed point numbers)| Q16.16 number +real (floating point number) f32 int (integer) i32 nat (unsigned integer) u32 diff --git a/docs/SPECIFICATION.org b/docs/SPECIFICATION.org index 25f58d5..ed640c1 100644 --- a/docs/SPECIFICATION.org +++ b/docs/SPECIFICATION.org @@ -52,9 +52,7 @@ type Vec3 { :CUSTOM_ID: numeric :END: - =real= - - 32 bit Q16.16 fixed point by default. - - self casts to a 64 bit floating point (Double) by default for modern CPUs that have a FPU - for 3D math for performance reasons + - 32 bit floats - =int= - 32 bit integer - =nat= diff --git a/src/main.c b/src/main.c index 4360675..1928d34 100644 --- a/src/main.c +++ b/src/main.c @@ -16,13 +16,10 @@ #include #endif -uint32_t pc = 1; /* Program counter */ - Code *code; void mainloop() { - pc = step_vm(&code->current, code->memory); - if (pc == 0) { + if (!step_vm(&code->current, code->memory)) { #ifdef __EMSCRIPTEN__ emscripten_cancel_main_loop(); /* this should "kill" the app. */ #else