Rewrite RGBFIX

- Make it work inside pipelines
- Add RGBFIX tests to the suite
- Be more flexible in accepted MBC names
- Add warnings for dangerous or nonsensical input params
- Improve man page
This commit is contained in:
ISSOtm
2020-12-26 01:53:16 +01:00
committed by Eldred Habert
parent f28b4abafc
commit 41d544a4eb
215 changed files with 1450 additions and 541 deletions

View File

@@ -203,7 +203,7 @@ develop:
$Qenv $(MAKE) -j WARNFLAGS="-Werror -Wall -Wextra -Wpedantic -Wno-type-limits \
-Wno-sign-compare -Wvla -Wformat -Wformat-security -Wformat-overflow=2 \
-Wformat-truncation=1 -Wformat-y2k -Wswitch-enum -Wunused \
-Wuninitialized -Wunknown-pragmas -Wstrict-overflow=5 \
-Wuninitialized -Wunknown-pragmas -Wstrict-overflow=4 \
-Wstringop-overflow=4 -Walloc-zero -Wduplicated-cond \
-Wfloat-equal -Wshadow -Wcast-qual -Wcast-align -Wlogical-op \
-Wnested-externs -Wno-aggressive-loop-optimizations -Winline \

View File

@@ -32,6 +32,58 @@
static inline _Noreturn unreachable_(void) {}
#endif
// Use builtins whenever possible, and shim them otherwise
#ifdef __GNUC__ // GCC or compatible
#define ctz __builtin_ctz
#define clz __builtin_clz
#elif defined(_MSC_VER)
#include <assert.h>
#include <intrin.h>
#pragma intrinsic(_BitScanReverse, _BitScanForward)
static inline int ctz(unsigned int x)
{
unsigned long cnt;
assert(x != 0);
_BitScanForward(&cnt, x);
return cnt;
}
static inline int clz(unsigned int x)
{
unsigned long cnt;
assert(x != 0);
_BitScanReverse(&cnt, x);
return 31 - cnt;
}
#else
// FIXME: these are rarely used, and need testing...
#include <limits.h>
static inline int ctz(unsigned int x)
{
int cnt = 0;
while (!(x & 1)) {
x >>= 1;
cnt++;
}
return cnt;
}
static inline int clz(unsigned int x)
{
int cnt = 0;
while (x <= UINT_MAX / 2) {
x <<= 1;
cnt++;
}
return cnt;
}
#endif
// Macros for stringification
#define STR(x) #x
#define EXPAND_AND_STR(x) STR(x)

View File

@@ -34,9 +34,15 @@
/* MSVC doesn't use POSIX types or defines for `read` */
#ifdef _MSC_VER
# include <io.h>
# define STDIN_FILENO 0
# define STDOUT_FILENO 1
# define STDERR_FILENO 2
# define ssize_t int
# define SSIZE_MAX INT_MAX
#else
# include <fcntl.h>
# include <unistd.h>
#endif
/* MSVC doesn't support `[static N]` for array arguments from C99 */
@@ -46,4 +52,22 @@
# define MIN_NB_ELMS(N) static (N)
#endif
// MSVC uses a different name for O_RDWR, and needs an additional _O_BINARY flag
#ifdef _MSC_VER
# include <fcntl.h>
# define O_RDWR _O_RDWR
# define S_ISREG(field) ((field) & _S_IFREG)
# define O_BINARY _O_BINARY
#elif !defined(O_BINARY) // Cross-compilers define O_BINARY
# define O_BINARY 0 // POSIX says we shouldn't care!
#endif // _MSC_VER
// Windows has stdin and stdout open as text by default, which we may not want
#if defined(_MSC_VER) || defined(__MINGW32__)
# include <io.h>
# define setmode(fd, mode) _setmode(fd, mode)
#else
# define setmode(fd, mode) ((void)0)
#endif
#endif /* RGBDS_PLATFORM_H */

File diff suppressed because it is too large Load Diff

View File

