Project

General

Profile

Actions

Emulator Issues #9019

closed

Change Disc doesn't properly notify games about the disc change

Added by ProjectRevoTPP over 8 years ago. Updated over 3 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-12436

Description

Mario Party 4 has the "Tray is open" message when the cover is open on a real Gamecube, but this causes the game to crash on the emulator when changing the disc to another before resetting, preventing us from switching games programmatically (MP4 to MP6).

It's a mundane feature since it's an emulator and not a real Gamecube, but not having it is causing us problems.


Files

Screenshot (13).png (29.1 KB) Screenshot (13).png windows4ya, 10/12/2015 04:01 AM

Related issues 1 (0 open1 closed)

Has duplicate Emulator - Emulator Issues #11726: GameCube Games aren't properly informed about disc removalDuplicate

Actions
Actions #1

Updated by Felk over 8 years ago

Here's an example of Mario Party 6 continuing to read it's music from the changed iso and causing distorted music: https://youtu.be/ifx1Ax6rLGc

Actions #2

Updated by JosJuice over 8 years ago

When you change disc, Dolphin simulates the tray being open for 1 second before inserting the new disc. Which problem are you reporting? Not having a function for opening the tray for longer than 1 second, or games like Mario Party 6 not behaving as on console when the tray is open?

Actions #3

Updated by ProjectRevoTPP over 8 years ago

JosJuice wrote:

When you change disc, Dolphin simulates the tray being open for 1 second before inserting the new disc. Which problem are you reporting? Not having a function for opening the tray for longer than 1 second, or games like Mario Party 6 not behaving as on console when the tray is open?

More specifically have the disc cover be open while the file dialog is open to select the new disc, so yes, open longer than 1 second.

Actions #4

Updated by JosJuice over 8 years ago

Could you explain why you want that? It sounds like a very weird feature. I'm all for adding a separate "remove disc" option, though.

Actions #5

Updated by Anonymous over 8 years ago

If this really doesn't work anymore, then it's a regression.
All you (used to?) have to do to simulate removing the disc is to do "change disc..." and then click cancel instead of selecting a new disc image.
I coded it originally. Feel my wrath if you broke it :)

Actions #6

Updated by Felk over 8 years ago

godisgovernment wrote:

If this really doesn't work anymore, then it's a regression.
All you (used to?) have to do to simulate removing the disc is to do "change disc..." and then click cancel instead of selecting a new disc image.
I coded it originally. Feel my wrath if you broke it :)

Yes, it does not work anymore. Opening the "change disc" dialog does not affect the game. clicking cancen does not affect the game. choosing another iso makes the game break. If you separately call DVDInterface::SetDiscInside(false) it does not affect the game.

Actions #7

Updated by JosJuice over 8 years ago

This commit changed how cancelling the file open dialog works: https://github.com/dolphin-emu/dolphin/commit/b3c9f437db116eae1d6df1068029c8b1eab60357

Actions #8

Updated by JosJuice over 8 years ago

Also, this commit seems to have removed the "empty the drive" function being triggered by the file name being empty. Now it just re-inserts an old disc if it couldn't insert a new one. https://github.com/dolphin-emu/dolphin/commit/a3b59f684575086f233233fbae04fb7eabfd1f46

Actions #9

Updated by theincrediblemastere over 8 years ago

JosJuice wrote:

Could you explain why you want that? It sounds like a very weird feature. I'm all for adding a separate "remove disc" option, though.

Wasn't the exact same question asked for the "Wiimote battery charge" setting?

Since there are things you can't do like run out of charge or open a disc tray in a virtual space like an Emulator, having these sort of trivial things as an option just puts that little bit more "reality" into the equation. And besides, maybe an issue could be uncovered involving behavior when the disc tray is open!

Actions #10

Updated by JosJuice over 8 years ago

