Skip to main content

Types​


dgo-entry​

dgo-entry: structuresource
Fields​
offset: uint32
length: uint32

dgo-file​

dgo-file: basicsource
Fields​
type: type
num-go-files: uint32
total-length: uint32
rsvd: uint32
data: uint8

gcommon​

source

Types​


bfloat​

bfloat: basicsource
Fields​
type: type
data: float

inline-array-class​

inline-array-class: basicsource
Fields​
type: type
length: int32
allocated-length: int32
_data: uint8

vec4s​

vec4s: uint128source

Functions​


*

*(x: int, y: int) => intsource
Compute the product of two integers
+(x: int, y: int) => intsource
Compute the sum of two integers
-(x: int, y: int) => intsource
Compute the difference of two integers
/(x: int, y: int) => intsource
Compute the quotient of two integers

1/​

1/(x: float) => floatsource
Reciprocal floating point

abs​

abs(a: int) => intsource
Take the absolute value of an integer

append!​

append!(front: object, back: object) => objectsource
Append back to front, return the combined list.

ash​

ash(value: int, shift-amount: int) => intsource
Arithmetic shift value by shift-amount.
A positive shift-amount will shift to the left and a negative will shift to the right.

assoc​

assoc(item: object, alist: object) => objectsource
Is there an entry with key item in the association list alist?
Returns the key-value pair.

assoce​

assoce(item: object, alist: object) => objectsource
Is there an entry with key item in the association list alist?
Returns the key-value pair.
Treats a key of 'else like an else case

basic-type?​

basic-type?(obj: basic, parent-type: type) => symbolsource
Is obj of type parent-type?
Note: this will return #f if you put a parent-type of object.
Only use this with types that are fully defined.

breakpoint-range-set!​

breakpoint-range-set!(a0: uint, a1: uint, a2: uint) => intsource
Sets some debug register (COP0 Debug, dab, dabm) to break on memory access.
This is not supported in OpenGOAL.

delete!​

delete!(item: object, lst: object) => pairsource
Remove the first occurance of item from lst (where item is actual a pair in the list)

delete-car!​

delete-car!(item: object, lst: object) => objectsource
Remove the first first occurance of an element from the list where (car elt) is item.

fact​

fact(x: int) => intsource

false-func​

false-func() => symbolsource
Return false

find-parent-method​

find-parent-method(child-type: type, method-id: int) => functionsource
Search the type tree for a parent type with a different method
from the child, for the given method ID.
DANGER: only call this if you expect to find something.
There are no method-table range checks, so it may run off the end
of a method table and return junk

identity​

identity(x: object) => objectsource
Function which returns its input. The first function of the game!
This will not preserve the upper 64-bits of a 128-bit value.

insert-cons!​

insert-cons!(kv: object, alist: object) => pairsource
Update an association list to have the given (key . value) pair kv.
If it already exists in the list, remove it.
DANGER: this function allocates memory on the global heap.

inspect​

inspect(arg0: object) => objectsource
Inspect any boxed object.

last​

last(lst: object) => objectsource
Get the last element in a proper list

logand​

logand(a: int, b: int) => intsource
Compute the bitwise and

logior​

logior(a: int, b: int) => intsource
Compute the bitwise inclusive-or

lognor​

lognor(a: int, b: int) => intsource
Compute not or.

lognot​

lognot(a: int) => intsource
Compute the bitwise not

logxor​

logxor(a: int, b: int) => intsource
Compute the logical exclusive-or

max​

max(a: int, b: int) => intsource
Compute maximum.

mem-copy!​

mem-copy!(dst: pointer, src: pointer, size: int) => pointersource
Memory copy. Not a very efficient optimization, but has no restrictions.
Increasing address copy.

mem-or!​

mem-or!(dst: pointer, src: pointer, size: int) => pointersource
Set the dst to (logior dst src) byte by byte.
Not very efficient.

mem-print​

mem-print(data: pointer, word-count: int) => symbolsource

mem-set32!​

