Crate asar_snes

Crate asar_snes 

Source
Expand description

§Asar Rust Bindings

This crate provides a safe wrapper around the Asar library version 1.91.

By default this crate is not thread-safe.

In case it is needed to use this crate in a multithreaded environment, the thread-safe feature should be enabled, doing so will make all the functions use a global lock to ensure that the Asar API is called in a thread-safe manner.

Modules§

patching
This is the raw patching API of asar, it is not recommended to use this directly as it does not prevent multiple calls to the API at the same time which may result in tramplings of the global state in asar’s library.

Structs§

AdvancedPatchOptions
Represents the advanced options for a patch operation, requiring, at least, the ROM data and the patch location. Several options can be added to the patch operation, like include paths, defines, warning settings, memory files, etc. See the PatchOption enum for all the available options. Creation of this struct should be done with the AdvancedPatchOptions::new method.
ApplyResult
This type represents the result of a patch operation.
BasicPatchOptions
Represents the basic options for a patch operation, only requiring the ROM data and the patch location.
ConcurrentApplyError
This error is returned when trying to call Patcher::apply while another ApplyResult is alive.
Define
Represents a define from Asar, with its name and contents.
ErrorData
Represents an error message from Asar.
Label
Represents a label from Asar, with its name and location. The location is the SNES address of the label.
MemoryFile
Represents the memory file for a patch operation, with the filename and the data.
Patcher
The Patcher struct is a convenient wrapper around the patching api.
RomData
Represents the ROM data, with a byte vector and the ROM length
WarnSetting
Represents the warn settings for a patch operation, with the warnid and whether it is enabled or not.
WrittenBlock
Represents a block of data written to the ROM by Asar as a consequence of a call to asar_patch or asar_patch_ex. It has the PC offset, the SNES offset and the number of bytes written.

Enums§

MemoryFileData
Represents the data for a memory file, the data can be binary or text.
PatchOption
Represents the options that can be added to a patch operation.
PatchResult
SymbolType

Functions§

api_version
Returns the API version of Asar.
math
Computes a math expression.
max_rom_size
Returns the maximum ROM size that Asar can handle in bytes
version
Returns the version of Asar, in the format Major * 10000 + Minor * 100 + Revision.
with_asar_lock
Executes the closure with the Asar global lock.

Type Aliases§

MapperType
WarningData
Represents a warning message from Asar.

Attribute Macros§

use_asar_global_lock
This macro is used to ensure that the global lock is used in the function.