Next Generation Emulation banner

1 - 1 of 1 Posts

·
Registered
Joined
·
423 Posts
Discussion Starter #1
In a previous post, I told you about the ease with which we can detect game-functions.
Now, I've been working on a way to ease the registration of patches.

Before, we had to do this:
- implement a patch (for now, translating it from Cxbx' code)
- declare it's signature in the interface-section of the unit involved
- assure this unit is known (via the 'uses'-clause) to a central unit
- the function-name had to be added to a case-statment (in an include-file)
- the same symbol had to be re-declared as a string (so we can also know it by name)

Apart from step one and two, this required lots of manual house-keeping (and it was error-prone too).
To remedy all this, I've changed to using the 'exports' directive. Using this, we can now suffice with one step besides the declaration & implementation:
- add the function to an 'exports' section in the unit involved.

Using the excellent Jcl library (and more specifically, the JclPeImage.pas unit), we can now iterate over the exported functions - resulting in precisely the two things we need : the location of our patch and it's name.

As an example, I've exported all 38 patches that we've (mostly) translated up until now, and I must say : this feels like the way it's supposed to be done!

Bottom line : Again we've made it a few more steps easier to add patches to Dxbx!


I'd like to sign-off with a call-out to anyone considering to join our project : Developing for Dxbx is easier than ever, it's fun, and there's lots of challenge too be had - so don't hesitate and join us!
 
1 - 1 of 1 Posts
Top