Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix gamecube games not noticing disc changes #8571
Fixes issue 9019.
…acies In particular: - Trying to play audio in a non-ready state returns the state-specific error, not an audio buf error - Audio status cannot be requested in non-ready states - The audio buffer cannot be configured in states other than ReadyNoReadsMade - Using the stop motor command while the motor is already stopped doesn't change states Additionally, the internal state IDs are used (which distinguish ReadyNoReadsMade and Ready), instead of the state IDs exposed in request error. This makes some of the weird behavior a bit more obvious. State and error behavior of the seek command was not implemented in this commit.
Turns out, Gamecube games actually do check DILENGTH, and if DILENGTH is at 0, they'll think the transfer completed successfully even if DEINT is used, since after all, surely that means everything was sent. That caused all sorts of issues, from audio looping when a disc is removed since it's re-using the same buffer to just flat-out crashing instead of showing the disc removed screen.
Resetting the DI registers disables interrupts, which means any errors reported (for instance) are just not sent though.