@@ -24,39 +24,48 @@
.Op Fl p Ar pad_value
.Op Fl r Ar ram_size
.Op Fl t Ar title_str
.Ar file
.Op Ar
.Sh DESCRIPTION
The
.Nm
program changes headers of Game Boy ROM images.
program changes headers of Game Boy ROM images, typically generated by
.Xr rgblink 1 ,
though it will work with
.Em any
Game Boy ROM.
It also performs other correctness operations, such as padding.
.Nm
only changes the fields for which it has values specified.
Developers are advised to fill those fields with 0x00 bytes in their source code before running
.Nm ,
and to have already populated whichever fields they don't specify using
.Nm .
.Pp
Note that options can be abbreviated as long as the abbreviation is unambiguous:
.Fl Fl verb
.Fl Fl color-o
is
.Fl Fl verbose ,
.Fl Fl color-only ,
but
.Fl Fl ver
.Fl Fl color
is invalid because it could also be
.Fl Fl version .
The arguments are as follows:
.Fl Fl color-compatible .
Options later in the command line override those set earlier.
Accepted options are as follows:
.Bl -tag -width Ds
.It Fl C , Fl Fl color-only
Set the Game Boy Color\(enonly flag:
.Ad 0x143
= 0xC0.
If both this and the
Set the Game Boy Color\(enonly flag
.Pq Ad 0x143
to 0xC0.
This overrides
.Fl c
flag are set, this takes precedence.
if it was set prior.
.It Fl c , Fl Fl color-compatible
Set the Game Boy Color\(encompatible flag:
.Ad 0x143
= 0x80.
If both this and the
.Fl C
flag are set,
.Fl C
takes precedence.
.Pq Ad 0x143
to 0x80.
This overrides
.Fl c
if it was set prior.
.It Fl f Ar fix_spec , Fl Fl fix-spec Ar fix_spec
Fix certain header values that the Game Boy checks for correctness.
Alternatively, intentionally trash these values by writing their binary inverse instead.
@@ -83,55 +92,63 @@ Trash the global checksum.
.It Fl i Ar game_id , Fl Fl game-id Ar game_id
Set the game ID string
.Pq Ad 0x13F Ns \(en Ns Ad 0x142
to a given string of exactly 4 characters.
If both this and the title are set, the game ID will overwrite the overlapping portion of the title.
to a given string.
If it's longer than 4 chars, it will be truncated, and a warning emitted.
.It Fl j , Fl Fl non-japanese
Set the non-Japanese region flag:
.Ad 0x14A
= 1.
Set the non-Japanese region flag
.Pq Ad 0x14A
to 0x01.
.It Fl k Ar licensee_str , Fl Fl new-licensee Ar licensee_str
Set the new licensee string
.Pq Ad 0x144 Ns \(en Ns Ad 0x145
to a given string, truncated to at most two characters.
to a given string.
If it's longer than 2 chars, it will be truncated, and a warning emitted.
.It Fl l Ar licensee_id , Fl Fl old-licensee Ar licensee_id
Set the old licensee code,
.Ad 0x14B ,
Set the old licensee code
.Pq Ad 0x14B
to a given value from 0 to 0xFF.
This value is deprecated and should be set to 0x33 in all new software.
.It Fl m Ar mbc_type , Fl Fl mbc-type Ar mbc_type
Set the MBC type,
.Ad 0x147 ,
Set the MBC type
.Pq Ad 0x147
to a given value from 0 to 0xFF.
This value may also be an MBC name from the Pan Docs.
.It Fl n Ar rom_version , Fl Fl rom-version Ar rom_version
Set the ROM version,
.Ad 0x14C ,
Set the ROM version
.Pq Ad 0x14C
to a given value from 0 to 0xFF.
.It Fl p Ar pad_value , Fl Fl pad-value Ar pad_value
Pad the image to a valid size with a given pad value from 0 to 0xFF.
Pad the ROM image to a valid size with a given pad value from 0 to 255 (0xFF).
.Nm
will automatically pick a size from 32 KiB, 64 KiB, 128 KiB, ..., 8192 KiB.
The cartridge size byte
.Pq Ad 0x148
will be changed to reflect this new size.
The recommended padding value is 0xFF, to speed up writing the ROM to flash chips, and to avoid "nop slides" into VRAM.
.It Fl r Ar ram_size , Fl Fl ram-size Ar ram_size
Set the RAM size,
.Ad 0x149 ,
Set the RAM size
.Pq Ad 0x149
to a given value from 0 to 0xFF.
.It Fl s , Fl Fl sgb-compatible
Set the SGB flag:
.Ad 0x146
= 3. This flag will be ignored by the SGB unless the old licensee code is 0x33!
Set the SGB flag
.Pq Ad 0x146
to 0x03.
This flag will be ignored by the SGB unless the old licensee code is 0x33!
If this is given as well as
.Fl l ,
but is not set to 0x33, a warning will be printed.
.It Fl t Ar title , Fl Fl title Ar title
Set the title string
.Pq Ad 0x134 Ns \(en Ns Ad 0x143
to a given string, truncated to at most 16 characters.
It is recommended to use 15 characters instead, to avoid clashing with the CGB flag
.Po Fl c
to a given string.
If the title is longer than the max length, it will be truncated, and a warning emitted.
The max length is 11 characters if the game ID
.Pq Fl i
is specified, 15 characters if the CGB flag
.Fl ( c
or
.Fl C
.Pc .
If both this and the game ID are set, the game ID will overwrite the overlapping portion of the title.
.Fl C )
is specified but the game ID is not, and 16 characters otherwise.
.It Fl V , Fl Fl version
Print the version of the program and exit.
.It Fl v , Fl Fl validate
@@ -139,7 +156,7 @@ Equivalent to
.Fl f Cm lhg .
.El
.Sh EXAMPLES
Most values in the ROM header are only cosmetic.
Most values in the ROM header do not matter to the actual console, and most are seldom useful anyway.
The bare minimum requirements for a workable program are the header checksum, the Nintendo logo, and (if needed) the CGB/SGB flags.
It is a good idea to pad the image to a valid size as well
.Pq Do valid Dc meaning a power of 2, times 32 KiB .
@@ -152,14 +169,13 @@ a valid size:
The following will make a SGB-enabled, color-enabled game with a title of
.Dq foobar ,
and pad it to a valid size.
.Po
The Game Boy itself does not use the title, but some emulators or ROM managers do.
.Pc
.Pq The Game Boy itself does not use the title, but some emulators or ROM managers do.
.Pp
.D1 $ rgbfix -vcs -l 0x33 -p 255 -t foobar baz.gb
.Pp
The following will duplicate the header (sans global checksum) of the game
.Dq Survival Kids :
The following will duplicate the header of the game
.Dq Survival Kids ,
sans global checksum:
.Pp
.D1 $ rgbfix -cjsv -k A4 -l 0x33 -m 0x1B -p 0xFF -r 3 -t SURVIVALKIDAVKE \
SurvivalKids.gbc

1
test/fix/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/padding*_*

16
test/fix/README.md Normal file
View File

@@ -0,0 +1,16 @@
# RGBFIX tests
These tests check that RGBFIX behaves properly.
## Structure of a test
- `test.bin`: The file passed as input to RGBFIX.
- `test.flags`: The command-line flags passed to RGBFIX's invocation.
Actually, only the first line is considered; the rest of the file may contain comments about the test.
- `test.gb`: The expected output.
May not exist, generally when the test expects an error, in which case the comparison is skipped.
- `test.err`: The expected error output.
## Special tests
- `noexist.err` is the expected error output when RGBFIX is given a non-existent input file.

View File

@@ -0,0 +1,3 @@
<EFBFBD><EFBFBD><1B>!H0<48>;<<>N˗<4E><CB97><EFBFBD>=<3D><><EFBFBD><EFBFBD>^{ KC}b<12>Q<EFBFBD>&<14>3<EFBFBD> <20>/]<01><08><><EFBFBD>d<EFBFBD><64>Z=<3D><><EFBFBD>b<EFBFBD>a<EFBFBD>i:<3A>eS<65>><18><>U@<40>Ay<ae<61><65><EFBFBD>$vf<76><13><>g<> VC<56><43>~><3E><><EFBFBD><EFBFBD><11><> <09>s_ <0C><>&nWFoK<04><18><>X`'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>bl<17>{<7B><><EFBFBD><EFBFBD>
<EFBFBD><0F><><EFBFBD><EFBFBD>8<EFBFBD><38><EFBFBD><$:V<0F>"㳙ځh<DA81><68>D<EFBFBD><44>ж<15><>Qc<51><63><EFBFBD><1E>㸺Z<E3B8BA><5A>T<><54><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><56><0F><>4<EFBFBD>B<><1E>d T<><54> <09>I<1A><>
<EFBFBD>(/׻<><D7BB>{h<>:<3A><>Qm<51>$*|

View File

@@ -0,0 +1,3 @@
warning: Ignoring 'm' in fix spec
warning: Ignoring 'a' in fix spec
warning: Ignoring 'o' in fix spec

View File

@@ -0,0 +1 @@
-f lmao

2
test/fix/color.bin Normal file
View File

@@ -0,0 +1,2 @@
<EFBFBD><EFBFBD>+2l}~<7E><>Ѧ<><D1A6>}<7D><>1x<31><78><EFBFBD><EFBFBD>&)Y<18>q*<2A><><EFBFBD><EFBFBD>ɒ<EFBFBD><C992>^ H<>p@v6}<7D><>[<5B><>&<26><><EFBFBD>h<EFBFBD><68><EFBFBD>Bn~<7E>T<EFBFBD>0<><30>uf<75>\<5C>8<EFBFBD><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><13>Ñ<EFBFBD>W<EFBFBD><57><EFBFBD><EFBFBD> 5^Bq<<3C>K<EFBFBD>"S%<25><>U!<0F><>r,7<10><16>g<16>4Ȩ<><C8A8><10><><EFBFBD><EFBFBD><EFBFBD><1C>hL<68><4C>؝<EFBFBD>)<29><1A><><EFBFBD>6U@<19>׍`ݑT<DD91>T<EFBFBD> <0B><><EFBFBD><44>8z<38>5<EFBFBD><35>~A<>鱽ܜ<E9B1BD>|
<EFBFBD>><3E>]<5D>/<2F>K<EFBFBD><4B><EFBFBD>d~<7E><>"gF* AU<>"W<>7]}<7D><>/<2F>}<<3C><>s[lx<07>ܔ}Ы[<5B><><EFBFBD>8<EFBFBD><1E><><EFBFBD><EFBFBD><EFBFBD>

0
test/fix/color.err Normal file
View File

1
test/fix/color.flags Normal file
View File

@@ -0,0 +1 @@
-C

2
test/fix/color.gb Normal file
View File

@@ -0,0 +1,2 @@
<EFBFBD><EFBFBD>+2l}~<7E><>Ѧ<><D1A6>}<7D><>1x<31><78><EFBFBD><EFBFBD>&)Y<18>q*<2A><><EFBFBD><EFBFBD>ɒ<EFBFBD><C992>^ H<>p@v6}<7D><>[<5B><>&<26><><EFBFBD>h<EFBFBD><68><EFBFBD>Bn~<7E>T<EFBFBD>0<><30>uf<75>\<5C>8<EFBFBD><38><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><13>Ñ<EFBFBD>W<EFBFBD><57><EFBFBD><EFBFBD> 5^Bq<<3C>K<EFBFBD>"S%<25><>U!<0F><>r,7<10><16>g<16>4Ȩ<><C8A8><10><><EFBFBD><EFBFBD><EFBFBD><1C>hL<68><4C>؝<EFBFBD>)<29><1A><><EFBFBD>6U@<19>׍`ݑT<DD91>T<EFBFBD> <0B><><EFBFBD><44>8z<38>5<EFBFBD><35>~A<>鱽ܜ<E9B1BD>|
<EFBFBD>><3E>]<5D>/<2F>K<EFBFBD><4B><EFBFBD>d~<7E><>"gF* AU<>"W<>7]}<7D><>/<2F>}<<3C><>s[lx<07>ܔ}Ы[<5B><><EFBFBD>8<EFBFBD><1E><><EFBFBD><EFBFBD><EFBFBD>

BIN
test/fix/compatible.bin Normal file

Binary file not shown.

0
test/fix/compatible.err Normal file
View File

View File

@@ -0,0 +1 @@
-c

BIN
test/fix/compatible.gb Normal file

Binary file not shown.

0
test/fix/empty.bin Normal file
View File

2
test/fix/empty.err Normal file
View File

@@ -0,0 +1,2 @@
FATAL: "<filename>" too short, expected at least 336 ($150) bytes, got only 0
Fixing "<filename>" failed with 1 error

0
test/fix/empty.flags Normal file
View File

0
test/fix/empty.gb Normal file
View File

BIN
test/fix/fix-override.bin Normal file

Binary file not shown.

View File

@@ -0,0 +1 @@
warning: 'l' overriding 'L' in fix spec

View File

@@ -0,0 +1 @@
-f Ll

BIN
test/fix/fix-override.gb Normal file

Binary file not shown.

BIN
test/fix/gameid-trunc.bin Normal file

Binary file not shown.

View File

@@ -0,0 +1 @@
warning: Truncating game ID "FOUR!" to 4 chars

View File

@@ -0,0 +1 @@
-i 'FOUR!'

BIN
test/fix/gameid-trunc.gb Normal file

Binary file not shown.

BIN
test/fix/gameid.bin Normal file

Binary file not shown.

0
test/fix/gameid.err Normal file
View File

1
test/fix/gameid.flags Normal file
View File

@@ -0,0 +1 @@
-i RGBD

BIN
test/fix/gameid.gb Normal file

Binary file not shown.

BIN
test/fix/global-large.bin Normal file

Binary file not shown.

View File

View File

@@ -0,0 +1 @@
-fg

BIN
test/fix/global-large.gb Normal file

Binary file not shown.

BIN
test/fix/global-larger.bin Normal file

Binary file not shown.

View File

View File

@@ -0,0 +1 @@
-fg

BIN
test/fix/global-larger.gb Normal file

Binary file not shown.

BIN
test/fix/global-trash.bin Normal file

Binary file not shown.

View File

View File

@@ -0,0 +1 @@
-f G

BIN
test/fix/global-trash.gb Normal file

Binary file not shown.

BIN
test/fix/global.bin Normal file

Binary file not shown.

0
test/fix/global.err Normal file
View File

1
test/fix/global.flags Normal file
View File

@@ -0,0 +1 @@
-f g

BIN
test/fix/global.gb Normal file

Binary file not shown.

BIN
test/fix/header-edit.bin Normal file

Binary file not shown.

0
test/fix/header-edit.err Normal file
View File

View File

@@ -0,0 +1,2 @@
-Cf h
Checks that the header checksum properly accounts for header modifications

BIN
test/fix/header-edit.gb Normal file

Binary file not shown.

BIN
test/fix/header-trash.bin Normal file

Binary file not shown.

View File

View File

@@ -0,0 +1 @@
-f H

BIN
test/fix/header-trash.gb Normal file

Binary file not shown.

BIN
test/fix/header.bin Normal file

Binary file not shown.

0
test/fix/header.err Normal file
View File

1
test/fix/header.flags Normal file
View File

@@ -0,0 +1 @@
-f h

BIN
test/fix/header.gb Normal file

Binary file not shown.

BIN
test/fix/jp.bin Normal file

Binary file not shown.

0
test/fix/jp.err Normal file
View File

1
test/fix/jp.flags Normal file
View File

@@ -0,0 +1 @@
-j

BIN
test/fix/jp.gb Normal file

Binary file not shown.

BIN
test/fix/logo-trash.bin Normal file

Binary file not shown.

0
test/fix/logo-trash.err Normal file
View File

View File

@@ -0,0 +1 @@
-f L

BIN
test/fix/logo-trash.gb Normal file

Binary file not shown.

BIN
test/fix/logo.bin Normal file

Binary file not shown.

0
test/fix/logo.err Normal file
View File

1
test/fix/logo.flags Normal file
View File

@@ -0,0 +1 @@
-f l

BIN
test/fix/logo.gb Normal file

Binary file not shown.

BIN
test/fix/mbc.bin Normal file

Binary file not shown.

0
test/fix/mbc.err Normal file
View File

1
test/fix/mbc.flags Normal file
View File

@@ -0,0 +1 @@
-m 177

BIN
test/fix/mbc.gb Normal file

Binary file not shown.

BIN
test/fix/mbcless-ram.bin Normal file

Binary file not shown.

1
test/fix/mbcless-ram.err Normal file
View File

@@ -0,0 +1 @@
warning: MBC "ROM" has no RAM, but RAM size was set to 2

View File

@@ -0,0 +1 @@
-m ROM -r 2

BIN
test/fix/mbcless-ram.gb Normal file

Binary file not shown.

View File

@@ -0,0 +1,3 @@
<EFBFBD><13><>i& <20><><EFBFBD>y<EFBFBD><79>S<EFBFBD><53><EFBFBD><EFBFBD>aJ<04><><EFBFBD>'ZD<5A>y<EFBFBD><79><EFBFBD>1n<31>
<EFBFBD><13><>9<EFBFBD>Q<EFBFBD>H<EFBFBD>p<EFBFBD><18>yF<79><15><><EFBFBD><EFBFBD><EFBFBD>ߘ<EFBFBD><DF98>8^<5E><>]<5D>b<EFBFBD><62> F<19><><6D>
<EFBFBD><14>ьM<D18C><4D>F<EFBFBD><46>W<EFBFBD><57>w<16>k<EFBFBD><6B><EFBFBD> O`<60><><EFBFBD><18>U<EFBFBD>0<EFBFBD><30>r<EFBFBD><72><EFBFBD><EFBFBD>Ιܥ<CE99><DCA5>7"<1D><>"f<><66><EFBFBD><EFBFBD>fw<08> X<><58>:<3A>޸<EFBFBD><DEB8>Xp<58>V<EFBFBD>Ī\-<2D>`x<><78><EFBFBD>*N<><4E>y<EFBFBD>a4<0E>J<EFBFBD><4A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܊<EFBFBD>p<EFBFBD><70><EFBFBD>.7<EFBFBD>c+<2B>Q<EFBFBD><51>Վ<EFBFBD>B<EFBFBD>He<48>z<EFBFBD><7A><EFBFBD>1<EFBFBD>O<n_&KHh<48><05><>v<13><><EFBFBD>x<EFBFBD><78><07>Y<EFBFBD><59><1D>A<7F><41><EFBFBD><EFBFBD>;C<>o<EFBFBD>l<EFBFBD><6C>:<3A> <0C><><EFBFBD><EFBFBD>̒<0F>ܩ!<21>f<><16><16><>P<EFBFBD>`@<12>:<3A>z<EFBFBD>v<EFBFBD><76><EFBFBD>d<EFBFBD><64>Z<EFBFBD>"<22>a*m*.:?<3F><><EFBFBD><EFBFBD><EFBFBD>Y˛c3<63>Ƞ>#`<60><>\_<>w<EFBFBD><77><EFBFBD>

