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

VITA: add ability to invoke app with game path provided via boot parameter #2789

Merged
merged 2 commits into from May 25, 2022

Conversation

cy33hc
Copy link
Contributor

@cy33hc cy33hc commented May 22, 2022

I'm the author of the Vita homebrew app called Vita-Launcher (https://github.com/cy33hc/vita-launcher). I want to add support for booting EastRPG games directly from my app. This requires some changes in EasyRPG to read the boot params passed from my app to start the game.

Let me know if you have any questions.

And before my change, the psvita build is crashing on startup. 0.7.0-stable is working fine.

@Ghabry
Copy link
Member

Ghabry commented May 22, 2022

@cy33hc
Thank you for your contribution!

So the sceAppMgrGetAppParam are not provided as argc/argv by the startup code. That is unfortunate. As a follow-up to #2781 the new psp2_main.cpp could transform them. They are in normal URI-format so shouldn't be too hard. But as a short-term solution your contribution is fine.

@cy33hc
Copy link
Contributor Author

cy33hc commented May 22, 2022

Thx @Ghabry for reviewing. I also found the commit #8de4c7d3344f82449d61e6b7ac505cc3e6cbe6eb broke the psvita build. I spent an hour building backward and found this commit.

@Ghabry
Copy link
Member

Ghabry commented May 22, 2022

@cy33hc
Thanks!

I also found an additional issue causing the breakage: We built vita2dlib on our buildbot incorrectly.

So in a few days everything should run again :D

@cy33hc
Copy link
Contributor Author

cy33hc commented May 22, 2022

@cy33hc Thanks!

I also found an additional issue causing the breakage: We built vita2dlib on our buildbot incorrectly.

So in a few days everything should run again :D

I don't think it's broken by vita2dlib. I reverted commit 8de4c7d in a branch and it works perfectly fine.

@carstene1ns
Copy link
Member

What he meant was that our official build is broken in 2 ways. 😅

@Ghabry
Copy link
Member

Ghabry commented May 23, 2022

What he meant was that our official build is broken in 2 ways.

Yeah but Vita3k only cares about the vita2dlib one.

I cannot revert the commit because empty string is actually used for the working directory (converted to . in the platform class) and in ZIP files for the root. But by now I'm pretty sure why this code is crashing for you. I will add a fix to #2787

Copy link
Member

@Ghabry Ghabry left a comment

Choose a reason for hiding this comment

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

looks fine to me.

Any improvements to the parser can land in #2781

@Ghabry Ghabry added this to the 0.7.1 milestone May 23, 2022
@Ghabry Ghabry added the PSVita label May 23, 2022
@Ghabry
Copy link
Member

Ghabry commented May 23, 2022

@cy33hc Could you test if the latest source from master fixes the crash for you? (Without reverting #8de4c7d3344f82449d61e6b7ac505cc3e6cbe6e)

And please compile yourself, our buildbot-version is still broken. :)

@cy33hc
Copy link
Contributor Author

cy33hc commented May 23, 2022

@Ghabry Compiled from master and it is still crashing on startup. How to enable debug and where does the file get created?. I can try do a debug build to grab the logs.

@fdelapena fdelapena added Needs feedback Waiting for the issue author to give further information. and removed Needs feedback Waiting for the issue author to give further information. labels May 23, 2022
@Ghabry
Copy link
Member

Ghabry commented May 24, 2022

@cy33hc Thanks for the offer to help. Please update master again. Now everything should be in that was related to Vita (except your PR). A debug build is not really needed. The logging also works in Release.

Then here https://github.com/EasyRPG/Player/blob/master/src/directory_tree.cpp#L26 Remove the comment before #define EP_DEBUG_DIRECTORYTREE.

Then the error logging will be much more verbose.

If the logfile is not being created (should appear in ux0:/data/easyrpg-player you can try hardcoding a different path here: https://github.com/EasyRPG/Player/blob/master/src/output.cpp#L85

Change this e.g. to FileFinder::Root().OpenOutputStream("ux0:/data/easyrpg.log", std::ios_base::out | std::ios_base::app);. Then the logfile is created in ux0:/data.

@fdelapena fdelapena added the Needs feedback Waiting for the issue author to give further information. label May 24, 2022
@cy33hc
Copy link
Contributor Author

cy33hc commented May 25, 2022

@Ghabry It's fails to compile now. Getting the following error message. It seems like the vita2dlib has some hardcoded references to the shaders that were removed.

libvita2d/source/vita2d.c:362: undefined reference to `opaque_v'

@carstene1ns
Copy link
Member

You need upstream libvita2d, not fbo-patched version.
EasyRPG/buildscripts#129

@cy33hc
Copy link
Contributor Author

cy33hc commented May 25, 2022

@Ghabry Great. I recompile from master with libvita2d lib and no more crashes.

@fdelapena fdelapena removed the Needs feedback Waiting for the issue author to give further information. label May 25, 2022
// Check if app is invoked with an externalized game path
char boot_params[1024];
sceAppMgrGetAppParam(boot_params);
if (strstr(boot_params,"psgm:play") && strstr(boot_params, "&project_path=")) {
Copy link
Member

Choose a reason for hiding this comment

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

One minor thing, please use 'project-path' (with hyphen) for consistency with our official arguments.

…meter

update project_path to project-path for consistency
@cy33hc
Copy link
Contributor Author

cy33hc commented May 25, 2022

@Ghabry @carstene1ns Updated project_path to project-path.

@carstene1ns
Copy link
Member

Thank you! :)

@carstene1ns carstene1ns merged commit a8036d0 into EasyRPG:master May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

4 participants