cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

MultiMBC1MemoryRule.h (1787B)


      1/*
      2 * Gearboy - Nintendo Game Boy Emulator
      3 * Copyright (C) 2012  Ignacio Sanchez
      4
      5 * This program is free software: you can redistribute it and/or modify
      6 * it under the terms of the GNU General Public License as published by
      7 * the Free Software Foundation, either version 3 of the License, or
      8 * any later version.
      9
     10 * This program is distributed in the hope that it will be useful,
     11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     13 * GNU General Public License for more details.
     14
     15 * You should have received a copy of the GNU General Public License
     16 * along with this program.  If not, see http://www.gnu.org/licenses/
     17 *
     18 */
     19
     20#ifndef MULTIMBC1MEMORYRULE_H
     21#define	MULTIMBC1MEMORYRULE_H
     22
     23#include "MemoryRule.h"
     24
     25class MultiMBC1MemoryRule : public MemoryRule
     26{
     27public:
     28    MultiMBC1MemoryRule(Processor* pProcessor, Memory* pMemory,
     29            Video* pVideo, Input* pInput, Cartridge* pCartridge, Audio* pAudio);
     30    virtual ~MultiMBC1MemoryRule();
     31    virtual u8 PerformRead(u16 address);
     32    virtual void PerformWrite(u16 address, u8 value);
     33    virtual void Reset(bool bCGB);
     34    virtual size_t GetRamSize();
     35    virtual u8* GetRamBanks();
     36    virtual u8* GetCurrentRamBank();
     37    virtual int GetCurrentRamBankIndex();
     38    virtual u8* GetRomBank0();
     39    virtual int GetCurrentRomBank0Index();
     40    virtual u8* GetCurrentRomBank1();
     41    virtual int GetCurrentRomBank1Index();
     42    virtual void SaveState(std::ostream& stream);
     43    virtual void LoadState(std::istream& stream);
     44
     45private:
     46    void SetROMBanks();
     47
     48private:
     49    int m_iMulticartMode;
     50    int m_iROMBankHi;
     51    int m_iROMBankLo;
     52    int m_iMBC1Bank_1;
     53    int m_iMBC1MBank_0;
     54    int m_iMBC1MBank_1;
     55};
     56
     57#endif	/* MULTIMBC1MEMORYRULE_H */