C# Class SharpTune.RomMod.Mod

Defines and Applies a Mod (series of patches) to a ROM.
Afficher le fichier Open project: Merp/SharpTune Class Usage Examples

Méthodes publiques

Свойство Type Description
ReleaseBuildWarning string
TestBuildWarning string
patchList List
unPatchList List

Méthodes publiques

Méthode Description
Mod ( Stream s, string modPath ) : System

Constructor for embedded mods

Mod ( string modPath ) : System

Constructor for external mods

Mod ( string modPath, string build ) : System

Constructor for partial-patches

PrintPatches ( ) : void

Print patch descriptions to the console.

TryApplyMod ( Stream romStream ) : bool

Try to apply the patches to the ROM.

TryCheckApplyMod ( string romPath, string outPath, bool apply, bool commit ) : bool
TryDefinition ( AvailableDevices ad, string defPath ) : bool
TryGetMetaBlob ( uint startAddress, uint length, Blob &match, List blobs ) : bool

Try to find a blob in the patch that starts at the given address.

TryPrintBaselines ( string patchPath, Stream romStream ) : bool

Extract actual ROM data, for appending to a patch file.

TryReadMetaString ( Blob metadata, string &metaString, int &offset ) : bool

Read a single string from the metadata blob.

Consider returning false, printing error message. But, need to be certain to abort the whole process at that point...

TryReadPatches ( ) : bool

Create the patch start/end metadata from the patch file.

TryRemoveMod ( Stream romStream ) : bool

Try to remove patches from a ROM

TryReversePatches ( ) : bool

Reverses the "direction" of the patch by start address manipulation

TryValidatePatches ( Stream romStream ) : bool

Determine whether the data that the patch was designed to overwrite match what's actually in the ROM.

TryValidateUnPatches ( Stream romStream ) : bool

Determine whether the data that the patch was designed to overwrite match what's actually in the ROM.

Private Methods

Méthode Description
TryApplyPatch ( Patch patch, Stream romStream ) : bool

Given a patch, look up the content Blob and write it into the ROM.

TryCheckPrintBaseline ( Patch patch, Stream outStream ) : bool

Print the current contents of the ROM in the address range for the given patch. Contains a check against metadata when IsMetaChecked = true

TryConfirmPatchVersion ( Blob blob, int &offset ) : bool

Try to read the 'required version' metadata.

TryGetPatchBlob ( uint startAddress, uint length, Blob &match, List blobs ) : bool

Try to find a blob that starts at the given address.

TryReadBlobs ( BlobList &blist ) : bool

Try to read blobs from the patch file.

TryReadBuffer ( Stream romStream, uint startAddress, byte buffer ) : bool

Try to read an arbitrary byte range from the ROM.

TryReadCalibrationChange ( Blob blob, int &offset ) : bool

Try to read the initial and final calibration IDs

TryReadCalibrationId ( Blob blob, int &offset, string &calibrationId ) : bool

Try to read the calibration ID from the patch metadata.

TryReadCopyPatch ( Blob metadata, Patch &patch, int &offset, List blobs ) : bool

Read a single Offset Patch from the metadata blob. Offset patch reads from Srecord "copystart" Writes to rom at "start"

Consider returning false, printing error message. But, need to be certain to abort the whole process at that point...

TryReadMetaHeader8 ( Blob metadata, int &offset ) : bool
TryReadMetadata ( Blob blob, List blobs ) : bool

Try to read the patch file metadata (start and end addresses of each patch, etc).

TryReadPatch ( Blob metadata, Patch &patch, int &offset, List blobs ) : bool

Read a single Patch from the metadata blob.

Consider returning false, printing error message. But, need to be certain to abort the whole process at that point...

TryReadPatches ( Blob metadata, int &offset, List blobs ) : bool

Try to read the Patch metadata from the file.

TrySynthesize4BytePatch ( Blob metadata, Patch &patch, int &offset ) : bool

Construct a 4-byte patch from the metadata blob.

TrySynthesizeLast2Of4BytePatch ( Blob metadata, Patch &patch, int &offset ) : bool

Construct a Last 2 of 4-byte patch from the metadata blob.

TrySynthesizePullJsrHookPatch ( Blob metadata, Patch &patch, int &offset, List blobs ) : bool

Construct a Pull JSR HOOK patch from the metadata blob.

ValidateBytes ( Patch patch, Stream romStream ) : bool

Determine whether the bytes from a Patch's expected data match the contents of the ROM.

ValidateJSRHookBytes ( PullJSRHookPatch patch, Stream romStream ) : bool

Determine whether the bytes from a Patch's expected data match the contents of the ROM.

Method Details

Mod() public méthode

Constructor for embedded mods
public Mod ( Stream s, string modPath ) : System
s Stream
modPath string
Résultat System

Mod() public méthode

Constructor for external mods
public Mod ( string modPath ) : System
modPath string
Résultat System

Mod() public méthode

Constructor for partial-patches
public Mod ( string modPath, string build ) : System
modPath string
build string
Résultat System

PrintPatches() public méthode

Print patch descriptions to the console.
public PrintPatches ( ) : void
Résultat void

TryApplyMod() public méthode

Try to apply the patches to the ROM.
public TryApplyMod ( Stream romStream ) : bool
romStream Stream
Résultat bool

TryCheckApplyMod() public méthode

public TryCheckApplyMod ( string romPath, string outPath, bool apply, bool commit ) : bool
romPath string
outPath string
apply bool
commit bool
Résultat bool

TryDefinition() public méthode

public TryDefinition ( AvailableDevices ad, string defPath ) : bool
ad AvailableDevices
defPath string
Résultat bool

TryGetMetaBlob() public méthode

Try to find a blob in the patch that starts at the given address.
public TryGetMetaBlob ( uint startAddress, uint length, Blob &match, List blobs ) : bool
startAddress uint
length uint
match Blob
blobs List
Résultat bool

TryPrintBaselines() public méthode

Extract actual ROM data, for appending to a patch file.
public TryPrintBaselines ( string patchPath, Stream romStream ) : bool
patchPath string
romStream Stream
Résultat bool

TryReadMetaString() public méthode

Read a single string from the metadata blob.
Consider returning false, printing error message. But, need to be certain to abort the whole process at that point...
public TryReadMetaString ( Blob metadata, string &metaString, int &offset ) : bool
metadata Blob
metaString string
offset int
Résultat bool

TryReadPatches() public méthode

Create the patch start/end metadata from the patch file.
public TryReadPatches ( ) : bool
Résultat bool

TryRemoveMod() public méthode

Try to remove patches from a ROM
public TryRemoveMod ( Stream romStream ) : bool
romStream Stream
Résultat bool

TryReversePatches() public méthode

Reverses the "direction" of the patch by start address manipulation
public TryReversePatches ( ) : bool
Résultat bool

TryValidatePatches() public méthode

Determine whether the data that the patch was designed to overwrite match what's actually in the ROM.
public TryValidatePatches ( Stream romStream ) : bool
romStream Stream
Résultat bool

TryValidateUnPatches() public méthode

Determine whether the data that the patch was designed to overwrite match what's actually in the ROM.
public TryValidateUnPatches ( Stream romStream ) : bool
romStream Stream
Résultat bool

Property Details

ReleaseBuildWarning public_oe property

public string ReleaseBuildWarning
Résultat string

TestBuildWarning public_oe property

public string TestBuildWarning
Résultat string

patchList public_oe property

public List patchList
Résultat List

unPatchList public_oe property

public List unPatchList
Résultat List