Like I said, I'm all for having an option to remove the disc. What I don't understand why it should happen when opening the disc change dialog. Looking for the disc image you want to insert is like looking for a real disc you want to insert, in that you don't have to eject the old disc until it actually is time to insert the new one. I think it would be confusing to have the disc change dialog do something by just opening it (or cancelling it...)

Actions #11

Updated by ProjectRevoTPP over 8 years ago

JosJuice wrote:

Like I said, I'm all for having an option to remove the disc. What I don't understand why it should happen when opening the disc change dialog. Looking for the disc image you want to insert is like looking for a real disc you want to insert, in that you don't have to eject the old disc until it actually is time to insert the new one. I think it would be confusing to have the disc change dialog do something by just opening it (or cancelling it...)

You know you can open the disc cover without taking the game out right?

Actions #12

Updated by pauldacheez over 8 years ago

  • Subject changed from [Enhancement] Support Disc Cover being open to Change Disc doesn't actually open the disc cover, other disc manipulation tasks are missing
  • Status changed from New to Accepted

Whether the disc is physically in there or not, when the disc cover's open, the game can't read the disc. The issue here is that we're not properly telling the game that the lid is open in our current disc-switching code, we're just swapping the disc without notifying the currently-running game (as evidenced by the first comment's example, whereas on real console you'd instantly get an open-cover message). Are we not blocking disc reads or forgetting to set a bit that the open-lid sensor sets or something? I'm amazed this functions at all for multi-disc games.

I see plenty of valid complaints here about missing functionality (having the lid open indefinitely or having no disc in the drive); I'll ignore the UI part of the debate and just say that you should be able to do everything you can on real console.

Since I took the time to test this, lemme give examples of behavior exhibited by my two real consoles (DOL-101 GameCube, early launch-era Wii) and the handful of games I had lying around:

