2016-04-30 20:08:53 -04:00
|
|
|
#pragma once
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include "ControlManager.h"
|
|
|
|
#include "CPU.h"
|
2016-06-21 22:13:26 -04:00
|
|
|
#include "Console.h"
|
2016-06-22 19:23:08 -04:00
|
|
|
#include "VsZapper.h"
|
2016-04-30 20:08:53 -04:00
|
|
|
#include <assert.h>
|
2016-07-10 09:05:41 -04:00
|
|
|
#include "StandardController.h"
|
2017-04-22 13:19:21 -04:00
|
|
|
#include "MovieManager.h"
|
2016-07-10 09:05:41 -04:00
|
|
|
|
2017-11-19 23:08:23 -05:00
|
|
|
class BaseControlDevice;
|
|
|
|
|
2016-04-30 20:08:53 -04:00
|
|
|
class VsControlManager : public ControlManager
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
static VsControlManager *_instance;
|
|
|
|
uint8_t _prgChrSelectBit;
|
2017-11-19 23:08:23 -05:00
|
|
|
bool _refreshState = false;
|
|
|
|
|
2016-06-21 22:13:26 -04:00
|
|
|
uint32_t _protectionCounter = 0;
|
2017-11-19 23:08:23 -05:00
|
|
|
const uint32_t _protectionData[3][32] = {
|
2016-06-21 22:13:26 -04:00
|
|
|
{
|
|
|
|
0xFF, 0xBF, 0xB7, 0x97, 0x97, 0x17, 0x57, 0x4F,
|
|
|
|
0x6F, 0x6B, 0xEB, 0xA9, 0xB1, 0x90, 0x94, 0x14,
|
|
|
|
0x56, 0x4E, 0x6F, 0x6B, 0xEB, 0xA9, 0xB1, 0x90,
|
|
|
|
0xD4, 0x5C, 0x3E, 0x26, 0x87, 0x83, 0x13, 0x00
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0xB4, 0x00, 0x00, 0x00,
|
|
|
|
0x00, 0x6F, 0x00, 0x00, 0x00, 0x00, 0x94, 0x00,
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
|
|
|
},
|
|
|
|
{
|
|
|
|
0x05, 0x01, 0x89, 0x37, 0x05, 0x00, 0xD1, 0x3E,
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
|
|
|
}
|
|
|
|
};
|
2016-04-30 20:08:53 -04:00
|
|
|
|
2017-11-19 23:08:23 -05:00
|
|
|
ControllerType GetControllerType(uint8_t port) override;
|
2016-04-30 20:08:53 -04:00
|
|
|
|
|
|
|
public:
|
2017-11-19 23:08:23 -05:00
|
|
|
VsControlManager(shared_ptr<BaseControlDevice> systemActionManager, shared_ptr<BaseControlDevice> mapperControlDevice);
|
|
|
|
virtual ~VsControlManager();
|
2016-04-30 20:08:53 -04:00
|
|
|
|
2017-11-19 23:08:23 -05:00
|
|
|
void StreamState(bool saving) override;
|
|
|
|
void Reset(bool softReset) override;
|
2016-07-10 09:05:41 -04:00
|
|
|
|
2017-11-19 23:08:23 -05:00
|
|
|
static VsControlManager* GetInstance();
|
|
|
|
|
|
|
|
void SetInputType(VsInputType inputType);
|
|
|
|
|
|
|
|
void GetMemoryRanges(MemoryRanges &ranges) override;
|
2016-06-21 22:13:26 -04:00
|
|
|
|
2017-11-19 23:08:23 -05:00
|
|
|
uint8_t GetPrgChrSelectBit();
|
2016-04-30 20:08:53 -04:00
|
|
|
|
2017-11-19 23:08:23 -05:00
|
|
|
void RemapControllerButtons();
|
2016-04-30 20:08:53 -04:00
|
|
|
|
2017-11-19 23:08:23 -05:00
|
|
|
uint8_t ReadRAM(uint16_t addr) override;
|
|
|
|
void WriteRAM(uint16_t addr, uint8_t value) override;
|
2016-04-30 20:08:53 -04:00
|
|
|
};
|