mem-set32!(dst: pointer, size: int, value: int) => pointersource
Normal memset, but by 32-bit word.
NOTE: argument order is swapped from C

member​

member(obj: object, lst: object) => objectsource
Is obj in the list lst? Returns pair with obj as its car, or #f if not found.

min​

min(a: int, b: int) => intsource
Compute minimum.

mod​

mod(a: int, b: int) => intsource
Compute mod. It does what you expect for positive numbers. For negative numbers, nobody knows what to expect.
This is a 32-bit operation. It uses an idiv on x86 and gets the remainder.

nassoc​

nassoc(item-name: string, alist: object) => objectsource
Is there an entry named item-name in the association list alist?
Checks name with nmember or name= so you can have multiple keys.
Returns the ([key|(key..)] . value) pair.

nassoce​

nassoce(item-name: string, alist: object) => objectsource
Is there an entry named item-name in the association list alist?
Checks name with nmember for multiple keys or name= for single.
Allows else as a single key that always matches

nmember​

nmember(obj: basic, lst: object) => objectsource
Is obj in the list lst? Check with the name= function.

print​

print(arg0: object) => objectsource
Print out any boxed object. Does NOT insert a newline.
print-tree-bitmask(bits: int, count: int) => symbolsource
Print out a single entry for a process tree 'tree' diagram

printl​

printl(arg0: object) => objectsource
Print out any boxed object and a newline at the end.

qmem-copy->!​

qmem-copy->!(dst: pointer, src: pointer, size: int) => pointersource
Memory copy by quadword (16-bytes). More efficient, but has restrictions:
- dst and src should be 16-byte aligned.
- size in bytes will be rounding up to nearest 16-bytes
- Descending address copy

qmem-copy<-!​

qmem-copy<-!(dst: pointer, src: pointer, size: int) => pointersource
Memory copy by quadword. More efficient, but has restrictions:
- dst and src should be 16-byte aligned.
- size in bytes will be rounded up to 16-bytes
- Ascending address copy.

quad-copy!​

quad-copy!(dst: pointer, src: pointer, qwc: int) => nonesource
Optimized memory copy. The original is pretty clever, but this isn't.

ref​

ref(lst: object, index: int) => objectsource
Get an entry in a proper list by index

rem​

rem(a: int, b: int) => intsource
Compute remainder (32-bit). It is identical to mod. It uses a idiv and gets the remainder

sort​

sort(lst: pair, compare-func: function) => pairsource
Sort a list, using compare-func to compare elements.
The comparison function can return either an integer or a true/false.
For integers, use a positive number to represent first > second
Ex: (sort lst -) will sort in ascending order
For booleans, you must explicitly use TRUE and not a truthy value.
Ex: (sort my-list (lambda ((x int) (y int)) (< x y))) will sort ascending.
NOTE: if you use an integer, don't accidentally return TRUE.

true-func​

true-func() => symbolsource
Return true

type-type?​

type-type?(child-type: type, parent-type: type) => symbolsource
Is child-type a child (or equal to) parent-type?
It is safe to use this on a type that is not fully set up,
but in this case it will return #f.

valid?​

valid?(obj: object, expected-type: type, name: basic, allow-false: basic, print-dest: object) => symbolsource
Check if the given object is valid. This will work for structures, pairs, basics, bintegers, symbols, and types.
If you set expected-type to #f, it just checks for a 4-byte aligned address that's in GOAL memory.
If you're checking a structure, set expected-type to structure. This requires 16-byte alignment
Note: packed inline structures in arrays or fields will not pass this check.
Otherwise, set it to the type you expect. More specific types will pass.

If allow-false is #t, a #f will always pass. Otherwise, #f will fail (unless you're looking for a symbol).
Use allow-false if you want to allow a 'null' reference.

The name is only used when printing out an error if the check fails.
Use a name of #f to suppress error prints.

Variables​


*print-column*: bintegersource

*trace-list*​

*trace-list*: pairsource

BASIC_OFFSET​

BASIC_OFFSET: unknownsource

