Expand description
The main SM64 API for Wafel.
This crate provides two simulation APIs: Game and Timeline.
-
The Game API uses a traditional frame advance / save state model.
-
The Timeline API is higher level and manages save states internally. It allows accessing arbitrary frames in any order. This is the API used by the Wafel application for its rewind functionality.
For now, I recommend using the Game API for brute forcing purposes. The Timeline API works, but the algorithm is currently optimized for Wafel’s UI, so it may not be as fast in a brute forcing setting.
The Emu API attaches to a running emulator and allows reading/writing to its process memory. Similarly, the RemoteDll API attaches to a running instance of libsm64 in another process.
§Data paths
Many API methods take in a string path
parameter. This string uses a C-like syntax to
denote a location in memory.
The following are all valid syntax:
gMarioState.pos
gObjectPool[12].oPosX
gMarioState[0].wall?.normal
gMarioState.action & ACT_ID_MASK
Note:
p.x
automatically dereferences a pointerp
. The syntaxp->x
can also be used.*
is not used for pointer dereferencing. Instead you can use[0]
,->
, or.
.- A mask can be applied using
&
. The mask must be an integer literal or constant name. - Array indices must be an integer literal or constant name.
?
denotes that a pointer may be null. If so, the entire expression returnsValue::None
. If?
is not used, an error is thrown instead.
Variable and constant names are automatically pulled from the decomp source code. However, the names may be different if Wafel is out of date from decomp.
Object fields such as oPosX
are supported and can be accessed using the regular .
syntax.
Structs§
- A raw pointer value that can be stored in memory.
- An SM64 API that attaches to a running emulator and can read/write to its memory.
- An SM64 API that uses a traditional frame advance / save state model.
- A set of inputs for a given frame.
- Metadata for a .m64 TAS.
- Hitbox information for an SM64 object.
- An SM64 API that attaches to a running instance of libsm64 in a different process and can read/write to its memory.
- A save state used by Game.
- An SM64 surface (currently missing several fields).
- An SM64 API that allows reads and writes to arbitrary frames without frame advance or save states.
Enums§
- A simplified description of a variable’s data type.
- Float types of different sizes.
- Integer types of different sizes and signedness.
- SM64 game versions.
- A dynamically typed value.
Functions§
- Load an m64 TAS from a file.
- Lock a libsm64 DLL so that it requires a ROM to open.
- Save an m64 TAS to a file.
- Load an m64 TAS from a file.
- Lock a libsm64 DLL so that it requires a ROM to open.
- Save an m64 TAS to a file.
- Unlock a libsm64 DLL using a ROM.
- Unlock a libsm64 DLL using a ROM.
Type Aliases§
- A 16 bit signed angle.
- An integer value.
- An integer value.