update documentation
This commit is contained in:
parent
d27d4259aa
commit
457c77b6ab
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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=
|
||||
|
|
|
@ -16,13 +16,10 @@
|
|||
#include <emscripten.h>
|
||||
#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
|
||||
|
|
Loading…
Reference in New Issue