Skip to content

Improve sceGuSignal usage #306

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

fjtrujy
Copy link
Member

@fjtrujy fjtrujy commented Jun 20, 2025

Description

This PR improves the function definition of sceGuSignal and sceGuCallMode, having now better-named parameters and a better description too.
Additionally, I have fixed the usage in the examples that PSPSDK has.

@fjtrujy fjtrujy requested a review from sharkwouter June 20, 2025 14:31
@@ -15,7 +15,7 @@ int sceGuCallList(const void *list)

if (gu_call_mode == GU_CALL_SIGNAL)
{
sendCommandi(SIGNAL, (list_addr >> 16) | 0x110000);
sendCommandi(SIGNAL, (0x11 << 16) | (list_addr >> 16));
Copy link
Contributor

Choose a reason for hiding this comment

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

I like the old syntax (list_addr >> 16) | 0x110000 as it's clearer to me, but it's probably just my personal preference.

Copy link
Member Author

Choose a reason for hiding this comment

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

Same here… 0x11 is an specific command

@@ -33,7 +33,7 @@ int sceGuFinishId(unsigned int id)
case GU_CALL:
if (gu_call_mode == GU_CALL_SIGNAL)
{
sendCommandi(SIGNAL, 0x120000);
sendCommandi(SIGNAL, 0x12 << 16);
Copy link
Contributor

Choose a reason for hiding this comment

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

same here, I'd keep 0x120000 (personal preference)

Copy link
Member Author

Choose a reason for hiding this comment

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

The reason why I split it is because 0x12 is actually part of a GE command when SIGNAL CMD is used.

@@ -324,10 +324,6 @@ extern "C" {
#define GU_CALLBACK_SIGNAL (1)
#define GU_CALLBACK_FINISH (4)

/* Signal behavior */
#define GU_BEHAVIOR_SUSPEND (1)
Copy link
Member

Choose a reason for hiding this comment

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

Maybe instead of removing these 2 values we could add to the documentation that they are deprecated and should not be used. I think this might break existing code.

Copy link
Member Author

Choose a reason for hiding this comment

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

IMO is not worthy, this is why we introduced the versioning…

Copy link
Member

Choose a reason for hiding this comment

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

Is there a way we could cause a custom compile error when the old value is used?

Copy link
Member

Choose a reason for hiding this comment

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

I do see why you'd want to take it out, because it is confusing. My main issue is that if you try to compile code that uses one of these values, you'll get an error that does not help you to get your code to compile. I don't know how you'd find out that the original value was 1 or 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants