PSP-Archive / ARK-4

Custom Firmware for the PSP and PS Vita.
607 stars 41 forks source link

Custom launcher exit game hotkey not working if using HUD plugin (very minor issue) #268

Closed pmsobrado closed 6 months ago

pmsobrado commented 10 months ago

PSP/Vita Model

PCH-2000 (Vita Slim)

ARK Version

4.20.65 Rev 5

Homebrew/GAME (if applicable)

Any

Plugins ( if applicable )

"game, ms0:/seplugins/hud.prx, on"

Steps to reproduce

  1. Launch game with HUD plugin enabled.
  2. Try to exit to launcher.

It is a minor and unimportant bug, but I though I could ask here. This is the plugin: https://www.gamebrew.org/wiki/PSP_Hud

This only happens with the custom launcher (since the hotkey I'm trying is from and for the custom luncher, duh!). I guess the plugin captures all buttons first or something like that. It doesn't matter if configured keys on the plugin are not any of the ones of the hotkeys.

USB Charge

Disabled

Overclock

Disabled

Power Save

Disabled

Balanced Energy Mode

Disabled

Autoboot Launcher

Off

Disable PSP Go Pause

Off

Unlock Extra Memory

Disabled

Memory Stick Speedup

Disabled

Inferno Cache

Off

Skip Sony Logos

Off

Hide PIC0 and PIC1

Off

Hide MAC Address

Off

Hide DLC

Off

Turn off LEDs

Disabled

Verification of form.

krazynez commented 10 months ago

Screenshot_20231019-063023

Custom Launcher shortcut doesn't use select?

pmsobrado commented 10 months ago

You're using XMB, I mean, when in custom launcher, try to exit a game back to the gustom launcher with HUD plugin activated for game (doesn't need to be showed).

krazynez commented 10 months ago

I am not using anything that is a screenshot of gamebrew 😂 (for what controls HUD uses) I will test in a bit though.

pmsobrado commented 10 months ago

Don't look at it too much, it's a silly bug :)

pmsobrado commented 10 months ago

In any case, it doesn't matter if the plugin is using different keys/buttons. That's the weird part. The plugin must be capturing the keys somehow or whatever. Although, now that I think of it, I can use HUD and cwcheat at the same time...

krazynez commented 10 months ago

Indeed it does how interesting.

pmsobrado commented 10 months ago

Haha now you're curious about it!

JoseAaronLopezGarcia commented 10 months ago

I got it.

pmsobrado commented 10 months ago

You mean the cause?

krazynez commented 10 months ago

You mean the cause?

No he as a solution to fix it.

JoseAaronLopezGarcia commented 10 months ago

I mean I got it fixed. But my dumb ass pushed the fix to another branch that isn't main so there won't be a pre-release for now.

You can install this update for now. UPDATE.zip

pmsobrado commented 10 months ago

@JoseAaronLopezGarcia Can I use that update for standalone and Adrenaline versions of ARK? Will the "plugins per homebrew" build I'm using keep that change?

krazynez commented 10 months ago

rev 5 has those fixes you should be fine.

pmsobrado commented 10 months ago

@JoseAaronLopezGarcia I don't think it is on rev 5, that one is from two weeks ago and I'm talking about this:

https://github.com/PSP-Archive/ARK-4/issues/260

Thanks!

pmsobrado commented 10 months ago

@JoseAaronLopezGarcia Hi, is this fix available on latest Version 4.20.66 Rev 2 release? Thanks!

JoseAaronLopezGarcia commented 10 months ago

Yes, it should be fixed on latest release.

pmsobrado commented 10 months ago

Great news, thanks!

pmsobrado commented 9 months ago

I'm testing on latest 4.20.66 version and it is not fixed :(

EDIT

Actually, with HUD disabled, I'm getting a C1-2858-3 error when trying to exit a game and I have to restart my Vita.

EDIT 2

Confirmed working and no crash with this version https://github.com/PSP-Archive/ARK-4/releases/tag/v1697454709 (this one does not exit with HUD enabled, of course).

