Coder Social home page Coder Social logo

flips's People

Contributors

alcaro avatar althonos avatar bbhtt avatar foxsouns avatar kekun avatar miepee avatar mrexodia avatar orbea avatar randomdude999 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flips's Issues

Requirements?

Could you list the requirements for building Flips? I tested compilation on an Ubuntu Linux 16.04 LTS system with all the basic development requirements for GTK+ 2.0 and 3.0 installed, including the umbrella package libgtk-3-dev. It failed.

$ ./make.sh
rm: cannot remove 'flips.exe': No such file or directory
rm: cannot remove 'floating.zip': No such file or directory
rm: cannot remove 'flips': No such file or directory
rm: cannot remove 'obj/*': No such file or directory
GTK+ (1/3)
rm: cannot remove 'flips': No such file or directory
g++ flips-cli.cpp flips-w32.cpp libbps-suf.cpp libips.cpp crc32.cpp flips.cpp libbps.cpp flips-gtk.cpp libups.cpp -std=c++98 -Wall -Werror -O3 -fomit-frame-pointer -fmerge-all-constants -fvisibility=hidden -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -Wl,--gc-sections -fprofile-dir=obj/ -fprofile-generate -lgcov -fno-rtti -fno-exceptions -DNDEBUG -fopenmp -DFLIPS_GTK    -Ilibdivsufsort-2.0.1/include -DHAVE_CONFIG_H -D__STDC_FORMAT_MACROS libdivsufsort-2.0.1/lib/divsufsort.c libdivsufsort-2.0.1/lib/sssort.c libdivsufsort-2.0.1/lib/trsort.c   -oflips
flips-gtk.cpp:20:21: fatal error: gtk/gtk.h: No such file or directory
compilation terminated.
Makefile:93: recipe for target 'flips' failed
make: *** [flips] Error 1

If the GTK+ 3.0 development packages are removed, the command line-only build succeeds, and the resulting binary seems to work correctly.

Flatpak build generates as many patched versions of a game as there are patches to apply (IPS format)

Scenario: I download a pack of related patches (IPS format) for a game. Each one is like an ActionReplay code, it does one thing. I open Flips GUI and select the patches I want applied through the dialog box, then select ONE file for patching. The result: 3 different files are generated, each named like the patch name, and with different checksums for each.

Shouldn't the intended operation (for IPS format) be that several patches are applied to the game at once, and ONE file is generated as a result? Or is that not supported behavior?

I'm using Fedora 36 with the Flatpak build if that is relevant.

Exit code 3 - This patch is not intended for this ROM.

Hello,

Could you implement an option to ignore this error message please? I want to apply a BPS patch anyway. The file where the patch is for has changed only minimalistic.

I am using Flips cia CLI. I already tried the command --ignore-checksum but it didn't worked (or I missundertstand it).

The version I used was v1.31 and today I compiled v1.40 pre (master branche).

Thank you very much.

Incorrect output file name generation

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.

"appears scrambled or malformed" warning if not in ascending order?

I was getting the error "The patch was applied, but appears scrambled or malformed." for an IPS patch that was otherwise being correctly applied and could not understand why.

After building and debugging flips, I discovered that this was caused by the the chunks in the file not appearing in ascending order of address.

Is it possible to make this error more descriptive of which "scrambled or malformed" condition it's giving a warning about? There appear to be at least 3 different conditions that can give this same message.

.

I can see how it's a useful warning if you're expecting your own tool to always generate it in that order, but it doesn't appear to be part of any definition of the file format I could find, so I was very confused about why an IPS I was generating that appeared to obey the format was giving an error in your tool. Was even trying to eliminate chunks one by one to see which one was the cause, but that just led to more confusion since this error isn't due to any specific chunk, but their collective arrangement.

