Skip to content

Commit

Permalink
Only update DIMAR and DILENGTH if transfer completed without error
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Pokechu22 committed Jul 29, 2020
1 parent fba51b2 commit 537e40a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Source/Core/Core/HW/DVD/DVDInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1283,8 +1283,11 @@ void FinishExecutingCommand(ReplyType reply_type, DIInterruptType interrupt_type
else if (reply_type == ReplyType::Interrupt || reply_type == ReplyType::IOS)
transfer_size = s_DILENGTH;

s_DIMAR += transfer_size;
s_DILENGTH -= transfer_size;
if (interrupt_type == DIInterruptType::TCINT)
{
s_DIMAR += transfer_size;
s_DILENGTH -= transfer_size;
}

switch (reply_type)
{
Expand Down

0 comments on commit 537e40a

Please sign in to comment.