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

am/gui: Implement Wake-up message #1750

Merged
merged 4 commits into from
Dec 16, 2020
Merged

am/gui: Implement Wake-up message #1750

merged 4 commits into from
Dec 16, 2020

Conversation

AcK77
Copy link
Member

@AcK77 AcK77 commented Nov 24, 2020

This implement the ability to send a Wake-up (Resume) message to the guest.
Some games needs to sleep and wake-up the switch to unlock some ingame features, we now supports that.
I've cleaned up the AppletState class and ICommonStateGetter::ReceiveMessage call is implemented accordingly to RE.

(Thanks to Ryushu on Discord for helping me to reproduce the issue)

Oa3VOPXLj4

@AcK77 AcK77 added enhancement New feature or request gui Related to Ryujinx.Ui service-implementation Related to a service implementation service:am Related to the am module (Ryujinx.HLE.HOS.Services.Am) labels Nov 24, 2020
Copy link
Member

@riperiperi riperiperi left a comment

Choose a reason for hiding this comment

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

The UI stuff is good, I'm not sure about the change to enqueueing messages.

AppletState.EnqueueMessage(MessageInfo.Resume);

Definitely seems nicer than:

            AppletState.Messages.Enqueue(MessageInfo.Resume);
            AppletState.MessageEvent.ReadableEvent.Signal();

EnqueueMessage(MessageInfo.FocusStateChanged);
}

public void EnqueueMessage(MessageInfo message)
Copy link
Member

Choose a reason for hiding this comment

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

Why have these been moved out of this class? Surely signalling the event after each enqueue is desirable, and easier to do if you only have to use one line to do it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Because AM service signal the event if messages left in the buffer (checked by RE).
We currently do that outside of the AM service which is wrong. That’s why I’ve moved the logic in the service call and remove unused methods.

This implement the ability to send a Wake-up (Resume) message to the guest.
Sometime games needs to Sleep and Wake-up the switch to unlock some ingame features.
Copy link
Member

@gdkchan gdkchan left a comment

Choose a reason for hiding this comment

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

lgtm, thanks.

@gdkchan gdkchan merged commit 8083806 into Ryujinx:master Dec 16, 2020
@AcK77 AcK77 deleted the wake-up branch April 21, 2021 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request gui Related to Ryujinx.Ui service:am Related to the am module (Ryujinx.HLE.HOS.Services.Am) service-implementation Related to a service implementation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants