2014-05-30 05:09:54 +00:00
|
|
|
#ifndef __WSWAN_MEMORY_H
|
|
|
|
#define __WSWAN_MEMORY_H
|
|
|
|
|
|
|
|
#include "system.h"
|
|
|
|
|
|
|
|
namespace MDFN_IEN_WSWAN
|
|
|
|
{
|
|
|
|
class Memory
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
~Memory();
|
|
|
|
|
|
|
|
uint8 Read20(uint32);
|
|
|
|
void Write20(uint32 address,uint8 data);
|
|
|
|
|
2014-05-30 18:10:39 +00:00
|
|
|
void Init(const SyncSettings &settings);
|
2014-05-30 05:09:54 +00:00
|
|
|
|
|
|
|
void CheckSoundDMA();
|
|
|
|
void Reset();
|
|
|
|
void writeport(uint32 IOPort, uint8 V);
|
|
|
|
uint8 readport(uint32 number);
|
|
|
|
uint32 GetRegister(const unsigned int id, char *special, const uint32 special_len);
|
|
|
|
void SetRegister(const unsigned int id, uint32 value);
|
|
|
|
|
|
|
|
public:
|
|
|
|
uint8 wsRAM[65536];
|
|
|
|
uint8 *wsCartROM;
|
|
|
|
uint32 rom_size;
|
|
|
|
uint32 sram_size;
|
2014-05-30 16:50:58 +00:00
|
|
|
uint8 *wsSRAM; // = NULL;
|
2014-05-30 05:09:54 +00:00
|
|
|
|
|
|
|
uint16 WSButtonStatus; // bitfield of buttons, indeed
|
2014-05-30 20:53:52 +00:00
|
|
|
bool Lagged;
|
2014-05-30 05:09:54 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
|
|
uint8 ButtonWhich, ButtonReadLatch;
|
|
|
|
|
|
|
|
uint32 DMASource, DMADest;
|
|
|
|
uint16 DMALength;
|
|
|
|
uint8 DMAControl;
|
|
|
|
|
|
|
|
uint32 SoundDMASource;
|
|
|
|
uint16 SoundDMALength;
|
|
|
|
uint8 SoundDMAControl;
|
|
|
|
|
|
|
|
uint8 BankSelector[4];
|
|
|
|
|
|
|
|
uint8 CommControl, CommData;
|
|
|
|
|
|
|
|
bool language;
|
|
|
|
|
2014-06-19 15:57:07 +00:00
|
|
|
public:
|
|
|
|
void (*ButtonHook)();
|
|
|
|
|
2014-05-30 05:09:54 +00:00
|
|
|
public:
|
|
|
|
System *sys;
|
2014-05-31 05:57:18 +00:00
|
|
|
template<bool isReader>void SyncState(NewState *ns);
|
2014-05-30 05:09:54 +00:00
|
|
|
private:
|
|
|
|
void CheckDMA();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
MEMORY_GSREG_ROMBBSLCT = 0,
|
|
|
|
MEMORY_GSREG_BNK1SLCT,
|
|
|
|
MEMORY_GSREG_BNK2SLCT,
|
|
|
|
MEMORY_GSREG_BNK3SLCT,
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|