Skip to main content

decomp-h

source

Types


decomp-work

decomp-work: structuresource
Fields
buffer0: uint8
buffer1: uint8
indices: uint16
temp-indices: uint16

decomp

source
Expand description
This file has compression/decompression functions used for compressed visibility data, bigmap data, and

joint animations (not the joint-anim-compressed stuff, an outer layer of lzo compression of those)



It also has the update-vis! method of level, which handles the details of decompression.

Luckily for us, the IOP ramdisk vis stuff from Jak 1 is gone!



It's not super clear to me why they ditched this system. Maybe the visibility data is a lot smaller in jak 2.
### Types ---

huf-dictionary-node

huf-dictionary-node: structuresource
Fields
zero: uint16
one: uint16

Functions


pack-comp-rle

pack-comp-rle(arg0: pointer, arg1: pointer, arg2: int, arg3: int) => pointersource

unpack-comp-huf

unpack-comp-huf(arg0: pointer, arg1: pointer, arg2: uint, arg3: huf-dictionary-node) => nonesource

unpack-comp-lzo

unpack-comp-lzo(arg0: pointer, arg1: pointer) => nonesource

unpack-comp-rle

unpack-comp-rle(arg0: pointer, arg1: pointer) => pointersource

file-io

source
Expand description
GOAL File I/O

This is mostly not used in the retail game and was more for loading stuff during development.

The file-stream is an inefficient way to load data, but is flexible and can load

from the CD, or over the network in development.

The file-info type is used in actual game data for checking versions.



represents a file that can be read/written, similar to FILE* in C.

NOTE: this is a special type in three ways:

1). It is used in the C runtime. This must be kept in sync with kmachine.h's FileStream

2). This type is built-in to the compiler (see TypeSystem.cpp, add_builtin_types)

It must be kept up to date with that definition as well.

3). The C runtime constructs this type before anything is loaded. The sizes

must be kept up to date there as well.
### Types ---

file-info

file-info: basicsource
Fields
type: type
file-type: pointer
file-name: basic
major-version: uint32
minor-version: uint32
maya-file-name: basic
tool-debug: basic
mdb-file-name: basic

file-stream

file-stream: basicsource
Fields
type: type
flags: uint32
mode: symbol
name: string
file: uint32

Functions


file-info-correct-version?

file-info-correct-version?(arg0: file-info, arg1: file-kind, arg2: int) => symbolsource
Check if the version and kind in the info is valid. The version-override can specify a
non-default version, or set to 0 for the default version

file-stream-read-string

file-stream-read-string(arg0: file-stream, arg1: string) => stringsource
Fill a string with data from a file stream.
Note: this function does not work.

make-file-name

make-file-name(arg0: file-kind, arg1: string, arg2: int, arg3: symbol) => stringsource
Get a file name to open a file with the given kind and name.
The art-group-version argument can be used to override the version
of the art-group. Set it to 0 or less to use the default version
Similar to MakeFileName in C.
Note: file type enum is different between C and GOAL.
File versions should match those in versions.h.
Uses a single *file-temp-string* buffer, shared with make-vfile-name.
arg3 is unused.

make-vfile-name

make-vfile-name(arg0: file-kind, arg1: string) => stringsource
Make virtual? file name. This makes a name that the kernel knows how to
handle in a specific way. This function is not used.

Variables


*file-temp-string*

*file-temp-string*: stringsource

ART_GROUP_FILE_VERSION

const ART_GROUP_FILE_VERSION: unknownsource

LEVEL_BT_FILE_VERSION

LEVEL_BT_FILE_VERSION: unknownsource

LEVEL_VS_FILE_VERSION

LEVEL_VS_FILE_VERSION: unknownsource

MAP_FILE_VERSION

MAP_FILE_VERSION: unknownsource

SCE_SEEK_CUR

SCE_SEEK_CUR: unknownsource

SCE_SEEK_END

SCE_SEEK_END: unknownsource

SCE_SEEK_SET

SCE_SEEK_SET: unknownsource

TPAGE_FILE_VERSION

