Split MemoryCard and PadDevice (now Controller)

This commit is contained in:
Connor McLaughlin
2019-12-09 00:51:52 +10:00
parent c1710482df
commit da14b10e72
15 changed files with 71 additions and 71 deletions

38
src/core/controller.cpp Normal file
View File

@ -0,0 +1,38 @@
#include "controller.h"
#include "common/state_wrapper.h"
#include "digital_controller.h"
Controller::Controller() = default;
Controller::~Controller() = default;
void Controller::Reset() {}
bool Controller::DoState(StateWrapper& sw)
{
return !sw.HasError();
}
void Controller::ResetTransferState() {}
bool Controller::Transfer(const u8 data_in, u8* data_out)
{
*data_out = 0xFF;
return false;
}
std::shared_ptr<Controller> Controller::Create(std::string_view type_name)
{
if (type_name == "DigitalController")
return DigitalController::Create();
return {};
}
std::optional<s32> Controller::GetButtonCodeByName(std::string_view type_name, std::string_view button_name)
{
if (type_name == "DigitalController")
return DigitalController::GetButtonCodeByName(button_name);
return {};
}