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

Switch: Change Applet handling #2698

Merged
merged 1 commit into from
Feb 17, 2022

Conversation

carstene1ns
Copy link
Member

  • Lock closing to allow cleanup
  • manually pause and resume on focus lost
  • do not check for docking/undocking anymore, use hook
  • log firmware version

Trying to fix the first issue from the forum post: https://community.easyrpg.org/t/easy-rpg-switch-port-0-7/1038

@carstene1ns carstene1ns added UX For issues affecting the user experience, such annoyances, counter-intuitive or ugly design Switch labels Nov 19, 2021
@carstene1ns carstene1ns added this to the 0.7.1 milestone Nov 19, 2021
@carstene1ns carstene1ns force-pushed the feature/switch-suspend branch 2 times, most recently from 2b89374 to b5c972c Compare November 19, 2021 00:53
@carstene1ns
Copy link
Member Author

Okay, got the report that at least one issue was fixed with this PR. Audio stutters when returning from home menu are gone (this does not really make sense though, see below).

The logfile shows 3 things to note here:

  • The gained focus event fires when starting the app 📉
  • The lost focus event does not fire at all 🤦
  • The logfile does not have a trailing linebreak 🙃
[2021-11-18 23:18:53] Debug: EasyRPG Player 0.7.0 (PR@b5c972ca, 2021-11-19) started
[2021-11-18 23:18:53] Debug: ======================================================
[2021-11-18 23:18:53] Debug: Clock: NxClock steady=true period=custom (1 / 19200000)
[2021-11-18 23:18:53] Debug: Seeded the RNG with 1637288330.
[2021-11-18 23:18:53] Debug: CLI: 
[2021-11-18 23:18:53] Debug: Running on Nintendo Switch (13.0.0 with Atmosphere)
//////
[2021-11-18 23:18:53] Debug: Gained Focus, resuming execution.
//////
[2021-11-18 23:18:53] Debug: Game and Save Directory:
[2021-11-18 23:18:53] Debug: 1: [Native]  -> sdmc:/switch/easyrpg-player/Zerras Adventure
[2021-11-18 23:18:54] Debug: Loading game Zerra´s  Adventure
[2021-11-18 23:18:54] Debug: Using RPG2k Interpreter
[2021-11-18 23:18:54] Debug: RM2k >= v.1.61 (English release) detected
[2021-11-18 23:18:54] Debug: Engine configured as: 2k=true 2k3=false MajorUpdated=true Eng=true
[2021-11-18 23:18:54] Debug: RTP path ./rtp/2000 is invalid, not adding
[2021-11-18 23:18:54] Debug: RTP path /switch/easyrpg-player/rtp/2000 is invalid, not adding
[2021-11-18 23:18:54] Debug: Patch configuration: dynrpg=false maniac=false
[2021-11-18 23:18:54] Debug: Cannot find: ./ExFont
[2021-11-18 23:18:54] Debug: Loading ExFont from RPG_RT.exe
[2021-11-18 23:18:57] Debug: EXEReader: EXFONT not found in dbase at 0x80f962d4
[2021-11-18 23:18:57] Debug: Actor 3: Removing item 24 (of type 6) from equipment slot 1 (needs type 1)
[2021-11-18 23:18:57] Debug: Actor 3: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:18:57] Debug: Actor 3: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:18:57] Debug: Actor 3: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:18:57] Debug: Actor 3: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:18:57] Debug: Actor 5: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:18:57] Debug: Actor 5: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:18:57] Debug: Actor 5: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:18:57] Debug: Actor 5: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:18:57] Debug: Actor 7: Removing item 487 (of type 0) from equipment slot 1 (needs type 1)
[2021-11-18 23:18:57] Debug: Actor 7: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:18:57] Debug: Actor 7: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:18:57] Debug: Actor 7: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:18:57] Debug: Actor 7: Removing item 80 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:18:57] Debug: Actor 10: Removing item 18 (of type 6) from equipment slot 1 (needs type 1)
[2021-11-18 23:18:57] Debug: Actor 10: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:18:57] Debug: Actor 10: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:18:57] Debug: Actor 13: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:18:57] Debug: Actor 13: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:18:57] Debug: Actor 13: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:18:57] Debug: Actor 13: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:18:57] Debug: Actor 17: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:18:57] Debug: Actor 17: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:18:57] Debug: Actor 17: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:18:57] Debug: Actor 21: Removing item 400 (of type 0) from equipment slot 1 (needs type 1)
[2021-11-18 23:18:57] Debug: Actor 22: Removing item 18 (of type 6) from equipment slot 2 (needs type 1)
[2021-11-18 23:18:57] Debug: Actor 22: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:18:57] Debug: Actor 22: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:18:57] Debug: Actor 22: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:19:02] Debug: Loading Save Save05.lsd
[2021-11-18 23:19:02] Debug: Savegame version 700 (EasyRPG Player 0.7.0)
[2021-11-18 23:19:02] Debug: Loaded Map Map0035.lmu
[2021-11-18 23:19:02] Debug: Tree: THE OTHER SIDE < IDEAS < MAPA PRINCIPAL
[2021-11-18 23:19:08] Debug: Loaded Map Map0027.lmu
[2021-11-18 23:19:08] Debug: Tree: ICE CAVE 4
[2021-11-18 23:19:13] Debug: Loaded Map Map0024.lmu
[2021-11-18 23:19:13] Debug: Tree: ICE CAVE 3
[2021-11-18 23:19:26] Debug: Loaded Map Map0027.lmu
[2021-11-18 23:19:26] Debug: Tree: ICE CAVE 4
[2021-11-18 23:19:30] Debug: Starting battle 102 (SNAKE X2 ICE CAVE): algos=(RPG_RT/RPG_RT)
[2021-11-18 23:20:44] Debug: Saving to Save05.lsd
[2021-11-18 23:21:44] Debug: Saving to Save05.lsd [2x]
[2021-11-18 23:21:44] Debug: Loaded Map Map0035.lmu
[2021-11-18 23:21:44] Debug: Tree: THE OTHER SIDE < IDEAS < MAPA PRINCIPAL
[2021-11-18 23:22:19] Debug: Saving to Save05.lsd
[2021-11-18 23:22:22] Warning: Got close request from home menu.
[2021-11-18 23:22:22] Debug: Actor 3: Removing item 24 (of type 6) from equipment slot 1 (needs type 1)
[2021-11-18 23:22:22] Debug: Actor 3: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:22:22] Debug: Actor 3: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:22:22] Debug: Actor 3: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:22:22] Debug: Actor 3: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:22:22] Debug: Actor 5: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:22:22] Debug: Actor 5: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:22:22] Debug: Actor 5: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:22:22] Debug: Actor 5: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:22:22] Debug: Actor 7: Removing item 487 (of type 0) from equipment slot 1 (needs type 1)
[2021-11-18 23:22:22] Debug: Actor 7: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:22:22] Debug: Actor 7: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:22:22] Debug: Actor 7: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:22:22] Debug: Actor 7: Removing item 80 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:22:22] Debug: Actor 10: Removing item 18 (of type 6) from equipment slot 1 (needs type 1)
[2021-11-18 23:22:22] Debug: Actor 10: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:22:22] Debug: Actor 10: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:22:22] Debug: Actor 13: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:22:22] Debug: Actor 13: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:22:22] Debug: Actor 13: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:22:22] Debug: Actor 13: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:22:22] Debug: Actor 17: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:22:22] Debug: Actor 17: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:22:22] Debug: Actor 17: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:22:22] Debug: Actor 21: Removing item 400 (of type 0) from equipment slot 1 (needs type 1)
[2021-11-18 23:22:22] Debug: Actor 22: Removing item 18 (of type 6) from equipment slot 2 (needs type 1)
[2021-11-18 23:22:22] Debug: Actor 22: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
///////
[2021-11-18 23:22:22] Debug: Actor 22: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)[2021-11-18 23:22:35] Debug: EasyRPG Player 0.7.0 (PR@b5c972ca, 2021-11-19) started
///////
[2021-11-18 23:22:35] Debug: ======================================================
[2021-11-18 23:22:35] Debug: Clock: NxClock steady=true period=custom (1 / 19200000)
[2021-11-18 23:22:35] Debug: Seeded the RNG with 1637288553.
[2021-11-18 23:22:35] Debug: CLI: 
[2021-11-18 23:22:35] Debug: Running on Nintendo Switch (13.0.0 with Atmosphere)
[2021-11-18 23:22:35] Debug: Gained Focus, resuming execution.
[2021-11-18 23:22:35] Debug: Game and Save Directory:
[2021-11-18 23:22:35] Debug: 1: [Native]  -> sdmc:/switch/easyrpg-player/Zerras Adventure
[2021-11-18 23:22:36] Debug: Loading game Zerra´s  Adventure
[2021-11-18 23:22:36] Debug: Using RPG2k Interpreter
[2021-11-18 23:22:36] Debug: RM2k >= v.1.61 (English release) detected
[2021-11-18 23:22:36] Debug: Engine configured as: 2k=true 2k3=false MajorUpdated=true Eng=true
[2021-11-18 23:22:36] Debug: RTP path ./rtp/2000 is invalid, not adding
[2021-11-18 23:22:36] Debug: RTP path /switch/easyrpg-player/rtp/2000 is invalid, not adding
[2021-11-18 23:22:36] Debug: Patch configuration: dynrpg=false maniac=false
[2021-11-18 23:22:36] Debug: Cannot find: ./ExFont
[2021-11-18 23:22:36] Debug: Loading ExFont from RPG_RT.exe
[2021-11-18 23:22:39] Debug: EXEReader: EXFONT not found in dbase at 0x80f962d4
[2021-11-18 23:22:39] Debug: Actor 3: Removing item 24 (of type 6) from equipment slot 1 (needs type 1)
[2021-11-18 23:22:39] Debug: Actor 3: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:22:39] Debug: Actor 3: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:22:39] Debug: Actor 3: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:22:39] Debug: Actor 3: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:22:39] Debug: Actor 5: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:22:39] Debug: Actor 5: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:22:39] Debug: Actor 5: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:22:39] Debug: Actor 5: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:22:39] Debug: Actor 7: Removing item 487 (of type 0) from equipment slot 1 (needs type 1)
[2021-11-18 23:22:39] Debug: Actor 7: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:22:39] Debug: Actor 7: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:22:39] Debug: Actor 7: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:22:39] Debug: Actor 7: Removing item 80 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:22:39] Debug: Actor 10: Removing item 18 (of type 6) from equipment slot 1 (needs type 1)
[2021-11-18 23:22:39] Debug: Actor 10: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:22:39] Debug: Actor 10: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:22:39] Debug: Actor 13: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:22:39] Debug: Actor 13: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:22:39] Debug: Actor 13: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:22:39] Debug: Actor 13: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:22:39] Debug: Actor 17: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:22:39] Debug: Actor 17: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:22:39] Debug: Actor 17: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:22:39] Debug: Actor 21: Removing item 400 (of type 0) from equipment slot 1 (needs type 1)
[2021-11-18 23:22:39] Debug: Actor 22: Removing item 18 (of type 6) from equipment slot 2 (needs type 1)
[2021-11-18 23:22:39] Debug: Actor 22: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:22:39] Debug: Actor 22: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:22:39] Debug: Actor 22: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:22:42] Debug: Loading Save Save05.lsd
[2021-11-18 23:22:43] Debug: Savegame version 700 (EasyRPG Player 0.7.0)
[2021-11-18 23:22:43] Debug: Loaded Map Map0035.lmu
[2021-11-18 23:22:43] Debug: Tree: THE OTHER SIDE < IDEAS < MAPA PRINCIPAL
[2021-11-18 23:23:15] Debug: Switched from handheld to docked mode.
[2021-11-18 23:24:18] Debug: Loaded Map Map0027.lmu
[2021-11-18 23:24:18] Debug: Tree: ICE CAVE 4
[2021-11-18 23:24:33] Debug: Starting battle 104 (SNAKE X2 + LLAMA): algos=(RPG_RT/RPG_RT)
[2021-11-18 23:25:33] Debug: Saving to Save05.lsd
[2021-11-18 23:25:42] Debug: Switched from docked to handheld mode.
[2021-11-18 23:26:56] Debug: Switched from handheld to docked mode.
[2021-11-18 23:27:25] Debug: Switched from docked to handheld mode.
[2021-11-18 23:27:48] Warning: Got close request from home menu.
[2021-11-18 23:27:48] Debug: Actor 3: Removing item 24 (of type 6) from equipment slot 1 (needs type 1)
[2021-11-18 23:27:48] Debug: Actor 3: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:27:48] Debug: Actor 3: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:27:48] Debug: Actor 3: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:27:48] Debug: Actor 3: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:27:48] Debug: Actor 5: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:27:48] Debug: Actor 5: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:27:48] Debug: Actor 5: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:27:48] Debug: Actor 5: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:27:48] Debug: Actor 7: Removing item 487 (of type 0) from equipment slot 1 (needs type 1)
[2021-11-18 23:27:48] Debug: Actor 7: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:27:48] Debug: Actor 7: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:27:48] Debug: Actor 7: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:27:48] Debug: Actor 7: Removing item 80 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:27:48] Debug: Actor 10: Removing item 18 (of type 6) from equipment slot 1 (needs type 1)
[2021-11-18 23:27:48] Debug: Actor 10: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)
[2021-11-18 23:27:48] Debug: Actor 10: Removing item 76 (of type 0) from equipment slot 5 (needs type 5)
[2021-11-18 23:27:48] Debug: Actor 13: Removing item 44 (of type 8) from equipment slot 2 (needs type 2)
[2021-11-18 23:27:48] Debug: Actor 13: Removing item 53 (of type 0) from equipment slot 3 (needs type 3)
[2021-11-18 23:27:48] Debug: Actor 13: Removing item 67 (of type 0) from equipment slot 4 (needs type 4)

@Ghabry
Copy link
Member

Ghabry commented Nov 25, 2021

@carstene1ns
Do you consider the current state mergeable? At least it still works ^^

- Lock closing to allow cleanup
- manually pause and resume on focus lost/standby
- do not check for docking/undocking anymore, use hook
- log firmware version
@carstene1ns carstene1ns force-pushed the feature/switch-suspend branch from b5c972c to db803f1 Compare November 29, 2021 20:29
@carstene1ns
Copy link
Member Author

Fixed the event firing. Properly goes to standby now as well, however the audio issues persist.
I am considering to write a dedicated audio driver with hardware mixing (using audren).

@Ghabry Ghabry merged commit c0bfaf5 into EasyRPG:master Feb 17, 2022
@carstene1ns carstene1ns deleted the feature/switch-suspend branch February 17, 2022 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Switch UX For issues affecting the user experience, such annoyances, counter-intuitive or ugly design
Development

Successfully merging this pull request may close these issues.

3 participants