RomOnlyMemoryRule.h (1596B)
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 ROMONLYMEMORYRULE_H 21#define ROMONLYMEMORYRULE_H 22 23#include "MemoryRule.h" 24 25class RomOnlyMemoryRule : public MemoryRule 26{ 27public: 28 RomOnlyMemoryRule(Processor* pProcessor, Memory* pMemory, 29 Video* pVideo, Input* pInput, Cartridge* pCartridge, Audio* pAudio); 30 virtual ~RomOnlyMemoryRule(); 31 virtual u8 PerformRead(u16 address); 32 virtual void PerformWrite(u16 address, u8 value); 33 virtual void Reset(bool bCGB); 34 virtual void SaveRam(std::ostream &file); 35 virtual bool LoadRam(std::istream &file, s32 fileSize); 36 virtual size_t GetRamSize(); 37 virtual u8* GetRamBanks(); 38 virtual u8* GetCurrentRamBank(); 39 virtual int GetCurrentRamBankIndex(); 40 virtual u8* GetRomBank0(); 41 virtual int GetCurrentRomBank0Index(); 42 virtual u8* GetCurrentRomBank1(); 43 virtual int GetCurrentRomBank1Index(); 44}; 45 46#endif /* ROMONLYMEMORYRULE_H */