GameCube: games either instantly complain when you open the cover ("Please close the disc cover.") or they delay their complaining until the next disc read ("Please close the disc cover to continue."). Removing the disc (and optionally inserting another) and closing the lid makes them ask for their original disc ("This disc is not [game]. Please insert the [game] Game Disc." or just the latter sentence if no disc was inserted), at which point you can press Reset to reboot back to IPL. (Reset is a soft button, e.g. the game handles its signal, so it'd normally flush most of the RAM and send you back to the title logos, but when there's no disc or a different disc in the drive, it resets the console completely. Games that delay their complaints to the next disc read don't need to display any of these disc-related messages before pressing Reset does this.)

Wii (Wii discs, firmware 4.2U): games generally just complain instantly when you eject the disc ("Please insert the disc for [game]."), and pressing Reset (still a soft button; signal's probably still handled by the game, but it probably calls Starlet to do most of the actual reset work anyway) sends you back to the Wii menu with whatever method pressing Home > Wii Menu uses (e.g. it shows the "grey channels" animation before showing the home menu).

Wii (GameCube discs, MIOS v10): when ejected, games act like the disc cover's open ("Please close the disc cover."). Inserting another game's disc makes them ask for their original disc ("This disc is not [game]. Please insert the [game] Game Disc."); games attempt to read the disc regardless of whether it's a GameCube or Wii disc. Reset reboots the console entirely (e.g. "Health & Safety" white-text-on-black-screen, then home menu). There seems to be no way to get it to a state where games think the disc cover's closed without a disc inside.

Actions #13

Updated by JosJuice over 8 years ago

Dolphin is supposed to open the cover when a disc is ejected. Maybe there is something wrong with the implementation. https://github.com/dolphin-emu/dolphin/commit/61da252858644b1ca52b4e3eac1317854fb17977

Actions #14

Updated by windows4ya over 8 years ago

ProjectRevoTPP wrote:

Mario Party 4 has the "Tray is open" message when the cover is open on a real Gamecube, but this causes the game to crash on the emulator when changing the disc to another before resetting, preventing us from switching games programmatically (MP4 to MP6).

It's a mundane feature since it's an emulator and not a real Gamecube, but not having it is causing us problems.

Try this

  1. open note pad
  2. name it as eject.iso and save
  3. disable Use Panic Handlers in config
  4. change disc to eject.iso while the game is running
  5. and dolphin will eject the game disc

I tried this method on SSBB
I got this

Actions #15

Updated by Felk over 8 years ago

I tried changing the iso mid-game on the following games:
GC: Mario Kart Double Dash!!, Mario Party 4-6, Pokemon Colosseum, Rayman 3 Hoodlum Havoc, TLoZ: The Wind Waker
Wii: Mario Party 8, Pokemon Battle Revolution, Smash Bros. Brawl
In that order:

Gamecube:
1: During title cutscene: Game hangs
During title screen: game crashes on selecting to start the game "Invalid read from 0x6ec055f6, PC = 0x80015b0c"
2: During title cutscene: Game hangs
During title screen: Dolphin crashes (a)
3: During title cutscene: Game hangs
During title screen: distorted music, hang upon continuing
4: During title cutscene: distorted music, game crash upon continuing "invalid read..."
During title screen: same
5: During title screen: game crash upon continuing "invalid read..."
6: During title cutscene: game hangs
During title screen: distorted music, hang upon continuing
7: During title screen: distorted music, hang upon continuing

Wii:
1: During title screen: hang
During game mode selection: hang
2: During title screen: "Please insert the PBR Game Disc"
During main menu: same
3: During title cutscene: "Please insert the SSBB Game Disc.", for half a second, a bit of cutscene, then back to insert-disc-screen.
During main menu: same
During title screen: Nothing. "Tried to decrypt data from a non-Wii volume" upon continuing, hang afterwards

Used Dolphin version: 4.0-8033-dirty (newest commits).
So it appears that this does not work on gamecube at all, and is a matter of luck on the Wii.

Actions #16

Updated by Felk over 8 years ago

Forgot to mention what my "(a)" meant:
dolphin throws an exception here: https://github.com/dolphin-emu/dolphin/blob/737de5e115c79a5e85d3c0caf7888edd46ce9453/Source/Core/Core/HW/DVDInterface.cpp#L341
But now mario party 4 just gets distorted music and hangs as well on the title screen.
Also noteworthy that i replaced the iso with mario party 4 each time (except for mp4, i used mp5 for that one)

Actions #17

Updated by JosJuice over 8 years ago

  • Subject changed from Change Disc doesn't actually open the disc cover, other disc manipulation tasks are missing to Change Disc doesn't properly notify games about the disc change

Thanks for all the testing. This seems like quite a major issue with disc changing. I'll change the issue title to only be about that, because keeping track of two issues in one issue report gets messy. Anyone, feel free to create a separate issue report for being able to remove discs without inserting a new one if you want to.

Good catch with the (a) thing. Dolphin checks that a disc is inserted before it starts executing a DVD command, but it doesn't do it before finishing, so it's possible to run into that problem if you change disc while a command is executing. Fixing that won't fix the main issue, though.

Actions #18

Updated by JosJuice over 8 years ago

I think 4.0-8172 happens to fix the (a) problem.

Actions #19

Updated by Felk over 8 years ago

Using 8377, a quick test switching from mp4 iso to mp6 and vice versa on the title screen still results in scrambled music. Switching from mp8 to mp4 still results in a hang. The behaviour seems to not have changed

Actions #20

Updated by JosJuice over 8 years ago

The only behavior change that I expected was that Dolphin no longer will crash with an exception in the DVD reading code sometimes. 4.0-8172 doesn't do anything about in-game hangs or garbled music.

Actions #21

Updated by JosJuice almost 5 years ago

Actions #22

Updated by JosJuice about 4 years ago

  • Status changed from Accepted to Fix pending
Actions #23

Updated by JosJuice over 3 years ago

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

Also available in: Atom PDF