Skip to content
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: fix missing ramp of main surround channel #10643

Merged
merged 2 commits into from May 12, 2022

Conversation

Tilka
Copy link
Member

@Tilka Tilka commented May 7, 2022

Also more renaming. Not sure if fixing the ramp makes a noticeable difference anywhere.

@Tilka Tilka force-pushed the ax_cleanup branch 3 times, most recently from 662d8ea to 6967603 Compare May 7, 2022 15:31
{
ret |= MIX_L_RAMP | MIX_R_RAMP;
if (ret & MIX_AUXA_L)
ret |= MIX_AUXA_L_RAMP | MIX_AUXA_R_RAMP;
if (ret & MIX_AUXB_L)
ret |= MIX_AUXB_L_RAMP | MIX_AUXB_R_RAMP;
if (ret & MIX_AUXA_S)
ret |= MIX_AUXA_S_RAMP;
if (ret & MIX_AUXB_S)
ret |= MIX_AUXB_S_RAMP;
}
ret |= MIX_ALL_RAMPS;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am I correct in guessing that the intended change here is equivalent to adding | MIX_MAIN_S_RAMP to the first line, like it's done below if m_crc is not 0x4e8a8b21?

If so this consolidation seems wrong to me, but I'm not familiar with the DSP so I could be missing context. For example, if the 0x8 bit of mixer_control is set and the lowest three bits are not then in the old code none of these ifs are true leaving ret == 0xf, while in this version it becomes 0xAAAAAF.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Make sure to look at the two commits individually.
  2. Yes, setting all ramp flags changes the value of ret. However, a ramp flag has no effect if its corresponding channel is not active. See the MIX_ON checks in AXVoice.h that precede each use of RAMP_ON.

Copy link
Contributor

@Dentomologist Dentomologist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have any GameCube games to test with, but the code LGTM.

@Tilka Tilka merged commit 333659c into dolphin-emu:master May 12, 2022
10 checks passed
@Tilka Tilka deleted the ax_cleanup branch May 12, 2022 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants