documentation writing and API doc update

This commit is contained in:
2025-02-04 07:37:10 -06:00
parent ede899e9a3
commit 5e7c946d43
40 changed files with 1791 additions and 769 deletions

View File

@@ -1,59 +0,0 @@
name: Build (Release + Cross)
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
# 1) Native Linux build
- os: ubuntu-latest
name: "Linux (Release)"
target: "release"
# 2) Windows build (cross-compile from Ubuntu with mingw)
- os: ubuntu-latest
name: "Windows (Cross)"
target: "crosswin"
# 3) Native macOS build
- os: macos-latest
name: "macOS (Release)"
target: "release"
steps:
- name: Check Out Code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install Meson and Ninja
run: |
python -m pip install --upgrade pip
pip install meson ninja
- name: Install Dependencies for Cross (mingw)
if: ${{ matrix.target == 'crosswin' }}
run: |
sudo apt-get update
sudo apt-get install -y mingw-w64
# Add any other packages needed for cross compilation
- name: Build
run: make ${{ matrix.target }}
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}-artifacts
# If your build output folders differ, adjust accordingly:
path: |
build_release
build_win

View File

@@ -1,140 +1,10 @@
# Color
#### white
**array**
# color Module
[
1,
1,
1,
1
]
#### black
**array**
[
0,
0,
0,
1
]
#### blue
**array**
[
0.32941176470588235,
0.43137254901960786,
1,
1
]
#### green
**array**
[
0.47058823529411764,
1,
0.0392156862745098,
1
]
#### yellow
**array**
[
0.984313725490196,
1,
0.16862745098039217,
1
]
#### red
**array**
[
1,
0.1411764705882353,
0.0784313725490196,
1
]
#### teal
**array**
[
0.3764705882352941,
0.9882352941176471,
0.9294117647058824,
1
]
#### gray
**array**
[
0.7098039215686275,
0.7098039215686275,
0.7098039215686275,
1
]
#### cyan
**array**
[
0,
1,
1,
1
]
#### purple
**array**
[
0.6352941176470588,
0.36470588235294116,
0.8901960784313725,
1
]
#### editor
**object**
## Color
#### tohtml(v)
#### Arkanoid
**object**
#### Gameboy
**object**
#### Apple
**object**
#### Debug
**object**
#### Editor
**object**
#### normalize(c)
## esc
## ColorMap

View File

@@ -1,23 +1,19 @@
# Event
#### events
**object**
# event Module
## push_event
> Push a custom user event into SDL's queue, passing a callback function.
```
function push_event()
```
## engine_input
#### observe(name, obj, fn)
#### unobserve(name, obj)
#### rm_obj(obj)
#### notify(name, ...args)
> Poll all system events (keyboard, mouse, etc.) and call the given function with each event object.
```
function engine_input()
```

View File

@@ -1,78 +1,51 @@
# Resources
#### replpath(str, path)
# resources Module
## scripts
#### replstrs(path)
## images
#### scripts
**array**
[
"jsoc",
"jsc",
"jso",
"js"
]
#### images
**array**
[
"png",
"gif",
"jpg",
"jpeg"
]
#### sounds
**array**
[
"wav",
"flac",
"mp3",
"qoa"
]
#### is_image(path)
## sounds
#### find_image(file)
## fonts
#### find_sound(file)
## lib
## canonical
#### find_script(file)
```
function canonical(file)
```
## find_image
#### is_sound(path)
```
function find_image(...args)
```
## find_sound
#### is_animation(path)
```
function find_sound(...args)
```
## find_script
#### is_path(str)
#### texture
**object**
#### gif
**object**
```
function find_script(...args)
```
## find_font
```
function find_font(...args)
```

View File

@@ -1,67 +1,19 @@
# Spline
#### sample_angle(type, points, angle)
# spline Module
## catmull
> Perform Catmull-Rom spline sampling on an array of 2D points, returning an array of samples.
```
function catmull()
```
## bezier
#### bezier_loop(cp)
#### bezier_node_count(cp)
#### is_bezier(t)
#### is_catmull(t)
#### bezier2catmull(b)
#### catmull2bezier(c)
Given a set of control points C for a camtull-rom type curve, return a set of cubic bezier points to give the same curve.
#### catmull_loop(cp)
#### catmull_caps(cp)
Given a set of control points cp, return the necessary caps added to the spline.
#### type
**object**
#### bezier_tan_partner(points, i)
#### bezier_cp_mirror(points, i)
#### bezier_point_handles(points, i)
#### bezier_nodes(points)
#### bezier_is_node(points, i)
#### bezier_is_handle(points, i)
> Perform a Bezier spline (or catmull) sampling on 2D points, returning an array of sampled points.
```
function bezier()
```

View File

@@ -1,34 +1,43 @@
# actor
#### spawn(script, config, callback)
# actor Module
Create a new actor, using this actor as the master, initializing it with 'script' and with data (as a JSON or Nota file) from 'config'.
## all_objects
#### rm_pawn(pawn)
```
function all_objects(fn, startobj = world)
```
## find_object
#### timers
**array**
[]
#### kill()
Remove this actor and all its padawans from existence.
#### interval(fn, seconds)
```
function find_object(fn, startobj = world)
```
## tag_add
#### delay(fn, seconds)
Call 'fn' after 'seconds' with 'this' set to the actor.
#### padawans
**array**
[
{}
]
```
function tag_add(tag, obj)
```
## tag_rm
```
function tag_rm(tag, obj)
```
## tag_clear_guid
```
function tag_clear_guid(obj)
```
## objects_with_tag
```
function objects_with_tag(tag)
```

1
docs/api/base.md Normal file
View File

@@ -0,0 +1 @@
# base Module

1
docs/api/cmd.md Normal file
View File

@@ -0,0 +1 @@
# cmd Module

22
docs/api/doc.md Normal file
View File

@@ -0,0 +1,22 @@
# doc Module
## print_api
```
function print_api(obj)
```
## print_modules
```
function print_modules()
```
## write_modules
```
function write_modules()
```

85
docs/api/draw2d.md Normal file
View File