TPAGE_FILE_VERSION: unknownsource

TX_FILE_VERSION

TX_FILE_VERSION: unknownsource

load-dgo

source

Types


dgo-header

dgo-header: structuresource
Fields
length: uint32
rootname: uint8

load-chunk-msg

load-chunk-msg: structuresource
Fields
rsvd: uint16
result: load-msg-result
address: pointer
section: uint32
maxlen: uint32
dummy: uint32
basename: sound-stream-name

load-dgo-msg

load-dgo-msg: structuresource
Fields
rsvd: uint16
result: load-msg-result
b1: pointer
b2: pointer
bt: pointer
name: uint128
address: uint32

play-chunk-msg

play-chunk-msg: structuresource
Fields
rsvd: uint16
result: uint16
address: pointer
section: uint32
maxlen: uint32
id: uint32
basename: sound-stream-name

Functions


destroy-mem

destroy-mem(arg0: pointer, arg1: pointer) => nonesource

dgo-load-begin

dgo-load-begin(arg0: string, arg1: pointer, arg2: pointer, arg3: pointer) => load-dgo-msgsource

dgo-load-cancel

dgo-load-cancel() => nonesource

dgo-load-continue

dgo-load-continue(arg0: pointer, arg1: pointer, arg2: pointer) => load-dgo-msgsource

dgo-load-get-next

dgo-load-get-next(arg0: pointer) => pointersource
dgo-load-link(arg0: dgo-header, arg1: kheap, arg2: uint, arg3: symbol, arg4: symbol) => symbolsource

find-temp-buffer

find-temp-buffer(arg0: int) => pointersource

str-ambient-play

str-ambient-play(arg0: string) => nonesource

str-ambient-stop

str-ambient-stop(arg0: string) => nonesource

str-load

str-load(arg0: string, arg1: int, arg2: pointer, arg3: int) => symbolsource

str-load-cancel

str-load-cancel() => nonesource

str-load-status

str-load-status(arg0: pointer) => symbolsource

str-play-async

str-play-async(arg0: string, arg1: sound-id) => nonesource

str-play-kick

str-play-kick() => nonesource

str-play-queue

str-play-queue(arg0: string, arg1: string, arg2: string, arg3: string, arg4: pointer, arg5: pointer) => nonesource

str-play-stop

str-play-stop(arg0: string, arg1: sound-id) => nonesource

Variables


*dgo-name*

*dgo-name*: stringsource

*dgo-time*

*dgo-time*: time-framesource

*load-dgo-rpc*

*load-dgo-rpc*: rpc-buffer-pairsource

*load-str-lock*

*load-str-lock*: symbolsource

*load-str-rpc*

*load-str-rpc*: rpc-buffer-pairsource

*play-str-rpc*

*play-str-rpc*: rpc-buffer-pairsource

*que-str-lock*

*que-str-lock*: symbolsource

load-state

source

Variables


*backup-load-state*

*backup-load-state*: load-statesource

*display-load-commands*

*display-load-commands*: symbolsource

loader-h

source

Types


external-art-buffer

external-art-buffer: basicsource
Fields
type: type
index: int32
other: external-art-buffer
status: symbol
locked?: symbol
login?: symbol
frame-lock: symbol
init-heap: function
heap: kheap
pending-load-file: string
pending-load-file-part: int32
pending-load-file-owner: handle
pending-load-file-priority: float
load-file: string
load-file-part: int32
load-file-owner: handle
load-file-priority: float
buf: pointer
len: int32
art-group: art-group
art-data: uint32
Methods
set-pending-file(obj: external-art-buffer, arg0: string, arg1: int, arg2: handle, arg3: float) => intsource
update(obj: external-art-buffer) => intsource
inactive?(obj: external-art-buffer) => symbolsource
file-status(obj: external-art-buffer, arg0: string, arg1: int) => symbolsource
link-file(obj: external-art-buffer, arg0: art-group) => art-groupsource
unlink-file(obj: external-art-buffer, arg0: art-group) => intsource
unlock!(obj: external-art-buffer) => intsource

