2019-02-17 19:54:29 -05:00
|
|
|
#pragma once
|
|
|
|
#include "stdafx.h"
|
|
|
|
#include "BaseControlDevice.h"
|
2019-03-12 09:15:57 -04:00
|
|
|
#include "../Utilities/Serializer.h"
|
2019-02-17 19:54:29 -05:00
|
|
|
|
|
|
|
class SnesController : public BaseControlDevice
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
uint32_t _stateBuffer = 0;
|
2019-10-14 13:14:42 -04:00
|
|
|
uint8_t _turboSpeed = 0;
|
2019-02-17 19:54:29 -05:00
|
|
|
|
|
|
|
protected:
|
2019-10-14 13:14:42 -04:00
|
|
|
string GetKeyNames() override;
|
|
|
|
void InternalSetStateFromInput() override;
|
|
|
|
uint16_t ToByte();
|
|
|
|
void Serialize(Serializer &s) override;
|
|
|
|
void RefreshStateBuffer() override;
|
2019-02-17 19:54:29 -05:00
|
|
|
|
|
|
|
public:
|
2019-05-12 21:18:05 -04:00
|
|
|
enum Buttons { A = 0, B, X, Y, L, R, Select, Start, Up, Down, Left, Right };
|
|
|
|
|
2019-10-14 13:14:42 -04:00
|
|
|
SnesController(Console* console, uint8_t port, KeyMappingSet keyMappings);
|
2019-02-17 19:54:29 -05:00
|
|
|
|
2019-10-18 17:05:44 -04:00
|
|
|
ControllerType GetControllerType() override;
|
2019-10-14 13:14:42 -04:00
|
|
|
uint8_t ReadRam(uint16_t addr) override;
|
|
|
|
void WriteRam(uint16_t addr, uint8_t value) override;
|
2019-02-17 19:54:29 -05:00
|
|
|
};
|