Browse Source
* Currently only allows cores to register and describe digital inputs. * Removed unnecessary protected destructor from PlipVideo.master
Ian Burgmyer
4 years ago
7 changed files with 102 additions and 2 deletions
@ -0,0 +1,20 @@ |
|||||||
|
/* PlipInput.cpp
|
||||||
|
* |
||||||
|
* Provides an interface between the emulation core and the frontend. |
||||||
|
*/ |
||||||
|
|
||||||
|
#include "PlipInput.h" |
||||||
|
|
||||||
|
namespace Plip { |
||||||
|
void PlipInput::AddInput(int id, const PlipInputDefinition& input) { |
||||||
|
m_coreInput.insert(std::pair<int, PlipInputDefinition>(id, input)); |
||||||
|
} |
||||||
|
|
||||||
|
void PlipInput::AddInput(std::map<int, PlipInputDefinition> inputList) { |
||||||
|
m_coreInput.insert(inputList.begin(), inputList.end()); |
||||||
|
} |
||||||
|
|
||||||
|
void PlipInput::ClearInput() { |
||||||
|
m_coreInput.clear(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,26 @@ |
|||||||
|
/* PlipInput.h
|
||||||
|
* |
||||||
|
* Provides an interface between the emulation core and the frontend. |
||||||
|
*/ |
||||||
|
|
||||||
|
#pragma once |
||||||
|
|
||||||
|
#include <map> |
||||||
|
#include <string> |
||||||
|
|
||||||
|
#include "PlipInputDefinition.h" |
||||||
|
|
||||||
|
namespace Plip { |
||||||
|
class PlipInput { |
||||||
|
public: |
||||||
|
void AddInput(int id, const PlipInputDefinition &input); |
||||||
|
void AddInput(std::map<int, PlipInputDefinition> inputList); |
||||||
|
void ClearInput(); |
||||||
|
|
||||||
|
protected: |
||||||
|
PlipInput() = default; |
||||||
|
|
||||||
|
private: |
||||||
|
std::map<int, PlipInputDefinition> m_coreInput; |
||||||
|
}; |
||||||
|
} |
@ -0,0 +1,21 @@ |
|||||||
|
/* PlipInputDefinition.cpp
|
||||||
|
* |
||||||
|
* Allows the core to define an input for the frontend to handle. |
||||||
|
*/ |
||||||
|
|
||||||
|
#include "PlipInputDefinition.h" |
||||||
|
|
||||||
|
namespace Plip { |
||||||
|
PlipInputDefinition::PlipInputDefinition(PlipInputType type, const std::string &description) { |
||||||
|
m_type = type; |
||||||
|
m_description = description; |
||||||
|
} |
||||||
|
|
||||||
|
std::string PlipInputDefinition::GetDescription() const { |
||||||
|
return m_description; |
||||||
|
} |
||||||
|
|
||||||
|
PlipInputType PlipInputDefinition::GetType() const { |
||||||
|
return m_type; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,32 @@ |
|||||||
|
/* PlipInputDefinition.h
|
||||||
|
* |
||||||
|
* Allows the core to define an input for the frontend to handle. |
||||||
|
*/ |
||||||
|
|
||||||
|
#pragma once |
||||||
|
|
||||||
|
#include <string> |
||||||
|
|
||||||
|
namespace Plip { |
||||||
|
union PlipInputData { |
||||||
|
bool digital = false; |
||||||
|
}; |
||||||
|
|
||||||
|
enum class PlipInputType { |
||||||
|
Digital |
||||||
|
}; |
||||||
|
|
||||||
|
class PlipInputDefinition { |
||||||
|
public: |
||||||
|
PlipInputDefinition(PlipInputType type, const std::string &description); |
||||||
|
|
||||||
|
std::string GetDescription() const; |
||||||
|
PlipInputType GetType() const; |
||||||
|
|
||||||
|
PlipInputData data; |
||||||
|
|
||||||
|
private: |
||||||
|
PlipInputType m_type; |
||||||
|
std::string m_description; |
||||||
|
}; |
||||||
|
} |
Loading…
Reference in new issue