BIG_MEMORY​

BIG_MEMORY: unknownsource

BINTEGER_OFFSET​

BINTEGER_OFFSET: unknownsource

END_OF_MEMORY​

const END_OF_MEMORY: unknownsource

format​

format: functionsource

PAIR_OFFSET​

PAIR_OFFSET: unknownsource

PC_BIG_MEMORY​

PC_BIG_MEMORY: unknownsource

PC_PORT​

PC_PORT: unknownsource

PC_PROFILER_ENABLE​

PC_PROFILER_ENABLE: unknownsource

SYM_TO_STRING_OFFSET​

SYM_TO_STRING_OFFSET: unknownsource

USE_VM​

USE_VM: unknownsource

gkernel-h​

source

Types​


catch-frame​

catch-frame: stack-framesource
Fields​
type: type
name: symbol
next: stack-frame
sp: int32
ra: int32
freg: float
rreg: uint128

cpu-thread​

cpu-thread: threadsource
Fields​
type: type
name: basic
process: process
previous: thread
suspend-hook: function
resume-hook: function
pc: pointer
sp: pointer
stack-top: pointer
stack-size: int32
rreg: uint64
freg: float
stack: uint8

dead-pool​

dead-pool: process-treesource
Fields​
type: type
name: basic
mask: process-mask
parent: pointer
brother: pointer
child: pointer
ppointer: pointer
self: process-tree
Methods​
get-process(obj: dead-pool, type-to-make: type, stack-size: int) => processsource
Get a process from this dead pool of the given type.
return-process(obj: dead-pool, proc: process) => nonesource
Return a process to its pool once you are done with it.

dead-pool-heap​

dead-pool-heap: dead-poolsource
Fields​
type: type
name: basic
mask: process-mask
parent: pointer
brother: pointer
child: pointer
ppointer: pointer
self: process-tree
allocated-length: int32
compact-time: uint32
compact-count-targ: uint32
compact-count: uint32
fill-percent: float
first-gap: dead-pool-heap-rec
first-shrink: dead-pool-heap-rec
heap: kheap
alive-list: dead-pool-heap-rec
last: dead-pool-heap-rec
dead-list: dead-pool-heap-rec
process-list: dead-pool-heap-rec
Methods​
compact(obj: dead-pool-heap, count: int) => nonesource
Do heap compaction. The count argument tells us how much work to do.
If the heap is very full we will automatically do more work than requested.
shrink-heap(obj: dead-pool-heap, proc: process) => dead-pool-heapsource
Shrink the heap of a process.
This resizes the process heap to be the exact size it is currently using.
churn(obj: dead-pool-heap, count: int) => nonesource
Mess with the heap
memory-used(obj: dead-pool-heap) => intsource
Get the amount of memory used. This includes gaps between processes.
memory-total(obj: dead-pool-heap) => intsource
Get the total amount of memory for processes
gap-size(obj: dead-pool-heap, rec: dead-pool-heap-rec) => intsource
Determine the size between the given process and the next process or end of the heap.
If you give the first rec, it will given the gap between the beginning of the heap and the next process.
gap-location(obj: dead-pool-heap, rec: dead-pool-heap-rec) => pointersource
Get the gap after the given process.
If root of the alive list is given, will give the first gap between the heap and the first process.
If there is no gap, may point to the next process. Not 16-byte aligned.
find-gap(obj: dead-pool-heap, rec: dead-pool-heap-rec) => dead-pool-heap-recsource
Start at the given record and find the closest gap after it. Returns the rec
which has the gap after it. If no gaps, returns the last rec.
find-gap-by-size(obj: dead-pool-heap, size: int) => dead-pool-heap-recsource
Find a gap which will fit at least size bytes. Returns the rec for the proc before the gap.
Will return a #f rec if there's no gap big enough.
memory-free(obj: dead-pool-heap) => intsource
Get the total memory free.
compact-time(obj: dead-pool-heap) => uintsource
Access the compact time field.

dead-pool-heap-rec​

dead-pool-heap-rec: structuresource

event-message-block​

event-message-block: structuresource
Fields​
to: process
from: process
num-params: int32
message: symbol
param: uint64

handle​

handle: uint64source

kernel-context​

kernel-context: basicsource
Fields​
type: type
prevent-from-run: process-mask
require-for-run: process-mask
allow-to-run: process-mask
next-pid: int32
fast-stack-top: pointer
current-process: process
relocating-process: basic
relocating-min: int32
relocating-max: int32
relocating-offset: int32
low-memory-message: symbol

process​

process: process-treesource
Fields​
type: type
name: basic
mask: process-mask
parent: pointer
brother: pointer
child: pointer
ppointer: pointer
self: process-tree
pool: dead-pool
status: basic
pid: int32
main-thread: cpu-thread
top-thread: thread
entity: entity-actor
state: state
trans-hook: function
post-hook: function
event-hook: function
allocated-length: int32
next-state: state
heap-base: pointer
heap-top: pointer
heap-cur: pointer
stack-frame-top: stack-frame
connection-list: connectable
stack: uint8
States​
dead-state: TODO
empty-state: TODO

process-tree​

process-tree: basicsource
Fields​
type: type
name: basic
mask: process-mask
parent: pointer
brother: pointer
child: pointer
ppointer: pointer
self: process-tree
Methods​
activate(obj: process, dest: process-tree, name: basic, stack-top: pointer) => process-treesource
Activate a process! Put it on the given active tree and set up the main thread.
deactivate(obj: eco-pill) => nonesource
init-from-entity!(obj: basebutton, arg0: entity-actor) => nonesource
run-logic?(obj: money) => symbolsource
process-tree-method-13: unknown

protect-frame​

protect-frame: stack-framesource
Fields​
type: type
name: symbol
next: stack-frame
exit: function

stack-frame​

stack-frame: basicsource
Fields​
type: type
name: symbol
next: stack-frame

state​

state: protect-framesource
Fields​
type: type
name: symbol
next: stack-frame
exit: function
code: function
trans: function
post: function
enter: function
event: function

thread​

thread: basicsource
Fields​
type: type
name: basic
process: process
previous: thread
suspend-hook: function
resume-hook: function
pc: pointer
sp: pointer
stack-top: pointer
stack-size: int32
Methods​
stack-size-set!(this: thread, stack-size: int) => nonesource
Set the backup stack size of a thread. This should only be done on the main-thread.
This should be done immediately after allocating the main-thread.
Users can do this if they want a larger or smaller backup stack than the default.
thread-suspend(unused: cpu-thread) => nonesource
Suspend the thread and return to the kernel.
thread-resume(thread-to-resume: cpu-thread) => nonesource
Resume a suspended thread. Call this from the kernel only.
This is also used to start a thread initialized with set-to-run.
As a result of MIPS/x86 differences, there is a hack for this.

Variables​


*gtype-basic-offset*​

*gtype-basic-offset*: unknownsource

*irx-major-version*​

*irx-major-version*: unknownsource

*irx-minor-version*​

*irx-minor-version*: unknownsource

*kernel-major-version*​

*kernel-major-version*: unknownsource

*kernel-minor-version*​

*kernel-minor-version*: unknownsource

*scratch-memory-top*​

*scratch-memory-top*: unknownsource

*tab-size*​

*tab-size*: unknownsource

DPROCESS_STACK_SIZE​

const DPROCESS_STACK_SIZE: unknownsource

INVALID_HANDLE​

INVALID_HANDLE: unknownsource

KERNEL_DEBUG​

KERNEL_DEBUG: unknownsource

PP​

PP: unknownsource

PROCESS_CLEAR_MASK​

PROCESS_CLEAR_MASK: unknownsource

PROCESS_HEAP_MULT​

PROCESS_HEAP_MULT: unknownsource

PROCESS_HEAP_SIZE​

PROCESS_HEAP_SIZE: unknownsource

PROCESS_STACK_SAVE_SIZE​