@@ -0,0 +1,85 @@
# draw2d Module
## point
```
function point(pos, size, color = Color.blue)
```
## line
```
function line(points, color = Color.white, thickness = 1, pipeline)
```
## cross
```
function cross(pos, size, color = Color.red, thickness = 1, pipe)
```
## arrow
```
function arrow(start, end, color = Color.red, wingspan = 4, wingangle = 10, pipe)
```
## rectangle
```
function rectangle(rect, color = Color.white, pipeline)
```
## tile
```
function tile(image, rect, color = Color.white, tile = tile_def, pipeline)
```
## slice9
```
function slice9(image, rect = [0,0], slice = 0, color = Color.white, info = slice9_info, pipeline)
```
## image
```
function image(image, rect = [0,0], rotation = 0, color, pipeline)
```
## images
```
function images(image, rects, config)
```
## sprites
```
function sprites(sprites, sort = 0, pipeline)
```
## circle
```
function circle(pos, radius, color, inner_radius = 1, pipeline)
```
## text
```
function text(text, rect, font = sysfont, size = 0, color = Color.white, wrap = 0, pipeline)
```

1
docs/api/engine.md Normal file
View File

@@ -0,0 +1 @@
# engine Module

130
docs/api/geometry.md Normal file
View File

@@ -0,0 +1,130 @@
# geometry Module
## rect_intersection
> Return the intersection of two rectangles (x,y,w,h). The result may be empty if no intersection.
```
function rect_intersection()
```
## rect_intersects
> Return a boolean indicating if two rectangles overlap.
```
function rect_intersects()
```
## rect_expand
> Merge or combine two rectangles, returning their bounding rectangle.
```
function rect_expand()
```
## rect_inside
> Return true if the first rectangle is completely inside the second.
```
function rect_inside()
```
## rect_random
> Return a random point within the given rectangle (uniform distribution).
```
function rect_random()
```
## cwh2rect
> Helper: convert a center point and width/height vector to a rect object.
```
function cwh2rect()
```
## rect_point_inside
> Return true if the given point is inside the given rectangle.
```
function rect_point_inside()
```
## rect_pos
> Return just the (x,y) position of a rectangle as a 2D array.
```
function rect_pos()
```
## rect_move
> Offset a rectangle by a 2D vector.
```
function rect_move()
```
## box
```
function box(w, h)
```
## sphere
## circle
## ngon
```
function ngon(radius, n)
```
## arc
```
function arc(radius, angle, n, start = 0)
```
## corners2points
```
function corners2points(ll, ur)
```
## sortpointsccw
```
function sortpointsccw(points)
```
## points2cm
```
function points2cm(points)
```

171
docs/api/graphics.md Normal file
View File

@@ -0,0 +1,171 @@
# graphics Module
## make_sprite_mesh
> Given an array of sprites, build a single geometry mesh for rendering them.
```
function make_sprite_mesh()
```
## make_sprite_queue
> Given an array of sprites, optionally sort them and build a queue of pipeline commands.
```
function make_sprite_queue()
```
## make_text_buffer
> Generate a GPU buffer mesh of text quads for rendering with a font, etc.
```
function make_text_buffer()
```
## rectpack
> Perform a rectangle packing using the stbrp library. Return positions for each rect.
```
function rectpack()
```
## make_rtree
> Create a new R-Tree for quickly querying many rectangles or sprite bounds.
```
function make_rtree()
```
## make_texture
> Convert raw image bytes (PNG, JPG) into an SDL_Surface object.
```
function make_texture()
```
## make_gif
> Load a GIF from an array of bytes, returning an object with frames[] of surfaces.
```
function make_gif()
```
## make_aseprite
> Load an Aseprite/ASE file from an array of bytes, returning frames or animations.
```
function make_aseprite()
```
## cull_sprites
> Filter an array of sprites to only those visible in the provided camera's view.
```
function cull_sprites()
```
## rects_to_sprites
> Convert an array of rect coords into sprite objects referencing an image.
```
function rects_to_sprites()
```
## make_surface
> Create a blank RGBA surface with the given dimensions. For software rendering or icons.
```
function make_surface()
```
## make_cursor
> Create an SDL_Cursor from an existing surface and a given hotspot location.
```
function make_cursor()
```
## make_font
> Load a font from TTF/OTF data (an ArrayBuffer) at the given pixel size.
```
function make_font()
```
## make_sprite
> Create a new sprite object, which has rect, color, layer, and image references.
```
function make_sprite()
```
## make_line_prim
> Build a GPU mesh representing a thick polyline from an array of points, using parsl.
```
function make_line_prim()
```
## is_image
```
function is_image(obj)
```
## texture
```
function texture(path)
```
## tex_hotreload
```
function tex_hotreload(file)
```
## get_font
```
function get_font(path,size)
```
## queue_sprite_mesh
```
function queue_sprite_mesh(queue)
```

View File

@@ -1,75 +1,100 @@
# input
#### show_keyboard()
# input Module
## mouse_show
> Show or hide the mouse cursor. Pass true to show, false to hide.
```
function mouse_show()
```
## mouse_lock
#### keyboard_shown()
> Capture or release the mouse. Pass true to lock, false to unlock.
```
function mouse_lock()
```
## cursor_set
#### mouse_mode()
> Set the given cursor (created by os.make_cursor) as the active mouse cursor.
```
function cursor_set()
```
## keyname
#### mouse_cursor()
> Given a numeric keycode, return the corresponding key name (e.g., from SDL).
```
function keyname()
```
## keymod
#### cursor_img()
> Return an object describing the current modifier keys, e.g. {shift:true, ctrl:true}.
```
function keymod()
```
#### keycodes
**object**
## mouse
#### codekeys
**object**
## keyboard
## print_pawn_kbm
#### mouse
**object**
[object Object]
#### keyboard
**object**
```
function print_pawn_kbm(pawn)
```
## procdown
#### state2str(state)
```
function procdown()
```
## print_md_kbm
#### print_pawn_kbm(pawn)
```
function print_md_kbm(pawn)
```
## has_bind
#### procdown()
```
function has_bind(pawn, bind)
```
#### print_md_kbm(pawn)
## action
## tabcomplete
#### has_bind(pawn, bind)
```
function tabcomplete(val, list)
```
## do_uncontrol
#### action
**object**
#### tabcomplete(val, list)
#### do_uncontrol(pawn)
```
function do_uncontrol(pawn)
```
## player

View File

