Temporal Flux Plugin Architecture v1.00

This document assumes you have a decent working knowledge of programming in a .NET language (and uses C# notation).  It also assumes you have moderate experience in ROM hacking.

This document provides some basic information on the Temporal Flux Plugin Architecture (TFPA), but it is strongly recommended that you look over the included MapPlugin example to see how it all fits together.  A "starting point" project has also been included (FluxPlugin).  Any members or methods not listed here are for use by Flux only at this time.

The point of the TFPA is to provide a unified profile of handling data, in both reading and writing.  This allows Temporal Flux to treat a plugin's data just like its own and enforces a certain amount of data integrity.  Since Flux already takes care of all the overhead necessary for any ROM editor, the TFPA also resolves a lot of the "heavy lifting" allowing the plugin author to focus on writing the editor itself.

The TFPA is considered to be an open standard (and may later be open source).  This means the development of how the TFPA works and what features it contains is open to all programmers using it.

Limitations

Because of the way the .NET framework links its libraries together, every time a change is made to the TFPA's interface or supporting classes, all older plugins depending on it will be immediately obsoleted.  When the occasion arises I will look into writing a wrapper class, but I'm not sure the limitation can be overcome at this time.

References

At a minimum, you will want to add the FluxShared library as a reference in your project.  You may also want to add WeifenLuo.WinFormsUI.Docking, PSVRender, and GGRLib.

 IFluxPlugin Interface

In order for Temporal Flux to recognize your plugin, you will need to inherit a public class from the IFluxPlugin interface.  Your plugin will also need to be in the same directory as Flux's executable.

 SaveRecord Class

The SaveRecord class is used to read and write records from the ROM.  There are four pre-defined types, as indicated by the PointerType enumeration. To use any of these types, simply assign a value to the nPointerType variable.  Flux also has a few other more complex types not available publicly at this time (and likely of limited use).

If you need to define a new type, you'll need to inherit from the SaveRecord class and create new delegates for RecClaim, RecExport, RecGet, RecImport, RecReseat, RecSave, and RecSize. Its possible to have a mixture of predefined and newly defined delegates (OWExits uses its own Get and Size, but Simple's Save and Claim).

PointerRecord Class

The PointerRecord class is designed to properly store and save all of a records pointers, no matter how complex they may be.

GlobalShared Class

The GlobalShared class contains a number of static helper members and methods.

cFreeSpace Class

The cFreeSpace class is essentially a doubly-linked list containing all the known free space in the ROM.  This is not a live variable and is reconstructed on request by Temporal Flux, typically at the start of the saving process.