Mesen-X/Core/Zapper.h

35 lines
681 B
C
Raw Normal View History

#pragma once
#include "stdafx.h"
#include "BaseControlDevice.h"
2016-06-22 19:23:08 -04:00
struct ZapperButtonState
{
bool TriggerPressed = false;
bool LightNotDetected = false;
uint8_t ToByte()
{
return (LightNotDetected ? 0x08 : 0x00) | (TriggerPressed ? 0x10 : 0x00);
}
};
class Zapper : public BaseControlDevice
{
private:
2016-07-30 17:27:14 -04:00
bool _pulled = false;
int32_t _xPosition = -1;
int32_t _yPosition = -1;
protected:
2016-06-22 19:23:08 -04:00
virtual uint8_t RefreshState();
uint8_t ProcessNetPlayState(uint32_t netplayState);
void StreamState(bool saving);
2016-06-22 19:23:08 -04:00
ZapperButtonState GetZapperState();
public:
using BaseControlDevice::BaseControlDevice;
2016-06-22 19:23:08 -04:00
virtual uint8_t GetPortOutput();
virtual uint32_t GetNetPlayState();
};