PROCESS_STACK_SAVE_SIZE: unknownsource

PROCESS_STACK_SIZE​

PROCESS_STACK_SIZE: unknownsource

gkernel​

source

Functions​


change-brother​

change-brother(arg0: process-tree, arg1: process-tree) => objectsource
Unused, and wrong.
It seems like this was written when processes store process-trees, not (pointer process-tree).

change-parent​

change-parent(obj: process-tree, new-parent: process-tree) => process-treesource
Make obj a child of new-parent

change-to-last-brother​

change-to-last-brother(arg0: process-tree) => process-treesource

execute-process-tree​

execute-process-tree(obj: process-tree, func: function, context: kernel-context) => objectsource
Like iterate, but also requires that prevent-from-run's mask doesn't block, and that run-logic?
is true in order to call the function.

inspect-process-heap​

inspect-process-heap(obj: process) => symbolsource
Inspect the heap of a process.

inspect-process-tree​

inspect-process-tree(obj: process-tree, level: int, mask: int, detail: symbol) => process-treesource
Debug print a pocess-tree

iterate-process-tree​

iterate-process-tree(obj: process-tree, func: function, context: kernel-context) => objectsource
Call func on all processes that aren't a process-tree. If func returns 'dead, stop.
The kernel-context is ignored.

kernel-dispatcher​

kernel-dispatcher() => objectsource
Run the kernel!
This is the entry point from C++ to GOAL.

kill-by-name​

kill-by-name(name: object, pool: process-tree) => symbolsource
Call deactivate on all process with the given name.

kill-by-type​

kill-by-type(type: object, pool: process-tree) => symbolsource
Call deactivate on all processes with the given type

kill-not-name​

kill-not-name(name: object, pool: process-tree) => symbolsource
Call deactivate on all processes that don't match the name

kill-not-type​

kill-not-type(type: object, pool: process-tree) => symbolsource
Call deactivate on all prcesses that don't match the given type

load-package​

load-package(package: string, allocation: kheap) => pairsource
Load a Package from a CGO/DGO

previous-brother​

previous-brother(proc: process-tree) => objectsource
Get the process p where (-> p brother) is proc. Unused

process-by-name​

process-by-name(name: object, pool: process-tree) => processsource
Look up a process in the given pool by name

process-count​

process-count(this: process-tree) => intsource
Count number of processes in the given tree using iterate-process-tree

process-not-name​

process-not-name(name: object, pool: process-tree) => processsource
Look up a process with not the given name.

remove-exit​

remove-exit() => stack-framesource

reset-and-call​

reset-and-call(obj: thread, func: function) => objectsource
Make the given thread the top thread, reset the stack, and call the function.
Sets up a return trampoline so when the function returns it will return to the
kernel context. Will NOT deactivate on return, so this is intended for temporary threads.
NOTE: this should only be done from the kernel, running on the
kernel's stack.

return-from-thread​

return-from-thread() => nonesource
Context switch to the saved kernel context now.
This is intended to be jumped to with the ret instruction (return trampoline)
at the end of a normal function, so this should preserve rax.
To make sure this happens, all ops should be asm ops and we should have no
GOAL expressions.

return-from-thread-dead​

return-from-thread-dead() => nonesource
Like return from thread, but we clean up our process with deactivate first.
The return register is not preserved here, instead we return the value of deactivate

run-function-in-process​

run-function-in-process(obj: process, func: function, a0: object, a1: object, a2: object, a3: object, a4: object, a5: object) => objectsource
Switch to the given process and run the function. This is used to initialize a process.
The function will run until it attempts to change state. At the first attempt to change state,
this function will return. The idea is that you use this when you want to initialize a process NOW.
This will then return the value of the function you called!

search-process-tree​

search-process-tree(obj: process-tree, func: function) => process-treesource
Find the first process which func return true on. Won't find process-tree's (by mask)

set-to-run​

