Alcaro/Flips

Incorrect output file name generation

Closed this issue · 7 comments

If the patch filename contains non-Latin/punctuation/numerical symbols, the default output filename will be different. For example, spaces will be converted to %20.

By the way, is "The patch was applied, but appears scrambled or malformed." message intended in case of this patch?
EDIT: Just in case, I use build from AUR in Arch Linux.

Also I think it'd make sense to suggest saving in the same directory as the source rom as opposed to the home dir.

This hack also causes a warning being displayed.
http://www.romhacking.net/hacks/263/

(Apparently I unwatched this repo and missed this issue, sorry about that)

This is four issues in one. Don't do that, it's impossible to close half an issue if half of it is resolved.

Dynamite Headdy being scrambled - yes, it's intended, because that patch is screwy.

The IPS format is made out of various instructions to write N bytes to position P. This patch consists of these writes:

Patch position (hex) | Write target (hex) | Length (dec)
[5] 0: 512
[20A] 18E: 2
[211] 1C0: 48
[246] 1F0: 1
[24C] 1F1: 1
[252] 5AC00: 4110
[1265] CDAE0: 5794
[290C] 234: 2
[2913] 291: 1
[2919] 108B2: 4
[2922] 15B10: 4
[292B] 15C24: 4
[2934] 32C: 4
[293D] 36E: 4
[2946] 3CE: 2
[294D] 3C6: 2
[2954] 3C8: 2
[295B] 3D0: 1
[2961] 19FE00: 4176
[39B6] 5599A: 2
[39BD] 5599C: 4
[39C6] 55712: 2
[39CD] 55714: 4
[39D6] 558CC: 2
[39DD] 558CE: 4
[39E6] 559B6: 2
[39ED] 559B8: 4
[39F6] 55CCE: 2
[39FD] 55CD0: 4
[3A06] 559FA: 2
[3A0D] 559FC: 4
[3A16] 55A00: 2
[3A1D] 1A1800: 8252
Expand to 0x1A383C

In a normal IPS patch, the second column is sequential; there's no reason to do otherwise. If it's not, Flips throws that warning. It's technically a valid IPS patch (the IPS format is badly documented, it's not clear whether these strange inputs are legal IPSes), but no patcher I know of creates such scrambled patches, so it's likely the patch is damaged.

Maybe it's a strange patcher I haven't seen, maybe it really is damaged. I don't know, and neither does Flips. Hence the warning.

 

Castlevania Chorus - contains an instruction to truncate the ROM. Such instructions are only needed if the output ROM is smaller than the input; if the input ROM is not larger than the truncation position, it's unneeded, and Flips thinks you're using wrong input file.

Perhaps there's an ancient patcher floating around that's taking unexpected liberties with the IPS format; patchers are 'allowed' to do way too much stupid stuff with the IPS format. But Flips can't be sure, so it throws a warning.

My recommendation for both is to recreate the patch using Floating or Lunar IPS, or preferably convert to BPS and submit that as an update.

 

The paths are legit issues. Percent-encoding was me mixing paths and URIs in a broken way, good catch. As for the directory, docs say "the file chooser is able to make good suggestions on its own", but if it's just defaulting to the current working directory then it clearly isn't.

(e: fixed missing separators, apparently triple linebreak isn't paragraph-but-extra-hole)

No response from OP, and there's nothing else I can do with these screwy patches. Gonna close this.

Maybe I should've made Flips ultra-permissive with IPSes, it seems to be a dying format. But it wasn't dying when I made Flips v1.00, so maybe I made the right choice. No way to know.

I had no idea I needed to respond. The latest build still suggests the working directory for output.

If you don't say anything, I assume you're satisfied with my fixes/explanations. Maybe I was unclear about my expectations and you thought I was still working on it, and then we both forgot it.

Either way, hopefully that's all cwds (except the first one on each button, but that'd take more effort to fix than it's worth, I'd have to store a bunch of paths in the config).

As for the messy IPSes, I can't do anything until I know which tool created them and how to detect them, and I require your assistance in tracking that down.

Or we can just leave the warnings there, those patches are rare and Flips still emits the correct ROM.

I don't really care. Thanks for the explanation anyway.