dreamcast/maple/maple_port.hpp

38 lines
917 B
C++

#pragma once
#include "maple_bus_bits.hpp"
constexpr inline uint32_t ap_port_select(const uint32_t port)
{
switch (port) {
default: [[fallthrough]];
case 0: return ap::port_select::a;
case 1: return ap::port_select::b;
case 2: return ap::port_select::c;
case 3: return ap::port_select::d;
}
}
constexpr inline uint32_t host_instruction_port_select(const uint32_t port)
{
switch (port) {
default: [[fallthrough]];
case 0: return host_instruction::port_select::a;
case 1: return host_instruction::port_select::b;
case 2: return host_instruction::port_select::c;
case 3: return host_instruction::port_select::d;
}
}
constexpr inline uint32_t ap_lm_bus(const uint32_t lm)
{
switch (lm) {
default: [[fallthrough]];
case 0: return ap::lm_bus::_0;
case 1: return ap::lm_bus::_1;
case 2: return ap::lm_bus::_2;
case 3: return ap::lm_bus::_3;
case 4: return ap::lm_bus::_4;
}
}