HLE: Return LastUrl for Web/Offline BrowserApplet exit reason
What this does
Changes the BrowserApplet to return LastUrl instead of ExitButton when the shim type is Web or Offline.
Why
While testing Ni no Kuni, the game would get stuck in an infinite loop on the title screen video on a fresh boot.
After investigating, I found that the game invokes the BrowserApplet (likely for Terms of Service) and checks the applet exit reason to determine whether navigation completed successfully.
Currently, the stub always returns ExitButton, which causes the game to believe the flow was cancelled.
If a save file already exists, the game skips this check and proceeds normally, which is why the issue only happens on a clean start.
Since Ryujinx does not implement the full behavior of the Switch Web Applet, accurately emulating the complete web-based flow would be significantly complex and likely out of scope for this applet at the moment. Returning LastUrl for Web and Offline shim types better represents a successful navigation from the game's perspective and allows the title to proceed as expected.
Other shim types (Shop, Login, Share, etc.) are left unchanged and still return ExitButton.
Testing
-
Ni no Kuni
- Before: game stuck in an infinite loop on first boot
- After: game boots correctly without requiring a pre-existing save file
Demo
Two short videos showing the behavior before and after this change:
- Before: infinite loop on the title screen
- before.mp4
- After: normal boot flow after the applet exits
- after.mp4
Notes
This is my first contribution to an emulator project, so please let me know if you'd like any adjustments or additional testing. The change is intentionally limited in scope to reduce the risk of affecting other titles.