Skip to main content

memcard-h

source

Types


mc-file-info

mc-file-info: structuresource
Fields
present: int32
blind-data: float
blind-data-int8: int8
level-index: int32
fuel-cell-count: float
money-count: float
buzzer-count: float
completion-percentage: float
minute: uint8
hour: uint8
week: uint8
day: uint8
month: uint8
year: uint8

mc-handle

mc-handle: int32source

mc-slot-info

mc-slot-info: structuresource
Fields
handle: int32
known: int32
formatted: int32
inited: int32
last-file: int32
mem-required: int32
mem-actual: int32
file: mc-file-info

Functions


mc-sync

mc-sync() => intsource

Block here, waiting for the memory card to finish being read/written.
Note - this will freeze the entire game, so this should not be used
outside of debugging.

show-mc-info

show-mc-info(dma-buf: dma-buffer) => nonesource

Print mc info to the screen.

Types


cpad-info

cpad-info: hw-cpadsource
Fields
type: type
valid: uint8
status: uint8
button0: uint16
rightx: uint8
righty: uint8
leftx: uint8
lefty: uint8
abutton: uint8
dummy: uint8
number: int32
cpad-file: int32
button0-abs: pad-buttons
button0-shadow-abs: pad-buttons
button0-rel: pad-buttons
stick0-dir: float
stick0-speed: float
new-pad: int32
state: int32
align: uint8
direct: uint8
buzz-val: uint8
buzz-time: time-frame
buzz: basic
buzz-act: int32
change-time: time-frame

cpad-list

cpad-list: basicsource
Fields
type: type
num-cpads: int32
cpads: cpad-info

hw-cpad

hw-cpad: basicsource
Fields
type: type
valid: uint8
status: uint8
button0: uint16
rightx: uint8
righty: uint8
leftx: uint8
lefty: uint8
abutton: uint8
dummy: uint8

Functions


analog-input

analog-input(in: int, offset: float, center-val: float, max-val: float, out-range: float) => floatsource

Convert integer input from pad into a float between -out-range and +out-range.
The offset is applied directly to the input.
The center val is the expected value for 0, after applying offset.
The max val is the expected value with the stick pushed all the way

buzz-stop!

buzz-stop!(idx: int) => nonesource

Set the buzz to 0 on both vibration motors of the given cpad.

cpad-invalid!

cpad-invalid!(pad: cpad-info) => cpad-infosource

Reset all data in a cpad-info

cpad-set-buzz!

cpad-set-buzz!(pad: cpad-info, buzz-idx: int, buzz-amount: int, duration: time-frame) => nonesource

Turn on vibration motor 'buzz-idx' for duration, at magnitude buzz-amount.

service-cpads

service-cpads() => cpad-listsource

Read from cpads and update vibration

Variables


*cheat-mode*

*cheat-mode*: symbolsource

*cpad-debug*

*cpad-debug*: symbolsource

*cpad-list*

*cpad-list*: cpad-listsource

STICK_DEADZONE

STICK_DEADZONE: unknownsource

Types


rpc-buffer

rpc-buffer: basicsource
Fields
type: type
elt-size: uint32
elt-count: uint32
elt-used: uint32
busy: basic
base: pointer
data: uint8

rpc-buffer-pair

rpc-buffer-pair: basicsource
Fields
type: type
buffer: rpc-buffer
current: rpc-buffer
last-recv-buffer: pointer
rpc-port: int32
Methods
call(obj: rpc-buffer-pair, fno: uint, recv-buff: pointer, recv-size: uint) => intsource

Call an RPC. This is an async RPC. Use check-busy or sync to see if it's done.

add-element(obj: rpc-buffer-pair) => pointersource

Add an element, and return a pointer to the element.
If we are out of elements, flush by doing an RPC call.
DANGER: this uses all arguments of 0. If you want something else, flush it yourself.
If we're RPC 0 and we do this auto-flush, print a warning.

decrement-elt-used(obj: rpc-buffer-pair) => intsource

If elt-used > 0, decrease it by one.

sync(obj: rpc-buffer-pair, print-stall-warning: symbol) => intsource

Wait for the in progress RPC to complete.

check-busy(obj: rpc-buffer-pair) => symbolsource

Is the currently running RPC still busy?

pop-last-received(obj: rpc-buffer-pair) => pointersource

Variables


RPC-DGO

RPC-DGO: unknownsource

RPC-LOAD-STR

RPC-LOAD-STR: unknownsource

RPC-PLAY-STR

RPC-PLAY-STR: unknownsource

RPC-RAMDISK

RPC-RAMDISK: unknownsource

RPC-SOUND-LOADER

RPC-SOUND-LOADER: unknownsource

RPC-SOUND-PLAYER

RPC-SOUND-PLAYER: unknownsource

timer-h

source

Types


profile-bar

profile-bar: basicsource
Fields
type: type
profile-frame-count: int32
cache-time: time-frame
data: profile-frame
Methods
get-last-frame-time-stamp(obj: profile-bar) => uintsource

