diff options
| author | KiritoDv <kiritodev01@gmail.com> | 2023-09-18 03:39:03 -0600 |
|---|---|---|
| committer | KiritoDv <kiritodev01@gmail.com> | 2023-09-18 03:39:03 -0600 |
| commit | 16374cd98fe49163520d211bff04d6302a63d4f8 (patch) | |
| tree | 9350fd34bae193925b4aa0925bb9d331500f8c7f /src/n64 | |
| parent | 396f732bc58080430562ea60fd345bf2e51cfc0b (diff) | |
Added first multiversion support
Diffstat (limited to 'src/n64')
| -rw-r--r-- | src/n64/Cartridge.cpp | 6 | ||||
| -rw-r--r-- | src/n64/Cartridge.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/n64/Cartridge.cpp b/src/n64/Cartridge.cpp index 96e150c..97fdef4 100644 --- a/src/n64/Cartridge.cpp +++ b/src/n64/Cartridge.cpp @@ -6,6 +6,8 @@ void N64::Cartridge::Initialize() { LUS::BinaryReader reader((char*) this->gRomData.data(), this->gRomData.size()); reader.SetEndianness(LUS::Endianness::Big); + reader.Seek(0x10, LUS::SeekOffsetType::Start); + this->gRomCRC = BSWAP32(reader.ReadUInt32()); reader.Seek(0x20, LUS::SeekOffsetType::Start); this->gGameTitle = std::string(reader.ReadCString()); reader.Seek(0x3E, LUS::SeekOffsetType::Start); @@ -57,3 +59,7 @@ std::string N64::Cartridge::GetCountryCode() { return "unk"; } } + +uint32_t N64::Cartridge::GetCRC() { + return this->gRomCRC; +} diff --git a/src/n64/Cartridge.h b/src/n64/Cartridge.h index e53b8ef..9450239 100644 --- a/src/n64/Cartridge.h +++ b/src/n64/Cartridge.h @@ -20,11 +20,13 @@ public: CountryCode GetCountry(); uint8_t GetVersion() const; std::string GetHash(); + uint32_t GetCRC(); private: std::vector<uint8_t> gRomData; CountryCode gCountryCode; uint8_t gVersion; std::string gGameTitle; std::string gHash; + uint32_t gRomCRC; }; }
\ No newline at end of file |