View File

@@ -0,0 +1 @@
warning: Truncating new licensee "HOMEBREW" to 2 chars

View File

@@ -0,0 +1 @@
-k HOMEBREW

View File

@@ -0,0 +1,3 @@
<EFBFBD><13><>i& <20><><EFBFBD>y<EFBFBD><79>S<EFBFBD><53><EFBFBD><EFBFBD>aJ<04><><EFBFBD>'ZD<5A>y<EFBFBD><79><EFBFBD>1n<31>
<EFBFBD><13><>9<EFBFBD>Q<EFBFBD>H<EFBFBD>p<EFBFBD><18>yF<79><15><><EFBFBD><EFBFBD><EFBFBD>ߘ<EFBFBD><DF98>8^<5E><>]<5D>b<EFBFBD><62> F<19><><6D>
<EFBFBD><14>ьM<D18C><4D>F<EFBFBD><46>W<EFBFBD><57>w<16>k<EFBFBD><6B><EFBFBD> O`<60><><EFBFBD><18>U<EFBFBD>0<EFBFBD><30>r<EFBFBD><72><EFBFBD><EFBFBD>Ιܥ<CE99><DCA5>7"<1D><>"f<><66><EFBFBD><EFBFBD>fw<08> X<><58>:<3A>޸<EFBFBD><DEB8>Xp<58>V<EFBFBD>Ī\-<2D>`x<><78><EFBFBD>*N<><4E>y<EFBFBD>a4<0E>J<EFBFBD><4A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܊<EFBFBD>p<EFBFBD><70><EFBFBD>.7<EFBFBD>c+<2B>Q<EFBFBD><51>Վ<EFBFBD>B<EFBFBD>He<48>z<EFBFBD><7A><EFBFBD>1<EFBFBD>O<n_&KHh<48><05><>v<13><><EFBFBD>x<EFBFBD><78><07>Y<EFBFBD><59><1D>A<7F><41><EFBFBD><EFBFBD>;C<>o<EFBFBD>l<EFBFBD><6C>:<3A> <0C><><EFBFBD><EFBFBD>̒<0F>ܩ!<21>f<><16><16><>P<EFBFBD>`@<12>:<3A>z<EFBFBD>v<EFBFBD><76><EFBFBD>d<EFBFBD><64>Z<EFBFBD>"<22>a*m*.:?<3F><><EFBFBD><EFBFBD><EFBFBD>YHOc3<63>Ƞ>#`<60><>\_<>w<EFBFBD><77><EFBFBD>

3
test/fix/new-lic.bin Normal file
View File

@@ -0,0 +1,3 @@
<EFBFBD><13><>i& <20><><EFBFBD>y<EFBFBD><79>S<EFBFBD><53><EFBFBD><EFBFBD>aJ<04><><EFBFBD>'ZD<5A>y<EFBFBD><79><EFBFBD>1n<31>
<EFBFBD><13><>9<EFBFBD>Q<EFBFBD>H<EFBFBD>p<EFBFBD><18>yF<79><15><><EFBFBD><EFBFBD><EFBFBD>ߘ<EFBFBD><DF98>8^<5E><>]<5D>b<EFBFBD><62> F<19><><6D>
<EFBFBD><14>ьM<D18C><4D>F<EFBFBD><46>W<EFBFBD><57>w<16>k<EFBFBD><6B><EFBFBD> O`<60><><EFBFBD><18>U<EFBFBD>0<EFBFBD><30>r<EFBFBD><72><EFBFBD><EFBFBD>Ιܥ<CE99><DCA5>7"<1D><>"f<><66><EFBFBD><EFBFBD>fw<08> X<><58>:<3A>޸<EFBFBD><DEB8>Xp<58>V<EFBFBD>Ī\-<2D>`x<><78><EFBFBD>*N<><4E>y<EFBFBD>a4<0E>J<EFBFBD><4A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܊<EFBFBD>p<EFBFBD><70><EFBFBD>.7<EFBFBD>c+<2B>Q<EFBFBD><51>Վ<EFBFBD>B<EFBFBD>He<48>z<EFBFBD><7A><EFBFBD>1<EFBFBD>O<n_&KHh<48><05><>v<13><><EFBFBD>x<EFBFBD><78><07>Y<EFBFBD><59><1D>A<7F><41><EFBFBD><EFBFBD>;C<>o<EFBFBD>l<EFBFBD><6C>:<3A> <0C><><EFBFBD><EFBFBD>̒<0F>ܩ!<21>f<><16><16><>P<EFBFBD>`@<12>:<3A>z<EFBFBD>v<EFBFBD><76><EFBFBD>d<EFBFBD><64>Z<EFBFBD>"<22>a*m*.:?<3F><><EFBFBD><EFBFBD><EFBFBD>Y˛c3<63>Ƞ>#`<60><>\_<>w<EFBFBD><77><EFBFBD>

