Skip to content

Releases

v1.01-release

Choose a tag to compare

@github-actions github-actions released this 19 Sep 11:40
b0f5b85

Bully Vita v1.01

The first release since the 2021 port, and the first with a version number that was chosen rather than defaulted. LiveArea shows 01.01.

Everything below was measured on hardware. The headline figure: a 13-hour session with 4,869 textures evicted and restored, zero lost, zero corrupted, no allocation ever refused, and no crash.

The crash after long sessions is fixed

The original port crashed after an hour or two of play. It was three separate leaks, none of them in the game's own logic:

  • vitaGL was quietly taking the game's heap for textures. Its allocator falls back to the game's own memory once video memory is full, and reports that memory as zero to anything asking how much is left. The heap climbed to 155 MB while every reading said there was room to spare. That fallback is now off, so texture pressure shows up where the loader can act on it.
  • The streamer never freed anything. CStreaming::IsThereEnoughFreeMemory compared the request against a hardcoded 10 MB and said yes to everything — fine on a phone with gigabytes spare, fatal here. It now sees the real heap, so streamed models and textures are released when memory gets tight, through the game's own machinery that was never being asked.
  • Every vertex buffer kept a full CPU-side copy of its mesh forever. 33 MB by the end of a session, never falling once. Those copies are released once the data is on the GPU and put back if the game locks the buffer again.

On top of that, the loader runs a texture cache: once textures no longer fit in video memory, the ones the game has stopped drawing with are dropped and brought back the moment they're needed. A dropped texture is never lost — its bytes are parked in RAM or written to ux0:data/Bully/textures, and the store survives between runs so revisiting an area costs nothing. The cache refuses to drop anything it cannot put back.

It renders on current vitaGL

The port was released against a 2021 vitaGL that renders nothing on current firmware. Moving it forward exposed two problems that each produced a black screen with no error:

  • The viewport was being corrupted at build time. vitaGL's SOFTFP_ABI option double-moved the viewport arguments on this port's softfp toolchain, so every primitive — including the clear — was clipped away. A fifteen-line program that only cleared the screen red came out black. The option is not used.
  • Shaders are compiled at runtime now, the way gtasa_vita does it, instead of loading precompiled .gxp files that current vitaGL silently misparses. This makes libshacccg.suprx a requirement.

MSAA is 2x rather than the original 4x: the traces showed CDRAM with no free headroom at all.

An audio crash before the first frame

Building OpenAL with a current compiler surfaced a latent alignment fault in openal-soft: a 16-byte-aligned store to a stack slot that the ABI only guarantees 8-byte alignment for. The 2021 binary survived by luck of frame layout. openal-soft is now built from source, pinned, with the offending alignment lowered so the store is one the stack always satisfies.

Memory returned to the game

The original held two 16 MB FIOS RAM caches in front of a file API the game never reads through. Measured across two sessions on the same route, the run without them was slightly faster per megabyte and ended 35 MB lower on the heap. They're gone.

Threads

The game's main thread has a core to itself. It previously shared core 0 at equal priority with the display queue — the thread that presents finished frames — which cannot be moved. So the game moved instead.

Loader safety

  • A recursive lock serialises everything the loader does to vitaGL. Without it, an eviction's glBindTexture could land between the game's own bind and upload and free a buffer the game was writing into — a heap corruption that took nine hours to surface and was traced from a core dump.
  • Functions the loader hooks are checked before hooking: the prologue must relocate cleanly and the function must take four or fewer argument words. Anything that fails is left alone and named in the log rather than guessed at.
  • A texture that can't be safely restored is never dropped. Freeing one you can't put back is how the ground and the buildings went black in earlier builds.

Requirements

  • libshacccg.suprx installed — new; shaders compile at runtime
  • Space on ux0: for ux0:data/Bully/textures; with too little free the loader runs without the card tier and keeps every texture resident, which is the original behaviour

Building

The original no longer compiles against a current VitaSDK. This release builds against current VitaSDK, vitaGL, vitaShaRK and openal-soft, each pinned by revision in the CI workflow, and CI builds the VPK on every push.

Known limits

Two things this release does not fix, stated plainly so the word "fixed" above doesn't hide them:

  • Frame rate. The game runs its own limiter at roughly 28 fps and drops to around 21 in crowded areas. Both were measured to the millisecond. The crowd cost is per-pedestrian AI on one core, and the engine's world update is built around global state that cannot be split across cores. This is what the engine does on this hardware.
  • Area transitions. Loading a new area takes around 13 seconds, 91% of which is memory-card I/O — the game reopens its two archive files thousands of times per load. Measured, not yet addressed.