@@ -1,84 +1,154 @@
# io
Functions for filesystem input/output commands.
#### exists()
# io Module
Returns true if a file exists.
## rm
#### ls()
> Remove the file or empty directory at the given path.
List contents of the game directory.
#### cp(f1,f2)
Copy file f1 to f2.
#### mv()
Rename file f1 to f2.
#### rm(f)
Remove file f.
#### chdir()
```
function rm()
```
## mkdir
#### mkdir()
> Create a directory at the given path.
Make dir.
#### chmod(file,mode)
```
function mkdir()
```
## stat
#### slurp(path)
> Return an object describing file metadata for the given path. The object includes filesize, modtime, createtime, and accesstime. Throw an error if the path does not exist.
Returns the contents of given file as a string.
#### slurpbytes(path)
Return the contents of a file as a byte array.
#### slurpwrite(path, c)
Write a given string to a given file.
#### save_qoa()
```
function stat()
```
## globfs
#### pack_start()
> Return an array of files matching any glob patterns provided. Recursively enumerates the filesystem within PHYSFS.
```
function globfs()
```
## match
#### pack_add()
> Return boolean indicating whether the given path[1] matches the provided wildcard pattern[2].
```
function match()
```
## exists
#### pack_end()
> Return a boolean indicating whether the file or directory at the given path exists.
```
function exists()
```
## mount
#### mod()
> Mount a directory or archive[1] at the specified mount point[2]. An undefined mount point mounts to '/'. Throw on error.
```
function mount()
```
## unmount
#### dumpfolder
**string**
> Unmount a previously mounted directory or archive. Throw on error.
```
function unmount()
```
## slurp
#### mkpath(dir)
> Read the entire file at the given path as a string. Throw on error.
```
function slurp()
```
## slurpbytes
#### extensions(ext)
> Read the entire file at the given path as a raw ArrayBuffer. Throw on error.
```
function slurpbytes()
```
## slurpwrite
#### glob(pat)
> Write data[1] (string or ArrayBuffer) to the given file path[2]. Overwrite if it exists. Throw on error.
Glob files in game directory.
```
function slurpwrite()
```
## writepath
> Set the write directory. Subsequent writes will go here by default. Throw on error.
```
function writepath()
```
## basedir
> Return the application's base directory (where the executable is located).
```
function basedir()
```
## userdir
> Return the user's directory, often used for saving data.
```
function userdir()
```
## realdir
> Return the actual, real directory (on the host filesystem) that contains the given file path. Return undefined if not found.
```
function realdir()
```
## open
> Open a file for writing, returning a file object that can be used for further operations. Throw on error.
```
function open()
```
## searchpath
> Return an array of all directories in the current paths.
```
function searchpath()
```

100
docs/api/js.md Normal file
View File

@@ -0,0 +1,100 @@
# js Module
## dump_mem
> Return a string summarizing memory usage in the QuickJS runtime.
```
function dump_mem()
```
## dump_shapes
> Return a debug string describing the internal shape hierarchy used by QuickJS.
```
function dump_shapes()
```
## dump_atoms
> Return a debug string describing all currently registered atoms in the QuickJS runtime.
```
function dump_atoms()
```
## calc_mem
> Return the approximate memory usage of a single JS value.
```
function calc_mem()
```
## mem
> Return a comprehensive memory usage object for the current QuickJS runtime.
```
function mem()
```
## mem_limit
> Set (in bytes) the maximum memory the QuickJS runtime will attempt to use.
```
function mem_limit()
```
## gc_threshold
> Set the threshold at which garbage collection triggers automatically, in bytes.
```
function gc_threshold()
```
## max_stacksize
> Set the maximum allowed stack size for QuickJS. Exceeding it can cause errors.
```
function max_stacksize()
```
## memstate
> Return simpler memory usage (malloc sizes, etc.) for the QuickJS runtime.
```
function memstate()
```
## gc
> Force a full garbage collection immediately.
```
function gc()
```
## eval
> Evaluate the given JavaScript source string with an optional filename, returning the result.
```
function eval()
```

View File

@@ -1,15 +1,15 @@
# json
json implementation.
#### encode(value, replacer, space = 1)
# json Module
Encode a value to json.
## encode
#### decode(text, reviver)
Decode a json string to a value.
#### readout(obj)
Encode an object fully, including function definitions.
```
function encode(val,space,replacer,whitelist)
```
## decode
```
function decode(text,reviver)
```

8
docs/api/loop.md Normal file
View File

@@ -0,0 +1,8 @@
# loop Module
## step
```
function step()
```

271
docs/api/math.md Normal file
View File

@@ -0,0 +1,271 @@
# math Module
## dot
> Compute the dot product between two numeric arrays, returning a scalar. Extra elements are ignored.
```
function dot()
```
## project
> Project one vector onto another, returning a new array of the same dimension.
```
function project()
```
## rotate
> Rotate a 2D point (or array of length 2) by the given angle (in turns) around an optional pivot.
```
function rotate()
```
## midpoint
> Compute the midpoint of two arrays of numbers. Only the first two entries are used if 2D is intended.
```
function midpoint()
```
## reflect
> Reflect a vector across a plane normal. Both arguments must be numeric arrays.
```
function reflect()
```
## distance
> Compute the Euclidean distance between two numeric arrays of matching length.
```
function distance()
```
## direction
> Compute the normalized direction vector from the first array to the second.
```
function direction()
```
## angle
> Given a 2D vector, return its angle from the X-axis in radians or some chosen units.
```
function angle()
```
## norm
> Return a normalized copy of the given numeric array. For 2D/3D/4D or arbitrary length.
```
function norm()
```
## angle_between
> Compute the angle between two vectors (2D/3D/4D).
```
function angle_between()
```
## lerp
> Linear interpolation between two numbers: lerp(a, b, t).
```
function lerp()
```
## gcd
> Compute the greatest common divisor of two integers.
```
function gcd()
```
## lcm
> Compute the least common multiple of two integers.
```
function lcm()
```
## clamp
> Clamp a number between low and high. clamp(value, low, high).
```
function clamp()
```
## angledist
> Compute the signed distance between two angles in 'turn' units, e.g. 0..1 range.
```
function angledist()
```
## jitter
> Apply a random +/- percentage noise to a number. Example: jitter(100, 0.05) -> ~95..105.
```
function jitter()
```
## mean
> Compute the arithmetic mean of an array of numbers.
```
function mean()
```
## sum
> Sum all elements of an array of numbers.
```
function sum()
```
## sigma
> Compute standard deviation of an array of numbers.
```
function sigma()
```
## median
> Compute the median of an array of numbers.
```
function median()
```
## length
> Return the length of a vector (i.e. sqrt of sum of squares).
```
function length()
```
## from_to
> Return an array of points from a start to an end, spaced out by a certain distance.
```
function from_to()
```
## rand
> Return a random float in [0,1).
```
function rand()
```
## randi
> Return a random 32-bit integer.
```
function randi()
```
## srand
> Seed the random number generator with the given integer, or with current time if none.
```
function srand()
```
## TAU
## deg2rad
```
function deg2rad(deg)
```
## rad2deg
```
function rad2deg(rad)
```
## turn2rad
```
function turn2rad(x)
```
## rad2turn
```
function rad2turn(x)
```
## turn2deg
```
function turn2deg(x)
```
## deg2turn
```
function deg2turn(x)
```