set-to-run(thread: cpu-thread, func: function, a0: object, a1: object, a2: object, a3: object, a4: object, a5: object) => pointersource
Set the given thread to call the given function with the given arguments next time it resumes.
Only for main threads.
Once the function returns, the process deactivates.

set-to-run-bootstrap​

set-to-run-bootstrap() => nonesource
This function is a clever hack.
To reset a thread to running a new function, we stash the arguments as saved registers.
These are then restored by thread-resume on the next run of the kernel.
This stub remaps these saved registers to argument registers.
It also creates a return trampoline to return-from-thread-dead, so if the main thread returns, the
process is properly cleaned up by deactivate.

stream<-process-mask​

stream<-process-mask(arg0: object, arg1: process-mask) => process-masksource

throw​

throw(name: symbol, value: object) => intsource
Dynamic throw.

throw-dispatch​

throw-dispatch(obj: catch-frame, value: object) => nonesource
Throw the given value to the catch frame.
Only can throw a 64-bit value. The original could throw 128 bits.

unload-package​

unload-package(package: string) => pairsource
Mark a package as unloaded, if it was loaded previously

Variables​


*16k-dead-pool*​

*16k-dead-pool*: dead-poolsource

*4k-dead-pool*​

*4k-dead-pool*: dead-poolsource

*8k-dead-pool*​

*8k-dead-pool*: dead-poolsource

*active-pool*​

*active-pool*: process-treesource

*camera-dead-pool*​

*camera-dead-pool*: dead-poolsource

*camera-master-dead-pool*​

*camera-master-dead-pool*: dead-poolsource

*camera-pool*​

*camera-pool*: process-treesource

*dead-pool-list*​

*dead-pool-list*: pairsource

*debug-dead-pool*​

*debug-dead-pool*: dead-pool-heapsource

*deci-count*​

*deci-count*: intsource

*default-dead-pool*​

*default-dead-pool*: dead-poolsource

*default-pool*​

*default-pool*: process-treesource

*display-pool*​

*display-pool*: process-treesource

*dram-stack*​

*dram-stack*: pointersource

*entity-pool*​

*entity-pool*: process-treesource

*fake-scratchpad-data*​

*fake-scratchpad-data*: pointersource

*fake-scratchpad-stack*​

*fake-scratchpad-stack*: pointersource

*global-search-count*​

*global-search-count*: intsource

*global-search-name*​

*global-search-name*: basicsource

*irx-version*​

*irx-version*: bintegersource

*kernel-boot-level*​

*kernel-boot-level*: symbolsource

*kernel-boot-mode*​

*kernel-boot-mode*: symbolsource

*kernel-context*​

*kernel-context*: kernel-contextsource

*kernel-dram-stack*​

*kernel-dram-stack*: unknownsource

*kernel-packages*​

*kernel-packages*: pairsource

*kernel-version*​

*kernel-version*: bintegersource

*last-loado-debug-usage*​

*last-loado-debug-usage*: intsource

*last-loado-global-usage*​

*last-loado-global-usage*: intsource

*last-loado-length*​

*last-loado-length*: intsource

*listener-process*​

*listener-process*: processsource

*master-mode*​

*master-mode*: symbolsource

*nk-dead-pool*​

*nk-dead-pool*: dead-pool-heapsource

*null-kernel-context*​

*null-kernel-context*: kernel-contextsource

*null-process*​

*null-process*: processsource

*pause-lock*​

*pause-lock*: symbolsource

*pickup-dead-pool*​

*pickup-dead-pool*: dead-poolsource

*target-dead-pool*​

*target-dead-pool*: dead-poolsource

*target-pool*​

*target-pool*: process-treesource

*use-old-listener-print*​

*use-old-listener-print*: symbolsource

*vis-boot*​

*vis-boot*: basicsource

dead-state​

const dead-state: statesource

entity-deactivate-handler​

entity-deactivate-handler: functionsource

gstate​

source

Functions​


enter-state​

enter-state(arg0: object, arg1: object, arg2: object, arg3: object, arg4: object, arg5: object) => objectsource
Make the process stored in pp enter the state in pp next-state

