mirror of
https://github.com/zoriya/ComSquare.git
synced 2026-06-01 09:45:25 +00:00
Using a constexpr for the magic header string of a SPC rom
This commit is contained in:
@@ -162,7 +162,7 @@ namespace ComSquare::Cartridge
|
||||
{
|
||||
std::string str = std::string(reinterpret_cast<char *>(this->_data), 0x21);
|
||||
|
||||
if (str != "SNES-SPC700 Sound File Data v0.30")
|
||||
if (str != Cartridge::_magicSPC)
|
||||
return false;
|
||||
if (this->_data[0x21] != 0x1A || this->_data[0x22] != 0x1A)
|
||||
return false;
|
||||
|
||||
@@ -91,6 +91,8 @@ namespace ComSquare::Cartridge
|
||||
Header _mapHeader(uint32_t headerAddress);
|
||||
//! @brief Current type of the cartridge
|
||||
CartridgeType _type;
|
||||
//! @brief Magic Header string of a SPC Rom
|
||||
static constexpr std::string_view _magicSPC = "SNES-SPC700 Sound File Data v0.30";
|
||||
public:
|
||||
//! @brief Load a rom from it's path.
|
||||
explicit Cartridge(const std::string &romPath);
|
||||
|
||||
Reference in New Issue
Block a user