Mesen/Core/VsControlManager.h
Souryo 850102bbdc Input: Added support for ~20 new peripherals (Incomplete, more fixes/changes to come)
Movies: Rewrote format to support all IO devices and console types
Netplay: Now supports all IO devices and console types
2017-11-19 23:08:23 -05:00

74 lines
1.8 KiB
C++

#pragma once
#include "stdafx.h"
#include "ControlManager.h"
#include "CPU.h"
#include "Console.h"
#include "VsZapper.h"
#include <assert.h>
#include "StandardController.h"
#include "MovieManager.h"
class BaseControlDevice;
enum class VsInputType
{
Default = 0,
TypeA = 1,
TypeB = 2,
TypeC = 3,
TypeD = 4,
TypeE = 5
};
class VsControlManager : public ControlManager
{
private:
static VsControlManager *_instance;
uint8_t _prgChrSelectBit;
VsInputType _inputType = VsInputType::Default;
bool _refreshState = false;
uint32_t _protectionCounter = 0;
const uint32_t _protectionData[3][32] = {
{
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
}
};
ControllerType GetControllerType(uint8_t port) override;
public:
VsControlManager(shared_ptr<BaseControlDevice> systemActionManager, shared_ptr<BaseControlDevice> mapperControlDevice);
virtual ~VsControlManager();
void StreamState(bool saving) override;
void Reset(bool softReset) override;
static VsControlManager* GetInstance();
void SetInputType(VsInputType inputType);
void GetMemoryRanges(MemoryRanges &ranges) override;
uint8_t GetPrgChrSelectBit();
void RemapControllerButtons();
uint8_t ReadRAM(uint16_t addr) override;
void WriteRAM(uint16_t addr, uint8_t value) override;
};