2015-07-10 21:07:24 -04:00
|
|
|
#pragma once
|
|
|
|
#include "stdafx.h"
|
2016-02-05 23:14:27 -05:00
|
|
|
#include "BaseControlDevice.h"
|
|
|
|
#include "Zapper.h"
|
2015-07-10 21:07:24 -04:00
|
|
|
|
2016-02-05 23:14:27 -05:00
|
|
|
class StandardController : public BaseControlDevice
|
2015-07-10 21:07:24 -04:00
|
|
|
{
|
|
|
|
private:
|
2017-02-25 14:20:30 -05:00
|
|
|
bool _isEmptyPort = false;
|
2016-07-19 16:30:18 -04:00
|
|
|
uint32_t _stateBuffer = 0;
|
|
|
|
uint32_t _stateBufferFamicom = 0;
|
|
|
|
uint8_t _lastButtonState = 0;
|
2016-02-05 23:14:27 -05:00
|
|
|
|
|
|
|
shared_ptr<BaseControlDevice> _additionalController;
|
|
|
|
|
|
|
|
protected:
|
2016-12-17 23:14:47 -05:00
|
|
|
uint8_t RefreshState() override;
|
|
|
|
virtual void StreamState(bool saving) override;
|
2015-07-10 21:07:24 -04:00
|
|
|
|
|
|
|
public:
|
2017-02-25 14:20:30 -05:00
|
|
|
StandardController(uint8_t port, bool emptyPort = false);
|
2016-02-05 23:14:27 -05:00
|
|
|
|
2017-08-30 18:31:27 -04:00
|
|
|
ButtonState GetButtonState();
|
2016-12-17 23:14:47 -05:00
|
|
|
uint32_t GetNetPlayState() override;
|
2016-02-14 12:58:35 -05:00
|
|
|
|
2016-12-17 23:14:47 -05:00
|
|
|
uint8_t GetPortOutput() override;
|
|
|
|
void RefreshStateBuffer() override;
|
2015-07-10 21:07:24 -04:00
|
|
|
|
2016-07-10 09:05:41 -04:00
|
|
|
//Used for VS System button unscrambling
|
|
|
|
uint32_t GetInternalState();
|
|
|
|
void SetInternalState(uint32_t state);
|
|
|
|
|
2017-08-12 11:54:05 -04:00
|
|
|
bool IsMicrophoneActive();
|
|
|
|
|
2016-02-05 23:14:27 -05:00
|
|
|
void AddAdditionalController(shared_ptr<BaseControlDevice> controller);
|
2016-07-19 16:30:18 -04:00
|
|
|
shared_ptr<BaseControlDevice> GetAdditionalController();
|
|
|
|
|
|
|
|
uint8_t GetLastButtonState();
|
2015-07-10 21:07:24 -04:00
|
|
|
};
|