Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config: Port EXI device and SI device settings to new config system. #10354

Merged
merged 2 commits into from Jan 9, 2022

Conversation

AdmiralCurtiss
Copy link
Contributor

Separate PR here because of this snippet of code that I'm not sure how to translate correctly into the new system:

    for (unsigned int i = 0; i < SerialInterface::MAX_SI_CHANNELS; ++i)
    {
      int source;
      controls_section->Get(fmt::format("PadType{}", i), &source, -1);
      if (source >= SerialInterface::SIDEVICE_NONE && source < SerialInterface::SIDEVICE_COUNT)
      {
        StartUp.m_SIDevice[i] = static_cast<SerialInterface::SIDevices>(source);
        config_cache.bSetPads[i] = true;
      }
    }

This happens while parsing GameINIs and basically means 'if PadTypeN is set to a valid value, override SIDeviceN with that, otherwise keep the value set by SIDeviceN'. I can and have added these to GetINIToLocationMap(), but that's not quite the same behavior -- if you set it to an invalid value, Dolphin will now use SIDEVICE_NONE rather than the current SIDeviceN value. Are we fine with this? If not, how do we adjust the code so that previous behavior still applies?

@AdmiralCurtiss AdmiralCurtiss force-pushed the config-port-core-3 branch 3 times, most recently from 6b6ecca to 9c2e5cb Compare January 6, 2022 18:30
@JosJuice
Copy link
Member

JosJuice commented Jan 6, 2022

I would be fine with this new PadType behavior.

Copy link
Member

@JosJuice JosJuice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a lot of casting going on in this PR. Is there any particular reason why the settings are defined as ints instead of the relevant enum type?

Source/Core/Core/HW/SI/SI_DeviceGCController.cpp Outdated Show resolved Hide resolved
@AdmiralCurtiss
Copy link
Contributor Author

I was somehow under the impression that you couldn't forward-declare an old C-style enum, but nope, seems to work fine. I've updated the settings to use the enum directly and removed the casts.

@leoetlino
Copy link
Member

For the record, forward declaring an enum is fine as long as you specify the underlying type (which is only possible starting from C++11). Forward declaring an enum class without specifying the underlying type is okay too (int is the default).

@dolphin-emu-bot
Copy link
Contributor

FifoCI detected that this change impacts graphical rendering. Here are the behavior differences detected by the system:

  • aeon-charge-attack on mvk-osx-m1: diff
  • burnout2-vehicletextures on mvk-osx-m1: diff
  • DKCR-Char on mvk-osx-m1: diff
  • DKCR-fast-depth on mvk-osx-m1: diff
  • ea-pink on mvk-osx-m1: diff
  • pm-hc-jp on mvk-osx-m1: diff
  • rs2-skybox on mvk-osx-m1: diff
  • spyro-bloom on mvk-osx-m1: diff
  • ssbb-mod-lloyd on mvk-osx-m1: diff
  • thps4-shadow on mvk-osx-m1: diff

automated-fifoci-reporter

@JosJuice JosJuice merged commit 1d9d9d6 into dolphin-emu:master Jan 9, 2022
10 checks passed
@AdmiralCurtiss AdmiralCurtiss deleted the config-port-core-3 branch January 9, 2022 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants