feat(libs): implement sceGameUpdateGetAddcontLatestVersion #704

Merged
adriadam10 merged 1 commit from upstream-pr/704 into main 2026-10-05 23:46:00 +00:00
adriadam10 commented 2026-10-05 17:19:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-05T17:19:14Z.


What

Implements sceGameUpdateGetAddcontLatestVersion (libSceGameUpdate), which was the last throwing export of the library. No update server is reachable, so it reports no newer add-on version (found = false).

Behaviour follows KytyPS5 (libNet.cpp, GameUpdateGetAddcontLatestVersion); prosper (hle_service.cpp) agrees on the codes and on found = false:

  • not initialized → 0x80412801. sceGameUpdateInitialize/Terminate now set and clear the initialized state; their return values are unchanged.
  • null info → 0x80412803.
  • info->size below sizeof(GameUpdateAddcontVersionInfo) (0x30) → 0x80412804 (KytyPS5; prosper doesn't check the size).
  • success: the struct is zeroed except size, found = false.

Where the references disagree:

  • null entitlement_label: KytyPS5 accepts it, prosper returns 0x80412803. It throws here, and the gap is listed in TechnicalDebt "Unknown function info".
  • bytes after found: KytyPS5 zeroes them, prosper leaves them untouched. This follows KytyPS5 (the primary reference), also noted in TechnicalDebt.

The layout is the existing GameUpdateAddcontVersionInfo in SceTypes.hpp, which matches KytyPS5's.

Tested

Linux, GCC Release build. New guest_gameupdate test (core/libs/tests/GuestGameUpdate.cpp, registered in the library's new CMakeLists.txt, PlayGo pattern including the MinGW block). It covers the not-initialized error before Initialize and after Terminate, null info, a short size, the throw on a null label, and the success fill (size preserved, every other byte zero). It fails on main, where the stub throws. Each check fails when its piece is removed (init/terminate state, null check, size check, zero fill, label throw). ctest -R guest_ passes, 96/96.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4748496957 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/704). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-05T17:19:14Z. --- ### What Implements `sceGameUpdateGetAddcontLatestVersion` (libSceGameUpdate), which was the last throwing export of the library. No update server is reachable, so it reports no newer add-on version (`found = false`). Behaviour follows KytyPS5 (`libNet.cpp`, `GameUpdateGetAddcontLatestVersion`); prosper (`hle_service.cpp`) agrees on the codes and on `found = false`: - not initialized → `0x80412801`. `sceGameUpdateInitialize`/`Terminate` now set and clear the initialized state; their return values are unchanged. - null `info` → `0x80412803`. - `info->size` below `sizeof(GameUpdateAddcontVersionInfo)` (0x30) → `0x80412804` (KytyPS5; prosper doesn't check the size). - success: the struct is zeroed except `size`, `found = false`. Where the references disagree: - null `entitlement_label`: KytyPS5 accepts it, prosper returns `0x80412803`. It throws here, and the gap is listed in TechnicalDebt "Unknown function info". - bytes after `found`: KytyPS5 zeroes them, prosper leaves them untouched. This follows KytyPS5 (the primary reference), also noted in TechnicalDebt. The layout is the existing `GameUpdateAddcontVersionInfo` in `SceTypes.hpp`, which matches KytyPS5's. ### Tested Linux, GCC Release build. New `guest_gameupdate` test (`core/libs/tests/GuestGameUpdate.cpp`, registered in the library's new `CMakeLists.txt`, PlayGo pattern including the MinGW block). It covers the not-initialized error before Initialize and after Terminate, null `info`, a short `size`, the throw on a null label, and the success fill (`size` preserved, every other byte zero). It fails on `main`, where the stub throws. Each check fails when its piece is removed (init/terminate state, null check, size check, zero fill, label throw). `ctest -R guest_` passes, 96/96. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
oneandonlydean commented 2026-10-05 20:30:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T20:30:05Z.


This needs a rebase now: docs/dev/TechnicalDebt.md conflicts with current main. #703 removed the sceNpTrophy2UnregisterUnlockCallback line next to your new sceGameUpdateGetAddcontLatestVersion line, so the resolution is to keep your line and leave that one out. Nothing else conflicts.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6002363890 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/704#issuecomment-6002363890). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-05T20:30:05Z. --- This needs a rebase now: `docs/dev/TechnicalDebt.md` conflicts with current `main`. #703 removed the `sceNpTrophy2UnregisterUnlockCallback` line next to your new `sceGameUpdateGetAddcontLatestVersion` line, so the resolution is to keep your line and leave that one out. Nothing else conflicts.
adriadam10 commented 2026-10-05 22:30:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-05T22:30:47Z.


Rebased on current main: kept my line and left #703's removed one out. guest_gameupdate passes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6004490697 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/704#issuecomment-6004490697). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-05T22:30:47Z. --- Rebased on current `main`: kept my line and left #703's removed one out. `guest_gameupdate` passes.
adriadam10 commented 2026-10-05 23:17:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-05T23:17:52Z.


Rebased on main (conflict in TechnicalDebt.md with the new sceUserServiceGetAgeLevel line, both kept); guest_gameupdate test passes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6005232424 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/704#issuecomment-6005232424). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-05T23:17:52Z. --- Rebased on main (conflict in TechnicalDebt.md with the new sceUserServiceGetAgeLevel line, both kept); guest_gameupdate test passes.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!704
No description provided.