-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
AESND_Reset
hangs when called
#140
Comments
Hey muff1n1634, thanks for pointing out the bug. we were not made aware this was in there. i will, however, look at fixing this. |
basic example that just inits and deinits aesndlib #include <stdio.h>
#include <gccore.h>
#include <wiiuse/wpad.h>
#include <aesndlib.h>
GXRModeObj * rmode;
void * xfb;
WPADData * wm0;
AESNDPB * voice;
int main(void)
{
// standard setup stuff
WPAD_Init();
wm0 = WPAD_Data(WPAD_CHAN_0);
VIDEO_Init();
rmode = VIDEO_GetPreferredMode(NULL);
xfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
VIDEO_Configure(rmode);
VIDEO_SetNextFramebuffer(xfb);
VIDEO_SetBlack(false);
VIDEO_Flush();
VIDEO_WaitVSync();
if (rmode->viTVMode & VI_NON_INTERLACE)
VIDEO_WaitVSync();
CON_Init(xfb,
20, 20,
rmode->fbWidth, rmode->xfbHeight,
rmode->fbWidth * VI_DISPLAY_PIX_SZ);
printf("\x1b[2;0H");
printf("I am a message\n");
// AESND_Init()
printf("calling AESND_Init()...\n");
AESND_Init();
printf("AESND_Init() called\n");
[[maybe_unused]] loop:
while (true)
{
WPAD_ScanPads();
wm0 = WPAD_Data(WPAD_CHAN_0);
if (wm0->btns_d & WPAD_BUTTON_HOME)
{
printf("Exiting\n");
goto exit;
}
VIDEO_WaitVSync();
}
exit:
// AESND_Reset()
printf("AESND_Reset()...\n");
AESND_Reset(); // execution hangs here with an unpatched aesndlib
printf("aesndlib was reset\n"); // this statement is never reached in that case
return 0;
} |
while adding a comment to explain the change, i did notice that some earlier lines did this version of the comparison ( lri $acc0.m,#0xcdd1
cmp
jeq sys_commands
lri $acc0.m,#0xface
cmp
jne wait_commands it seems the bug was avoided with these lines; perhaps the case with |
it is possible. one off cases are often a case of being overlooked |
as mentioned, this is now fixed. thanks for reporting and pointing out the fix! |
Was doing some testing with aesndlib a few days ago and found that calling
AESND_Reset
on exit just hangs my Wii. Wondered why, and looked into it a little bit.Apparently, I'm not the first one to find out about this - it was known about when adding support for aesndlib in Dolphin in July of 2022, and even gives a warning about it not working with an explanation of why:
From the linked commit, it looks like the fix is small:
I write this as an issue instead of a pull request because this fix is already in a commit (albeit in another remote) and so should be able to be cherry-picked from there. (If doing so would complicate history or other things, though, making another PR would be trivial.)
The text was updated successfully, but these errors were encountered: