Alcaro / Flips

Floating IPS is a patcher for IPS and BPS files.
Other
309 stars 45 forks source link

Selected patch type isn't applied correctly #57

Closed YoshiRulz closed 1 year ago

YoshiRulz commented 1 year ago

When you create a patch, the type you choose in the save file dialog only takes effect next time you save a patch.

I took the same 2 roms and made 2 patches on the IPS setting, then made 2 patches on the BPS setting.

$> for f in a.ips b.ips c.bps d.bps; do hexdump -C "$f" | head -n1; done
00000000  50 41 54 43 48 00 02 21  00 05 30 5b a9 ff 1f 00  |PATCH..!..0[....|
00000000  50 41 54 43 48 00 02 21  00 05 30 5b a9 ff 1f 00  |PATCH..!..0[....|
00000000  50 41 54 43 48 00 02 21  00 05 30 5b a9 ff 1f 00  |PATCH..!..0[....|
00000000  42 50 53 31 00 7f 9e 00  7f 3e 80 80 00 80 91 30  |BPS1.....>.....0|

This was with version unstable-2021-10-28 from Nixpkgs.

Alcaro commented 1 year ago

Yep, that's a bug. There's also a secondary bug in there, where it swaps the filename after the dialog closes, if the requested file extension doesn't match the chosen file filter; if you ask for an IPS named foo.bar, it should create foo.bar, not foo.ips.