mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Fix the global checksum calculation in rgbfix
A regression was spotted in rgbfix 0.3.7, where we would accidentally include the first byte of the existing checksum when calculating a global checksum. We now correctly ignore both of the existing checksum bytes. This was spotted when running rgbfix on the Pokémon Gold/Silver betas, as they have a non-zero global checksum. Fixes #280. Signed-off-by: Ben10do <Ben10do@users.noreply.github.com>
This commit is contained in:
@@ -478,9 +478,9 @@ int main(int argc, char *argv[])
|
|||||||
int byte;
|
int byte;
|
||||||
|
|
||||||
while ((byte = fgetc(rom)) != EOF) {
|
while ((byte = fgetc(rom)) != EOF) {
|
||||||
i++;
|
if (i != 0x14E && i != 0x14F)
|
||||||
if (i != 0x150)
|
|
||||||
globalcksum += byte;
|
globalcksum += byte;
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ferror(rom))
|
if (ferror(rom))
|
||||||
|
|||||||
Reference in New Issue
Block a user