Project

General

Profile

Actions

Emulator Issues #10765

closed

When loading a savestate made with a different input method, holding an analog input within the first ~.5 seconds after loading messes up the neutral position

Added by NarryG almost 7 years ago. Updated almost 6 years ago.

Status:
Fixed
Priority:
Normal
Assignee:
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:
5.0-9470

Description

Game Name?

Any Gamecube game (didn't test Wii)
Primarily tested on Twilight Princess but it happened on other games

Game ID? (right click the game in the game list, properties, info tab)

Does not apply

MD5 Hash? (right click the game in the game list, properties, info tab, MD5 Hash: Compute)

Does not apply

What's the problem? Describe what went wrong.
When you load a savestate made with a different input method, there's a short period of time (~.5 seconds) after loading the state where input isn't accepted. If you hold any analog input during this time, it will screw up the neutral position once it starts accepting input.

What steps will reproduce the problem?
Create a savestate using one input method (e.g. standard controller)
Swap input methods
Load the savestate
Hold any analog input within the first half second
Your neutral position is now messed up

Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.

Yes
5.0-6112

Is the issue present in the latest stable version?

Yes
5.0 Stable

What are your PC specifications? (CPU, GPU, Operating System, more)
Windows 10 Fall Creator's Update
i7-6700k
GTX 1080 Ti


Related issues 1 (0 open1 closed)

Related to Emulator - Emulator Issues #9051: Initially stuck GC axes, cleared by moving and restartingFixedBilliard26

Actions
Actions #1

Updated by NarryG almost 7 years ago

This does technically appear to just be a result to how you guys have Dolphin handle the controller swapping after loading a state. I'm not sure if you'd consider it a bug. All I know is I was running into it until I figured out what was wrong

In si.cpp we have

    if (type == device->GetDeviceType())
    {
      device->DoState(p);
    }
    else
    {
      // If no movie is active, we'll assume the user wants to keep their current devices
      // instead of the ones they had when the savestate was created.
      // But we need to restore the current devices first just in case.
      SIDevices original_device = device->GetDeviceType();
      std::unique_ptr<ISIDevice> save_device = SIDevice_Create(type, i);
      save_device->DoState(p);
      AddDevice(std::move(save_device));
      ChangeDeviceDeterministic(original_device, i);
    }

Looking at ChangeDeviceDeterministic,

  if (GetDeviceType(channel) != device)
  {
    CoreTiming::ScheduleEvent(0, s_change_device_event, ((u64)channel << 32) | SIDEVICE_NONE);
    CoreTiming::ScheduleEvent(SystemTimers::GetTicksPerSecond(), s_change_device_event,
                              ((u64)channel << 32) | device);
  }

You're disconnecting the controller on the first tick, then one second later you're connecting the new one. The controller code does what it's supposed to and sets the neutral position when it detects the controller one second later, but it's not made clear to the user that their controller isn't connected so if they try and input stuff right away, they can goof the neutral position.

Actions #2

Updated by Billiard26 about 6 years ago

  • Status changed from New to Questionable

This is just something the games do. They calibrate the controller when it is connected. The only solution would be to suppress inputs for some time and hope the game is done calibrating. I think this falls under "Working as intended".

Actions #3

Updated by NarryG about 6 years ago

Billiard26 wrote:

This is just something the games do. They calibrate the controller when it is connected. The only solution would be to suppress inputs for some time and hope the game is done calibrating. I think this falls under "Working as intended".

Understandable. In my testing, games calibrated instantly. It's that one second delay after loading the state that was causing the problem more than anything as there's no indication of the fact Dolphin is detaching the old controller and then attaching the new one a whole second later.

Actions #4

Updated by Billiard26 about 6 years ago

Yeah, we could add an OSD message so the device change is apparent at least.

Actions #5

Updated by Billiard26 almost 6 years ago

After looking closer at the relevant code I think forcing neutral values on calibration might be feasible (and sensible) (or at least optional).

Actions #6

Updated by Billiard26 almost 6 years ago

Actions #7

Updated by Billiard26 almost 6 years ago

  • Status changed from Questionable to Fix pending
  • Assignee set to Billiard26
Actions #8

Updated by Billiard26 almost 6 years ago

  • Status changed from Fix pending to Fixed
  • Fixed in set to 5.0-9470
Actions

Also available in: Atom PDF