Skip to main content

dma-bucket

source

Functions


dma-bucket-insert-tag

dma-bucket-insert-tag(base: inline-array, idx: bucket-id, tag-start: pointer, tag-end: pointer) => pointersource

Add a DMA chain to the bucket

dma-buffer-add-buckets

dma-buffer-add-buckets(dma-buf: dma-buffer, count: int) => inline-arraysource

Add count buckets. Each bucket is initialized as empty and won't transfer anything.

dma-buffer-patch-buckets

dma-buffer-patch-buckets(bucket: inline-array, count: int) => inline-arraysource

After adding all data to buckets, call this to stitch together the chains for
count consecutive buckets

dma-buffer

source

Types


dma-buffer

dma-buffer: basicsource
Fields
type: type
allocated-length: int32
base: pointer
end: pointer
data: uint64
data-buffer: uint8

dma-gif-packet

dma-gif-packet: structuresource
Fields
dma-vif: dma-packet
gif: uint64
gif0: uint64
gif1: uint64
quad: uint128

dma-packet

dma-packet: structuresource
Fields
dma: dma-tag
vif0: vif-tag
vif1: vif-tag
quad: uint128

dma-packet-array

dma-packet-array: inline-array-classsource
Fields
type: type
length: int32
allocated-length: int32
_data: uint8

Functions


dma-buffer-add-vu-function

dma-buffer-add-vu-function(dma-buf: dma-buffer, vu-func: vu-function, flush-path-3: int) => symbolsource

Add DMA tags to load the given VU function. The destination in vu instruction memory
is specific inside the vu-function. This does NOT copy the vu-function into the buffer,
but creates a reference to the existing VU function.

dma-buffer-free

dma-buffer-free(arg0: dma-buffer) => intsource

Get the number of free quadwords, rounded down, between base and end pointers.

dma-buffer-inplace-new

dma-buffer-inplace-new(obj: dma-buffer, size: int) => dma-buffersource

Create a dma-buffer in-place. Does not set the type of the dma-buffer object.

dma-buffer-length

dma-buffer-length(arg0: dma-buffer) => intsource

Get length used in quadwords, rounded down

dma-buffer-send

dma-buffer-send(chan: dma-bank, buf: dma-buffer) => nonesource

Send the DMA buffer! DOES NOT TRANSFER TAG, you probably want dma-buffer-send-chain instead.

dma-buffer-send-chain

dma-buffer-send-chain(chan: dma-bank-source, buf: dma-buffer) => nonesource

Send the DMA buffer! Sends the tags

dma-disasm

source

Types


vif-disasm-element

vif-disasm-element: structuresource
Fields
mask: uint32
tag: vif-cmd-32
val: uint32
print: uint32
string1: string
string2: string

Variables


*dma-disasm*

*dma-disasm*: symbolsource

*vif-disasm-table*

*vif-disasm-table*: arraysource

Types


dma-bank

dma-bank: structuresource
Fields
chcr: dma-chcr
madr: uint32
qwc: uint32

dma-bank-control

dma-bank-control: structuresource
Fields
ctrl: dma-ctrl
stat: uint32
pcr: uint32
sqwc: dma-sqwc
rbsr: uint32
rbor: uint32
stadr: uint32
enabler: uint32
enablew: uint32

dma-bank-source

dma-bank-source: dma-banksource
Fields
chcr: dma-chcr
madr: uint32
qwc: uint32
tadr: uint32

dma-bank-spr

dma-bank-spr: dma-bank-sourcesource
Fields
chcr: dma-chcr
madr: uint32
qwc: uint32
tadr: uint32
sadr: uint32

dma-bank-vif

dma-bank-vif: dma-bank-sourcesource
Fields
chcr: dma-chcr
madr: uint32
qwc: uint32
tadr: uint32
as0: uint32
as1: uint32

dma-bucket

dma-bucket: structuresource
Fields
tag: dma-tag
last: pointer
dummy: uint32
next: uint32

dma-chcr

dma-chcr: uint32source

dma-ctrl

dma-ctrl: uint32source

dma-enable

dma-enable: uint32source

dma-sqwc

dma-sqwc: uint32source

dma-tag

dma-tag: uint64source

vif-mask

vif-mask: uint32source

vif-stcycl-imm

vif-stcycl-imm: uint16source

vif-tag

vif-tag: uint32source

vif-unpack-imm

vif-unpack-imm: uint16source

vu-code-block

vu-code-block: basicsource
Fields
type: type
name: basic
code: uint32
size: int32
dest-address: uint32

vu-stat

vu-stat: uint64source

Functions


dma-count-until-done

dma-count-until-done(bank: dma-bank, count: pointer) => intsource

Like the previous one, kinda.
This function is unused.

dma-send-no-scratch

dma-send-no-scratch(bank: dma-bank, madr: uint32, qwc: uint32) => nonesource

Begin a DMA transfer, directly to the bank.
Makes sure any ongoing transfer on the channel is done
Flushes the cache. Sets dir to 0, so I don't expect
this to be used for VIF1 transfers.
Madr should not be a scratchpad address.
This function is unused.

dma-sync-fast

dma-sync-fast(bank: dma-bank) => nonesource

Wait for chcr str to go to 0, indicating DMA
is complete.

dma-sync-with-count

dma-sync-with-count(bank: dma-bank, count: pointer) => intsource

Wait for DMA to finish, incrementing count.
This doesn't seem like a very accurate way
to find out how long it takes...
This function is unused.

Variables


BUCKET_COUNT

BUCKET_COUNT: unknownsource

DMA_CONTROL_BANK

const DMA_CONTROL_BANK: unknownsource

GIF_DMA_BANK

GIF_DMA_BANK: unknownsource

INSTANT_DMA

INSTANT_DMA: unknownsource

INSTANT_DMA_COUNT

INSTANT_DMA_COUNT: unknownsource

SPR_FROM_BANK

SPR_FROM_BANK: unknownsource

SPR_TO_BANK

SPR_TO_BANK: unknownsource

VIF0_DMA_BANK

VIF0_DMA_BANK: unknownsource

VIF1_DMA_BANK

VIF1_DMA_BANK: unknownsource

VU0_DATA_MEM_MAP

VU0_DATA_MEM_MAP: unknownsource

VU1_DATA_MEM_MAP

VU1_DATA_MEM_MAP: unknownsource

Functions


clear-vu0-mem

clear-vu0-mem() => nonesource

Set the vu0 data memory to 0xabadbeef. This uses the slow EE mapping of VU memory.
Will crash on PC Port.

clear-vu1-mem

clear-vu1-mem() => nonesource

Set the vu1 data memory to 0xabadbeef. This uses the slow EE mapping of VU memory.
Will crash on PC Port.

dma-initialize

dma-initialize() => nonesource

Due to a bug in the PS2 hardware, you must always disable the DMAtag mismatch
error. This is done here.

dma-send

dma-send(arg0: dma-bank, madr: uint, qwc: uint) => nonesource

Send DMA given an address and a quadword count.
The madr can be in main memory or scratchpad.
This is appropriate for VIF0/GIF transfers.
It can be used for VIF1, but will do VIF -> madr, which is probably
not what you want.

dma-send-chain

dma-send-chain(arg0: dma-bank-source, tadr: uint) => nonesource

Send DMA! tadr should be a tag address, possibly in spad ram.
This is useful for sending to VIF.
Tag transfer is enabled, and DIR is set so a VIF1 transfer
goes from tadr -> VIF.

dma-send-chain-no-flush

dma-send-chain-no-flush(arg0: dma-bank-source, arg1: uint) => nonesource

Send DMA chain! But don't flush the cache, so be careful here. TTE enable.

dma-send-chain-no-tte

dma-send-chain-no-tte(arg0: dma-bank-source, arg1: uint) => nonesource

Send DMA chain! TTE bit is not set, don't transfer tags.
This is never used.

dma-send-from-spr

dma-send-from-spr(madr: uint, sadr: uint, qwc: uint, sync: symbol) => nonesource

Transfer from spr.

dma-send-from-spr-no-flush

dma-send-from-spr-no-flush(madr: uint, sadr: uint, qwc: uint, sync: symbol) => nonesource

Transfer from spr, don't flush the cache.

dma-send-to-spr

dma-send-to-spr(sadr: uint, madr: uint, qwc: uint, sync: symbol) => nonesource

Transfer data to spr

dma-send-to-spr-no-flush

dma-send-to-spr-no-flush(sadr: uint, madr: uint, qwc: uint, sync: symbol) => nonesource

Transfer to spr. Doesn't flush the cache first, so be careful.

dma-sync-crash

dma-sync-crash(arg0: dma-bank) => nonesource

Wait for DMA to finish for a while, then crash if we can't.
This function is unused.

dma-sync-hang

dma-sync-hang(bank: dma-bank) => nonesource

Hang here until the dma transfer is completed.
This is worse than the dma-sync-fast because it ends
up spamming the DMA bank register more often, and reduces
the speed of the DMA transfer.
This function is unused.

dump-vu1-mem

dump-vu1-mem() => nonesource

Print VU1 memory to runtime stdout.
Will crash on PC Port.

dump-vu1-range

dump-vu1-range(start: uint, total-count: uint) => symbolsource

Print part of VU1 memory to runtime stdout.
Will crash on PC Port.

reset-vif1-path

reset-vif1-path() => nonesource

When things go wrong, totally reset vif1.

symlink2

symlink2() => nonesource

symlink2 is a handwritten assembly version of the v2 linking routine.
it is not ported because the OpenGOAL linker has its own implementation already.

symlink3

symlink3() => nonesource

symlink3 is a handwritten assembly version of the v3 linking routine.
OpenGOAL uses a different format for v3, customized for x86-64, so this is not
needed. The C++ implementation is plenty fast enough

ultimate-memcpy

ultimate-memcpy(dst: pointer, src: pointer, size-bytes: uint) => nonesource

The Fastest Memory Copy, for larger transfers.
Memory is copied in ascending order, in 4 kB blocks.
The size should be a multiple of 16 bytes.

Variables


*video-reset-parm*

*video-reset-parm*: intsource