View File

@@ -1,149 +1,226 @@
# os
#### cwd()
# os Module
Get the absolute path of the current working directory.
## make_transform
#### env()
> Create a new transform object that can be used for 2D/3D positioning, scaling, and rotation.
Return the value of the environment variable v.
```
function make_transform()
```
#### sys()
## clean_transforms
> Force an update on all transforms to remove dangling references or perform house-keeping.
#### system()
```
function clean_transforms()
```
## platform
#### quit()
> Return a string with the underlying platform name, like 'Windows', 'Linux', or 'macOS'.
```
function platform()
```
#### exit()
## arch
> Return the CPU architecture string for this system (e.g. 'x64', 'arm64').
```
function arch()
```
#### reindex_static()
## totalmem
> Return the total system RAM in bytes.
#### gc()
```
function totalmem()
```
## freemem
#### eval()
> Return the amount of free system RAM in bytes, if known.
```
function freemem()
```
#### make_body()
## hostname
> Return the system's hostname, or an empty string if not available.
```
function hostname()
```
#### make_circle2d()
## version
> Return the OS or kernel version string, if the platform provides it.
#### make_poly2d()
```
function version()
```
## kill
#### make_seg2d()
> Send a signal (e.g., 'SIGINT', 'SIGTERM', etc.) to the current process.
```
function kill()
```
#### make_texture()
## exit
> Exit the application with the specified exit code.
```
function exit()
```
#### make_tex_data()
## now
> Return current time (in seconds as a float) with high resolution.
#### make_font()
```
function now()
```
## openurl
#### make_model()
> Open the provided URL in the default web browser, if possible.
```
function openurl()
```
#### make_transform()
## make_timer
> Create a new timer object that will call a specified function after a certain delay.
```
function make_timer()
```
#### make_emitter()
## update_timers
> Advance all timers by the provided time delta (in seconds).
#### make_buffer()
```
function update_timers()
```
## sleep
#### make_line_prim()
> Block execution for the specified number of seconds.
```
function sleep()
```
#### make_cylinder()
## battery_pct
> Return the battery level (percentage) or negative if unknown.
```
function battery_pct()
```
#### make_cone()
## battery_voltage
> Return the current battery voltage in volts, if available.
#### make_disk()
```
function battery_voltage()
```
## battery_seconds
#### make_torus()
> Return the estimated remaining battery time in seconds, or negative if unknown.
```
function battery_seconds()
```
#### make_sphere()
## power_state
> Return a string describing power status: 'on battery', 'charging', 'charged', etc.
```
function power_state()
```
#### make_klein_bottle()
## on
> Register a global callback for certain engine-wide or system-level events.
#### make_trefoil_knot()
```
function on()
```
## rt_info
#### make_hemisphere()
> Return internal QuickJS runtime info, such as object counts.
```
function rt_info()
```
#### make_plane()
## rusage
> Return resource usage stats for this process, if the platform supports it.
```
function rusage()
```
#### make_video()
## mallinfo
> Return detailed memory allocation info (arena size, free blocks, etc.) on some platforms.
#### platform
**string**
```
function mallinfo()
```
## env
#### user
**string**
> Fetch the value of a given environment variable, or undefined if it doesn't exist.
```
function env()
```
#### home
**string**
#### prefpath()
#### openurl(url)
## system
> Execute a shell command using the system() call. Returns the command's exit code.
```
function system()
```

View File

@@ -1,189 +1,66 @@
# render
Draw shapes in screen space.
#### flushtext()
# render Module
## _main
#### camera_screen2world()
## device
## toggles
#### viewport()
## stencil_writer
```
function stencil_writer(...args)
```
#### end_pass()
## fillmask
```
function fillmask(ref)
```
#### commit()
## mask
```
function mask(image, pos, scale, rotation = 0, ref = 1)
```
#### glue_pass()
## viewport
```
function viewport(rect)
```
#### text_size()
## scissor
```
function scissor(rect)
```
#### text_ssbo()
## queue
```
function queue(cmd)
```
#### set_camera()
## setup_draw
#### pipeline()
#### setuniv3()
#### setuniv()
#### spdraw()
#### setuniproj()
#### setuniview()
#### setunivp()
#### setunim4()
#### setuniv2()
#### setuniv4()
#### setpipeline()
#### screencolor()
#### imgui_new()
#### gfx_gui()
#### imgui_end()
#### imgui_init()
#### poly_prim(verts)
#### make_shader(shader)
#### shader_apply_material(shader, material = {})
#### sg_bind(shader, mesh = {}, material = {}, ssbo)
#### device
**object**
Device resolutions given as [x,y,inches diagonal].
#### init()
#### circle(pos, radius, color)
#### poly(points, color, transform)
#### line(points, color = Color.white, thickness = 1, transform)
#### point(pos,size,color = Color.blue)
#### cross(pos, size, color = Color.red)
Draw a cross centered at pos, with arm length size.
#### arrow(start, end, color = Color.red, wingspan = 4, wingangle = 10)
Draw an arrow from start to end, with wings of length wingspan at angle wingangle.
#### coordinate(pos, size, color)
#### boundingbox(bb, color = Color.white)
#### rectangle(lowerleft, upperright, color)
Draw a rectangle, with its corners at lowerleft and upperright.
#### box(pos, wh, color = Color.white)
#### window(pos, wh, color)
#### text(str, pos, size = 1, color = Color.white, wrap = -1, anchor = [0,1], cursor = -1)
#### image(tex, pos, scale = 1, rotation = 0, color = Color.white, dimensions = [tex.width, tex.height])
#### fontcache
**object**
#### set_font(path, size)
```
function setup_draw()
```
## setup_hud
```
function setup_hud()
```

32
docs/api/sound.md Normal file
View File

@@ -0,0 +1,32 @@
# sound Module
## undefined
## pcm
```
function pcm(file)
```
## play
```
function play(file)
```
## cry
```
function cry(file)
```
## music
```
function music(file, fade = 0.5)
```

