From d14d984fd671a88c8f542353b3196a574a50c26a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A3=CF=84=CE=AD=CF=86=CE=B1=CE=BD=CE=BF=CF=82=20=22Coor?= =?UTF-8?q?nio/8924th=22=20=CE=92=CE=BB=CE=B1=CF=83=CF=84=CF=8C=CF=82?= <8924th@gmail.com> Date: Mon, 23 Sep 2024 14:56:24 +0300 Subject: [PATCH] renames, fixes --- src/Assistants/HomeDirManager.cpp | 2 +- src/Assistants/HomeDirManager.hpp | 8 +- .../BYTEPUSHER/Cores/BYTEPUSHER_STANDARD.hpp | 4 +- src/Systems/CHIP8/Cores/CHIP8_MODERN.hpp | 4 +- src/Systems/CHIP8/Cores/MEGACHIP.hpp | 4 +- src/Systems/CHIP8/Cores/SCHIP_LEGACY.hpp | 4 +- src/Systems/CHIP8/Cores/SCHIP_MODERN.hpp | 6 +- src/Systems/CHIP8/Cores/XOCHIP.hpp | 4 +- src/Systems/GAMEBOY/Cores/GAMEBOY_CLASSIC.hpp | 146 ++++++++++-------- src/Systems/GameFileChecker.cpp | 72 +++++++-- src/Systems/GameFileChecker.hpp | 10 +- 11 files changed, 161 insertions(+), 103 deletions(-) diff --git a/src/Assistants/HomeDirManager.cpp b/src/Assistants/HomeDirManager.cpp index bfeb60f..e31677e 100644 --- a/src/Assistants/HomeDirManager.cpp +++ b/src/Assistants/HomeDirManager.cpp @@ -114,7 +114,7 @@ bool HomeDirManager::validateGameFile(const fsPath gamePath) noexcept { } const auto tempSHA1{ SHA1::from_span(mFileData) }; - const bool gameApproved{ checkGame(getFileSize(), gamePath.extension().string(), tempSHA1)}; + const bool gameApproved{ checkGame(mFileData, gamePath.extension().string(), tempSHA1)}; if (gameApproved) { mFilePath = gamePath; diff --git a/src/Assistants/HomeDirManager.hpp b/src/Assistants/HomeDirManager.hpp index 9f69425..03e60d2 100644 --- a/src/Assistants/HomeDirManager.hpp +++ b/src/Assistants/HomeDirManager.hpp @@ -6,6 +6,7 @@ #pragma once +#include #include #include @@ -20,7 +21,11 @@ class HomeDirManager final { HomeDirManager(const HomeDirManager&) = delete; HomeDirManager& operator=(const HomeDirManager&) = delete; - using GameValidator = bool (*)(const std::size_t, const std::string&, const std::string&); + using GameValidator = bool (*)( + std::span, + const std::string&, + const std::string& + ) noexcept; fsPath mFilePath{}; std::string mFileSHA1{}; @@ -59,6 +64,7 @@ class HomeDirManager final { auto getFileName() const noexcept { return mFilePath.filename().string(); } auto getFileStem() const noexcept { return mFilePath.stem().string(); } auto getFileExts() const noexcept { return mFilePath.extension().string(); } + auto getFileSpan() const noexcept { return std::span{ mFileData }; } auto getFileSize() const noexcept { return mFileData.size(); } auto getFileData() const noexcept { return mFileData.data(); } auto getFileSHA1() const noexcept { return mFileSHA1; } diff --git a/src/Systems/BYTEPUSHER/Cores/BYTEPUSHER_STANDARD.hpp b/src/Systems/BYTEPUSHER/Cores/BYTEPUSHER_STANDARD.hpp index 7822513..022dfc3 100644 --- a/src/Systems/BYTEPUSHER/Cores/BYTEPUSHER_STANDARD.hpp +++ b/src/Systems/BYTEPUSHER/Cores/BYTEPUSHER_STANDARD.hpp @@ -44,7 +44,7 @@ class BYTEPUSHER_STANDARD final : public BytePusher_CoreInterface { public: BYTEPUSHER_STANDARD(); - static constexpr bool testGameSize(const usz size) noexcept { - return size <= cTotalMemory; + static constexpr bool isGameFileValid(std::span game) noexcept { + return game.size() <= cTotalMemory; } }; diff --git a/src/Systems/CHIP8/Cores/CHIP8_MODERN.hpp b/src/Systems/CHIP8/Cores/CHIP8_MODERN.hpp index 015386f..0da1231 100644 --- a/src/Systems/CHIP8/Cores/CHIP8_MODERN.hpp +++ b/src/Systems/CHIP8/Cores/CHIP8_MODERN.hpp @@ -43,8 +43,8 @@ class CHIP8_MODERN final : public Chip8_CoreInterface { public: CHIP8_MODERN(); - static constexpr bool testGameSize(const usz size) noexcept { - return size + cGameLoadPos <= cTotalMemory; + static constexpr bool isGameFileValid(std::span game) noexcept { + return game.size() + cGameLoadPos <= cTotalMemory; } private: diff --git a/src/Systems/CHIP8/Cores/MEGACHIP.hpp b/src/Systems/CHIP8/Cores/MEGACHIP.hpp index 5d32fab..356063c 100644 --- a/src/Systems/CHIP8/Cores/MEGACHIP.hpp +++ b/src/Systems/CHIP8/Cores/MEGACHIP.hpp @@ -102,8 +102,8 @@ class MEGACHIP final : public Chip8_CoreInterface { public: MEGACHIP(); - static constexpr bool testGameSize(const usz size) noexcept { - return size + cGameLoadPos <= cTotalMemory; + static constexpr bool isGameFileValid(std::span game) noexcept { + return game.size() + cGameLoadPos <= cTotalMemory; } private: diff --git a/src/Systems/CHIP8/Cores/SCHIP_LEGACY.hpp b/src/Systems/CHIP8/Cores/SCHIP_LEGACY.hpp index c60f118..2a82224 100644 --- a/src/Systems/CHIP8/Cores/SCHIP_LEGACY.hpp +++ b/src/Systems/CHIP8/Cores/SCHIP_LEGACY.hpp @@ -47,8 +47,8 @@ class SCHIP_LEGACY final : public Chip8_CoreInterface { public: SCHIP_LEGACY(); - static constexpr bool testGameSize(const usz size) noexcept { - return size + cGameLoadPos <= cTotalMemory; + static constexpr bool isGameFileValid(std::span game) noexcept { + return game.size() + cGameLoadPos <= cTotalMemory; } private: diff --git a/src/Systems/CHIP8/Cores/SCHIP_MODERN.hpp b/src/Systems/CHIP8/Cores/SCHIP_MODERN.hpp index ac7456a..fb8ae32 100644 --- a/src/Systems/CHIP8/Cores/SCHIP_MODERN.hpp +++ b/src/Systems/CHIP8/Cores/SCHIP_MODERN.hpp @@ -47,8 +47,8 @@ class SCHIP_MODERN final : public Chip8_CoreInterface { public: SCHIP_MODERN(); - static constexpr bool testGameSize(const usz size) noexcept { - return size + cGameLoadPos <= cTotalMemory; + static constexpr bool isGameFileValid(std::span game) noexcept { + return game.size() + cGameLoadPos <= cTotalMemory; } private: @@ -68,8 +68,6 @@ class SCHIP_MODERN final : public Chip8_CoreInterface { // 00DN - scroll plane N lines down void instruction_00CN(const s32 N) noexcept; - // 00DN - scroll plane N lines up - void instruction_00DN(const s32 N) noexcept; // 00E0 - erase whole display void instruction_00E0() noexcept; // 00EE - return from subroutine diff --git a/src/Systems/CHIP8/Cores/XOCHIP.hpp b/src/Systems/CHIP8/Cores/XOCHIP.hpp index 7adedf0..21d2c1e 100644 --- a/src/Systems/CHIP8/Cores/XOCHIP.hpp +++ b/src/Systems/CHIP8/Cores/XOCHIP.hpp @@ -59,8 +59,8 @@ class XOCHIP final : public Chip8_CoreInterface { public: XOCHIP(); - static constexpr bool testGameSize(const usz size) noexcept { - return size + cGameLoadPos <= cTotalMemory; + static constexpr bool isGameFileValid(std::span game) noexcept { + return game.size() + cGameLoadPos <= cTotalMemory; } private: diff --git a/src/Systems/GAMEBOY/Cores/GAMEBOY_CLASSIC.hpp b/src/Systems/GAMEBOY/Cores/GAMEBOY_CLASSIC.hpp index 4ba1f1d..b92fae1 100644 --- a/src/Systems/GAMEBOY/Cores/GAMEBOY_CLASSIC.hpp +++ b/src/Systems/GAMEBOY/Cores/GAMEBOY_CLASSIC.hpp @@ -9,7 +9,6 @@ #include "../GameBoy_CoreInterface.hpp" #include -#include /*==================================================================*/ @@ -48,83 +47,98 @@ class GAMEBOY_CLASSIC final : public GameBoy_CoreInterface { std::span mInOutBank { mMemoryBanks.begin() + 0xFF00, 0x0080 }; // IO REGS std::span mHighBank { mMemoryBanks.begin() + 0xFF80, 0x007F }; // HRAM - - /* Video Bank Map */ - std::span mVideoTileMap_{ mVideoBank.begin() + 0x0000, 0x1800 }; + /* Video Bank 0 Tile Map */ std::span mVideoTileMap0{ mVideoBank.begin() + 0x0000, 0x0800 }; std::span mVideoTileMap1{ mVideoBank.begin() + 0x0800, 0x0800 }; std::span mVideoTileMap2{ mVideoBank.begin() + 0x1000, 0x0800 }; + std::span mVideoTileMap3{ mVideoBank.begin() + 0x1800, 0x0400 }; + std::span mVideoTileMap4{ mVideoBank.begin() + 0x1C00, 0x0400 }; - std::span mVideoAttrMap_{ mVideoBank.begin() + 0x1800, 0x0800 }; + /* Video Bank 1 Attr Map */ std::span mVideoAttrMap0{ mVideoBank.begin() + 0x1800, 0x0400 }; std::span mVideoAttrMap1{ mVideoBank.begin() + 0x1C00, 0x0400 }; /* I/O Ranges */ - u8& mJoyPadInput { mInOutBank[0x00] }; // P1/JOYP - u8& mSerialData { mInOutBank[0x01] }; // SB - u8& mSerialControl { mInOutBank[0x02] }; // SC - - u8& mRegisterDIV { mInOutBank[0x04] }; // DIV - u8& mRegisterTIMA { mInOutBank[0x05] }; // TIMA - u8& mRegisterTMA { mInOutBank[0x06] }; // TMA - u8& mRegisterTAC { mInOutBank[0x07] }; // TAC - - u8& mInterruptFlag { mInOutBank[0x0F] }; // IF - - u8& mAudioCh1Sweep { mInOutBank[0x10] }; // NR10 - u8& mAudioCh1Timer { mInOutBank[0x11] }; // NR11 - u8& mAudioCh1VolEnv { mInOutBank[0x12] }; // NR12 - u8& mAudioCh1PerLo { mInOutBank[0x13] }; // NR13 - u8& mAudioCh1PerHi { mInOutBank[0x14] }; // NR14 - - u8& mAudioCh2Timer { mInOutBank[0x16] }; // NR21 - u8& mAudioCh2VolEnv { mInOutBank[0x17] }; // NR22 - u8& mAudioCh2PerLo { mInOutBank[0x18] }; // NR23 - u8& mAudioCh2PerHi { mInOutBank[0x19] }; // NR24 - - u8& mAudioCh3Dac { mInOutBank[0x1A] }; // NR30 - u8& mAudioCh3Timer { mInOutBank[0x1B] }; // NR31 - u8& mAudioCh3VolEnv { mInOutBank[0x1C] }; // NR32 - u8& mAudioCh3PerLo { mInOutBank[0x1D] }; // NR33 - u8& mAudioCh3PerHi { mInOutBank[0x1E] }; // NR34 - - u8& mAudioCh4Timer { mInOutBank[0x20] }; // NR40 - u8& mAudioCh4FreqRng{ mInOutBank[0x21] }; // NR41 - u8& mAudioCh4PerHi { mInOutBank[0x22] }; // NR42 - u8& mAudioCh4PerLo { mInOutBank[0x23] }; // NR43 - - u8& mAudioVolumeVIN { mInOutBank[0x24] }; // NR50 - u8& mAudioPanning { mInOutBank[0x25] }; // NR51 - u8& mAudioEnable { mInOutBank[0x26] }; // NR52 - - std::span mWavePattern + u8& mJOYP { mInOutBank[0x00] }; // Joypad + u8& mSB { mInOutBank[0x01] }; // Serial transfer data + u8& mSC { mInOutBank[0x02] }; // Serial transfer control + + u8& mDIV { mInOutBank[0x04] }; // Divider register + u8& mTIMA { mInOutBank[0x05] }; // Timer counter + u8& mTMA { mInOutBank[0x06] }; // Timer modulo + u8& mTAC { mInOutBank[0x07] }; // Timer control + + u8& mIF { mInOutBank[0x0F] }; // Interrupt flag + + u8& mNR10 { mInOutBank[0x10] }; // Sound channel 1 sweep + u8& mNR11 { mInOutBank[0x11] }; // Sound channel 1 length timer & duty cycle + u8& mNR12 { mInOutBank[0x12] }; // Sound channel 1 volume & envelope + u8& mNR13 { mInOutBank[0x13] }; // Sound channel 1 period low + u8& mNR14 { mInOutBank[0x14] }; // Sound channel 1 period high & control + + u8& mNR21 { mInOutBank[0x16] }; // Sound channel 2 length timer & duty cycle + u8& mNR22 { mInOutBank[0x17] }; // Sound channel 2 volume & envelope + u8& mNR23 { mInOutBank[0x18] }; // Sound channel 2 period low + u8& mNR24 { mInOutBank[0x19] }; // Sound channel 2 period high & control + + u8& mNR30 { mInOutBank[0x1A] }; // Sound channel 3 DAC enable + u8& mNR31 { mInOutBank[0x1B] }; // Sound channel 3 length timer + u8& mNR32 { mInOutBank[0x1C] }; // Sound channel 3 output level + u8& mNR33 { mInOutBank[0x1D] }; // Sound channel 3 period low + u8& mNR34 { mInOutBank[0x1E] }; // Sound channel 3 period high & control + + u8& mNR40 { mInOutBank[0x20] }; // Sound channel 4 length timer + u8& mNR41 { mInOutBank[0x21] }; // Sound channel 4 volume & envelope + u8& mNR42 { mInOutBank[0x22] }; // Sound channel 4 frequency & randomness + u8& mNR43 { mInOutBank[0x23] }; // Sound channel 4 control + + u8& mNR50 { mInOutBank[0x24] }; // Master volume & VIN panning + u8& mNR51 { mInOutBank[0x25] }; // Sound panning + u8& mNR52 { mInOutBank[0x26] }; // Sound on/off + + std::span mWAVE /* Storage for waveform */ { mInOutBank.begin() + 0x30, 0x10 }; - std::span mDisplayControl - { mInOutBank.begin() + 0x40, 0x0D }; // split to regs here + u8& mLCDC { mInOutBank[0x40] }; // LCD control + u8& mSTAT { mInOutBank[0x41] }; // LCD status + u8& mSCY { mInOutBank[0x42] }; // Viewport Y pos + u8& mSCX { mInOutBank[0x43] }; // Viewport X pos + u8& mLY { mInOutBank[0x44] }; // LCD Y coord + u8& mLYC { mInOutBank[0x45] }; // LY compare + u8& mDMA { mInOutBank[0x46] }; // OAM DMA source addr & start + u8& mBGP { mInOutBank[0x47] }; // BG palette data + u8& mOBP0 { mInOutBank[0x48] }; // OBJ palette 0 data + u8& mOBP1 { mInOutBank[0x49] }; // OBJ palette 1 data + u8& mWY { mInOutBank[0x4A] }; // Window Y pos + u8& mWX { mInOutBank[0x4B] }; // Window X pos + 7 + u8& mKEY1 { mInOutBank[0x4D] }; // Prepare speed switch - u8& mVideoBankSelect{ mInOutBank[0x4F] }; // VBK - u8& mBootRomEnabled { mInOutBank[0x50] }; - u8& mVideoSrcHiDMA { mInOutBank[0x51] }; // HDMA1 - u8& mVideoSrcLoDMA { mInOutBank[0x52] }; // HDMA2 - u8& mVideoDstHiDMA { mInOutBank[0x53] }; // HDMA3 - u8& mVideoDstLoDMA { mInOutBank[0x54] }; // HDMA4 - u8& mVideoPropsDMA { mInOutBank[0x55] }; // HDMA5 - u8& mInfraredPort { mInOutBank[0x56] }; // RP - u8& mBgPaletteSpec { mInOutBank[0x68] }; // BCPS/BGPI - u8& mBgPaletteData { mInOutBank[0x69] }; // OCPS/OBPI - u8& mObjPaletteSpec { mInOutBank[0x6A] }; // OCPD/OBPD - u8& mObjPaletteData { mInOutBank[0x6B] }; // OPRI - u8& mObjPriorityMode{ mInOutBank[0x6C] }; // SVBK - u8& mWorkBankSelect { mInOutBank[0x70] }; // SVBK - u8& mAudioDigiOut12 { mInOutBank[0x76] }; // PCM12 - u8& mAudioDigiOut32 { mInOutBank[0x77] }; // PCM34 - u8& mInterruptEnable{ mMemoryBanks[0xFFFF] }; // IE + u8& mVBK { mInOutBank[0x4F] }; // VRAM bank + u8& mBOOT { mInOutBank[0x50] }; // Boot ROM enable + u8& mHDMA1{ mInOutBank[0x51] }; // VRAM DMA src hi + u8& mHDMA2{ mInOutBank[0x52] }; // VRAM DMA src lo + u8& mHDMA3{ mInOutBank[0x53] }; // VRAM DMA dst hi + u8& mHDMA4{ mInOutBank[0x54] }; // VRAM DMA dst lo + u8& mHDMA5{ mInOutBank[0x55] }; // VRAM DMA len/mode/start + + u8& mRP { mInOutBank[0x56] }; // Infrared comms port + + u8& mBCPS { mInOutBank[0x68] }; // BG (color) palette spec / index + u8& mBCPD { mInOutBank[0x69] }; // BG (color) palette data + u8& mOCPS { mInOutBank[0x6A] }; // OBJ (color) palette spec / index + u8& mOCPD { mInOutBank[0x6B] }; // OBJ (color) palette data + u8& mOPRI { mInOutBank[0x6C] }; // OBJ priority mode + u8& mSVBK { mInOutBank[0x70] }; // WRAM bank + + u8& mPCM12{ mInOutBank[0x76] }; // Audio digital out 1 & 2 + u8& mPCM34{ mInOutBank[0x77] }; // Audio digital out 3 & 4 + + u8& mIE { mMemoryBanks[0xFFFF] }; // Interrupt enable } mMMU; class PPU { - + // insert spongebob in box saying "IMAGINATION!" } mPPU; @@ -219,7 +233,7 @@ class GAMEBOY_CLASSIC final : public GameBoy_CoreInterface { struct Opcode { - using InstrStep = std::function; + using InstrStep = void(*)(CPU* const, MMU* const); const u32 mOpcode{}; const u32 mLength{}; @@ -244,7 +258,7 @@ class GAMEBOY_CLASSIC final : public GameBoy_CoreInterface { public: GAMEBOY_CLASSIC(); - static constexpr bool testGameSize(const usz size) noexcept { - return size <= 0; + static constexpr bool isGameFileValid(std::span game) noexcept { + return true; } }; diff --git a/src/Systems/GameFileChecker.cpp b/src/Systems/GameFileChecker.cpp index fe4131b..952c178 100644 --- a/src/Systems/GameFileChecker.cpp +++ b/src/Systems/GameFileChecker.cpp @@ -90,6 +90,12 @@ std::unique_ptr GameFileChecker::constructCore() { case GameCoreType::BYTEPUSHER_STANDARD: return std::make_unique(); + case GameCoreType::GAMEBOY_CLASSIC: + return std::make_unique(); + + case GameCoreType::GAMEBOY_COLOR: + return std::make_unique(); + default: case GameCoreType::INVALID: return nullptr; @@ -121,20 +127,20 @@ std::unique_ptr GameFileChecker::initGameCore() noexcept { /*==================================================================*/ bool GameFileChecker::validate( - const std::size_t size, + std::span game, const std::string& type, const std::string& sha1 ) noexcept { if (sha1.empty()) { - return validate(size, type); + return validate(game, type); } else { /* database check here */ - return validate(size, type); // placeholder + return validate(game, type); // placeholder } } bool GameFileChecker::validate( - const std::size_t size, + std::span game, const std::string& type ) noexcept { static const std::unordered_map sExtMap{ @@ -153,6 +159,8 @@ bool GameFileChecker::validate( {".hwc", GameFileType::hwc}, {".bnc", GameFileType::bnc}, {".BytePusher", GameFileType::BytePusher}, + {".gb", GameFileType::gb}, + {".gbc", GameFileType::gbc}, }; const auto it{ sExtMap.find(type) }; @@ -162,93 +170,123 @@ bool GameFileChecker::validate( } switch (it->second) { +/*==================================================================*/ + #pragma region CHIP8 FILE EXTS + case (GameFileType::c2x): case (GameFileType::c4x): return testGame( true, - //CHIP8X_HIRES::testGameSize(size), + //CHIP8X_HIRES::isGameFileValid(game), GameCoreType::CHIP8X_HIRES ); case (GameFileType::c8x): return testGame( true, - //CHIP8X::testGameSize(size), + //CHIP8X::isGameFileValid(game), GameCoreType::CHIP8X ); case (GameFileType::c2h): return testGame( true, - //CHIP8_2P::testGameSize(size), + //CHIP8_2P::isGameFileValid(game), GameCoreType::CHIP8_2P ); case (GameFileType::c4h): return testGame( true, - //CHIP8_4P::testGameSize(size), + //CHIP8_4P::isGameFileValid(game), GameCoreType::CHIP8_4P ); case (GameFileType::mc8): return testGame( - MEGACHIP::testGameSize(size), + MEGACHIP::isGameFileValid(game), GameCoreType::MEGACHIP ); case (GameFileType::gc8): return testGame( true, - //GIGACHIP::testGameSize(size), + //GIGACHIP::isGameFileValid(game), GameCoreType::GIGACHIP ); case (GameFileType::xo8): return testGame( - XOCHIP::testGameSize(size), + XOCHIP::isGameFileValid(game), GameCoreType::XOCHIP ); case (GameFileType::hwc): return testGame( true, - //HWCHIP64::testGameSize(size), + //HWCHIP64::isGameFileValid(game), GameCoreType::HWCHIP64 ); case (GameFileType::c8e): return testGame( true, - //CHIP8E::testGameSize(size), + //CHIP8E::isGameFileValid(game), GameCoreType::CHIP8E ); case (GameFileType::c8h): return testGame( true, - //CHIP8_2P::testGameSize(size), + //CHIP8_2P::isGameFileValid(game), GameCoreType::CHIP8_2P ); // patched! case (GameFileType::bnc): case (GameFileType::ch8): return testGame( - CHIP8_MODERN::testGameSize(size), + CHIP8_MODERN::isGameFileValid(game), GameCoreType::CHIP8_MODERN ); case (GameFileType::sc8): return testGame( - SCHIP_LEGACY::testGameSize(size), + SCHIP_LEGACY::isGameFileValid(game), GameCoreType::SCHIP_LEGACY ); + #pragma endregion +/*VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV*/ + +/*==================================================================*/ + #pragma region BYTEPUSHER FILE EXTS + case (GameFileType::BytePusher): return testGame( - BYTEPUSHER_STANDARD::testGameSize(size), + BYTEPUSHER_STANDARD::isGameFileValid(game), GameCoreType::BYTEPUSHER_STANDARD ); + + #pragma endregion +/*VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV*/ + +/*==================================================================*/ + #pragma region GAMEBOY FILE EXTS + + case (GameFileType::gb): + return testGame( + GAMEBOY_CLASSIC::isGameFileValid(game), + GameCoreType::GAMEBOY_CLASSIC + ); + + case (GameFileType::gbc): + return testGame( + GAMEBOY_CLASSIC::isGameFileValid(game), + GameCoreType::GAMEBOY_CLASSIC + ); + + #pragma endregion +/*VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV*/ } return false; }; diff --git a/src/Systems/GameFileChecker.hpp b/src/Systems/GameFileChecker.hpp index 5d6e8a1..5c17386 100644 --- a/src/Systems/GameFileChecker.hpp +++ b/src/Systems/GameFileChecker.hpp @@ -6,7 +6,7 @@ #pragma once -#include +#include #include #include #include @@ -31,6 +31,7 @@ enum class GameFileType { hwc, // HYPERWAVE-CHIP bnc, BytePusher, + gb, gbc // GAMEBOY/GAMEBOY COLOR }; enum class GameCoreType { @@ -41,7 +42,8 @@ enum class GameCoreType { CHIP8_MODERN, SCHIP_MODERN, CHIP8X_HIRES, CHIP8X_SCHIP, HWCHIP64, MEGACHIP, GIGACHIP, - BYTEPUSHER_STANDARD + BYTEPUSHER_STANDARD, + GAMEBOY_CLASSIC, GAMEBOY_COLOR, }; /*==================================================================*/ @@ -65,7 +67,7 @@ class GameFileChecker final { } static bool validate( - const std::size_t size, + std::span game, const std::string& type ) noexcept; @@ -74,7 +76,7 @@ class GameFileChecker final { public: static bool validate( - const std::size_t size, + std::span game, const std::string& type, const std::string& sha1 ) noexcept;