inherit-state​

inherit-state(child: state, parent: state) => statesource
Copy handler functions from parent to child

looping-code​

looping-code() => symbolsource
Loop.

send-event-function​

send-event-function(proc: process-tree, msg: event-message-block) => objectsource
Function to send an event to a process. Please use the send-event macros when possible

gstring​

source

Functions​


append-character-to-string​

append-character-to-string(str: string, char: uint8) => intsource
Append char to the end of the given string.

cat-string<-string​

cat-string<-string(a: string, b: string) => stringsource
Append b to a. No length checks

cat-string<-string_to_charp​

cat-string<-string_to_charp(a: string, b: string, end-ptr: pointer) => pointersource
Append b to a, using chars of b up to (and including) the one pointed to by end-ptr,
or, until the end of b, whichever comes first.

catn-string<-charp​

catn-string<-charp(a: string, b: pointer, len: int) => stringsource
Append b to a, exactly len chars

charp-basename​

charp-basename(charp: pointer) => pointersource
Like basename in C

charp<-string​

charp<-string(dst: pointer, src-string: string) => intsource
Copy a GOAL string into a character array.

clear​

clear(a0-0: string) => stringsource
Make string empty

copy-charp<-charp​

copy-charp<-charp(dst: pointer, src: pointer) => pointersource
C string copy.

copy-string<-string​

copy-string<-string(dst: string, src: string) => stringsource
Copy data from one string to another, like strcpy

copyn-string<-charp​

copyn-string<-charp(str: string, charp: pointer, len: int) => stringsource
Copy data from a charp to a GOAL string. Copies len chars, plus a null.

copyn-string<-string​

copyn-string<-string(dst: string, src: string, len: int) => stringsource
Copy len bytes of data from one string to another, like strncpy

name=​

name=(arg0: basic, arg1: basic) => symbolsource
Do arg0 and arg1 have the same name?
This can use either strings or symbols

string->float​

string->float(str: string) => floatsource
Convert a string to a float, but it is not implemented.

string->int​

string->int(str: string) => intsource
String to int. Supports binary, hex, and decimal. Negative is implemented for decimal and hex
But I think it's broken?

string-cat-to-last-char​

string-cat-to-last-char(base-str: string, append-str: string, char: uint) => pointersource
Append append-str to the end of base-str, up to the last occurance of char in append-str

string-charp=​

string-charp=(str: string, charp: pointer) => symbolsource
Is the data in str equal to the C string charp?

string-downcase​

string-downcase(in: string, out: string) => stringsource
Lowercase the given string.

string-get-arg!!​

string-get-arg!!(a-str: string, arg: string) => symbolsource
Get the first argument from a whitespace separated list of arguments.
The arguments can be in quotes or not.
Removes argument from arg string, sucks up white space before the next one
Outputs argument to a-str.

string-get-flag!!​

string-get-flag!!(result: pointer, in: string, first-flag: string, second-flag: string) => symbolsource

string-get-float!!​

string-get-float!!(arg0: pointer, arg1: string) => symbolsource

string-get-int32!!​

string-get-int32!!(arg0: pointer, arg1: string) => symbolsource
Get an int32 from a list of arguments

string-skip-to-char​

string-skip-to-char(str: pointer, char: uint) => pointersource
Return pointer to first instance of char in C string, or to the null terminator if none

string-skip-whitespace​

string-skip-whitespace(arg0: pointer) => pointersource
Skip over spaces, tabs, r's and n's

string-strip-leading-whitespace!​

string-strip-leading-whitespace!(str: string) => symbolsource
Remove whitespace at the front of a string

string-strip-trailing-whitespace!​

string-strip-trailing-whitespace!(str: string) => symbolsource
Remove whitespace at the end of a string

string-strip-whitespace!​

string-strip-whitespace!(arg0: string) => symbolsource
Remove whitespace at the beginning and end of a string

string-suck-up!​

string-suck-up!(str: string, location: pointer) => symbolsource
Remove character between the start of string and location.
The char pointed to by location is now the first.