(Otherwise thanks for making a good replacement for LunarIPS. It's very handy to have.)

About those firefox tars...

Just a suggestion: if you wanted to make those easily available without inflating the repo size, you could try faux-creating them into a build artifact. Maybe write a short shell script to curl them down from the public repo, then have that sit statically in your CI result? Hell, you could even put them in a release.

It's not a huge issue, but my machine took the git pull pretty hard when I updated my repo from last year, haha.

--apply with no destination file does nothing

Expectation: flips -a patch.ips game.exe applies the patch to game.exe without creating an extra file

Reality: It did nothing, it only applied the patch with flips -a patch.ips game.exe game.exe

My computer doesn't have internet right now, and --version doesn't actually print a version number, but pacman tells me this is version 123.1

Add a switch to remake ips patches to 'no-header' versions.

If a patch doesn't change the header, it's possible to turn a ips patch for a headered rom into a patch to a non-headered rom.

I normally use ipsbehead for this, but it seems very unknown, and it has the limitation that you have to know ahead of type the size of the header (in short, it applies to SNES and PC-engine ips patches that were supposed to apply to ROMs that have the 512 bytes header).

So there are a few opportunities here. If it's possible to validate a ips patch needs a header. I'm not sure that is possible, even passing the rom, with a header or not.

Otherwise the operation might be 'destructive' if applied to a patch that already is to a no-header ROM. Anyway, even destructive, i think it's a switch worth supporting, with a few warnings if the patch can't be ascertained to apply to a header version because ipsbehead is very unknown and it's sort of in the wheelhouse of this program.

I don't know if there are other consoles where the ROM dumps have header and non-header versions that could apply. I know that redump xmls have these { '.nes' : 16, '.fds' : 16, '.lnx' : 64, '.a78' : 128 } as the number of bytes to skip for the roms that 'require' a header to check checksums* (note, SNES sfc is not there because redump only distributes no-header versions because it doesn't 'require' a header).
So basically i know those 4 don't count because even no-intro gave up on not requiring headers on them.

* of note, this is completely idiotic because nearly all the patches to nes on romhacking.net for instance, say they apply to 'crc something' and the crc something was lifted from redump and .... the patch also counts the header and applies to a completely different rom than the redump dump because the header is different. Great fucking job redump. Or maybe the fault is with the patch uploaders.

CI improvements

[ ] CI should build Flips under MSVC, to ensure I don't sneak in some GCC-ism
[ ] CI should build with make.sh's high-grade optimizations, and provide build artifacts, so I can provide a download link

tried to use make.sh with clang

im running into a clang error while attempting to compile flips. i have g++ installed, and build-essential, and this should be all, as termux repacks debian packages for its package manager (which is apt with different mirrors)
i was aiming for a cli build, and grabbed from the latest commit as of posting. im going to post the log on gist, and will post link here soon

ignore checksum option for bps

Hi,
I have many times problems with MSU patches that are in bps format if they want to be combined with other hacks, e.g., latest here where Vitor released a SA-1 patch for gradius (v17), but we only offer a msu support bps for v16:

https://www.zeldix.net/t1522p100-gradius-iii#42157

instead of giving the error message "This patch is not intended for this ROM." could you maybe make a warning instead alike:

"Warning: This patch is not intended for this ROM. Do you want to patch anyway?" And then let the user decide with Yes/No.

The command line :
flips --ignore-checksum --apply patch.bps rom.sfc
is already doing this, but having this option in the GUI would be a great advantage imo!

Full Uninstall

How to remove COMPLETELY this utility from Windows OS?
To be more specific:
All files with bps. extension get flower icon on them and get labeled as Flips utility file in their properties.
How to restore the default state of these files?
Thank you in advance.

Add a 'write to stdout' mode

(and maybe a 'read from stdin' mode, though that one is not so important).

This is in order to not be forced to create tmp files. In my usecase i'm using flips to help create .dat files for RA.

In these (variably huge) files i'd like to apply the patch to the rom and grab stdout in order to calculate the needed checksums without actually writing the file to disk at any time.

xdelta has something like that iirc:

https://github.com/jmacd/xdelta/blob/wiki/CommandLineSyntax.md 'use stdout'

Now that i think about stdin is (when supported) in linux indicated by a '-'. It's probably not very possible here because patchers need two input files (though it's totally possible in bash with process substitution, which is annoying).

