obhq / obliteration

Experimental free and open-source PlayStation 4 kernel
https://obliteration.net
Apache License 2.0
619 stars 17 forks source link

Allow installation of update PKGs. #283

Closed VocalFan closed 9 months ago

VocalFan commented 1 year ago

So, I made fPKGs of the disk copy that I have of Tom Clancy The Division along with the patch. I installed the Base PKG, then I went to install the Patch PKG, but it seems that we don't check if a PKG is a patch yet seeing as I just get

image

Maybe we can check metadata or file names? Base name: UP0001-CUSA01810_00-THEDIVISION00001-A0100-V0100.pkg Update name: UP0001-CUSA01810_00-THEDIVISION00001-A0121-V0100.pkg

ultimaweapon commented 1 year ago

There should be some data in the PKG to tell if it is a patch or base package.

VocalFan commented 1 year ago

Most likely.

We could check for the file sce_discmap_patch.plt and see if it's in the PKG, or somehow try to check the header bytes.

Could be kinda cool if we read the latest changeinfo.xml haha

ultimaweapon commented 1 year ago

The PKG header is better if possible.

VocalFan commented 1 year ago

The PKG header is better if possible.

I know the PS3 has this, I'll check around the PS4 header documentation and ask around as well.

VocalFan commented 1 year ago

So, seems we'll have to check for the file sce_discmap_patch.plt at the base of the PKG. Base Apps and Patches have the same content type value.

CONTENT_TYPE_GD = 0x1A, /* pkg_ps4_app, pkg_ps4_patch, pkg_ps4_remaster */
ultimaweapon commented 1 year ago

Have you checked all of the header fields?

VocalFan commented 1 year ago

Have you checked all of the header fields?

Might've found one? Content_Flags 0x78

#       define PKG_CONTENT_FLAGS_FIRST_PATCH      0x00100000
#       define PKG_CONTENT_FLAGS_REMASTER         0x00400000
#       define PKG_CONTENT_FLAGS_SUBSEQUENT_PATCH 0x40000000
#       define PKG_CONTENT_FLAGS_DELTA_PATCH      0x41000000
#       define PKG_CONTENT_FLAGS_CUMULATIVE_PATCH 0x60000000
ultimaweapon commented 1 year ago

Okay. Our next problem is: which one? because there are 4 of it. Can you diff the header of the packages to see the differences?

BTW where did you get those flags?

VocalFan commented 1 year ago

Okay. Our next problem is: which one? because there are 4 of it. Can you diff the header of the packages to see the differences?

BTW where did you get those flags?

The PKG PFS TOOL.

Though I've looked around and... The way the PS4 does it? It checks the Param.SFO file.

Parameter: CATEGORY

Seems we have to check for the value gd for the base game, and gp for the update files.

https://www.psdevwiki.com/ps4/Param.sfo#CATEGORY

ultimaweapon commented 1 year ago

The PKG PFS TOOL.

What is it license? For the PKG handling library we can incorporate source from almost any license, except the one that no license is specified.

The way the PS4 does it? It checks the Param.SFO file.

How did you know the PS4 check this file?

VocalFan commented 1 year ago
  1. No license on the repo

  2. Uh, my source is the creator of Orbis Patcher and Prospero Patcher, 0x199, which is also the owner of the SCE PS4/PS5 Discord server for modding PS4 and PS5s.

ultimaweapon commented 1 year ago

No license on the repo

Okay then we can't incorporate it sources. You need to careful on this because most of our sources using MIT license, which mean it cannot incorporate sources from most of the other emulators because most of them use GPL.

Uh, my source is the creator of Orbis Patcher and Prospero Patcher, 0x199, which is also the owner of the SCE PS4/PS5 Discord server for modding PS4 and PS5s.

Okay looking good.

VocalFan commented 1 year ago

Lol, yeah, when the leader of the PS4 modding group says so, good to assume that it's true haha

VocalFan commented 1 year ago

But yeah, seems Param.sfo is where the PS4 gets most of its information from.

VocalFan commented 9 months ago

image

VocalFan commented 9 months ago
Application Title   : Detroit: Become Human™
Application ID      : CUSA08344
Application Category: gd
Application Version : 01.00

Before update ^

image Installing update...

image

Application Title   : Detroit: Become Human™
Application ID      : CUSA08344
Application Category: gp
Application Version : 01.08

After update ^

VocalFan commented 9 months ago

I'll make a PR once I get DLC functional as well.

VocalFan commented 9 months ago

@ultimaweapon Realized I'm doing this wrong uh we're supposed to have 3 folders.

/user/app /user/appcont (dlc) /user/patch (Update/Patch)

...And yet our one "/user/app" folder which holds the emulator's games... We don't even have a root folder to put the appcont or patch into seeing as games are put on the exact root of gamePath.

VocalFan commented 9 months ago

Current solution: make it so we have an ADDCONT and PATCH folder in the specific game's folder.

VocalFan commented 9 months ago

@ultimaweapon Just double checking with ya, how should I do this?

ultimaweapon commented 9 months ago

Better to use suffix on a directory name and keep it in the games folder.

VocalFan commented 9 months ago

Better to use suffix on a directory name and keep it in the games folder.

So, the idea I posted of ADDCONT and PATCH being folders in the game folder?

ultimaweapon commented 9 months ago

Nope. I mean something like CUSA12455-patch0 if the game folder is CUSA12455.