HLE: Return LastUrl for Web/Offline BrowserApplet exit reason

Fixes infinite loop on title screen for Ni no Kuni when no save file exists.
This commit is contained in:
Digote
2026-01-18 10:23:51 -03:00
committed by GreemDev
parent 1260f93aaf
commit 7a11fc3e2a

View File

@@ -38,11 +38,17 @@ namespace Ryujinx.HLE.HOS.Applets.Browser
Logger.Stub?.PrintStub(LogClass.ServiceAm, $"{argument.Type}: {argument.GetValue()}"); Logger.Stub?.PrintStub(LogClass.ServiceAm, $"{argument.Type}: {argument.GetValue()}");
} }
// Web and Offline browser applets use LastUrl as the completion result.
// Non-navigation shims (Shop, Login, Share, etc.) do not depend on navigation state and expect ExitButton.
WebExitReason exitReason = (_shimKind == ShimKind.Web || _shimKind == ShimKind.Offline)
? WebExitReason.LastUrl
: WebExitReason.ExitButton;
if ((_commonArguments.AppletVersion >= 0x80000 && _shimKind == ShimKind.Web) || (_commonArguments.AppletVersion >= 0x30000 && _shimKind == ShimKind.Share)) if ((_commonArguments.AppletVersion >= 0x80000 && _shimKind == ShimKind.Web) || (_commonArguments.AppletVersion >= 0x30000 && _shimKind == ShimKind.Share))
{ {
List<BrowserOutput> result = List<BrowserOutput> result =
[ [
new(BrowserOutputType.ExitReason, (uint)WebExitReason.ExitButton) new(BrowserOutputType.ExitReason, (uint)exitReason)
]; ];
_normalSession.Push(BuildResponseNew(result)); _normalSession.Push(BuildResponseNew(result));
@@ -51,7 +57,7 @@ namespace Ryujinx.HLE.HOS.Applets.Browser
{ {
WebCommonReturnValue result = new() WebCommonReturnValue result = new()
{ {
ExitReason = WebExitReason.ExitButton, ExitReason = exitReason,
}; };
_normalSession.Push(BuildResponseOld(result)); _normalSession.Push(BuildResponseOld(result));