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
AX: Implement loop_counter and support UCodes without LPF #5211
Conversation
|
|
MSVC doesn't support Other than that, why do you need a dedicated NoLpf PB struct? Unless I missed something, the only difference is the |
|
@BhaaLseN The existence of the |
|
Ah, duh. Forgot about that. Nvm then. |
|
So, with MS not supporting that (yet), what's going to happen to this? |
|
My plan was to wait until C++17 is a thing in Dolphin and for MSVC |
|
Looking at this again, isn't this the reason why we have to care about the struct layout (and potentially create duplicates)? |
|
@BhaaLseN that's what I ended up doing for Zelda HLE, see https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/Core/HW/DSPHLE/UCodes/Zelda.cpp#L885 I'm not against doing the same thing for AX. |
|
can't you just use unions for this (instead of the #ifdef stuff)? |
Required for Rogue Squadron.
|
Updated to use copies for the alternate layout. |
| { | ||
| switch (crc) | ||
| { | ||
| case 0x4e8a8b21: |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| @@ -253,8 +253,9 @@ struct AXPB | |||
| PBSampleRateConverter src; | |||
| PBADPCMLoopInfo adpcm_loop_info; | |||
| PBLowPassFilter lpf; | |||
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
LGTM. I completed the first three missions of RS2 (reported to crash with the hack in Ishiiruka) and they seem to be working fine here. Rogue Squadron 3 isn't working well in Dolphin right now, but, in the parts of the game I got to it also works. As a bonus, it appears that Pac-Man World Rally is fixed. The audio now seems to be roughly the same as LLE. Instead of having some sounds super loud, and some super quiet, they all now play fairly loud, but can be adjusted in the options. The game appears louder than most on console as well. |
| @@ -81,17 +81,50 @@ union AXBuffers | |||
| }; | |||
|
|
|||
| // Read a PB from MRAM/ARAM | |||
| void ReadPB(u32 addr, PB_TYPE& pb) | |||
| void ReadPB(u32 addr, PB_TYPE& pb, bool has_lpf = true) | |||
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| { | ||
| case 0x4e8a8b21: | ||
| return false; | ||
| default: |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
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.
Overall LGTM, thanks a lot.
Affects: * Star Wars: Rogue Leader * Star Wars: Rebel Strike
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.
Theres also
| // TODO: find other UCode versions with different mixer_control values |
| @@ -80,18 +80,63 @@ union AXBuffers | |||
| #endif | |||
| }; | |||
|
|
|||
| // Determines if this version of the UCode has a PBLowPassFilter in its AXPB layout. | |||
| bool HasLpf(u32 crc) | |||
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
I'm fine with merging this now because even if other UCode versions have the same weirdness, it should only impact LPF emulation which is presently disabled due to other issues. I think it's a good compromise. |
Uses constexpr if and hence requires C++17. This approach is possible without constexpr if but would be much uglier.I decided to replace the preprocessorAX_GCandAX_WIIdefines with a configuration template parameter. This allowed for further variants in AX functionality to be supported via constexpr if.While one can now semi-trivially remove the need for the global variables inAXVoice.hafter this change, I've decided to leave that to another PR.(P.S.: delroth did all the hard work, this just implements the fix.)
Edit: Now uses copies for layout differences.