external-art-control

external-art-control: basicsource
Fields
type: type
buffer: external-art-buffer
rec: spool-anim
spool-lock: handle
reserve-buffer: external-art-buffer
reserve-buffer-count: int16
dma-reserve-buffer-count: int16
active-stream: string
queue-stream: array
frame-mask: uint32
dma-reserve-heap: kheap
Methods
update(obj: external-art-control, arg0: symbol) => intsource
clear-rec(obj: external-art-control) => intsource
spool-push(obj: external-art-control, arg0: string, arg1: int, arg2: process, arg3: float) => intsource
file-status(obj: external-art-control, arg0: string, arg1: int) => symbolsource
reserve-alloc(obj: external-art-control) => kheapsource
reserve-free(obj: external-art-control, arg0: kheap) => intsource
none-reserved?(obj: external-art-control) => symbolsource

load-dir

load-dir: basicsource
Fields
type: type
lev: level
string-array: array
data-array: array
Methods
load-to-heap-by-name(obj: load-dir-art-group, arg0: string, arg1: symbol, arg2: kheap, arg3: int) => art-groupsource
set-loaded-art(obj: load-dir-art-group, arg0: art-group) => art-groupsource

load-dir-art-group

load-dir-art-group: load-dirsource
Fields
type: type
lev: level
string-array: array
data-array: array
art-group-array: array

spool-anim

spool-anim: basicsource
Fields
type: type
name: string
anim-name: basic
buffer: external-art-buffer
parts: int32
hint-id: int32
priority: float
owner: handle
command-list: pair

subtitle-image

subtitle-image: basicsource
Fields
type: type
width: uint16
height: uint16
palette: rgba
data: uint8

subtitle-range

subtitle-range: basicsource
Fields
type: type
start-frame: float
end-frame: float
message: basic

loader

source

Types


spooler-block

spooler-block: basicsource
Fields
type: type
anim: spool-anim
idle: art-joint-anim
exit: art-joint-anim
break-func: function
part: int32
part-audio-start: float
old-status: uint16
old-pos: int32
good-time: time-frame
old-time: time-frame
good-count: int32
sid: sound-id
real-start-time: time-frame
paused?: symbol

Functions


art-group-load-check

art-group-load-check(arg0: string, arg1: kheap, arg2: int) => art-groupsource

art-load

art-load(arg0: string, arg1: kheap) => artsource

drawable-load

drawable-load(arg0: drawable, arg1: kheap) => drawablesource

external-art-buffer-init

external-art-buffer-init(arg0: external-art-buffer) => intsource

ja-abort-spooled-anim

ja-abort-spooled-anim(arg0: spool-anim, arg1: art-joint-anim, arg2: int) => intsource

ja-play-spooled-anim

ja-play-spooled-anim(arg0: spool-anim, arg1: art-joint-anim, arg2: art-joint-anim, arg3: function) => intsource

Variables


*gui-control*

*gui-control*: gui-controlsource

*gui-kick-str*

*gui-kick-str*: symbolsource

*preload-spool-anims*

*preload-spool-anims*: symbolsource

ramdisk

source

Types


ramdisk-rpc-fill

ramdisk-rpc-fill: structuresource
Fields
rsvd1: int32
ee-id: int32
rsvd2: int32
filename: uint128

ramdisk-rpc-load

ramdisk-rpc-load: structuresource
Fields
rsvd: int32
ee-id: int32
offset: uint32
length: uint32

ramdisk-rpc-load-to-ee

ramdisk-rpc-load-to-ee: structuresource
Fields
rsvd: int32
addr: int32
offset: int32
length: int32
filename: uint128

Functions


ramdisk-load

ramdisk-load(arg0: int, arg1: uint, arg2: uint, arg3: pointer) => intsource

ramdisk-sync

ramdisk-sync() => nonesource

Variables


*current-ramdisk-id*

*current-ramdisk-id*: intsource

*ramdisk-rpc*

*ramdisk-rpc*: rpc-buffer-pairsource