C# Класс SharpTune.RomMod.Mod

Defines and Applies a Mod (series of patches) to a ROM.
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
ReleaseBuildWarning string
TestBuildWarning string
patchList List
unPatchList List

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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.

Описание методов

Mod() публичный Метод

Constructor for embedded mods
public Mod ( Stream s, string modPath ) : System
s Stream
modPath string
Результат System

Mod() публичный Метод

Constructor for external mods
public Mod ( string modPath ) : System
modPath string
Результат System

Mod() публичный Метод

Constructor for partial-patches
public Mod ( string modPath, string build ) : System
modPath string
build string
Результат System

PrintPatches() публичный Метод

Print patch descriptions to the console.
public PrintPatches ( ) : void
Результат void

TryApplyMod() публичный Метод

Try to apply the patches to the ROM.
public TryApplyMod ( Stream romStream ) : bool
romStream Stream
Результат bool

TryCheckApplyMod() публичный Метод

public TryCheckApplyMod ( string romPath, string outPath, bool apply, bool commit ) : bool
romPath string
outPath string
apply bool
commit bool
Результат bool

TryDefinition() публичный Метод

public TryDefinition ( AvailableDevices ad, string defPath ) : bool
ad AvailableDevices
defPath string
Результат bool

TryGetMetaBlob() публичный Метод

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
Результат bool

TryPrintBaselines() публичный Метод

Extract actual ROM data, for appending to a patch file.
public TryPrintBaselines ( string patchPath, Stream romStream ) : bool
patchPath string
romStream Stream
Результат bool

TryReadMetaString() публичный Метод

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
Результат bool

TryReadPatches() публичный Метод

Create the patch start/end metadata from the patch file.
public TryReadPatches ( ) : bool
Результат bool

TryRemoveMod() публичный Метод

Try to remove patches from a ROM
public TryRemoveMod ( Stream romStream ) : bool
romStream Stream
Результат bool

TryReversePatches() публичный Метод

Reverses the "direction" of the patch by start address manipulation
public TryReversePatches ( ) : bool
Результат bool

TryValidatePatches() публичный Метод

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
Результат bool

TryValidateUnPatches() публичный Метод

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
Результат bool

Описание свойств

ReleaseBuildWarning публичное свойство

public string ReleaseBuildWarning
Результат string

TestBuildWarning публичное свойство

public string TestBuildWarning
Результат string

patchList публичное свойство

public List patchList
Результат List

unPatchList публичное свойство

public List unPatchList
Результат List