License Question

Hey there. Cool library/program. I'm the coder of LibIPS.NET, which is based on the older, LGPL v3 version of your code (before you changed the license.) I'm wondering if I can update my library to your latest libips version, without changing the library to GPL v3? There were some bugs in the order release that your fixed, but I can't fix them in my library without changing my license.

flips segfaults easily by trying to create multi-gb patches

The ones typically found when you try to compare a psp/p2/wii game patched and unpatched. Compared to xdelta, which takes much less memory, flips (bps) seems to have pathological memory consumption. Maybe it expected to be able to hold all of the source in memory?

I'm going to have to add another mode for my utility to deal with xdelta patches for the iso cases unless this is solved.

I used --bps-linear btw, shouldn't i have?

[Question] Why can't you provide any pre-built binaries for the latest version?

Title says it. I just want to know why you can't provide any pre-built binaries for the latest release of Flips? For some reason, the only pre-built Flips binary that you have officially provided is a little outdated. Why not update that binary on SMWCentral to the latest version, or even put some pre-built Flips binaries on this repository's Releases section?

Selected patch type isn't applied correctly

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.

Can't Create IPS for 16 MB Files

As per title, with input and output files that are exactly 16 MB and using the IPS format, I get the error:

The IPS format does not support files larger than 16MB.

While this is true (to my knowledge), there should be no issue supporting files that are exactly 16 MB. The offending check is presumably this or the following line, but I'm not clear why those checks would trigger -- does filemap add 1 byte to the length somewhere along the line?

Thanks.

Request: Ignore checksum in GUI

BPS patches can be applied ignoring the checksum via command line, but there is no option to do so in the GUI.

Use case for this is applying multiple (small) hacks to the same ROM. IPS won't cut it as an alternative because of the 16MB limit upon creating one.

I'd imagine a checkbox that is "off" by default (check ROM by default) or a dialog window that warns the user that the ROM is not inteded for this patch with the option to click "Ignore" to patch the ROM regardless..

Compilation fails due to integer comparison

Ubuntu 16.04, dependencies seem to be met fine.

$ ./make.sh                                                                                                                                                                                                            
rm: cannot remove 'flips.exe': No such file or directory
rm: cannot remove 'floating.zip': No such file or directory
rm: cannot remove 'flips': No such file or directory
rm: cannot remove 'rc.o': No such file or directory
rm: cannot remove '*.gcda': No such file or directory
GTK+ (1/3)
rm: cannot remove 'flips': No such file or directory
g++ flips-cli.cpp libbps-suf.cpp libbps.cpp libips.cpp crc32.cpp libups.cpp flips-w32.cpp flips.cpp flips-gtk.cpp -std=c++98 -Wall -Werror -O3 -fomit-frame-pointer -fmerge-all-constants -fvisibility=hidden -fno-exceptions -fno-unwind-table
s -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -Wl,--gc-sections -fprofile-generate -lgcov -fno-rtti -fno-exceptions -DNDEBUG -fopenmp -DFLIPS_GTK -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr
/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/mirclient -I/usr/include/mircore -I/usr/include/mircookie -I/usr/include/cairo -I/u
sr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng1
2 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0  -Ilibdivsufsort-2.0.1/include -DHAVE
_CONFIG_H -D__STDC_FORMAT_MACROS libdivsufsort-2.0.1/lib/divsufsort.c libdivsufsort-2.0.1/lib/sssort.c libdivsufsort-2.0.1/lib/trsort.c   -oflips
libbps.cpp: In function ‘bpserror bps_create_linear(mem, mem, mem, mem*)’:
libbps.cpp:287:38: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
   if (numunchanged>1 || numunchanged == targetend-target)
                                      ^
cc1plus: all warnings being treated as errors
Makefile:91: recipe for target 'flips' failed
make: *** [flips] Error 1

Both make TARGET=cli DIVSUF=no and make TARGET=gtk LFLAGS='-lgcov' result in a binary and no warning, so I guess it's one of the FLAGS set in your script picking this up.

Tag a release?

