SonicMastr / godot-vita

Godot Engine Vita Port based off of Stary2001 and EIREXE Contributions utilizing PVR_PSP2
https://godotengine.org
MIT License
251 stars 19 forks source link

Doesn't quite work on Mac #18

Closed Floki56 closed 1 year ago

Floki56 commented 2 years ago

I've double-checked to make sure I exported everything right, but it doesn't seem to quite work on mac yet. Whenever I try to install the vpk I get a invalid title ID error (0xF0030000 in vitashell), but the title ID has been formatted correctly. I tried manually placing a .pck into the gamedata folder like shown in the original release, game launched to a black screen and crashed shortly. Thank you so much for putting this much effort into the whole thing! It's been a dream of mine to be able to develop for vita, and this gets us all one step closer.

SonicMastr commented 2 years ago

Your Title ID is 9 characters and only contains capitalized alphanumeric characters, correct?

Floki56 commented 2 years ago

yes correct

SonicMastr commented 2 years ago

That error in vitashell is specifically an invalid Title ID error. I'd recommend a double check/change of the Title ID

Dracks commented 2 years ago

Hello,

I'm also a mac user, I'm trying to run (out of curisity) my project the-last-mission to run it on my vita, and I've got the same error oxF0030000 initially the title-id I've got was longer than the correct one, and I was getting a different error, in this case the instalation goes up to the end, but at last 1% throws this error.

(You can see my changes in this branch: feature/psvita-export)

If you wish, I can send to you the output of my godot

Dracks commented 1 year ago

I just tested with a linux computer, to export it and works fine (Same project, simply clone the psvita branch of my project) and it installs, after doesn't do anything... (Because this branch is not 100% fine) But installs

One interesting point, the one done with linux, has a lower size.

baiXfeng commented 1 year ago

I generated a vpk under mac, and got a similar error after installation. Then I compared the vpk generated under windows platform through the file comparison tool, and found that in the sce_sys/param.sfo file generated under mac platform, the setting of TITLEID was not correct. The vpk installation error should be caused by this reason, in order to see this problem intuitively, I have provided a screenshot, here @SonicMastr

baiXfeng commented 1 year ago

I may have found the cause of the problem. platform/vita/export/vita-mksfoex.cpp line 220.

    if ((entry = find_name("TITLE_ID"))) {
        if (sfo->title_id.length() != 9) {
            fprintf(stderr, "TITLE_ID must be 9 characters long\n");
            return 1;
        }
        entry->data = sfo->title_id.to_upper().utf8().get_data();
    }

    if ((entry = find_name("VERSION"))) {
        if (sfo->version.length() != 5 || sfo->version.find_char('.') != 2) {
            entry->data = "01.00"; // Default to 01.00 if invalid version
        } else {
            entry->data = sfo->version.utf8().get_data();
        }
    }

    if ((entry = find_name("PARENTAL_LEVEL"))) {
        if (sfo->parental_level < 0 || sfo->parental_level > 11) {
            entry->value = 0;
        } else {
            entry->value = sfo->parental_level;
        }
    }

    if (sfo->title.length() > 0) {
        g_title = sfo->title.utf8().get_data();
    }

sfo->title_id.to_upper().utf8() returns a temporary object, entry->data points to the address of a temporary object. The content pointed to by entry->data has changed before writing to the .sfo file.

SonicMastr commented 1 year ago

Thanks for this investigation (I have no way to actually properly test out the mac version)

If you don't mind, would you be able to create a macos build for yourself locally with your changes and make a PR? When I can get around to it, I'll test the windows and linux versions to see if they're OK as well. (3.5 branch though, I need to fix the exporter for 3.X)

baiXfeng commented 1 year ago

Ok, I'll try

baiXfeng commented 1 year ago

I submitted a pr that can fix this problem very well, I tested it on my mac system. pr