string-upcase​

string-upcase(in: string, out: string) => stringsource
Uppercase the given string.

string<-charp​

string<-charp(str: string, charp: pointer) => stringsource
Copy all chars from a char* to a GOAL string.
Does NO length checking.

string<=?​

string<=?(a: string, b: string) => symbolsource

string<?​

string<?(a: string, b: string) => symbolsource
In dictionary order, is a < b?

string=​

string=(str-a: string, str-b: string) => symbolsource
Does str-a hold the same data as str-b?.
If either string is null, returns #f.

string>=?​

string>=?(a: string, b: string) => symbolsource

string>?​

string>?(a: string, b: string) => symbolsource
In dictionary order, is a > b?

substring!​

substring!(dst: string, src: string, start: int, end: int) => stringsource
Copy the specified substring to dst. Returns an empty string if invalid indices are given.

Variables​


*debug-draw-pauseable*​

*debug-draw-pauseable*: symbolsource

*stdcon*​

*stdcon*: stringsource

*stdcon0*​

*stdcon0*: stringsource

*stdcon1*​

*stdcon1*: stringsource

*string-tmp-str*​

*string-tmp-str*: stringsource

*temp-string*​

*temp-string*: stringsource

*temp-string2*​

*temp-string2*: stringsource

pskernel​

source

Types​


lowmemmap​

lowmemmap: structuresource
Fields​
irq-info-stack: uint32
irq2-info-stack: uint32
kernel-copy-fn: uint32
kernel-write-fn: uint32
r1-save: uint128
last-time: uint32
high-time: uint32
dma-status: uint32
dma-qnext: uint32
dma-qwc: uint32
dma-tnext: uint32
dma-stack0: uint32
dma-stack1: uint32
kernel-read-fn: uint32

Functions​


deinstall-debug-handler​

deinstall-debug-handler() => nonesource
Set the kernel exception handler back to the default?

deinstall-debug-handlers​

deinstall-debug-handlers() => nonesource
Set a bunch of excpetion handlers back to the default?

install-default-debug-handler​

install-default-debug-handler(handler: object) => nonesource
Installs the given handler as the debug handler 1 through 13.
Uses the install-debug-handler function defined in kmachine.cpp

kernel-check-hardwired-addresses​

kernel-check-hardwired-addresses() => nonesource
Checks a bunch of stuff in the kernel using kernel-read.
If the memory layout isn't what it expects, it prints an error and crashes.

kernel-copy-function​

kernel-copy-function(unused: object, source: object, dest: object, size: object) => nonesource
Copy size words from source to dest. The a0 argument is ignored.
Uses registers a0, a1, a2, a3

kernel-copy-to-kernel-ram​

kernel-copy-to-kernel-ram() => nonesource
Does a syscall 102. This is CpuConfig on released PS2 BIOSes.
I'm guessing this somehow calls kernel-copy-function

kernel-read​

kernel-read() => nonesource
Does a syscall 102. I'm guessing this somehow calls kernel-read-function

kernel-read-function​

kernel-read-function(unused: object, source: object) => nonesource
Read a single word (signed) from source

kernel-set-exception-vector​

kernel-set-exception-vector() => nonesource
Use syscall 13/syscall 14 to set exception handlers

kernel-set-interrupt-vector​

kernel-set-interrupt-vector() => nonesource
Use syscall 15 to set an interrupt handler

kernel-set-level2-vector​

kernel-set-level2-vector() => nonesource
Set some handler by writing directly to kernel memory. Not sure what this is.

kernel-write​

kernel-write() => nonesource
Does a syscall 102. I'm guessing this somehow calls kernel-write-function.

kernel-write-function​

kernel-write-function(unused: object, source: object, dest: object) => nonesource
Writes a single word to the destination

resend-exception​

resend-exception() => nonesource
I think this was to return from a GOAL crash handler back to the EE kernel's crash handler.

return-from-exception​

return-from-exception(regs: object) => nonesource
Restore the registers and eret.