Looks like, at least for me, something may have broken when trying to fix the hotkey functionality with the HUD plugin enabled :(

pmsobrado commented 9 months ago

@JoseAaronLopezGarcia should we reopen this issue for further testing?

krazynez commented 9 months ago

I will yeah this also correlates with another recent issue as well it seems. https://github.com/PSP-Archive/ARK-4/issues/277

pmsobrado commented 9 months ago

Never used CFE, but, seems like there's a crash when exiting launcher, maybe is not directly related to this issue, but it's definitely affecting it.

krazynez commented 9 months ago

Never used CFE, but, seems like there's a crash when exiting launcher, maybe is not directly related to this issue, but it's definitely affecting it.

Yeah seems to be a similar issue is what I was getting at with exiting launcher. I tested yesterday, if I launch a game from Custom Launcher then use the Exit hotkeys, then exit the Launcher it works fine. But Custom Launcher then Exit will crash.

pmsobrado commented 9 months ago

Any news on this? Thanks.

pmsobrado commented 6 months ago

Is this fixed on latest release?

JoseAaronLopezGarcia commented 6 months ago

No idea. Try it out and report back.

pmsobrado commented 6 months ago

Yep, seems to be even more broken, I just opened another issue:

https://github.com/PSP-Archive/ARK-4/issues/301

Thanks!

EDIT

Is is not more broken, it is better than last update before the current one where the hotkey to go back to launcher didn't work. It works now, but not with HUD plugin enabled, so this issue remains the same as when the issue was opened.

JoseAaronLopezGarcia commented 6 months ago

Looking into it.

pmsobrado commented 6 months ago

@JoseAaronLopezGarcia any way to disable certain plugin only on standalone launcher?

JoseAaronLopezGarcia commented 6 months ago

yes, you can use the "launcher" keyword for settings/plugins that affect only the launcher, letting you enable/disable only for it. Simply write something like this anywhere after the line that enables the plugin:

launcher, ms0:/seplugins/myplugin.prx, off

I should probably add Launcher as an option when installing plugins, but for now I'm trying to figure out this one issue.

pmsobrado commented 6 months ago

Cool, thanks.

EDIT

Seems like the plugin making my system crash is "cwcheat.prx", so I will skip it for launcher :)

JoseAaronLopezGarcia commented 6 months ago

Got it working: https://github.com/PSP-Archive/ARK-4/releases/tag/v1707075722

This was a tough one, I had to slightly redo the way ARK applies the control patches so it was done first (easy), but then it kept crashing when trying to exit (this didn't happen with the HUD plugin disabled). So I had to add some code to terminate the main thread of the HUD plugin before exiting, this fixes it and it's all good now.

Let me know if it works fine and all.

pmsobrado commented 6 months ago

Trying it now...

EDIT

I'm getting an error, let me try without plugins...

JoseAaronLopezGarcia commented 6 months ago

I just found a much better fix for it. The real cause of the issue was that HUD plugin creates a thread that polls the controller, and the game itself is also polling the controller, which made more than one thread attempt to exit and that caused a crash. The new implementation doesn't patch the HUD plugin anymore, instead it implements detection of the exit thread already being executed, thus no more than one exit thread can run at the same time. This fix should be much better as it should also fix any other test case where this might happen (i.e. any other plugin or homebrew). You can find the new fix here: https://github.com/PSP-Archive/ARK-4/releases/tag/v1707077210

pmsobrado commented 6 months ago

That one works, the other did not, so mission accomplish I guess! Thanks!

Will this fix be included on the next release and onwards?

EDIT

I'm testing these new features:

1 - Added ability to force open VSH Menu by pressing L+R+Select anywhere in the XMB. 2 - You can now boot Custom Launcher in Recovery mode by holding R Trigger when it is loading.

My results:

1 - It does not work when HUD is active and with the same keys, but seems to work if I remap HUD to other keys. 2 - Same as 1, but is this new "Classic Recovery" accessed from Custom Launcher by holding R on boot a screen with the options overclock, powersave, balanced energy mode, memstick speedup, and inferno cache? Because I'm not sure if thats the new thing or I'm accessing something else hehe.

JoseAaronLopezGarcia commented 6 months ago

Rev 7 is now live as the main release.

As for those features:

1- HUD will do whatever patches, so it's normal that they conflict. This is a weird conflict indeed, but thankfully not that big of a deal.

2- ARK-4 used to have a recovery menu that was essentially a stripped down Custom Launcher, eventually we made the Classic Recovery Menu that is more akin to what you'd find in M33/PRO/ME/etc, to reduce that much redundancy we just merged the recovery menu into the custom launcher and kept the classic one as the standard. So bring back the original Recovery Menu you can now boot up the Custom Launcher, and hold the R button when you see the spinning wheel (launcher booting up).

pmsobrado commented 6 months ago

I will download Rev 7 again, thanks.

As for the explanations, thanks very much. I guess that's the small menu I'm seeing, with those few options. Wait, isn't those options the same as "Normal boot -> CFW options"?

JoseAaronLopezGarcia commented 6 months ago

Yeah, the Recovery Menu is basically there to handle CFW Settings, Plugins and File Browser. Basically the bare minimum needed to fix any issue.

pmsobrado commented 6 months ago

Thanks for all the work!