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
gem-count: float
skill-count: float
completion-percentage: float
minute: uint8
hour: uint8
week: uint8
day: uint8
month: uint8
year: uint8
game-time0: uint32
game-time1: uint32
secrets: uint32
features: uint32

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

show-mc-info

show-mc-info(arg0: dma-buffer) => nonesource
Expand description

Interface for game controllers.

the cpad-list contains both game controllers.

Use the service-cpads functions once per frame to update the data and vibration control

The cpad-set-buzz! function can be used for vibration.

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-pause-val: uint8
buzz-pause-time: uint8
buzz-time: time-frame
buzz: basic
buzz-act: int32
change-time: time-frame
old-rightx: uint8
old-righty: uint8
old-leftx: uint8
old-lefty: uint8
Methods
adjust-to-screen-flip(obj: cpad-info) => intsource

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

mouse-info

mouse-info: basicsource
Fields
type: type
active: symbol
cursor: basic
valid: symbol
id: uint8
status: uint16
button0: uint16
deltax: int8
deltay: int8
wheel: uint8
change-time: time-frame
button0-abs: uint32
button0-shadow-abs: uint32
button0-rel: uint32
pos: vector
posx: float
posy: float
oldposx: float
oldposy: float
speedx: float
speedy: float

scf-time

scf-time: structuresource
Fields
stat: uint8
second: uint8
minute: uint8
hour: uint8
week: uint8
day: uint8
month: uint8
year: uint8

Functions


analog-input

analog-input(arg0: int, arg1: float, arg2: float, arg3: float, arg4: 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!(arg0: int) => nonesource

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

cpad-invalid!

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

Reset all data in a cpad-info

cpad-set-buzz!

cpad-set-buzz!(arg0: cpad-info, arg1: int, arg2: int, arg3: 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

service-mouse

service-mouse() => nonesource

Update the mouse, and draw the cursor.

Variables


*cheat-mode*

*cheat-mode*: symbolsource

*cpad-debug*

*cpad-debug*: symbolsource

*cpad-list*

*cpad-list*: cpad-listsource

*mouse*

*mouse*: mouse-infosource

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, arg0: uint, arg1: pointer, arg2: uint) => intsource
add-element(obj: rpc-buffer-pair) => pointersource
decrement-elt-used(obj: rpc-buffer-pair) => intsource
sync(obj: rpc-buffer-pair, arg0: symbol) => intsource
check-busy(obj: rpc-buffer-pair) => symbolsource
pop-last-received(obj: rpc-buffer-pair) => pointersource

timer-h

source
Expand description

There are two sources for timing:

- EE TIMER1, used for the frame profiler. There are 9765 counts of this per frame. It gets reset in drawable.

- The "stopwatch" system, used for reading the CPU clock cycle counter, at 300 MHz (32-bit)

Types


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(arg0: timer-bank) => uintsource

Return a timer's counter value

Variables


COP0_STATUS_IE

COP0_STATUS_IE: unknownsource

EE_SECONDS_PER_TICK

EE_SECONDS_PER_TICK: unknownsource
Expand description

Types related to VIF: the PS2's Vector Interface.

Each of VU0 and VU1 has a VIF which is used to sent/receive data.

The VIFs are controller by registers and fed data using DMA

the vif registers defined here are used extremely rarely, usually they are sent DMA

(during gameplay, everything is synchronized by DMA, so code generally does not know when

it is safe to mess with VIF registers.)

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
Expand description

this file has no code, just macros for vector-unit stuff.



in OpenGOAL we're also using this for VU0 macros to help with VU0 operations that are not

directly implemented by the OpenGOAL compiler

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