aboutsummaryrefslogtreecommitdiff
path: root/src/NDSCart.cpp
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2018-12-11 19:16:19 +0100
committerStapleButter <thetotalworm@gmail.com>2018-12-11 19:16:19 +0100
commite2f3c293609c7e0c8d7c5b29afe343e1187842fa (patch)
tree0eb404166d4547129637581d2be86c079b0bb7c4 /src/NDSCart.cpp
parent0579a1cd2e63fe882aed1ac9562a82308cbd1c56 (diff)
blarg.
also, calculate ROM CRC.
Diffstat (limited to 'src/NDSCart.cpp')
-rw-r--r--src/NDSCart.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/NDSCart.cpp b/src/NDSCart.cpp
index 03dfe4c..5be1fff 100644
--- a/src/NDSCart.cpp
+++ b/src/NDSCart.cpp
@@ -21,6 +21,7 @@
#include "NDS.h"
#include "NDSCart.h"
#include "ARM.h"
+#include "CRC32.h"
#include "melon_fopen.h"
@@ -733,6 +734,7 @@ u32 DataOutLen;
bool CartInserted;
u8* CartROM;
u32 CartROMSize;
+u32 CartCRC;
u32 CartID;
bool CartIsHomebrew;
@@ -1094,6 +1096,9 @@ bool LoadROM(const char* path, const char* sram, bool direct)
fclose(f);
//CartROM = f;
+ CartCRC = CRC32(CartROM, CartROMSize);
+ printf("ROM CRC32: %08X\n", CartCRC);
+
// generate a ROM ID
// note: most games don't check the actual value
// it just has to stay the same throughout gameplay