Giter Club home page Giter Club logo

Comments (5)

DacoTaco avatar DacoTaco commented on September 4, 2024

Hey muff1n1634,

thanks for pointing out the bug. we were not made aware this was in there.
sadly there are many forks of libogc that have fixes like this, but never upstream them (due to not knowing/thinking about it, not caring or even not wanting to).
we won't be cherry picking from said forks, as it would make the git history and even greater mess then it already is.

i will, however, look at fixing this.
is there any code you can supply to test this with? i have no knowledge of how this all works haha

from libogc.

muff1n1634 avatar muff1n1634 commented on September 4, 2024

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;
}

from libogc.

muff1n1634 avatar muff1n1634 commented on September 4, 2024

while adding a comment to explain the change, i did notice that some earlier lines did this version of the comparison (lri/cmp vs cmpi):

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 0xdead was overlooked?

from libogc.

DacoTaco avatar DacoTaco commented on September 4, 2024

it is possible. one off cases are often a case of being overlooked

from libogc.

DacoTaco avatar DacoTaco commented on September 4, 2024

as mentioned, this is now fixed. thanks for reporting and pointing out the fix!

from libogc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.