Parsing the basic rom's data

This commit is contained in:
AnonymusRaccoon
2020-01-30 18:06:30 +01:00
parent f74c79ad44
commit cb6ab59635
2 changed files with 9 additions and 2 deletions
+7
View File
@@ -76,6 +76,13 @@ namespace ComSquare::Cartridge
ADDMAPPINGMODE(this->_data[headerAddress + 21] & 0x1u ? HiRom : LoRom);
if (this->_data[headerAddress + 21] & 0x2u || this->_data[headerAddress + 210] & 0x4u)
ADDMAPPINGMODE(ExRom);
this->header.romType = this->_data[headerAddress + 22];
this->header.romSize = 0x400u << this->_data[headerAddress + 23];
this->header.sramSize = 0x400u << this->_data[headerAddress + 24];
this->header.creatorID = this->_data[headerAddress + 25];
this->header.version = this->_data[headerAddress + 27];
this->header.checksumComplement = this->_data[headerAddress + 28];
this->header.checksum = this->_data[headerAddress + 29];
return headerAddress & 0x200u;
}
}
+2 -2
View File
@@ -30,9 +30,9 @@ namespace ComSquare::Cartridge
//! @brief The rom type (special information about the rom, still don't know what).
uint8_t romType;
//! @brief The size (in bytes) of the ram
uint8_t romSize;
unsigned romSize;
//! @brief The size of the SRom inside the cartridge.
uint8_t sramSize;
unsigned sramSize;
//! @brief Creator license ID code.
uint8_t creatorID;
//! @brief The version of the game