More 'using enum' in places where it seems appropriate.

This commit is contained in:
Stephen Anthony 2024-05-12 18:24:55 -02:30
parent bff2fdd817
commit cd1095b0b6
13 changed files with 170 additions and 303 deletions

View File

@ -65,6 +65,7 @@ class FSNodeFactory
default:
return nullptr;
}
return nullptr;
}
private:

View File

@ -65,18 +65,11 @@ string CartridgeBUSInfoWidget::describeBUSVersion(CartridgeBUS::BUSSubtype subty
{
switch(subtype)
{
case CartridgeBUS::BUSSubtype::BUS0:
return "BUS (v0)";
case CartridgeBUS::BUSSubtype::BUS1:
return "BUS (v1)";
case CartridgeBUS::BUSSubtype::BUS2:
return "BUS (v2)";
case CartridgeBUS::BUSSubtype::BUS3:
return "BUS (v3)";
default:
throw runtime_error("unreachable");
using enum CartridgeBUS::BUSSubtype;
case BUS0: return "BUS (v0)";
case BUS1: return "BUS (v1)";
case BUS2: return "BUS (v2)";
case BUS3: return "BUS (v3)";
default: throw runtime_error("unreachable");
}
}

View File

@ -61,19 +61,11 @@ string CartridgeCDFInfoWidget::describeCDFVersion(CartridgeCDF::CDFSubtype subty
{
switch(subtype)
{
case CartridgeCDF::CDFSubtype::CDF0:
return "CDF (v0)";
case CartridgeCDF::CDFSubtype::CDF1:
return "CDF (v1)";
case CartridgeCDF::CDFSubtype::CDFJ:
return "CDFJ";
case CartridgeCDF::CDFSubtype::CDFJplus:
return "CDFJ+";
default:
throw runtime_error("unreachable");
using enum CartridgeCDF::CDFSubtype;
case CDF0: return "CDF (v0)";
case CDF1: return "CDF (v1)";
case CDFJ: return "CDFJ";
case CDFJplus: return "CDFJ+";
default: throw runtime_error("unreachable");
}
}

View File

@ -517,20 +517,12 @@ string CartridgeCDFWidget::describeCDFVersion(CartridgeCDF::CDFSubtype subtype)
{
switch(subtype)
{
case CartridgeCDF::CDFSubtype::CDF0:
return "CDF (v0)";
case CartridgeCDF::CDFSubtype::CDF1:
return "CDF (v1)";
case CartridgeCDF::CDFSubtype::CDFJ:
return "CDFJ";
case CartridgeCDF::CDFSubtype::CDFJplus:
return "CDFJ+";
default:
throw runtime_error("unreachable");
using enum CartridgeCDF::CDFSubtype;
case CDF0: return "CDF (v0)";
case CDF1: return "CDF (v1)";
case CDFJ: return "CDFJ";
case CDFJplus: return "CDFJ+";
default: throw runtime_error("unreachable");
}
}

View File

@ -63,15 +63,16 @@ void DelayQueueWidget::loadConfig() {
const int delay = delayQueueIterator->delay();
switch (address) {
case TIA::DummyRegisters::shuffleP0:
using enum TIA::DummyRegisters;
case shuffleP0:
ss << delay << " clk, shuffle GRP0";
break;
case TIA::DummyRegisters::shuffleP1:
case shuffleP1:
ss << delay << " clk, shuffle GRP1";
break;
case TIA::DummyRegisters::shuffleBL:
case shuffleBL:
ss << delay << " clk, shuffle ENABL";
break;

View File

@ -54,24 +54,25 @@ void QuadTariWidget::addController(GuiObject* boss, int x, int y,
x += second ? _fontWidth * 10 : 0;
switch(controller.type())
{
case Controller::Type::Joystick:
using enum Controller::Type;
case Joystick:
x += _fontWidth * 2;
widget = new JoystickWidget(boss, _font, x, y, controller, true);
break;
case Controller::Type::Driving:
case Driving:
widget = new DrivingWidget(boss, _font, x, y, controller, true);
break;
case Controller::Type::Paddles:
case Paddles:
widget = new PaddleWidget(boss, _font, x, y, controller, true, second);
break;
case Controller::Type::AtariVox:
case AtariVox:
widget = new AtariVoxWidget(boss, _font, x, y, controller, true);
break;
case Controller::Type::SaveKey:
case SaveKey:
widget = new SaveKeyWidget(boss, _font, x, y, controller, true);
break;

View File

@ -559,37 +559,24 @@ RiotWidget::addControlWidget(GuiObject* boss, const GUI::Font& font,
{
switch(controller.type())
{
case Controller::Type::AmigaMouse:
return new AmigaMouseWidget(boss, font, x, y, controller);
case Controller::Type::AtariMouse:
return new AtariMouseWidget(boss, font, x, y, controller);
case Controller::Type::AtariVox:
return new AtariVoxWidget(boss, font, x, y, controller);
case Controller::Type::BoosterGrip:
return new BoosterWidget(boss, font, x, y, controller);
case Controller::Type::Driving:
return new DrivingWidget(boss, font, x, y, controller);
case Controller::Type::Genesis:
return new GenesisWidget(boss, font, x, y, controller);
case Controller::Type::Joy2BPlus:
return new Joy2BPlusWidget(boss, font, x, y, controller);
case Controller::Type::Joystick:
return new JoystickWidget(boss, font, x, y, controller);
case Controller::Type::Keyboard:
return new KeyboardWidget(boss, font, x, y, controller);
// case Controller::Type::KidVid: // TODO - implement this
// case Controller::Type::MindLink: // TODO - implement this
// case Controller::Type::Lightgun: // TODO - implement this
case Controller::Type::QuadTari:
return new QuadTariWidget(boss, font, x, y, controller);
case Controller::Type::Paddles:
return new PaddleWidget(boss, font, x, y, controller);
case Controller::Type::SaveKey:
return new SaveKeyWidget(boss, font, x, y, controller);
case Controller::Type::TrakBall:
return new TrakBallWidget(boss, font, x, y, controller);
default:
return new NullControlWidget(boss, font, x, y, controller);
using enum Controller::Type;
case AmigaMouse: return new AmigaMouseWidget(boss, font, x, y, controller);
case AtariMouse: return new AtariMouseWidget(boss, font, x, y, controller);
case AtariVox: return new AtariVoxWidget(boss, font, x, y, controller);
case BoosterGrip: return new BoosterWidget(boss, font, x, y, controller);
case Driving: return new DrivingWidget(boss, font, x, y, controller);
case Genesis: return new GenesisWidget(boss, font, x, y, controller);
case Joy2BPlus: return new Joy2BPlusWidget(boss, font, x, y, controller);
case Joystick: return new JoystickWidget(boss, font, x, y, controller);
case Keyboard: return new KeyboardWidget(boss, font, x, y, controller);
// case KidVid: // TODO - implement this
// case MindLink: // TODO - implement this
// case Lightgun: // TODO - implement this
case QuadTari: return new QuadTariWidget(boss, font, x, y, controller);
case Paddles: return new PaddleWidget(boss, font, x, y, controller);
case SaveKey: return new SaveKeyWidget(boss, font, x, y, controller);
case TrakBall: return new TrakBallWidget(boss, font, x, y, controller);
default: return new NullControlWidget(boss, font, x, y, controller);
}
}

View File

@ -42,20 +42,12 @@ namespace {
Thumbulator::ConfigureFor thumulatorConfiguration(CartridgeCDF::CDFSubtype subtype)
{
switch (subtype) {
case CartridgeCDF::CDFSubtype::CDF0:
return Thumbulator::ConfigureFor::CDF;
case CartridgeCDF::CDFSubtype::CDF1:
return Thumbulator::ConfigureFor::CDF1;
case CartridgeCDF::CDFSubtype::CDFJ:
return Thumbulator::ConfigureFor::CDFJ;
case CartridgeCDF::CDFSubtype::CDFJplus:
return Thumbulator::ConfigureFor::CDFJplus;
default:
throw runtime_error("unreachable");
using enum CartridgeCDF::CDFSubtype;
case CDF0: return Thumbulator::ConfigureFor::CDF;
case CDF1: return Thumbulator::ConfigureFor::CDF1;
case CDFJ: return Thumbulator::ConfigureFor::CDFJ;
case CDFJplus: return Thumbulator::ConfigureFor::CDFJplus;
default: throw runtime_error("unreachable");
}
}
} // namespace
@ -886,14 +878,14 @@ uInt32 CartridgeCDF::romSize() const
#ifdef DEBUGGER_SUPPORT
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CartDebugWidget* CartridgeCDF::debugWidget(GuiObject* boss, const GUI::Font& lfont,
const GUI::Font& nfont, int x, int y, int w, int h)
CartDebugWidget* CartridgeCDF::debugWidget(GuiObject* boss,
const GUI::Font& lfont, const GUI::Font& nfont, int x, int y, int w, int h)
{
return new CartridgeCDFWidget(boss, lfont, nfont, x, y, w, h, *this);
}
CartDebugWidget* CartridgeCDF::infoWidget(GuiObject* boss, const GUI::Font& lfont,
const GUI::Font& nfont, int x, int y, int w, int h)
CartDebugWidget* CartridgeCDF::infoWidget(GuiObject* boss,
const GUI::Font& lfont, const GUI::Font& nfont, int x, int y, int w, int h)
{
return new CartridgeCDFInfoWidget(boss, lfont, nfont, x, y, w, h, *this);
}

View File

@ -109,49 +109,50 @@ unique_ptr<Cartridge> CartCreator::create(const FSNode& file,
int numMultiRoms = 0;
switch(type)
{
case Bankswitch::Type::_2IN1:
using enum Bankswitch::Type;
case _2IN1:
numMultiRoms = 2;
// Make sure we have a valid sized image
validMultiSize = (size == 2 * 2_KB || size == 2 * 4_KB || size == 2 * 8_KB || size == 2 * 16_KB || size == 2 * 32_KB);
break;
case Bankswitch::Type::_4IN1:
case _4IN1:
numMultiRoms = 4;
// Make sure we have a valid sized image
validMultiSize = (size == 4 * 2_KB || size == 4 * 4_KB || size == 4 * 8_KB || size == 4 * 16_KB);
break;
case Bankswitch::Type::_8IN1:
case _8IN1:
numMultiRoms = 8;
// Make sure we have a valid sized image
validMultiSize = (size == 8 * 2_KB || size == 8 * 4_KB || size == 8 * 8_KB);
break;
case Bankswitch::Type::_16IN1:
case _16IN1:
numMultiRoms = 16;
// Make sure we have a valid sized image
validMultiSize = (size == 16 * 2_KB || size == 16 * 4_KB || size == 16 * 8_KB);
break;
case Bankswitch::Type::_32IN1:
case _32IN1:
numMultiRoms = 32;
// Make sure we have a valid sized image
validMultiSize = (size == 32 * 2_KB || size == 32 * 4_KB);
break;
case Bankswitch::Type::_64IN1:
case _64IN1:
numMultiRoms = 64;
// Make sure we have a valid sized image
validMultiSize = (size == 64 * 2_KB || size == 64 * 4_KB);
break;
case Bankswitch::Type::_128IN1:
case _128IN1:
numMultiRoms = 128;
// Make sure we have a valid sized image
validMultiSize = (size == 128 * 2_KB || size == 128 * 4_KB);
break;
case Bankswitch::Type::_MVC:
case _MVC:
cartridge = make_unique<CartridgeMVC>(file.getPath(), size, md5, settings);
break;
@ -231,100 +232,54 @@ CartCreator::createFromImage(const ByteBuffer& image, size_t size,
// We should know the cart's type by now so let's create it
switch(type)
{
case Bankswitch::Type::_03E0:
return make_unique<Cartridge03E0>(image, size, md5, settings);
case Bankswitch::Type::_0840:
return make_unique<Cartridge0840>(image, size, md5, settings);
case Bankswitch::Type::_0FA0:
return make_unique<Cartridge0FA0>(image, size, md5, settings);
case Bankswitch::Type::_2K:
return make_unique<Cartridge2K>(image, size, md5, settings);
case Bankswitch::Type::_3E:
return make_unique<Cartridge3E>(image, size, md5, settings);
case Bankswitch::Type::_3EX:
return make_unique<Cartridge3EX>(image, size, md5, settings);
case Bankswitch::Type::_3EP:
return make_unique<Cartridge3EPlus>(image, size, md5, settings);
case Bankswitch::Type::_3F:
return make_unique<Cartridge3F>(image, size, md5, settings);
case Bankswitch::Type::_4A50:
return make_unique<Cartridge4A50>(image, size, md5, settings);
case Bankswitch::Type::_4K:
return make_unique<Cartridge4K>(image, size, md5, settings);
case Bankswitch::Type::_4KSC:
return make_unique<Cartridge4KSC>(image, size, md5, settings);
case Bankswitch::Type::_AR:
return make_unique<CartridgeAR>(image, size, md5, settings);
case Bankswitch::Type::_BF:
return make_unique<CartridgeBF>(image, size, md5, settings);
case Bankswitch::Type::_BFSC:
return make_unique<CartridgeBFSC>(image, size, md5, settings);
case Bankswitch::Type::_BUS:
return make_unique<CartridgeBUS>(image, size, md5, settings);
case Bankswitch::Type::_CDF:
return make_unique<CartridgeCDF>(image, size, md5, settings);
case Bankswitch::Type::_CM:
return make_unique<CartridgeCM>(image, size, md5, settings);
case Bankswitch::Type::_CTY:
return make_unique<CartridgeCTY>(image, size, md5, settings);
case Bankswitch::Type::_CV:
return make_unique<CartridgeCV>(image, size, md5, settings);
case Bankswitch::Type::_DF:
return make_unique<CartridgeDF>(image, size, md5, settings);
case Bankswitch::Type::_DFSC:
return make_unique<CartridgeDFSC>(image, size, md5, settings);
case Bankswitch::Type::_DPC:
return make_unique<CartridgeDPC>(image, size, md5, settings);
case Bankswitch::Type::_DPCP:
return make_unique<CartridgeDPCPlus>(image, size, md5, settings);
case Bankswitch::Type::_E0:
return make_unique<CartridgeE0>(image, size, md5, settings);
case Bankswitch::Type::_E7:
return make_unique<CartridgeE7>(image, size, md5, settings);
case Bankswitch::Type::_EF:
return make_unique<CartridgeEF>(image, size, md5, settings);
case Bankswitch::Type::_EFSC:
return make_unique<CartridgeEFSC>(image, size, md5, settings);
case Bankswitch::Type::_F0:
return make_unique<CartridgeF0>(image, size, md5, settings);
case Bankswitch::Type::_F4:
return make_unique<CartridgeF4>(image, size, md5, settings);
case Bankswitch::Type::_F4SC:
return make_unique<CartridgeF4SC>(image, size, md5, settings);
case Bankswitch::Type::_F6:
return make_unique<CartridgeF6>(image, size, md5, settings);
case Bankswitch::Type::_F6SC:
return make_unique<CartridgeF6SC>(image, size, md5, settings);
case Bankswitch::Type::_F8:
return make_unique<CartridgeF8>(image, size, md5, settings);
case Bankswitch::Type::_F8SC:
return make_unique<CartridgeF8SC>(image, size, md5, settings);
case Bankswitch::Type::_FA:
return make_unique<CartridgeFA>(image, size, md5, settings);
case Bankswitch::Type::_FA2:
return make_unique<CartridgeFA2>(image, size, md5, settings);
case Bankswitch::Type::_FC:
return make_unique<CartridgeFC>(image, size, md5, settings);
case Bankswitch::Type::_FE:
return make_unique<CartridgeFE>(image, size, md5, settings, size);
case Bankswitch::Type::_GL:
return make_unique<CartridgeGL>(image, size, md5, settings);
case Bankswitch::Type::_MDM:
return make_unique<CartridgeMDM>(image, size, md5, settings);
case Bankswitch::Type::_UA:
return make_unique<CartridgeUA>(image, size, md5, settings);
case Bankswitch::Type::_UASW:
return make_unique<CartridgeUA>(image, size, md5, settings, true);
case Bankswitch::Type::_SB:
return make_unique<CartridgeSB>(image, size, md5, settings);
case Bankswitch::Type::_TVBOY:
return make_unique<CartridgeTVBoy>(image, size, md5, settings);
case Bankswitch::Type::_WD:
case Bankswitch::Type::_WDSW:
return make_unique<CartridgeWD>(image, size, md5, settings);
case Bankswitch::Type::_X07:
return make_unique<CartridgeX07>(image, size, md5, settings);
default:
return nullptr; // The remaining types have already been handled
using enum Bankswitch::Type;
case _03E0: return make_unique<Cartridge03E0>(image, size, md5, settings);
case _0840: return make_unique<Cartridge0840>(image, size, md5, settings);
case _0FA0: return make_unique<Cartridge0FA0>(image, size, md5, settings);
case _2K: return make_unique<Cartridge2K>(image, size, md5, settings);
case _3E: return make_unique<Cartridge3E>(image, size, md5, settings);
case _3EX: return make_unique<Cartridge3EX>(image, size, md5, settings);
case _3EP: return make_unique<Cartridge3EPlus>(image, size, md5, settings);
case _3F: return make_unique<Cartridge3F>(image, size, md5, settings);
case _4A50: return make_unique<Cartridge4A50>(image, size, md5, settings);
case _4K: return make_unique<Cartridge4K>(image, size, md5, settings);
case _4KSC: return make_unique<Cartridge4KSC>(image, size, md5, settings);
case _AR: return make_unique<CartridgeAR>(image, size, md5, settings);
case _BF: return make_unique<CartridgeBF>(image, size, md5, settings);
case _BFSC: return make_unique<CartridgeBFSC>(image, size, md5, settings);
case _BUS: return make_unique<CartridgeBUS>(image, size, md5, settings);
case _CDF: return make_unique<CartridgeCDF>(image, size, md5, settings);
case _CM: return make_unique<CartridgeCM>(image, size, md5, settings);
case _CTY: return make_unique<CartridgeCTY>(image, size, md5, settings);
case _CV: return make_unique<CartridgeCV>(image, size, md5, settings);
case _DF: return make_unique<CartridgeDF>(image, size, md5, settings);
case _DFSC: return make_unique<CartridgeDFSC>(image, size, md5, settings);
case _DPC: return make_unique<CartridgeDPC>(image, size, md5, settings);
case _DPCP: return make_unique<CartridgeDPCPlus>(image, size, md5, settings);
case _E0: return make_unique<CartridgeE0>(image, size, md5, settings);
case _E7: return make_unique<CartridgeE7>(image, size, md5, settings);
case _EF: return make_unique<CartridgeEF>(image, size, md5, settings);
case _EFSC: return make_unique<CartridgeEFSC>(image, size, md5, settings);
case _F0: return make_unique<CartridgeF0>(image, size, md5, settings);
case _F4: return make_unique<CartridgeF4>(image, size, md5, settings);
case _F4SC: return make_unique<CartridgeF4SC>(image, size, md5, settings);
case _F6: return make_unique<CartridgeF6>(image, size, md5, settings);
case _F6SC: return make_unique<CartridgeF6SC>(image, size, md5, settings);
case _F8: return make_unique<CartridgeF8>(image, size, md5, settings);
case _F8SC: return make_unique<CartridgeF8SC>(image, size, md5, settings);
case _FA: return make_unique<CartridgeFA>(image, size, md5, settings);
case _FA2: return make_unique<CartridgeFA2>(image, size, md5, settings);
case _FC: return make_unique<CartridgeFC>(image, size, md5, settings);
case _FE: return make_unique<CartridgeFE>(image, size, md5, settings, size);
case _GL: return make_unique<CartridgeGL>(image, size, md5, settings);
case _MDM: return make_unique<CartridgeMDM>(image, size, md5, settings);
case _UA: return make_unique<CartridgeUA>(image, size, md5, settings);
case _UASW: return make_unique<CartridgeUA>(image, size, md5, settings, true);
case _SB: return make_unique<CartridgeSB>(image, size, md5, settings);
case _TVBOY:return make_unique<CartridgeTVBoy>(image, size, md5, settings);
case _WD: [[fallthrough]];
case _WDSW: return make_unique<CartridgeWD>(image, size, md5, settings);
case _X07: return make_unique<CartridgeX07>(image, size, md5, settings);
default: return nullptr; // The remaining types have already been handled
}
}

View File

@ -2262,47 +2262,21 @@ StringList EventHandler::getActionList(Event::Group group)
{
switch(group)
{
case Event::Group::Menu:
return getActionList(EventMode::kMenuMode);
case Event::Group::Emulation:
return getActionList(EventMode::kEmulationMode);
case Event::Group::Misc:
return getActionList(MiscEvents);
case Event::Group::AudioVideo:
return getActionList(AudioVideoEvents);
case Event::Group::States:
return getActionList(StateEvents);
case Event::Group::Console:
return getActionList(ConsoleEvents);
case Event::Group::Joystick:
return getActionList(JoystickEvents);
case Event::Group::Paddles:
return getActionList(PaddlesEvents);
case Event::Group::Keyboard:
return getActionList(KeyboardEvents);
case Event::Group::Driving:
return getActionList(DrivingEvents);
case Event::Group::Devices:
return getActionList(DevicesEvents);
case Event::Group::Debug:
return getActionList(DebugEvents);
case Event::Group::Combo:
return getActionList(ComboEvents);
default:
return {}; // ToDo
using enum Event::Group;
case Menu: return getActionList(EventMode::kMenuMode);
case Emulation: return getActionList(EventMode::kEmulationMode);
case Misc: return getActionList(MiscEvents);
case AudioVideo: return getActionList(AudioVideoEvents);
case States: return getActionList(StateEvents);
case Console: return getActionList(ConsoleEvents);
case Joystick: return getActionList(JoystickEvents);
case Paddles: return getActionList(PaddlesEvents);
case Keyboard: return getActionList(KeyboardEvents);
case Driving: return getActionList(DrivingEvents);
case Devices: return getActionList(DevicesEvents);
case Debug: return getActionList(DebugEvents);
case Combo: return getActionList(ComboEvents);
default: return {}; // ToDo
}
}
@ -2438,47 +2412,21 @@ int EventHandler::getActionListIndex(int idx, Event::Group group)
{
switch(group)
{
case Event::Group::Menu:
return idx;
case Event::Group::Emulation:
return idx;
case Event::Group::Misc:
return getEmulActionListIndex(idx, MiscEvents);
case Event::Group::AudioVideo:
return getEmulActionListIndex(idx, AudioVideoEvents);
case Event::Group::States:
return getEmulActionListIndex(idx, StateEvents);
case Event::Group::Console:
return getEmulActionListIndex(idx, ConsoleEvents);
case Event::Group::Joystick:
return getEmulActionListIndex(idx, JoystickEvents);
case Event::Group::Paddles:
return getEmulActionListIndex(idx, PaddlesEvents);
case Event::Group::Keyboard:
return getEmulActionListIndex(idx, KeyboardEvents);
case Event::Group::Driving:
return getEmulActionListIndex(idx, DrivingEvents);
case Event::Group::Devices:
return getEmulActionListIndex(idx, DevicesEvents);
case Event::Group::Debug:
return getEmulActionListIndex(idx, DebugEvents);
case Event::Group::Combo:
return getEmulActionListIndex(idx, ComboEvents);
default:
return -1;
using enum Event::Group;
case Menu: return idx;
case Emulation: return idx;
case Misc: return getEmulActionListIndex(idx, MiscEvents);
case AudioVideo: return getEmulActionListIndex(idx, AudioVideoEvents);
case States: return getEmulActionListIndex(idx, StateEvents);
case Console: return getEmulActionListIndex(idx, ConsoleEvents);
case Joystick: return getEmulActionListIndex(idx, JoystickEvents);
case Paddles: return getEmulActionListIndex(idx, PaddlesEvents);
case Keyboard: return getEmulActionListIndex(idx, KeyboardEvents);
case Driving: return getEmulActionListIndex(idx, DrivingEvents);
case Devices: return getEmulActionListIndex(idx, DevicesEvents);
case Debug: return getEmulActionListIndex(idx, DebugEvents);
case Combo: return getEmulActionListIndex(idx, ComboEvents);
default: return -1;
}
}

View File

@ -914,10 +914,11 @@ double OSystem::dispatchEmulation(EmulationWorker& emulationWorker)
// Handle the dispatch result
switch (dispatchResult.getStatus()) {
case DispatchResult::Status::ok:
using enum DispatchResult::Status;
case ok:
break;
case DispatchResult::Status::debugger:
case debugger:
#ifdef DEBUGGER_SUPPORT
myDebugger->start(
dispatchResult.getMessage(),
@ -929,7 +930,7 @@ double OSystem::dispatchEmulation(EmulationWorker& emulationWorker)
break;
case DispatchResult::Status::fatal:
case fatal:
#ifdef DEBUGGER_SUPPORT
myDebugger->startWithFatalError(dispatchResult.getMessage());
#else

View File

@ -429,11 +429,12 @@ void TIA::bindToControllers()
updateEmulation();
switch (pin) {
case Controller::AnalogPin::Five:
using enum Controller::AnalogPin;
case Five:
updateAnalogReadout(1);
break;
case Controller::AnalogPin::Nine:
case Nine:
updateAnalogReadout(0);
break;
@ -448,11 +449,12 @@ void TIA::bindToControllers()
updateEmulation();
switch (pin) {
case Controller::AnalogPin::Five:
using enum Controller::AnalogPin;
case Five:
updateAnalogReadout(3);
break;
case Controller::AnalogPin::Nine:
case Nine:
updateAnalogReadout(2);
break;

View File

@ -80,13 +80,14 @@ static void update_input()
GET_BITMASK(pad)
switch(input_type[0])
{
case Controller::Type::Driving:
using enum Controller::Type;
case Driving:
MASK_EVENT(Event::LeftDrivingCCW, pad, RETRO_DEVICE_ID_JOYPAD_LEFT);
MASK_EVENT(Event::LeftDrivingCW, pad, RETRO_DEVICE_ID_JOYPAD_RIGHT);
MASK_EVENT(Event::LeftDrivingFire, pad, RETRO_DEVICE_ID_JOYPAD_B);
break;
case Controller::Type::Paddles:
case Paddles:
MASK_EVENT(Event::LeftPaddleAIncrease, pad, RETRO_DEVICE_ID_JOYPAD_LEFT);
MASK_EVENT(Event::LeftPaddleADecrease, pad, RETRO_DEVICE_ID_JOYPAD_RIGHT);
MASK_EVENT(Event::LeftPaddleAFire, pad, RETRO_DEVICE_ID_JOYPAD_B);
@ -100,7 +101,7 @@ static void update_input()
EVENT(Event::LeftPaddleBAnalog, input_state_cb(pad, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X));
break;
case Controller::Type::Lightgun:
case Lightgun:
{
// scale from -0x8000..0x7fff to image rect
const Common::Rect& rect = stella.getImageRect();
@ -114,14 +115,14 @@ static void update_input()
break;
}
case Controller::Type::Joy2BPlus:
case Controller::Type::BoosterGrip:
case Joy2BPlus:
case BoosterGrip:
MASK_EVENT(Event::LeftJoystickFire9, pad, RETRO_DEVICE_ID_JOYPAD_Y);
[[fallthrough]];
case Controller::Type::Genesis:
case Genesis:
MASK_EVENT(Event::LeftJoystickFire5, pad, RETRO_DEVICE_ID_JOYPAD_A);
[[fallthrough]];
case Controller::Type::Joystick:
case Joystick:
default:
MASK_EVENT(Event::LeftJoystickLeft, pad, RETRO_DEVICE_ID_JOYPAD_LEFT);
MASK_EVENT(Event::LeftJoystickRight, pad, RETRO_DEVICE_ID_JOYPAD_RIGHT);
@ -135,13 +136,14 @@ static void update_input()
switch(input_type[1])
{
case Controller::Type::Driving:
using enum Controller::Type;
case Driving:
MASK_EVENT(Event::RightDrivingCCW, pad, RETRO_DEVICE_ID_JOYPAD_LEFT);
MASK_EVENT(Event::RightDrivingCW, pad, RETRO_DEVICE_ID_JOYPAD_RIGHT);
MASK_EVENT(Event::RightDrivingFire, pad, RETRO_DEVICE_ID_JOYPAD_B);
break;
case Controller::Type::Paddles:
case Paddles:
MASK_EVENT(Event::RightPaddleAIncrease, pad, RETRO_DEVICE_ID_JOYPAD_LEFT);
MASK_EVENT(Event::RightPaddleADecrease, pad, RETRO_DEVICE_ID_JOYPAD_RIGHT);
MASK_EVENT(Event::RightPaddleAFire, pad, RETRO_DEVICE_ID_JOYPAD_B);
@ -155,14 +157,14 @@ static void update_input()
EVENT(Event::RightPaddleBAnalog, input_state_cb(pad, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X));
break;
case Controller::Type::Joy2BPlus:
case Controller::Type::BoosterGrip:
case Joy2BPlus:
case BoosterGrip:
MASK_EVENT(Event::RightJoystickFire9, pad, RETRO_DEVICE_ID_JOYPAD_Y);
[[fallthrough]];
case Controller::Type::Genesis:
case Genesis:
MASK_EVENT(Event::RightJoystickFire5, pad, RETRO_DEVICE_ID_JOYPAD_A);
[[fallthrough]];
case Controller::Type::Joystick:
case Joystick:
default:
MASK_EVENT(Event::RightJoystickLeft, pad, RETRO_DEVICE_ID_JOYPAD_LEFT);
MASK_EVENT(Event::RightJoystickRight, pad, RETRO_DEVICE_ID_JOYPAD_RIGHT);