aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2016-05-06 08:38:10 +0100
committerIan C <ianc@noddybox.co.uk>2016-05-06 08:38:10 +0100
commitbeb25c09c87c67e83f05f89fe704890493aac263 (patch)
tree66cf4d328abf3b3413d27f1af619a3735d87837e /src
parentd66326a6717195dc93602d2f9af24f3411b25dd9 (diff)
Fixed SNES checksum.
Diffstat (limited to 'src')
-rw-r--r--src/snesout.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/snesout.c b/src/snesout.c
index 911ee49..c8b0bac 100644
--- a/src/snesout.c
+++ b/src/snesout.c
@@ -290,13 +290,15 @@ int SNESOutput(const char *filename, const char *filename_bank,
*/
csum = 0;
+ PokeW(mem, 0xffdc, 0xffff);
+
for(f = 0; f < count; f++)
{
csum = CalcChecksum(bank[f]->memory + base, len, csum);
}
PokeW(mem, 0xffde, csum);
- PokeW(mem, 0xffdc, 0xffffu - csum);
+ PokeW(mem, 0xffdc, csum ^ 0xffff);
/* Output ROM contents
*/