24 lines
769 B
C++
24 lines
769 B
C++
#pragma once
|
|
#include "../jabyengine_config.hpp"
|
|
#include "controller.hpp"
|
|
|
|
namespace JabyEngine {
|
|
namespace Periphery {
|
|
static constexpr uint32_t PortCount = Configuration::Periphery::IncludePortB ? 2 : 1;
|
|
static constexpr uint32_t DeviceCount = Configuration::Periphery::UseMultiTap ? 4 : 1;
|
|
|
|
extern RawController controller[PortCount][DeviceCount];
|
|
|
|
void query_controller();
|
|
|
|
template<typename T>
|
|
inline T& get_controller_as(size_t port, size_t device) {
|
|
return *reinterpret_cast<T*>(&controller[port][device]);
|
|
}
|
|
|
|
template<typename T>
|
|
inline T& get_primary_controller_as() {
|
|
return get_controller_as<T>(0, 0);
|
|
}
|
|
}
|
|
} |