New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust s_DIMAR/s_DILENGTH behavior (fixes Baten Kaitos music) #8733
Conversation
https://bugs.dolphin-emu.org/issues/11997 The problem seemed to be that s_DILENGTH would get set to 0 at times when it shouldn't. Simply not changing it in case of NoReply or DTK seems to fix the problem. However, we can actually go one step further in accuracy and use data.size() to change s_DIMAR and s_DILENGTH as partial reads (NoReply commands) complete, instead of jumping directly to 0 when the whole read completes.
|
Can confirm that this fixes the music issue in Baten Kaitos. |
|
|
||
| u32 transfer_size = 0; | ||
| if (reply_type == ReplyType::NoReply) | ||
| transfer_size = static_cast<u32>(data.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this value ever exceed the current value of s_DILENGTH (making it potentially negative after the subtraction down there)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only if the emulated software overwrites s_DILENGTH in the middle of a read, which doesn't make much sense. I'm not sure what happens on hardware if you do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good enough for me then.
|
|
||
| u32 transfer_size = 0; | ||
| if (reply_type == ReplyType::NoReply) | ||
| transfer_size = static_cast<u32>(data.size()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good enough for me then.
https://bugs.dolphin-emu.org/issues/11997
The problem seemed to be that
s_DILENGTHwould get set to 0 at times when it shouldn't. Simply not changing it in case ofNoReplyorDTKseems to fix the problem. However, we can actually go one step further in accuracy and usedata.size()to changes_DIMARands_DILENGTHas partial reads (NoReplycommands) complete, instead of jumping directly to 0 when the whole read completes.