View File

@@ -1,115 +1,137 @@
# time
Functions for manipulating time.
#### now()
# time Module
Get the time now.
## now
#### computer_dst()
> Return the current system time as a floating-point number of seconds with microsecond precision.
Return true if the computer is in daylight savings.
#### computer_zone()
Get the time zone of the running computer.
#### hour2minute()
```
function now()
```
## computer_dst
#### day2hour()
> Return true if the local system time is currently in Daylight Savings Time, otherwise false.
```
function computer_dst()
```
## computer_zone
#### minute2second()
> Return the local time zone offset from UTC in hours, e.g. -5 for EST.
```
function computer_zone()
```
## hour2minute
#### week2day()
```
function hour2minute()
```
## day2hour
#### strparse
**object**
```
function day2hour()
```
## minute2second
#### second
**number**
Earth-seconds in a second.
#### minute
**number**
Seconds in a minute.
#### hour
**number**
Seconds in an hour.
#### day
**number**
Seconds in a day.
#### week
**number**
Seconds in a week.
#### weekdays
**array**
Names of the days of the week.
#### monthstr
**array**
Full names of the months of the year.
#### epoch
**number**
Times are expressed in terms of day 0 at hms 0 of this year.
#### isleap(year)
Return true if the given year is a leapyear.
#### yearsize(y)
Given a year, return the number of days in that year.
#### timecode(t, fps = 24)
```
function minute2second()
```
## week2day
#### monthdays
**array**
Number of days in each month.
#### zones
**object**
```
function week2day()
```
#### record(num, zone = this.computer_zone()
Given a time, return an object with time fields.
#### number(rec)
Return the number representation of a given time.
#### fmt
**string**
Default format for time.
#### text(num, fmt = this.fmt, zone)
Return a text formatted time.
## strparse
## doc
## second
## minute
## hour
## day
## week
## weekdays
## monthstr
## epoch
## isleap
```
function isleap(year)
```
## yearsize
```
function yearsize(y)
```
## timecode
```
function timecode(t, fps = 24)
```
## monthdays
## zones
## record
```
function record(num, zone = this.computer_zone()
```
## number
```
function number(rec)
```
## fmt
## text
```
function text(num, fmt = this.fmt, zone)
```

14
docs/api/tween.md Normal file
View File

@@ -0,0 +1,14 @@
# tween Module
## Tween
## Ease
## tween
```
function tween(from, to, time, fn, cb)
```

103
docs/api/util.md Normal file
View File

@@ -0,0 +1,103 @@
# util Module
## guid
> Return a random 32-character hexadecimal UUID-like string.
```
function guid()
```
## insertion_sort
> In-place insertion sort of an array using a comparison function cmp(a,b)->Number.
```
function insertion_sort()
```
## deepfreeze
```
function deepfreeze(obj)
```
## dainty_assign
```
function dainty_assign(target, source)
```
## get
```
function get(obj, path, defValue)
```
## isObject
```
function isObject(o)
```
## isEmpty
```
function isEmpty(o)
```
## dig
```
function dig(obj, path, def = {})
```
## access
```
function access(obj, name)
```
## mergekey
```
function mergekey(o1, o2, k)
```
## merge
```
function merge(target, ...objs)
```
## copy
```
function copy(proto, ...objs)
```
## obj_lerp
```
function obj_lerp(a,b,t)
```
## normalizeSpacing
```
function normalizeSpacing(spacing)
```

10
docs/api/video.md Normal file
View File

@@ -0,0 +1,10 @@
# video Module
## make_video
> Decode a video file (MPEG, etc.) from an ArrayBuffer, returning a datastream object.
```
function make_video()
```

View File

@@ -1,12 +1,48 @@
// doc.js
var ret = {}
ret.sym = Symbol()
var io = use('io')
// List of modules (script names) to document
var docs = [
"actor",
"base",
"cmd",
"color",
"doc",
"draw2d",
"engine",
"event",
"geometry",
"graphics",
"input",
"io",
"js",
"json",
"loop",
"math",
"os",
"render",
"resources",
"sound",
"spline",
"time",
"tween",
"util",
"video"
]
/*
To get a module, do "var mod = use('SCRIPT')".
Each module has functions, parameters, etc. We print them, along with any doc string.
*/
ret.print_api = function(obj) {
for (var prop in obj) {
if (!obj.hasOwnProperty(prop)) continue
var val = obj[prop]
console.log(prop)
if (val[ret.sym]) console.log(' doc: ' + val[ret.sym])
if (val[prosperon.DOC]) console.log(' doc: ' + val[prosperon.DOC])
if (typeof val === 'function') {
var m = val.toString().match(/\(([^)]*)\)/)
if (m) console.log(' function: ' + prop + '(' + m[1].trim() + ')')
@@ -14,4 +50,60 @@ ret.print_api = function(obj) {
}
}
ret.print_modules = function() {
console.log("PRINTING MODULES")
for (var i = 0; i < docs.length; i++) {
var name = docs[i]
var mod = use(name)
console.log('MODULE: ' + name)
if (mod[prosperon.DOC]) console.log(' doc: ' + mod[prosperon.DOC])
ret.print_api(mod)
console.log('')
}
}
// Writes each module's docs to .src/docs/api/<moduleName>.md
ret.write_modules = function() {
var docsDir = '.src/docs/api'
if (!io.exists(docsDir)) io.mkdir(docsDir)
for (var i = 0; i < docs.length; i++) {
var name = docs[i]
var mod = use(name)
var lines = []
lines.push('# ' + name + ' Module\n')
// If the module itself has a docstring, include it
if (mod[prosperon.DOC]) {
lines.push(mod[prosperon.DOC] + '\n')
}
// Now list out each property/method
for (var prop in mod) {
if (!mod.hasOwnProperty(prop)) continue
var val = mod[prop]
// Section for this property
lines.push('## ' + prop + '\n')
// Show doc if available
if (val[prosperon.DOC]) {
lines.push('> ' + val[prosperon.DOC] + '\n')
}
// If it's a function, show signature
if (typeof val === 'function') {
var m = val.toString().match(/\(([^)]*)\)/)
if (m) lines.push('```\nfunction ' + prop + '(' + m[1].trim() + ')\n```')
lines.push('')
}
lines.push('')
}
var out = lines.join('\n')
io.slurpwrite(docsDir + '/' + name + '.md', out)
}
}
return ret

