Project

General

Profile

Actions

Emulator Issues #2078

closed

Play button not active if DefaultGCM and LastFilename not set

Added by glennricster over 14 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:

Description

What steps will reproduce the problem?

  1. Make sure DefaultGCM and LastFilename are not set in Dolphin.ini
  2. Start Dolphin and select an ISO in the game list.
  3. The play button does not become active. It is still possible to play a
    game by double clicking on the ISO in the game list, but could be confusing
    to the user.

This will happen, for example, in the case that this is the first run of
Dolphin and no ISO path has been selected, and in this case it happens
after an ISO path is added.

I have an attached a patch that seems to fix this issue.

Actions #1

Updated by glennricster over 14 years ago

You may notice in the patch that I used the EVT_LEFT_DOWN event, which previously was
conflicting with multiple selections. However, I think that I avoided that by
proppigating the event, and only doing anything if there are no previous selections.
So far I have seen no interference with multiple selections.

Actions #4

Updated by skidau over 14 years ago

Thanks, glennricster. This does fix the Play appearing on new installs. However,
after stopping a game, the Play button stays disabled. The Play button should be
enabled.

Actions #5

Updated by glennricster over 14 years ago

Okay, I will see what I can do about that.

Actions #6

Updated by glennricster over 14 years ago

Actually, I am not quite sure what you mean. When I start a game and stop it, the
play button is enabled. Also, while the game is active the play button is enabled to
pause the game.

Actions #7

Updated by skidau over 14 years ago

I started a fresh install of Dolphin (no Default ISO and no last filename). I select
a game from the game list and start it (I think with the play button). I press esc
or the stop button. The game list reappears but the Play and Stop buttons are disabled.

I think I also tried it with a Default ISO with the same result.

Actions #8

Updated by glennricster over 14 years ago

Hmm, I tried the same thing and after hitting the stop button, the game closes, and
the play button is enabled.

Actions #9

Updated by skidau over 14 years ago

After the game closes and before you have click the gamelist again, the Play button
is enabled for you?

Actions #10

Updated by glennricster over 14 years ago

Yeah, after the game closes without doing anything the play button is enabled. At
least in windows that is the case. In linux I have been unable to test this as, for
some reason, the program segmentation faults when I close a game on the first run.

Actions #11

Updated by glennricster over 14 years ago

Ok, so I think I am seeing something like what you are seeing. If I start and stop a
game, hit refresh, and start and stop a game, then after that the play button is not
enabled as it should be. I will see if I can fix that.

Actions #12

Updated by hrydgard over 14 years ago

  • Status changed from New to Accepted

When you've got it figured out, feel free to commit the fix, I've added you.

BTW it would be great if you could make game_loading not global somehow.

Actions #13

Updated by glennricster over 14 years ago

Ok, thanks. I will work on making game_loading not glabal. I don't think that
should be too hard. It is only used in a couple of functions.

Actions #14

Updated by glennricster over 14 years ago

Actually, is the game_loading variable even needed? During the entire time that a
game is running the m_GameListCtrl->IsEnabled() should return false, and if it is not
running it should return true. That should probably be used instead.

Actions #15

Updated by skidau over 14 years ago

"game_loading = true" is the time between when the user selects to play the game and
the time when the game is loaded (check the EmuThread in Core.cpp). During this
time, the play button must be disabled. It prevents the user from double clicking
the Play button and confusing the emulator.

Actions #16

Updated by glennricster over 14 years ago

I realize the intent of the variable. I was just saying that I think there may be a
better way to determine if the game is loading or not. However, the problem with
what I said before is that the game_loading variable is used in CFrame::UpdateGUI to
determine when to reenable the game list ctrl. Making my comment invalid.

Actions #17

Updated by glennricster over 14 years ago

I have found the problem, and I am trying to find a way to remedy it. The problem is
with the checking of Core::GetStartupParameter().m_strFilename.empty() on line 1069
of FrameTools.cpp. m_strFilename is set whenever a game is run. So on first run if
a game is automatically run (for example by passing "--elf=filename" from the command
line), m_strFilename is set and the check on line 1069 does the correct thing at the
beginning and disables the play button, but the play button is disabled after closing
the game because the m_strFilename is still set. If a game is not run automatically,
m_strFilename is also set when the game is stopped, and the play button is disabled.
If an ISO is selected in the game list, the play button is enabled later in the
update gui function still, but otherwise the play button remains disabled.

Actions #18

Updated by skidau over 14 years ago

Thanks for investigating this one.

The play button should not be disabled if m_strFilename is set after closing (i.e.
when the gamelist is on the screen). Maybe a check for those conditions in UpdateGUI
can fix this last issue.

Actions #19

Updated by glennricster over 14 years ago

One problem is that if a game is started automatically the gamelist is still on the
screen while the game is running, and so checking for gamelist won't work. Of course
the gamelist shouldn't be showing at that time so that is another problem.

Actions #20

Updated by glennricster over 14 years ago

One solution that seems to work is to clear the m_strFilename at the end of
CBoot::Bootup in Source/Core/Core/Boot/Boot.cpp. But I want to investigate a little
bit first to see if that is safe to do.

Actions #21

Updated by lawrence29reyome over 14 years ago

http://forums.dolphin-emu.com/thread-6744.html

I have included the patch in a recompiled 4922, tested and works

Actions #22

Updated by glennricster over 14 years ago

  • Status changed from Accepted to Fixed

This issue was closed by revision r4923.

Actions

Also available in: Atom PDF