0
test/fix/new-lic.err Normal file
View File

1
test/fix/new-lic.flags Normal file
View File

@@ -0,0 +1 @@
-k HB

3
test/fix/new-lic.gb Normal file
View File

@@ -0,0 +1,3 @@
<EFBFBD><13><>i& <20><><EFBFBD>y<EFBFBD><79>S<EFBFBD><53><EFBFBD><EFBFBD>aJ<04><><EFBFBD>'ZD<5A>y<EFBFBD><79><EFBFBD>1n<31>
<EFBFBD><13><>9<EFBFBD>Q<EFBFBD>H<EFBFBD>p<EFBFBD><18>yF<79><15><><EFBFBD><EFBFBD><EFBFBD>ߘ<EFBFBD><DF98>8^<5E><>]<5D>b<EFBFBD><62> F<19><><6D>
<EFBFBD><14>ьM<D18C><4D>F<EFBFBD><46>W<EFBFBD><57>w<16>k<EFBFBD><6B><EFBFBD> O`<60><><EFBFBD><18>U<EFBFBD>0<EFBFBD><30>r<EFBFBD><72><EFBFBD><EFBFBD>Ιܥ<CE99><DCA5>7"<1D><>"f<><66><EFBFBD><EFBFBD>fw<08> X<><58>:<3A>޸<EFBFBD><DEB8>Xp<58>V<EFBFBD>Ī\-<2D>`x<><78><EFBFBD>*N<><4E>y<EFBFBD>a4<0E>J<EFBFBD><4A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>܊<EFBFBD>p<EFBFBD><70><EFBFBD>.7<EFBFBD>c+<2B>Q<EFBFBD><51>Վ<EFBFBD>B<EFBFBD>He<48>z<EFBFBD><7A><EFBFBD>1<EFBFBD>O<n_&KHh<48><05><>v<13><><EFBFBD>x<EFBFBD><78><07>Y<EFBFBD><59><1D>A<7F><41><EFBFBD><EFBFBD>;C<>o<EFBFBD>l<EFBFBD><6C>:<3A> <0C><><EFBFBD><EFBFBD>̒<0F>ܩ!<21>f<><16><16><>P<EFBFBD>`@<12>:<3A>z<EFBFBD>v<EFBFBD><76><EFBFBD>d<EFBFBD><64>Z<EFBFBD>"<22>a*m*.:?<3F><><EFBFBD><EFBFBD><EFBFBD>YHBc3<63>Ƞ>#`<60><>\_<>w<EFBFBD><77><EFBFBD>