View File

@@ -1,5 +1,6 @@
var event = this
event.push_event[prosperon.DOC] = "Push a custom user event into SDL's queue, passing a callback function."
event.engine_input[prosperon.DOC] = "Poll all system events (keyboard, mouse, etc.) and call the given function with each event object."
return event

View File

@@ -1,17 +1,16 @@
var geometry = this
var math = use('math')
var shape = {};
shape.box = {};
shape.box.points = function (ll, ur) {
geometry.box = {};
geometry.box.points = function (ll, ur) {
return [ll, ll.add([ur.x - ll.x, 0]), ur, ll.add([0, ur.y - ll.y])];
};
shape.sphere = {};
shape.circle = {};
shape.sphere.volume = function (r) {
geometry.sphere = {};
geometry.circle = {};
geometry.sphere.volume = function (r) {
return (Math.pi * r * r * r * 4) / 3;
};
shape.sphere.random = function (r, theta = [0, 1], phi = [-0.5, 0.5]) {
geometry.sphere.random = function (r, theta = [0, 1], phi = [-0.5, 0.5]) {
if (typeof r === "number") r = [r, r];
if (typeof theta === "number") theta = [theta, theta];
if (typeof phi === "number") phi = [phi, phi];
@@ -22,14 +21,14 @@ shape.sphere.random = function (r, theta = [0, 1], phi = [-0.5, 0.5]) {
return [ra * Math.sin(ta) * Math.cos(pa), ra * Math.sin(ta) * Math.sin(pa), ra * Math.cos(ta)];
};
shape.circle.area = function (r) {
geometry.circle.area = function (r) {
return Math.pi * r * r;
};
shape.circle.random = function (r, theta) {
return shape.sphere.random(r, theta).xz;
geometry.circle.random = function (r, theta) {
return geometry.sphere.random(r, theta).xz;
};
shape.box = function (w, h) {
geometry.box = function (w, h) {
w /= 2;
h /= 2;
@@ -43,11 +42,11 @@ shape.box = function (w, h) {
return points;
};
shape.ngon = function (radius, n) {
return shape.arc(radius, 360, n);
geometry.ngon = function (radius, n) {
return geometry.arc(radius, 360, n);
};
shape.arc = function (radius, angle, n, start = 0) {
geometry.arc = function (radius, angle, n, start = 0) {
start = Math.deg2rad(start);
if (angle >= 360) angle = 360;
@@ -61,19 +60,19 @@ shape.arc = function (radius, angle, n, start = 0) {
return points;
};
shape.circle.points = function (radius, n) {
geometry.circle.points = function (radius, n) {
if (n <= 1) return [];
return shape.arc(radius, 360, n);
return geometry.arc(radius, 360, n);
};
shape.corners2points = function (ll, ur) {
geometry.corners2points = function (ll, ur) {
return [ll, ll.add([ur.x, 0]), ur, ll.add([0, ur.y])];
};
for (var i in geometry)
shape[i] = geometry[i]
geometry[i] = geometry[i]
shape.sortpointsccw = function (points) {
geometry.sortpointsccw = function (points) {
var cm = points2cm(points);
var cmpoints = points.map(function (x) {
return x.sub(cm);
@@ -89,7 +88,7 @@ shape.sortpointsccw = function (points) {
});
};
shape.points2cm = function(points)
geometry.points2cm = function(points)
{
var x = 0;
var y = 0;
@@ -102,4 +101,14 @@ shape.points2cm = function(points)
return [x / n, y / n];
}
return shape
geometry.rect_intersection[prosperon.DOC] = "Return the intersection of two rectangles (x,y,w,h). The result may be empty if no intersection."
geometry.rect_intersects[prosperon.DOC] = "Return a boolean indicating if two rectangles overlap."
geometry.rect_expand[prosperon.DOC] = "Merge or combine two rectangles, returning their bounding rectangle."
geometry.rect_inside[prosperon.DOC] = "Return true if the first rectangle is completely inside the second."
geometry.rect_random[prosperon.DOC] = "Return a random point within the given rectangle (uniform distribution)."
geometry.cwh2rect[prosperon.DOC] = "Helper: convert a center point and width/height vector to a rect object."
geometry.rect_point_inside[prosperon.DOC] = "Return true if the given point is inside the given rectangle."
geometry.rect_pos[prosperon.DOC] = "Return just the (x,y) position of a rectangle as a 2D array."
geometry.rect_move[prosperon.DOC] = "Offset a rectangle by a 2D vector."
return geometry

View File

@@ -195,4 +195,21 @@ graphics.queue_sprite_mesh = function(queue)
return [mesh.pos,mesh.uv,mesh.color,mesh.indices]
}
graphics.make_sprite_mesh[prosperon.DOC] = "Given an array of sprites, build a single geometry mesh for rendering them."
graphics.make_sprite_queue[prosperon.DOC] = "Given an array of sprites, optionally sort them and build a queue of pipeline commands."
graphics.make_text_buffer[prosperon.DOC] = "Generate a GPU buffer mesh of text quads for rendering with a font, etc."
graphics.rectpack[prosperon.DOC] = "Perform a rectangle packing using the stbrp library. Return positions for each rect."
graphics.make_rtree[prosperon.DOC] = "Create a new R-Tree for quickly querying many rectangles or sprite bounds."
graphics.make_texture[prosperon.DOC] = "Convert raw image bytes (PNG, JPG) into an SDL_Surface object."
graphics.make_gif[prosperon.DOC] = "Load a GIF from an array of bytes, returning an object with frames[] of surfaces."
graphics.make_aseprite[prosperon.DOC] = "Load an Aseprite/ASE file from an array of bytes, returning frames or animations."
graphics.cull_sprites[prosperon.DOC] = "Filter an array of sprites to only those visible in the provided camera's view."
graphics.rects_to_sprites[prosperon.DOC] = "Convert an array of rect coords into sprite objects referencing an image."
graphics.make_surface[prosperon.DOC] = "Create a blank RGBA surface with the given dimensions. For software rendering or icons."
graphics.make_cursor[prosperon.DOC] = "Create an SDL_Cursor from an existing surface and a given hotspot location."
graphics.make_font[prosperon.DOC] = "Load a font from TTF/OTF data (an ArrayBuffer) at the given pixel size."
graphics.make_sprite[prosperon.DOC] = "Create a new sprite object, which has rect, color, layer, and image references."
graphics.make_line_prim[prosperon.DOC] = "Build a GPU mesh representing a thick polyline from an array of points, using parsl."
return graphics

9
scripts/input.js Normal file
View File

@@ -0,0 +1,9 @@
var input = this
input.mouse_show[prosperon.DOC] = "Show or hide the mouse cursor. Pass true to show, false to hide."
input.mouse_lock[prosperon.DOC] = "Capture or release the mouse. Pass true to lock, false to unlock."
input.cursor_set[prosperon.DOC] = "Set the given cursor (created by os.make_cursor) as the active mouse cursor."
input.keyname[prosperon.DOC] = "Given a numeric keycode, return the corresponding key name (e.g., from SDL)."
input.keymod[prosperon.DOC] = "Return an object describing the current modifier keys, e.g. {shift:true, ctrl:true}."
return input

37
scripts/io.js Normal file
View File

@@ -0,0 +1,37 @@
var io = this
io.rm[prosperon.DOC] = "Remove the file or empty directory at the given path."
io.mkdir[prosperon.DOC] = "Create a directory at the given path."
io.exists[prosperon.DOC] = "Return a boolean indicating whether the file or directory at the given path exists."
io.stat[prosperon.DOC] = "Return an object describing file metadata for the given path. The object includes filesize, modtime, createtime, and accesstime. Throw an error if the path does not exist."
io.slurpbytes[prosperon.DOC] = "Read the entire file at the given path as a raw ArrayBuffer. Throw on error."
io.slurp[prosperon.DOC] = "Read the entire file at the given path as a string. Throw on error."
io.slurpwrite[prosperon.DOC] = "Write data[1] (string or ArrayBuffer) to the given file path[2]. Overwrite if it exists. Throw on error."
io.mount[prosperon.DOC] = "Mount a directory or archive[1] at the specified mount point[2]. An undefined mount point mounts to '/'. Throw on error."
io.unmount[prosperon.DOC] = "Unmount a previously mounted directory or archive. Throw on error."
io.writepath[prosperon.DOC] = "Set the write directory. Subsequent writes will go here by default. Throw on error."
io.match[prosperon.DOC] = "Return boolean indicating whether the given path[1] matches the provided wildcard pattern[2]."
io.globfs[prosperon.DOC] = "Return an array of files matching any glob patterns provided. Recursively enumerates the filesystem within PHYSFS."
io.basedir[prosperon.DOC] = "Return the application's base directory (where the executable is located)."
io.userdir[prosperon.DOC] = "Return the user's directory, often used for saving data."
io.open[prosperon.DOC] = "Open a file for writing, returning a file object that can be used for further operations. Throw on error."
io.realdir[prosperon.DOC] = "Return the actual, real directory (on the host filesystem) that contains the given file path. Return undefined if not found."
io.searchpath[prosperon.DOC] = "Return an array of all directories in the current paths."
return io

15
scripts/js.js Normal file
View File

@@ -0,0 +1,15 @@
var js = this
js.dump_mem[prosperon.DOC] = "Return a string summarizing memory usage in the QuickJS runtime."
js.dump_shapes[prosperon.DOC] = "Return a debug string describing the internal shape hierarchy used by QuickJS."
js.dump_atoms[prosperon.DOC] = "Return a debug string describing all currently registered atoms in the QuickJS runtime."
js.calc_mem[prosperon.DOC] = "Return the approximate memory usage of a single JS value."
js.mem[prosperon.DOC] = "Return a comprehensive memory usage object for the current QuickJS runtime."
js.mem_limit[prosperon.DOC] = "Set (in bytes) the maximum memory the QuickJS runtime will attempt to use."
js.gc_threshold[prosperon.DOC] = "Set the threshold at which garbage collection triggers automatically, in bytes."
js.max_stacksize[prosperon.DOC] = "Set the maximum allowed stack size for QuickJS. Exceeding it can cause errors."
js.memstate[prosperon.DOC] = "Return simpler memory usage (malloc sizes, etc.) for the QuickJS runtime."
js.gc[prosperon.DOC] = "Force a full garbage collection immediately."
js.eval[prosperon.DOC] = "Evaluate the given JavaScript source string with an optional filename, returning the result."
return js

View File

@@ -1,5 +1,32 @@
var math = this
math.dot[prosperon.DOC] = "Compute the dot product between two numeric arrays, returning a scalar. Extra elements are ignored."
math.project[prosperon.DOC] = "Project one vector onto another, returning a new array of the same dimension."
math.rotate[prosperon.DOC] = "Rotate a 2D point (or array of length 2) by the given angle (in turns) around an optional pivot."
math.midpoint[prosperon.DOC] = "Compute the midpoint of two arrays of numbers. Only the first two entries are used if 2D is intended."
math.reflect[prosperon.DOC] = "Reflect a vector across a plane normal. Both arguments must be numeric arrays."
math.distance[prosperon.DOC] = "Compute the Euclidean distance between two numeric arrays of matching length."
math.direction[prosperon.DOC] = "Compute the normalized direction vector from the first array to the second."
math.angle[prosperon.DOC] = "Given a 2D vector, return its angle from the X-axis in radians or some chosen units."
math.norm[prosperon.DOC] = "Return a normalized copy of the given numeric array. For 2D/3D/4D or arbitrary length."
math.angle_between[prosperon.DOC] = "Compute the angle between two vectors (2D/3D/4D)."
math.lerp[prosperon.DOC] = "Linear interpolation between two numbers: lerp(a, b, t)."
math.gcd[prosperon.DOC] = "Compute the greatest common divisor of two integers."
math.lcm[prosperon.DOC] = "Compute the least common multiple of two integers."
math.clamp[prosperon.DOC] = "Clamp a number between low and high. clamp(value, low, high)."
math.angledist[prosperon.DOC] = "Compute the signed distance between two angles in 'turn' units, e.g. 0..1 range."
math.jitter[prosperon.DOC] = "Apply a random +/- percentage noise to a number. Example: jitter(100, 0.05) -> ~95..105."
math.mean[prosperon.DOC] = "Compute the arithmetic mean of an array of numbers."
math.sum[prosperon.DOC] = "Sum all elements of an array of numbers."
math.sigma[prosperon.DOC] = "Compute standard deviation of an array of numbers."
math.median[prosperon.DOC] = "Compute the median of an array of numbers."
math.length[prosperon.DOC] = "Return the length of a vector (i.e. sqrt of sum of squares)."
math.from_to[prosperon.DOC] = "Return an array of points from a start to an end, spaced out by a certain distance."
math.rand[prosperon.DOC] = "Return a random float in [0,1)."
math.randi[prosperon.DOC] = "Return a random 32-bit integer."
math.srand[prosperon.DOC] = "Seed the random number generator with the given integer, or with current time if none."
math.TAU = Math.PI * 2;
math.deg2rad = function (deg) { return deg * 0.0174533; };
math.rad2deg = function (rad) { return rad / 0.0174533; };

34
scripts/os.js Normal file
View File

@@ -0,0 +1,34 @@
var os = this
os.make_transform[prosperon.DOC] = "Create a new transform object that can be used for 2D/3D positioning, scaling, and rotation."
os.clean_transforms[prosperon.DOC] = "Force an update on all transforms to remove dangling references or perform house-keeping."
os.platform[prosperon.DOC] = "Return a string with the underlying platform name, like 'Windows', 'Linux', or 'macOS'."
os.arch[prosperon.DOC] = "Return the CPU architecture string for this system (e.g. 'x64', 'arm64')."
os.totalmem[prosperon.DOC] = "Return the total system RAM in bytes."
os.freemem[prosperon.DOC] = "Return the amount of free system RAM in bytes, if known."
os.hostname[prosperon.DOC] = "Return the system's hostname, or an empty string if not available."
os.version[prosperon.DOC] = "Return the OS or kernel version string, if the platform provides it."
os.kill[prosperon.DOC] = "Send a signal (e.g., 'SIGINT', 'SIGTERM', etc.) to the current process."
os.exit[prosperon.DOC] = "Exit the application with the specified exit code."
os.now[prosperon.DOC] = "Return current time (in seconds as a float) with high resolution."
os.openurl[prosperon.DOC] = "Open the provided URL in the default web browser, if possible."
os.make_timer[prosperon.DOC] = "Create a new timer object that will call a specified function after a certain delay."
os.update_timers[prosperon.DOC] = "Advance all timers by the provided time delta (in seconds)."
os.sleep[prosperon.DOC] = "Block execution for the specified number of seconds."
os.battery_pct[prosperon.DOC] = "Return the battery level (percentage) or negative if unknown."
os.battery_voltage[prosperon.DOC] = "Return the current battery voltage in volts, if available."
os.battery_seconds[prosperon.DOC] = "Return the estimated remaining battery time in seconds, or negative if unknown."
os.power_state[prosperon.DOC] = "Return a string describing power status: 'on battery', 'charging', 'charged', etc."
os.on[prosperon.DOC] = "Register a global callback for certain engine-wide or system-level events."
os.rt_info[prosperon.DOC] = "Return internal QuickJS runtime info, such as object counts."
os.rusage[prosperon.DOC] = "Return resource usage stats for this process, if the platform supports it."
os.mallinfo[prosperon.DOC] = "Return detailed memory allocation info (arena size, free blocks, etc.) on some platforms."
os.env[prosperon.DOC] = "Fetch the value of a given environment variable, or undefined if it doesn't exist."
os.system[prosperon.DOC] = "Execute a shell command using the system() call. Returns the command's exit code."
return os

6
scripts/spline.js Normal file
View File

@@ -0,0 +1,6 @@
var spline = this
spline.catmull[prosperon.DOC] = "Perform Catmull-Rom spline sampling on an array of 2D points, returning an array of samples."
spline.bezier[prosperon.DOC] = "Perform a Bezier spline (or catmull) sampling on 2D points, returning an array of sampled points."
return spline

View File

@@ -32,6 +32,10 @@ time.strparse = {
s: "second",
};
time.now[prosperon.DOC] = "Return the current system time as a floating-point number of seconds with microsecond precision."
time.computer_dst[prosperon.DOC] = "Return true if the local system time is currently in Daylight Savings Time, otherwise false."
time.computer_zone[prosperon.DOC] = "Return the local time zone offset from UTC in hours, e.g. -5 for EST."
time.doc = {
doc: "Functions for manipulating time.",
second: "Earth-seconds in a second.",

View File

@@ -115,4 +115,8 @@ util.normalizeSpacing = function normalizeSpacing(spacing) {
}
}
util.guid[prosperon.DOC] = "Return a random 32-character hexadecimal UUID-like string."
util.insertion_sort[prosperon.DOC] = "In-place insertion sort of an array using a comparison function cmp(a,b)->Number."
return util

5
scripts/video.js Normal file
View File

@@ -0,0 +1,5 @@
var video = this
video.make_video[prosperon.DOC] = "Decode a video file (MPEG, etc.) from an ArrayBuffer, returning a datastream object."
return video

View File

@@ -5964,7 +5964,7 @@ static const JSCFunctionListEntry js_io_funcs[] = {
MIST_FUNC_DEF(io,basedir, 0),
MIST_FUNC_DEF(io, userdir, 0),
MIST_FUNC_DEF(io, realdir, 1),
MIST_FUNC_DEF(io, open, 2),
MIST_FUNC_DEF(io, open, 1),
MIST_FUNC_DEF(io, searchpath, 0),
};
@@ -7095,8 +7095,6 @@ static const JSCFunctionListEntry js_os_funcs[] = {
MIST_FUNC_DEF(os, openurl, 1),
MIST_FUNC_DEF(os, make_timer, 1),
MIST_FUNC_DEF(os, update_timers, 1),
@@ -7501,6 +7499,8 @@ JSValue js_imgui_use(JSContext *js);
#define MISTLINE(NAME) (ModuleEntry){#NAME, js_##NAME##_use}
void ffi_load(JSContext *js, int argc, char **argv) {
JSValue DOC = JS_NewSymbol(js, "+documentation+", 0);
arrput(module_registry, MISTLINE(io));
arrput(module_registry, MISTLINE(os));
arrput(module_registry, MISTLINE(input));
@@ -7691,6 +7691,7 @@ void ffi_load(JSContext *js, int argc, char **argv) {
JS_SetPropertyStr(js,prosp, "version", JS_NewString(js,PROSPERON_VERSION));
JS_SetPropertyStr(js,prosp,"revision",JS_NewString(js,PROSPERON_COMMIT));
JS_SetPropertyStr(js,prosp,"engine_start", JS_NewCFunction(js,js_os_engine_start, "engine_start", 1));
JS_SetPropertyStr(js,prosp,"DOC", DOC);
JS_SetPropertyStr(js,globalThis,"prosperon", prosp);