During my "quest" on patching VS/other-NES Games I've discovered that a hex-Editor is a good thing to have, but it can also be a huge drawback. During patch-development there's a lot of copy+paste compiled code in the hex-editor and manually adjusting a few bytes here and there. It could get extremly time consuming and you can easily screw things up by adjusting the wrong bytes by mistake etc. Sometimes I think I spent more time with the hex-editor instead of the assembler-patch code..
So I've invented a new patch-fileformat (for internal use at the moment, but perhaps others are interested)? The idea is to have a text-file containing all modifications in
cleartext, which is then parsed, and applied to the source-ROM.
This way, you can enter your modifications in this file and just run the parser (a .NET console application at the moment), and the patch gets applied in a second or so. If you screw things up, you can easily comment out your stuff and run the parser again, no need to hex-edit the file.
The parser uses this syntax:
c:\patch.exe <patch file> <Source ROM> <Destination ROM>
The original ROM is never touched, you always gets a new file.
Here's an extract how a patchfile could look like for my latest hack "VS Castlevania".
Currently, the parser only supports these two instructions ("poke" and "incbin") but more can (and probably will) be added.
Another advantage is documentation. It's alot easier to read later, what kind of modifications that has been done etc.
The fileformat is perhaps best suited during development. IPS-files are obviously alot smaller and probably better to distribute.
What do you think? Usefull or not?
So I've invented a new patch-fileformat (for internal use at the moment, but perhaps others are interested)? The idea is to have a text-file containing all modifications in
cleartext, which is then parsed, and applied to the source-ROM.
This way, you can enter your modifications in this file and just run the parser (a .NET console application at the moment), and the patch gets applied in a second or so. If you screw things up, you can easily comment out your stuff and run the parser again, no need to hex-edit the file.
The parser uses this syntax:
c:\patch.exe <patch file> <Source ROM> <Destination ROM>
The original ROM is never touched, you always gets a new file.
Here's an extract how a patchfile could look like for my latest hack "VS Castlevania".
Code:
;**** Remove ROM-check
poke #$ea,$1c038
poke #$ea,$1c039
poke #$ea,$1c03A
;*** NMI-inject
poke #$6c,$1c078
poke #$20,$1c079
poke #$fe,$1c07a
;*** Inject own-code
incbin "castle.bin",$1fe30
etc. etc.
'
poke #$ea,$1c038
poke #$ea,$1c039
poke #$ea,$1c03A
;*** NMI-inject
poke #$6c,$1c078
poke #$20,$1c079
poke #$fe,$1c07a
;*** Inject own-code
incbin "castle.bin",$1fe30
etc. etc.
'
Currently, the parser only supports these two instructions ("poke" and "incbin") but more can (and probably will) be added.
Another advantage is documentation. It's alot easier to read later, what kind of modifications that has been done etc.
The fileformat is perhaps best suited during development. IPS-files are obviously alot smaller and probably better to distribute.
What do you think? Usefull or not?