2
test/fix/noexist.err Normal file
View File

@@ -0,0 +1,2 @@
FATAL: Failed to open "noexist" for reading+writing: No such file or directory
Fixing "noexist" failed with 1 error

BIN
test/fix/old-lic-hex.bin Normal file

Binary file not shown.

0
test/fix/old-lic-hex.err Normal file
View File

View File

@@ -0,0 +1 @@
-l 0x2a

BIN
test/fix/old-lic-hex.gb Normal file

Binary file not shown.

2
test/fix/old-lic.bin Normal file
View File

@@ -0,0 +1,2 @@
<EFBFBD>EZ/:<3A><><EFBFBD><7F><7F>Ѐ<EFBFBD><02>J/<2F><><EFBFBD><EFBFBD>_<<3C>&<26>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD>XgAP
`<60>1@Wh<><68>||ø<>e뻬e^"7(*YV<59><56>T<EFBFBD><54><EFBFBD>OY!<21><03><04>̔]<5D><><EFBFBD>=<3D><01><>y<EFBFBD>V~x<>a<>]<5D>;<3B><><EFBFBD>¡<EFBFBD>zUm <0C><>z:d@֪<>b<EFBFBD> 'vʆq<02>W<EFBFBD><14>_<EFBFBD><5F><17><><EFBFBD>2)G<05>v(k<><6B><EFBFBD>g,<2C>p*@<40><>!<21><44>0k<14><><01><><EFBFBD>e<EFBFBD>%ǚod<6F><64><EFBFBD>$r<11><><EFBFBD> <<3C>:<3A><>cgi<67>"aF'=f<><66><1F><>EcVcL.03"w),<2C> HQi<51>D<EFBFBD>f<EFBFBD>3<EFBFBD>s(-$?a0<61>@<40><>.O<>B{y<>z<EFBFBD>ʫ<1A> h<>/\ <0B>S<>]<5D>o<EFBFBD><6F>m'2D#/gr<67>W3<>Χ<><CEA7>&U<><55><EFBFBD>EgMh<4D>-A<>6<><36><EFBFBD><EFBFBD><EFBFBD>4M|1<>q0O<30><4F>*$<24>O<EFBFBD>/n<><6E><EFBFBD>g<EFBFBD><67>2R<32><52>Q<EFBFBD>X<>_<07><><EFBFBD>[<>p<EFBFBD><70>\<5C>)ƧTS<54>T<EFBFBD>aP*'[<0F>x<EFBFBD><78><>Ub[Ԧ<>9s<39><73>I<EFBFBD><49>P

0
test/fix/old-lic.err Normal file
View File

1
test/fix/old-lic.flags Normal file
View File

@@ -0,0 +1 @@
-l 42

2
test/fix/old-lic.gb Normal file
View File

@@ -0,0 +1,2 @@
<EFBFBD>EZ/:<3A><><EFBFBD><7F><7F>Ѐ<EFBFBD><02>J/<2F><><EFBFBD><EFBFBD>_<<3C>&<26>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD>XgAP
`<60>1@Wh<><68>||ø<>e뻬e^"7(*YV<59><56>T<EFBFBD><54><EFBFBD>OY!<21><03><04>̔]<5D><><EFBFBD>=<3D><01><>y<EFBFBD>V~x<>a<>]<5D>;<3B><><EFBFBD>¡<EFBFBD>zUm <0C><>z:d@֪<>b<EFBFBD> 'vʆq<02>W<EFBFBD><14>_<EFBFBD><5F><17><><EFBFBD>2)G<05>v(k<><6B><EFBFBD>g,<2C>p*@<40><>!<21><44>0k<14><><01><><EFBFBD>e<EFBFBD>%ǚod<6F><64><EFBFBD>$r<11><><EFBFBD> <<3C>:<3A><>cgi<67>"aF'=f<><66><1F><>EcVcL.03"w),<2C> HQi<51>D<EFBFBD>f<EFBFBD>3<EFBFBD>s(-$?a0<61>@<40><>.O<>B{y<>z<EFBFBD>ʫ<1A> h<>/\ <0B>S<>]<5D>o<EFBFBD><6F>m'2D#/gr<67>W3<>Χ<><CEA7>&U<><55><EFBFBD>EgMh<4D>-A<>*6<><36><EFBFBD><EFBFBD><EFBFBD>4M|1<>q0O<30><4F>*$<24>O<EFBFBD>/n<><6E><EFBFBD>g<EFBFBD><67>2R<32><52>Q<EFBFBD>X<>_<07><><EFBFBD>[<>p<EFBFBD><70>\<5C>)ƧTS<54>T<EFBFBD>aP*'[<0F>x<EFBFBD><78><>Ub[Ԧ<>9s<39><73>I<EFBFBD><49>P

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More