Author
|
Topic: New patching format, UPS, debuts today (Read 5 times)
|
Deathlike2
Guest
|
|
« Reply #90 on: April 11, 2008, 11:32:30 am » |
|
If you want to create a patch format that I'll use *during development* as well as at release time, it should: - contain "replace data" rather than "xor" data
xor is actually more powerful than "replacing data". Replacing data is a one way fixed option. "xor" data allows you to "undo changes". For a romhacker, it's important for bug tracking changes they are making from one version to another. Unfortunately it relies on the order you are patching. - not care (or not necessarily care) about checksums The checksums are there for the average user.. to tell them that they are matching up with the wrong intended file. The patcher itself (not the format) should have an option to ignore this.
|
|
|
|
CaseCrash
Guest
|
|
« Reply #91 on: April 11, 2008, 11:35:40 am » |
|
- contain "replace data" rather than "xor" data
I don't see an explanation for this one? I mean your patches shouldn't overlap or anything, and xor allows you to remove a patch from your current file for testing instead of having to repatch the whole thing. Just wondering, 'cause if that's not really an issue then the -force option talked about earlier (or a "ignore checksum" option/dialog box) would allow you to ignore the crcs and do everything you want.
|
|
|
|
byuu
Guest
|
|
« Reply #92 on: April 11, 2008, 12:32:14 pm » |
|
Okay, how about a more detailed example?
Assume the following: File A = { 0x01, 0x02, 0x03, 0x04 } File B = { 0x11, 0x12, 0x03, 0x04 } File C = { 0x21, 0x02, 0x23, 0x04 }
We know it's easy to convert A to B, and then B to C, this works in both formats. But dshadoff and co are arguing for stacked patches. They want the option of applying either B's patch or C's patch, or both. UPS can already apply one patch (obviously), but things get tricky when you want to apply both (rather, two or more) patches individually in any arbitrary order.
IPS: Patch X = A->B = { 0x11, 0x12, --, -- } Patch Y = A->C = { 0x21, --, 0x23, -- }
Apply patch X and then patch Y to file A = { 0x21, 0x12, 0x23, 0x04 } Apply patch Y and then patch X to file A = { 0x11, 0x12, 0x23, 0x04 }
UPS: Patch X = A->B = { 0x01 ^ 0x11, 0x02 ^ 0x12, --, -- } = { 0x10, 0x10, --, -- } Patch Y = A->C = { 0x01 ^ 0x21, --, 0x03 ^ 0x23, -- } = { 0x20, --, 0x20, -- }
Apply patch X and then patch Y to file A = { 0x31, 0x12, 0x23, 0x04 } Apply patch Y and then patch X to file A = { 0x31, 0x12, 0x23, 0x04 }
Summary:
As you can see, when you stack patches with either IPS or UPS that do not both modify the exact same byte, things work as expected. But there's a problem both with IPS and UPS when both patches do modify the same byte.
With IPS, the most recently applied patch takes precedence. Sometimes, this will be fine. But there's a good chance this kind of patching will result in errors, especially if you're updating code instead of data structures. Even if this works, you're going to run into a lot of problems. What if user A patches Y then X, and reports a bug -- but you don't see it because you patched with X then Y? Despite applying the same two patches, you end up with two different files! Now what happens when you get crazy as with the SMW patching, where you have a page with ~100 different patches, all of which can be applied in any order whatsoever? See what I'm saying now? IPS wasn't meant to do this kind of thing, either. It's terrible design, plain and simple. And I would stand by that statement even if my patch format was unidirectional.
With UPS, it's even worse. You end up with invalid data on those places. So yes, IPS has an "advantage" that you're less likely to run into problems in this case. And that's the only "advantage" IPS has.
Again, if you really want stuff like this, then you want a specialized patcher dedicated to applying these patches in logical, known good order with more advanced information (eg these patches are incompatible, but this one is innocuous, etc etc.)
Imagine how much more user friendly that would be to have a special program with checkboxes and radioboxes, instead of having someone repeatedly apply random patches on top of each other onto a binary, hoping they get it all right, having no way to know what was previously applied?
As for the development process itself -- using patches for that is just silly. Even xkas works on all platforms in "arch none" mode. Instead of keeping IPS patches with individual modifications, why not keep commented assembly files with file offsets and modifications? You can even pull in data from other files and perform mathematical computations this way.
Now instead of simply repatching six patches instead of seven to the original ROM, you simply uncomment that incsrc line in your main project file and run the assembler again.
|
|
« Last Edit: April 11, 2008, 12:42:16 pm by byuu »
|
|
|
|
dshadoff
Guest
|
|
« Reply #93 on: April 11, 2008, 03:40:29 pm » |
|
As you can see, when you stack patches with either IPS or UPS that do not both modify the exact same byte, things work as expected. But there's a problem both with IPS and UPS when both patches do modify the same byte.
Yes of course, but I don't develop in such a haphazard way. When I am in control of the environment, I am familiar with all that; I know what I'm doing, and that's all that should matter. Providing a reference implementation is great, but if it enforces features I don't want, it becomes useless; if I'm going to have to write my own implementation to disable those features, I won't feel married to the format. I'm just trying to explain why no other formats have really caught on. Again, if you really want stuff like this, then you want a specialized patcher dedicated to applying these patches in logical, known good order with more advanced information (eg these patches are incompatible, but this one is innocuous, etc etc.)
Yeah, I suppose I'm going to have to make something like a binary CVS. As for the development process itself -- using patches for that is just silly. Even xkas works on all platforms in "arch none" mode. Instead of keeping IPS patches with individual modifications, why not keep commented assembly files with file offsets and modifications? You can even pull in data from other files and perform mathematical computations this way.
Um... I don't use xkas, and the only tools on my platform are the ones I write with my own hands ? And sure, I create assembler files for whatever code needs hacking, but 99% of the updates are data and pointers, and maintaining insertion code for 1-string blocks is far more tedious than maintaining patches. Everybody can argue until they're blue in the face that xor is superior in their opinion, or that CRCs are a good idea, and their arguments have some merit - but not enough to persuade me. The problems that are solved are problems that don't exist on my platform, and features that I found useful no longer exist. PPF is more likely to be useful to me than UPS. But seriously, if you all disagree with my comments, that's fine. I'll develop in my own way, and you develop in your own way. But UPS will not be my distribution tool because it's not my development tool. Well, unless I start getting CRC check issues, or I need to make my patch data opaque from prying eyes. 99.9% percent of people are only going to use this to apply patches, and for them, this is great. Nonetheless, if you think that a CRC check is going to stop the emails of "why doesn't this work for me ?", I believe you're mistaken. You will have already obtained the answer to that question, but will still have to explain it to them.
|
|
|
|
KaioShin
Guest
|
|
« Reply #94 on: April 11, 2008, 04:08:21 pm » |
|
dshadoff: PPF does all you want already. Why criticise a format then that you'll never need to use anyway? In general: I'm a bit shocked by some of the general responses. byuu announced this format over a year ago and was open for input from everyone for all this time, making several discussions about it. And now that it's here finally here everybody suddenly remembers a special use that no one else is needing and complains about it not supporting it. Typical for this community, but disappointing nonetheless
|
|
|
|
byuu
Guest
|
|
« Reply #95 on: April 11, 2008, 04:51:28 pm » |
|
Yes of course, but I don't develop in such a haphazard way. So if you don't have multiple patches that modify the same byte, UPS works already when you choose to ignore the CRC, which any patcher is free to do. What's the problem, again? Um... I don't use xkas, and the only tools on my platform are the ones I write with my own hands ? Yeah, I know how you feel. I have bad NIH syndrome, myself. Hence why I write all of these things. And sure, I create assembler files for whatever code needs hacking, but 99% of the updates are data and pointers, and maintaining insertion code for 1-string blocks is far more tedious than maintaining patches. ... you're serious? It's easier to maintain IPS patches to modify pointers and text strings than this? org $8022 lda #$20 //override bank for pointers
org $8064 //pointer block dw string1, string2, string3, string4
org $208000 //expanded ROM region start string1: db "Item", $00 string2: db "Magic", $00 string3: db "Equip", $00 string4: db "Save", $00 Meh, I'm not trying to persuade you. Do whatever works best for you. not enough to persuade me But I'm not trying to sell you on anything. I really don't care if you don't use things I make, I was more concerned with why you were bringing up the same old topic that I've covered for the past six pages now without at least presenting any new arguments on the subject. Nonetheless, if you think that a CRC check is going to stop the emails of "why doesn't this work for me ?", I believe you're mistaken. You will have already obtained the answer to that question, but will still have to explain it to them. Of course, but I'm a lot more sympathetic to those who can't figure out how to tell if a patch requires a copier header or not, and how to add/remove one, than I am about someone who can't find a clean copy of a ROM image, or figure out a three-button user interface. I won't lose any sleep ignoring the latter group. And now that it's here finally here everybody suddenly remembers a special use that no one else is needing and complains about it not supporting it. The worst part is that it does support it. And I've gone so far as to post raw hex showing that. The only edge case it does worse on is one that is terribly dangerous to begin with, even for IPS.
|
|
|
|
dshadoff
Guest
|
|
« Reply #96 on: April 11, 2008, 10:32:28 pm » |
|
Um... I don't use xkas, and the only tools on my platform are the ones I write with my own hands ? Yeah, I know how you feel. I have bad NIH syndrome, myself. Hence why I write all of these things. And sure, I create assembler files for whatever code needs hacking, but 99% of the updates are data and pointers, and maintaining insertion code for 1-string blocks is far more tedious than maintaining patches. ... you're serious? It's easier to maintain IPS patches to modify pointers and text strings than this? org $8022 lda #$20 //override bank for pointers
org $8064 //pointer block dw string1, string2, string3, string4
org $208000 //expanded ROM region start string1: db "Item", $00 string2: db "Magic", $00 string3: db "Equip", $00 string4: db "Save", $00 Well, not so much "Not Invented Here" syndrome as "Not Invented Anywhere" in most cases (PC Engine, remember ?). But I'll certainly take a look at xkas. MagicKit is fine for creating ROMs, but not patching. Is the xkas source open ? I'm pretty sure I'd have to make adjustments to the opcode set and potentially the memory management approach to accommodate the Hu6280 processor.
|
|
|
|
byuu
Guest
|
|
« Reply #97 on: April 12, 2008, 03:14:13 am » |
|
Well, not so much "Not Invented Here" syndrome as "Not Invented Anywhere" in most cases (PC Engine, remember ?). Oh, the assembler itself works anywhere, even if the current instruction set isn't supported. Well, glad you don't have NIH, then. I must've misread your intent. Would you believe I even wrote my own tile viewer? Heh. About the only app I use for my ROM hacks that doesn't come with OSes OOTB is a hex editor. This is part of why I don't really bug people to use stuff I write, just mention what it does and move on. UPS was a bit different, though, because it needs community support to replace IPS. Judging from this thread, it'll probably end up about as popular as PPF, sadly Is the xkas source open ? Better, it's public domain. The closest thing I have now though is a 65c816 instruction set. If you really wanted, I could add the PCE instruction set sometime. Should only take me a few hours, as it's just a simplification of the SNES CPU with a few new ops.
|
|
|
|
Ryusui
Guest
|
|
« Reply #98 on: April 12, 2008, 04:40:54 am » |
|
If it's any consolation, UPS has got my vote. Besides...how else am I gonna deliver a patch for Death Note: The Kira Game?
|
|
|
|
I.S.T.
Guest
|
|
« Reply #99 on: April 12, 2008, 05:27:23 am » |
|
Ye Old Custome Patcher?
|
|
|
|
byuu
Guest
|
|
« Reply #100 on: April 12, 2008, 09:15:45 am » |
|
Okay, I completely rewrote everything (underlying library + user interface), taking previous suggestions in mind, and I fixed the edge cases reported to me that were failing. It might still fail one or two extreme edge cases that will never happen in the real world, but I did my best. And for the love of god, please don't everyone message bomb me this time if a glitch is spotted. One post in this thread is enough. Last time I got private messages here and on the Zboard, an e-mail, and about five separate IMs on it. Kind of overwhelmed me, sorry for getting upset over that to those involved. http ://byuu.org/files/tsukuyomi_v01.zip (binaries for Win2k+ / Linux/GTK+) http ://byuu.org/files/tsukuyomi_v01.tar.bz2 (source) New initial interface. Look familiar? :P Nothing special here. The log output is now much more readable than the tiny little corner window. A simplified method for patching an existing file directly. And of course, the old-school patching method. Note the bypass checkbox. The reason it's not on the apply to existing file screen should be obvious. If a patch fails, it's not reversible. Applying a patch that is not reversible to your only copy of a file is retarded, and I will have no part in that. Write your own patcher or hack mine if you want that. I'm a lot more careful this time around about temporary files being deleted. I buffer the output in memory at the moment so that there's no temporary file spawned until it's time to write data out. If patching fails, no file is ever created. Yes, this means a 64MB target file requires 64MB memory. I really don't think that'll be a problem, but I'll come up with something more complete later. And yes, the DL v1.02 UPS patch works just fine with this patcher. The patch file and its format is unchanged between versions. If it's any consolation, UPS has got my vote. Besides...how else am I gonna deliver a patch for Death Note: The Kira Game? Thank you! :D
|
|
|
|
Ryusui
Guest
|
|
« Reply #101 on: April 12, 2008, 01:35:18 pm » |
|
Just uploaded a slightly updated release of my Sylvanian Melodies patch. I tested the UPS patch I already made: it still works with the new patcher, so the only change I made is to the readme, which now points the UPS-illiterate to Tsukuyomi instead of the old UPS v0.03.
|
|
|
|
Tauwasser
Guest
|
|
« Reply #102 on: April 12, 2008, 02:21:12 pm » |
|
So why do you differentiate between "new files" and "existing files"? Wouldn't it be much more convenient to just have the program see if source = traget and then decide what to do or maybe give a warning with a "continue anyway" option?
This somehow reminds me of various linux distri's which have so many tools all to do the same thing but in a different way and now the user is up to deciding which one would work and if so, work best :-/
cYa,
Tauwasser
|
|
|
|
creaothceann
Guest
|
|
« Reply #103 on: April 12, 2008, 02:31:22 pm » |
|
*approaches byuu and keels before him* UPS has got my vote.
And you have my bow support. *walks to join them*
|
|
|
|
akadewboy
Guest
|
|
« Reply #104 on: April 12, 2008, 03:04:22 pm » |
|
Oops never mind.
|
|
|
|
|