Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
folium-app
GitHub Repository: folium-app/Folium
Path: blob/a-new-beginning/Cherry/Core/include/Mapper.h
2 views
1
/*
2
* Gearcoleco - ColecoVision Emulator
3
* Copyright (C) 2021 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 MAPPER_H
21
#define MAPPER_H
22
23
#include "definitions.h"
24
#include <iostream>
25
26
class Cartridge;
27
28
class Mapper
29
{
30
public:
31
Mapper(Cartridge* pCartridge) : m_pCartridge(pCartridge) { }
32
virtual ~Mapper() { }
33
34
virtual void Reset() = 0;
35
virtual u8 Read(u16 address) = 0;
36
virtual void Write(u16 address, u8 value) = 0;
37
virtual void SaveState(std::ostream& stream) = 0;
38
virtual void LoadState(std::istream& stream) = 0;
39
virtual u8 GetRomBank() { return 0; }
40
virtual u32 GetRomBankAddress() { return 0; }
41
virtual u8 GetBankReg(int) { return 0; }
42
43
protected:
44
Cartridge* m_pCartridge;
45
};
46
47
#endif /* MAPPER_H */
48
49