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§
- Advanced
Patch Options - 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
PatchOptionenum for all the available options. Creation of this struct should be done with theAdvancedPatchOptions::newmethod. - Apply
Result - This type represents the result of a patch operation.
- Basic
Patch Options - Represents the basic options for a patch operation, only requiring the ROM data and the patch location.
- Concurrent
Apply Error - This error is returned when trying to call
Patcher::applywhile anotherApplyResultis alive. - Define
- Represents a define from Asar, with its name and contents.
- Error
Data - 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.
- Memory
File - Represents the memory file for a patch operation, with the filename and the data.
- Patcher
- The Patcher struct is a convenient wrapper around the
patchingapi. - RomData
- Represents the ROM data, with a byte vector and the ROM length
- Warn
Setting - Represents the warn settings for a patch operation, with the warnid and whether it is enabled or not.
- Written
Block - 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§
- Memory
File Data - Represents the data for a memory file, the data can be binary or text.
- Patch
Option - Represents the options that can be added to a patch operation.
- Patch
Result - Symbol
Type
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§
- Mapper
Type - Warning
Data - 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.