Returns the timestamp of the last (non-remaining) frame on the profiler bar.

reset(obj: profile-bar) => _type_source

Clear all blocks from the profile bar. Adds the start block

add-frame(obj: profile-bar, name: symbol, color: rgba) => profile-framesource

Add a block to the profile bar. Looks at the timer to determine the current time.

add-end-frame(obj: profile-bar, name: symbol, color: rgba) => profile-framesource

Finish the frame.

draw(obj: profile-bar, buf: dma-buffer, bar-pos: int) => floatsource

Draw the bar! The bar pos shouldn't be changed.

profile-frame

profile-frame: structuresource
Fields
name: symbol
time-stamp: uint32
color: rgba

stopwatch

stopwatch: basicsource
Fields
type: type
prev-time-elapsed: time-frame
start-time: time-frame
begin-level: int32

timer-bank

timer-bank: structuresource
Fields
count: uint32
mode: timer-mode
comp: uint32

timer-hold-bank

timer-hold-bank: timer-banksource
Fields
count: uint32
mode: timer-mode
comp: uint32
hold: uint32

timer-mode

timer-mode: uint32source

Functions


timer-init

timer-init(timer: timer-bank, mode: timer-mode) => intsource

Initiate a timer, start counting at a rate of 1 every 256 bus clocks (BUSCLK: ~147.456MHz).

Variables


*ticks-per-frame*

*ticks-per-frame*: intsource

*timer-reset-value*

*timer-reset-value*: uintsource

TIMER0_BANK

TIMER0_BANK: unknownsource

TIMER1_BANK

TIMER1_BANK: unknownsource

TIMER2_BANK

TIMER2_BANK: unknownsource

TIMER3_BANK

TIMER3_BANK: unknownsource

Functions


disable-irq

disable-irq() => nonesource

Disable all interrupts. Has no effect on PC Port

enable-irq

enable-irq() => nonesource

Enable all interrupts. Has no effect on PC Port.

stopwatch-begin

stopwatch-begin(obj: stopwatch) => intsource

Begin a stopwatch level, and starts it if it hasn't yet

stopwatch-elapsed-seconds

stopwatch-elapsed-seconds(obj: stopwatch) => floatsource

Returns the elapsed time so far (in seconds) of a stopwatch

stopwatch-elapsed-ticks

stopwatch-elapsed-ticks(obj: stopwatch) => time-framesource

Returns the elapsed time so far (in clock cycles) of a stopwatch

stopwatch-end

stopwatch-end(obj: stopwatch) => nonesource

End a stopwatch level. Stops the stopwatch if it's back to level zero.
There is no guard against ending a stopwatch too many times, and a negative level
will cause errors!

stopwatch-init

stopwatch-init(obj: stopwatch) => intsource

Init a stopwatch

stopwatch-reset

stopwatch-reset(obj: stopwatch) => intsource

Restart a stopwatch's times

stopwatch-start

stopwatch-start(obj: stopwatch) => intsource

Start a stopwatch from scratch

stopwatch-stop

stopwatch-stop(obj: stopwatch) => nonesource

Fully stop a stopwatch and save its elapsed time

timer-count

timer-count(timer: timer-bank) => uintsource

Return a timer's counter value

timer-reset

timer-reset(timer: timer-bank) => nonesource

Reset a timer's counter to zero

Variables


COP0_STATUS_IE

COP0_STATUS_IE: unknownsource

EE_SECONDS_PER_TICK

const EE_SECONDS_PER_TICK: unknownsource

Types


vif-bank

vif-bank: structuresource
Fields
stat: uint32
fbrst: uint32
err: vif-err
mark: uint32
cycle: uint32
mode: uint32
num: uint32
mask: uint32
code: uint32
itops: uint32
base: uint32
offset: uint32
tops: uint32
itop: uint32
top: uint32
r0: uint32
r1: uint32
r2: uint32
r3: uint32
c0: uint32
c1: uint32
c2: uint32
c3: uint32

vif-err

vif-err: uint32source

vif-fbrst

vif-fbrst: uint32source

vif-stat

vif-stat: uint32source

Variables


VIF0_BANK

VIF0_BANK: unknownsource

VIF1_BANK

VIF1_BANK: unknownsource

vu1-macros

source

Types


transform-regs

transform-regs: structuresource
Fields
vf1: uint128
vf2: uint128
vf3: uint128
vf4: uint128
vf5: uint128
vf6: uint128
vf7: uint128
vf8: uint128
vf9: uint128
vf10: uint128
vf11: uint128
vf12: uint128
vf13: uint128
vf14: uint128
vf15: uint128
vf16: uint128
vf17: uint128
vf18: uint128
vf19: uint128
vf20: uint128
vf21: uint128
vf22: uint128
vf23: uint128
vf24: uint128
vf25: uint128
vf26: uint128
vf27: uint128
vf28: uint128
vf29: uint128
vf30: uint128
vf31: uint128

Variables


*transform-regs*

*transform-regs*: transform-regssource