Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
alexbevi
GitHub Repository: alexbevi/BizHawk
Path: blob/master/wonderswan/memory.h
2 views
1
#ifndef __WSWAN_MEMORY_H
2
#define __WSWAN_MEMORY_H
3
4
#include "system.h"
5
6
namespace MDFN_IEN_WSWAN
7
{
8
class Memory
9
{
10
public:
11
~Memory();
12
13
uint8 Read20(uint32);
14
void Write20(uint32 address,uint8 data);
15
16
void Init(const SyncSettings &settings);
17
18
void CheckSoundDMA();
19
void Reset();
20
void writeport(uint32 IOPort, uint8 V);
21
uint8 readport(uint32 number);
22
uint32 GetRegister(const unsigned int id, char *special, const uint32 special_len);
23
void SetRegister(const unsigned int id, uint32 value);
24
25
public:
26
uint8 wsRAM[65536];
27
uint8 *wsCartROM;
28
uint32 rom_size;
29
uint32 sram_size;
30
uint8 *wsSRAM; // = NULL;
31
32
uint16 WSButtonStatus; // bitfield of buttons, indeed
33
bool Lagged;
34
35
private:
36
37
38
uint8 ButtonWhich, ButtonReadLatch;
39
40
uint32 DMASource, DMADest;
41
uint16 DMALength;
42
uint8 DMAControl;
43
44
uint32 SoundDMASource;
45
uint16 SoundDMALength;
46
uint8 SoundDMAControl;
47
48
uint8 BankSelector[4];
49
50
uint8 CommControl, CommData;
51
52
bool language;
53
54
public:
55
void (*ButtonHook)();
56
57
public:
58
System *sys;
59
template<bool isReader>void SyncState(NewState *ns);
60
private:
61
void CheckDMA();
62
63
};
64
65
enum
66
{
67
MEMORY_GSREG_ROMBBSLCT = 0,
68
MEMORY_GSREG_BNK1SLCT,
69
MEMORY_GSREG_BNK2SLCT,
70
MEMORY_GSREG_BNK3SLCT,
71
};
72
73
}
74
75
#endif
76
77