I read the comment added in 1f14a54, however I maintain a package on the AUR and have to name it something, since the current package is the old 1.31 release.
Do you mind tagging 1.40 anyway, or should I just make something up and have it build the latest commit?

Support files larger than 256MB for BPS creation?

After doing some testing via tones generated by Audacity, I've discovered that Flips seems to throw up a "files are too big" error on any file that's 256MB or larger when trying to create a BPS file...which is kind of problematic in the era where games can be several gigabytes in size.

Also interestingly, I was originally able to create a BPS patch from a 900MB game by using Flips v1.12, but when I was then unable to create a patch for a game that was 2.5GB, I updated to Flips v.1.31 only to discover that it couldn't even create the BPS patch for the 900MB game let alone the 2.5GB game, yet going back and using Flips v.1.12 resulted in it also being unable to create a BPS patch for the 900MB game...

(speaking of older versions, I can't help but notice that v1.31 removed the ability to create speed-optimized BPS patches)

Download link?

I dont see a releases page. is there a compiled windows binary i can download?

macOS build from source

Hello there 👋
I'm running macOS Catalina 10.15.5 and I'm trying to build Flips from src.
This is the output from make:

Makefile:83: no libdivsufsort-2.x detected; switching to fallback SA-IS
Makefile:84: libdivsufsort is approximately twice as fast as SA-IS
g++ crc32.cpp flips-cli.cpp flips-gtk.cpp flips-w32.cpp flips.cpp libbps-suf.cpp libbps.cpp libips.cpp libups.cpp sais.cpp -std=c++98   -fno-rtti -fno-exceptions -DFLIPS_CLI  -oflips
libbps-suf.cpp:799:38: warning: function 'bps_create_suf_pick<unsigned long>' has internal
      linkage but is not defined [-Wundefined-internal]
template<typename T> static bpserror bps_create_suf_pick(file* source, file* target, boo...
                                     ^
libbps-suf.cpp:823:17: note: used here
        bpserror err = bps_create_suf_pick<size_t>(source, target, moremem, &bps);
                       ^
1 warning generated.
Undefined symbols for architecture x86_64:
  "bpserror bps_create_suf_pick<unsigned long>(file*, file*, bool, (anonymous namespace)::bps_creator*)", referenced from:
      _bps_create_delta in libbps-suf-44ed7c.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [flips] Error 1

And this is the output from clang++ *.cpp -O3 -o flips:

flips.cpp:9:7: warning: 'operator new' is missing exception specification 'throw(std::bad_alloc)'
      [-Wmissing-exception-spec]
void* operator new(size_t n) { return malloc(n); } // forget allocation failures, let the...
      ^
                             throw(std::bad_alloc)
flips.cpp:10:6: warning: 'operator delete' is missing exception specification 'throw()'
      [-Wmissing-exception-spec]
void operator delete(void * p) { free(p); }
     ^
                               throw()
2 warnings generated.
libbps-suf.cpp:799:38: warning: function 'bps_create_suf_pick<unsigned long>' has internal
      linkage but is not defined [-Wundefined-internal]
template<typename T> static bpserror bps_create_suf_pick(file* source, file* target, boo...
                                     ^
libbps-suf.cpp:823:17: note: used here
        bpserror err = bps_create_suf_pick<size_t>(source, target, moremem, &bps);
                       ^
1 warning generated.
Undefined symbols for architecture x86_64:
  "bpserror bps_create_suf_pick<unsigned long>(file*, file*, bool, (anonymous namespace)::bps_creator*)", referenced from:
      _bps_create_delta in libbps-suf-816ae6.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Am I missing anything?

BPS patches ignore data removed from the beginning of the file

Steps to reproduce:

  • Take any file original.bin
  • Remove bytes from the beginning of the file, save as modified.bin
  • Create a new patch for original.bin->modified.bin
  • Select .bps output

Expected results

  • Patch properly created
  • Applying the patch to original.bin outputs a file that matches modified.bin

Actual results

  • FLIPS claims that the files are identical and the patch will do nothing
  • Applying the patch to original.bin outputs a file that matches original.bin

Tested on v1.12 and v1.31, with identical results

GTK causing build error on gcc8+

Basically it's this issue: google/flutter-desktop-embedding#119

GTK 3.22.30-1
GCC 7.5.0-3 compiles fine.
GCC 8.4.0-1 throws the error.
GCC 9.3.0-10 throws the error.
I can resolve it by adding -Wno-error=parentheses to the flags in make.sh, but adding that locally doesn't seem terribly elegant. Setting CC/CXX to gcc-7/g++-7 works as well, though if there's a performance gain to be had from gcc9 I'd rather have it.

gcc-9 failed build log

CC=gcc-9 CXX=g++-9 ./make.sh
GTK+ (1/3)
g++-9 flips-cli.cpp libbps-suf.cpp libips.cpp crc32.cpp libups.cpp flips.cpp libbps.cpp flips-w32.cpp flips-gtk.cpp libdivsufsort-2.0.1/lib/divsufsort.c libdivsufsort-2.0.1/lib/sssort.c libdivsufsort-2.0.1/lib/trsort.c -std=c++98 -fno-rtti -fno-exceptions -DNDEBUG -Wall -fopenmp -DFLIPS_GTK -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0  -Ilibdivsufsort-2.0.1/include -DHAVE_CONFIG_H -D__STDC_FORMAT_MACROS  -Wall -Werror -O3 -flto -fuse-linker-plugin -fomit-frame-pointer -fmerge-all-constants -fvisibility=hidden -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections -fdata-sections -Wl,--gc-sections -fprofile-dir=obj/ -Wl,-z,relro,-z,now,--as-needed,--hash-style=gnu,--relax -fprofile-generate -lgcov   -oflips
In file included from /usr/include/gtk-3.0/gtk/gtk.h:100,
                 from flips-gtk.cpp:20:
/usr/include/gtk-3.0/gtk/gtkfilechooserbutton.h:66:8: error: unnecessary parentheses in declaration of ‘__gtk_reserved1’ [-Werror=parentheses]
   66 |   void (*__gtk_reserved1);
      |        ^
/usr/include/gtk-3.0/gtk/gtkfilechooserbutton.h:67:8: error: unnecessary parentheses in declaration of ‘__gtk_reserved2’ [-Werror=parentheses]
   67 |   void (*__gtk_reserved2);
      |        ^
/usr/include/gtk-3.0/gtk/gtkfilechooserbutton.h:68:8: error: unnecessary parentheses in declaration of ‘__gtk_reserved3’ [-Werror=parentheses]
   68 |   void (*__gtk_reserved3);
      |        ^
/usr/include/gtk-3.0/gtk/gtkfilechooserbutton.h:69:8: error: unnecessary parentheses in declaration of ‘__gtk_reserved4’ [-Werror=parentheses]
   69 |   void (*__gtk_reserved4);
      |        ^
In file included from /usr/include/gtk-3.0/gtk/gtk.h:271,
                 from flips-gtk.cpp:20:
/usr/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:74:8: error: unnecessary parentheses in declaration of ‘__gtk_reserved1’ [-Werror=parentheses]
   74 |   void (*__gtk_reserved1);
      |        ^
/usr/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:75:8: error: unnecessary parentheses in declaration of ‘__gtk_reserved2’ [-Werror=parentheses]
   75 |   void (*__gtk_reserved2);
      |        ^
/usr/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:76:8: error: unnecessary parentheses in declaration of ‘__gtk_reserved3’ [-Werror=parentheses]
   76 |   void (*__gtk_reserved3);
      |        ^
/usr/include/gtk-3.0/gtk/deprecated/gtkstatusicon.h:77:8: error: unnecessary parentheses in declaration of ‘__gtk_reserved4’ [-Werror=parentheses]
   77 |   void (*__gtk_reserved4);
      |        ^
cc1plus: all warnings being treated as errors
Makefile:91: recipe for target 'flips' failed
make: *** [flips] Error 1

Unable to patch Mother 3 translation

I'm unable to patch the Mother 3 translation with Flips. The error message that I get is "This patch is not intended for this ROM.". All patches that I've tried for other games have worked correctly. The things that I can think of that may cause this is the fact that it's a pretty big rom (33MB) or because the patch is in ups format. I haven't found any other ups patches to test with. The patches I have tried are either ips or xdelta, where all ips worked and xdelta gave an "Unknown patch format." error. I assume I would get the same error if ups wasn't supported at all.

The rom that I'm trying to patch is from the no-intro collection and its SHA-1 matches the recommended one at romhacking.net. I'm using Flips v1.31 installed from the AUR on Arch Linux (https://aur.archlinux.org/packages/flips/).

Link to patch: http://www.romhacking.net/translations/1333/

[Help Request] Cross-compiling windows build from Linux

Normally I avoid making this sort of issue, but I'm having no luck thus far. I'm looking to be able to compile the windows executable from Linux, but have no familiarity with mingw. Is there some easy way to accomplish this? My specific interest in this case is in making the -I flag available to Winfolk I work with on the retroachievements platform.

I have a feeling as a last resort I could use the windows mingw from within wine, but that feels extremely unnecessary.

Qt for cross-platform GUI?

I did notice that the Flips README.md specified that you're not interested in using Qt. I'm tentatively opening a new issue because you also mentioned that you don't have the right hardware to provide a GUI for OSX.

I admit, my own experience developing against Qt is limited and a bit dated; however, based on that experience, it seems like it's relatively easy to create decent, simple UIs with Qt. Also, while I also do not have (official) hardware on which to run OSX, I was under the impression that clean C/C++ developed against the Qt SDK should normally cross-compile on OSX without much hassle.

Since I don't need Flips to run on OSX, I'm not too concerned about OSX in particular; however, wouldn't it make sense to adopt Qt at some point in order to provide a reasonable cross-platform GUI for Flips? Nearly all the (not-Java) cross-platform projects (including commercial ones) that I've seen target Qt so they can create one GUI and use it everywhere. (The rest are using wxWidgets, or else they're Gimp...)

The last time I did have some access to official OSX-running hardware, Apple Xcode was free-as-in-beer, like Microsoft has finally made Visual Studio, and I ended up using it (Xcode) a fair amount to compile code from various F/OSS projects, including some GUI apps, all of which used Qt.

I understand if it's still too much hassle at this point.

Use GTKFileChooserNative instead of GTKFileChooser

The native variants make the GTK build nicer on Linux platforms, due to it using the filepicker/save of the system environment, rather than always using GTK.
I think this just involves changing the gtk_file_chooser_dialog_new calls with gtk_file_chooser_native_new. Will probably try to do a PR for this.
May or may not need to change the #define GDK_VERSION_MIN_REQUIRED at the top of the file, not sure.

On error, do you always send EOF to the output?

Remember me, i was trying to use your app on a project? I decided to go with processbuilder and named pipes (to make it possible to patch roms i want to checkout the final checksums without blowing up my memory).

This works fine, but i found out a error case i'm not sure how to fix myself though i'm sure it's possible with select or something non-blocking like that. But why suffer if you don't have to? ;)

I have these 3 functions:

 @contextmanager
 def named_pipes(n=1):
     dirname = tempfile.mkdtemp()
     try:
         paths = [os.path.join(dirname, 'romhack_pipe' + str(i)) for i in range(n)]
         for path in paths:
             os.mkfifo(path)
 
         yield paths
     finally:
         shutil.rmtree(dirname)
 
 def get_checksums():
     hash_md5   = hashlib.md5()
     hash_sha1  = hashlib.sha1()
     hash_crc32 = 0
     size = 0
 
     buf = yield
 
     while len(buf) > 0:
         size += len(buf)
         hash_md5.update(buf)
         hash_sha1.update(buf)
         hash_crc32 = zlib.crc32(buf, hash_crc32)
         buf = yield
 
     crc = '{:08x}'.format( hash_crc32 & 0xffffffff )
     md5 = hash_md5.hexdigest()
     sha1 = hash_sha1.hexdigest()
 
     yield (size, crc, md5, sha1)
 
 def producer(arguments, generator_function):
     ''' will append a output fifo to the end of the argument list prior to
         applying the generator function to that fifo. Make sure the command
         output is setup for the last argument to be a output file in the arguments
     '''
     BLOCKSIZE = 2 ** 20
     process = None
     next(generator_function)
     with named_pipes() as pipes:
         pipe = pipes[0]
         arguments.append(pipe)
         with subprocess.Popen(arguments,
                 stdout=subprocess.DEVNULL,
                 stderr=subprocess.DEVNULL) as process:
             with open(pipe, 'rb') as fifo:
                 byt = fifo.read(BLOCKSIZE)
                 while len(byt) > 0:
                     generator_function.send(byt)
                     byt = fifo.read(BLOCKSIZE)
     #if a error occurred avoid writing bogus checksums
     if process.returncode != 0:
         raise NonFatalError('error during patching, try to remove the header if a snes rom')
 
     return generator_function.send([])

Anyway the idea is the producer uses namedpipes to create a pipe, then it passes the pipe write end to the flips (and xdelta) subprocesses as the last argument of a list of arguments, and the reader end keeps passing the bytes to a continuation (in many cases that middle function there), that produces the checksums from the bytes one step at a time.

Only in a defective patch, it appears that flips never opened the file output for writing so the named pipe open is blocked forever.

The message in 'normal' cmd line operation is Unknown patch format.. Could you do me the favor of always opening and closing (EOF sent) the output file in case of error? I think it's just a question of opening the given file for writing on startup and on a process end, it'll be closed.

These command line interfaces should have standardized handing out open files imo, but that's fantasies for when we refactor the world.

Will not compile on Windows with MinGW

I needed the new version of the patcher to fix the "won't create patch with files that are 16mb" 1.31 bug (the link to download on the old issue seems to be down), but I absolutely cannot get the patcher to compile on Windows. MinGW reports that _wtoi, _wcsicmp, and _wcsdup are not declared in scope back from the define in flips.h. I've tried messing with the header unsuccessfully. I can confirm that it is compiling with the FLIPS_WINDOWS option (so these should be working), but I can't figure out much beyond that. I also can confirm that these functions are properly functioning on my computer in programs I wrote to test them quickly, including with #define.

Combine/Merge BPS patches

Good day.
Recently I stumbled upon two hacks for Ocarina of Time (v1.2), one of which is in XDelta form (widescreen), and the other in BPS (uncensored).
What I've been trying to do these past days is to possibly merge them both into a single ROM.
I could easily convert the XDelta patch into a BPS one, to keep both of them as BSP patches.

However, given how XDelta and BPS patches work once patched into a ROM, it is very hard to keep track on what specific changes have been made to the ROM, since once applied the changes go way above 10MB in the patched ROM compared to the original base, even when the original XDelta/BPS patches do not go above 500kB each.

I tried separating the ROMs into 4 parts, and then make IPS patches from each part, then patching the IPS for each one into 4 final parts, then merging them together, but the IPS patches for each part were between 4-5MB each.

So, with that said, I wanted to know if there is perhaps a known way to possibly merge or combine 2 BPS patches into a single one, or perhaps make it so that one can be applied over the other, since neither XDelta nor BPS give this option (to avoid issues of incompatibility with the patched ROM).

The patches I am using are the following:

OoT 64 Widescreen patch:
https://www.dropbox.com/s/o4ad8fvqf02gji8/oot12ws.xdelta?dl=0

OoT64 Uncensoring patch:
http://www.mediafire.com/download/pgnk7x3kcmc3tlc/oot_v12_firetemple.zip

Both should be applied to a clean Ocarina of Time v1.2 ROM (N64).
If there is something I can do for testing, please let me know.

Thanks in advance!

BPM

Hi.
I saw a backup of bsnes.
I thought maybe you still have the same collection of beat versions.
The very first one that knew how to do bpm is interesting:
beat_v01.tar.xz (source code + documentation)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.