PizzaTowerSage2019Vita
Pizza Tower (SAGE 2019 Demo) port to PS Vita.
| Type | Filename | Size |
|---|---|---|
| DIR | assets | — |
| DIR | assets demo | — |
| DIR | scripts | — |
| DIR | src | — |
| FILE | .gitignore | 440 B |
| FILE | check_pal.py | 311 B |
| FILE | find_buttons.py | 2067 B |
| FILE | find_objects.py | 1038 B |
| FILE | find_pal_sprites.py | 1057 B |
| FILE | find_pal_tpag.py | 2124 B |
| FILE | find_spr_press.py | 1343 B |
| FILE | list_shaders.py | 1684 B |
| FILE | parse_dmp.py | 1706 B |
| FILE | read_3shaders.py | 1684 B |
| FILE | read_code_pal.py | 1044 B |
| FILE | read_pal_swap_set.py | 577 B |
| FILE | read_shdr.py | 1574 B |
| FILE | read_shdr2.py | 2495 B |
| FILE | README.md | 20602 B |
README
An unofficial port of Pizza Tower SAGE 2019 Demo (v14) for the PlayStation Vita.
Releases · Report an issue · Butterscotch
PizzaTowerSage2019Vita runs the official Windows GameMaker data of the famous SAGE 2019 demo through a specialized, Vita-focused version of Butterscotch, using VitaGL and the Modern-GL renderer. The port adds native PlayStation Vita controls with official PlayStation glyphs, memory-safe OpenAL audio streaming, GPU texture preloading, SGX543-compliant palette swapping shaders, and numerous gameplay and engine bug fixes.
[!IMPORTANT] This repository and its releases do not include Pizza Tower's proprietary game data. You must obtain the free demo from the official Pizza Tower Demo by PizzaTowerGuy. The VPK cannot run by itself: the user's
data.winmust be copied to the Vita.
Project Status
The current release build is v0.62, based on the Windows SAGE 2019 Demo (v14). It is fully playable from start to finish on real PlayStation Vita hardware at a rock-solid 60 FPS with zero GPU crashes.
Explore all three stages from the original SAGE 2019 Demo. Complete them all to unlock a secret bonus challenge: Snick's Challenge! - Pizzascape (Medieval) - Ancient Cheese (Ancient) - Bloodsauce Dungeon (Dungeon)
Bonus Stage: Snick's Challenge — A timed challenge combining all three stages!
Working in the current build:
- Complete Hub world, secret areas, Pizza Time countdown, and rank tallying;
- Rock-solid 60 FPS gameplay accelerated by VitaGL hardware rendering;
- Physical Vita controls mapped to native gamepad inputs with custom PlayStation glyphs;
- Fully restored pal_swapper shader for Peppino's SAGE Blue outfit ((48, 168, 248)) and transformation states with zero extra VRAM cost;
- Permanent BC3 (DXT5) PVR texture residency (~87 MiB total across all 35 pages) + hardware room-transition GPU synchronization barrier (PizzaSage_beforeRoomChange);
- Lazy OpenAL audio streaming for all 91 sound effects and music tracks without RAM exhaustion;
- Corrected Super Jump launch mechanics and analog stick upward-drift protection;
- Native SAGE in-game pause menu on Start (Continue, Retry Level, Title Screen) and port settings menu on Select;
- Dedicated LiveArea presence with custom icon, splash screen, and digital manual.
Screenshots
Controls
Pizza Tower SAGE recognizes the PlayStation Vita as a native gamepad controller. Prompts and button layouts have been adapted specifically for the handheld layout.
Changes and Improvements over Original PC Demo
Based on the development documentation and hardware testing logs, multiple enhancements, optimizations, and bug fixes were engineered to bring the original PC/itch.io demonstration to the PS Vita:
1. Isolated Application Environment and Title ID (PTSAGE001)
- Dedicated Title ID: Configured with Title ID
PTSAGE001so that the SAGE demo lives entirely side-by-side with the full game port (PTWVITA01) without overwriting save files, configurations, or texture caches. - Separated Data Directory: All runtime data is organized cleanly under
ux0:data/pizzatowersage/: - Game data:
ux0:data/pizzatowersage/data.win - Configurations:
ux0:data/pizzatowersage/config.ini - Saved games:
ux0:data/pizzatowersage/save/ - Execution log:
ux0:data/pizzatowersage/pizzatowersage.log - Custom LiveArea Integration: Includes dedicated assets (
icon0.png,pic0.png,bg0.png,startup.png) and an interactive digital manual explaining game mechanics.
2. On-Demand Lazy Audio Streaming
- Problem in Original: The PC release loaded ~275 MB of uncompressed WAV files (91 audio tracks and effects) into RAM upon startup. On the PlayStation Vita, this immediately exhausts the memory pool and causes hard crashes.
- Solution: Developed a streaming audio pipeline in OpenAL that parses the
AUDOdata chunk dynamically. Audio data is streamed on demand rather than bulk-loaded into system RAM. - RIFF Subchunk Sanitization: Implemented robust header filtering to ignore non-audio metadata blocks (such as
LISTinfo chunks), eliminating high-pitched digital chirping artifacts.
3. GPU Texture Cache, Permanent BC3 Residency, and GPU Crash Prevention (v0.60 / v0.61)
- Root Cause of v0.56–v0.59 GPU Crashes:
- In
v0.56–v0.59,PizzaVitaTexturePolicy_useBc3disabled BC3 (DXT5) textures wheneverPIZZA_ROOM_ATLAS_BC3was not defined, forcing all 2048×2048 texture pages into uncompressed RGBA4444 (8 MiB per page instead of 4 MiB). - Additionally,
v0.59disabledvitaModernPermanentSmallGameforPIZZA_SAGE_2019and capped resident textures at 144 MiB while inflating VitaGL runtime buffers. This triggered mid-frame texture evictions (glDeleteTextures/vglFree) while the PowerVR SGX543 GPU still had asynchronous draw lists referencing those textures in flight, causing fatal CDRAM page faults and GPU crashes during room transitions. - Permanent BC3 Residency Architecture:
- Restored
PizzaVitaTexturePolicy_useBc3forPIZZA_SAGE_2019(2048×2048and1024×2048pages) and re-enabledvitaModernPermanentSmallGame(gl) == truewith no artificial residency cap. - The 30 non-patched texture pages load directly from pre-baked BC3
.pvrassets inapp0:assets/pvr/(4 MiBper 2048×2048 page), while the 5 glyph-patched UI pages (pages 1, 8, 13, 15, 20) are excluded from runtime BC3 re-compression (!vitaModernPageHasPatch(pageId)) and uploaded once as losslessRGBA4444. - All 35 texture pages fit permanently in memory (~87.6 MiB total, leaving ~80 MiB of free RAM), completely eliminating mid-game texture eviction and freeing.
- Added a header-stub validation check (
st.st_size > sizeof(VitaModernTextureCacheHeader)) invitaModernLoadPreparedTextureso 20-byte.r444header stubs inapp0:never shadow full textures or.pvrfiles. - Room Transition GPU Drain Barrier (
PizzaSage_beforeRoomChange): - Before any room transition executes
Room EndorRoom Createevents (which may reallocate or resize render targets/surfaces), the runner flushes the renderer batch and callsglFinish(), ensuring the SGX543 hardware pipeline has completely drained all pending scene commands.
4. SGX543-Compliant Palette Swap Shader (pal_swapper) & Zero-VRAM BC3 Key Tagging
- Problem in Original:
1. The original GameMaker Studio shader used dynamic float-based loop iteration (
for (float i = ...)), which is rejected by the PowerVR SGX543 GLSL ES 1.00 (SceShaccCg) compiler. 2. When Peppino's sprite sheets were compressed into DXT5/BC3 4×4 blocks, the two RGB565 endpoints interpolated intermediate colors inside 4×4 blocks containing both the yellow outfit(255, 255, 64)and the red-brown shading(152, 80, 48), shifting the RGB values of the yellow pixels enough to miss RGB-only shader comparisons (or causing false positives on adjacent sprites if the RGB tolerance was widened). - Zero-VRAM Solution:
- Re-encoded only the 4×4 BC3 blocks containing Peppino's
(255, 255, 64)outfit pixels across the pre-bakedassets/pvr/page_*.bc3.pvrfiles:- 2-color blocks (yellow + transparent, or yellow + black outline): encoded with an exact RGB565 endpoint
0xFFE8((255, 255, 66)). - 3+ color blocks (yellow + outline + shading): encoded the yellow pixels with a dedicated 3-bit BC3 interpolated alpha code (
code 2,alpha = 219/255 ≈ 0.8588,[0.84, 0.88]), while all normal opaque pixels retainalpha = 1.0.
- 2-color blocks (yellow + transparent, or yellow + black outline): encoded with an exact RGB565 endpoint
- In
pizzaVitaPalSwapperFragmentShader,spr_peppalette(4×6) is resolved directly with exact 24-bit RGB palette values — mappingpalette_index == 2to SAGE Blue(48, 168, 248)— whenever the pixel matches the exact RGB565 key or carries the0.8588alpha tag, and then restoresgl_FragColor.a = 1.0. This achieves 100% pixel-accurate SAGE Blue clothes with zero extra texture memory.
5. Super Jump, Pause Menu, and Input Engine Overhaul (v0.62)
- Super Jump Launch (
scr_player_Sjumpprep): In the original PC GameMaker code, launching a charged Super Jump strictly checked for!key_up(releasing Up). On console/handheld controllers, players instinctively hit Cross (Jump) or release Up. The Vita runner launches the jump immediately upon pressing Cross or releasing D-Pad Up, with a fail-safe state transition toscr_player_Sjump(State 62). - Elimination of Phantom "Up" Input (
VK_NOKEY/global.key_up& Stick Drift): - Root Cause 1 (
VK_NOKEY = 0insaveData.ini): If the legacy PC keybind screen (obj_keyconfig) ever ran in an earlier session, it wroteup = "0"(VK_NOKEY) into[ControlsKeys]inux0:data/pizzatowersage/save/saveData.ini. Whenscr_getinputcalledkeyboard_check(global.key_up)with0(VK_NOKEY),RunnerKeyboard_check(kb, VK_NOKEY)evaluated!checkIfAnyKey(kb->keyDown)— which returnedtrueon every single frame because no keyboard keys are held on PS Vita! Moreover,key_upexists twice indata.win'sVARItable (var_id = 85forINSTANCE_SELFandvar_id = 325forINSTANCE_GLOBAL), so looking up"key_up"inctx->varNameMaponly resolved the selfvar_id(85), leavingglobal.key_up(325) equal to"0". That causedkey_upto stay permanentlytrue, making Peppino immediately enter Super Jump prep (state = 64) the instant Dash reached Mach 3 (scr_player_mach3) and automatically enter level selector PCs (obj_startgate) on contact. - Root Cause 2 (Analog Stick Drift): Upward left-stick resting drift (
pad.ly < 128) or slight diagonal upward tilt while running could also triggergamepad_axis_value(0, gp_axislv) < 0. - Fix in v0.62:
RunnerKeyboard_check,RunnerKeyboard_checkPressed, andRunnerKeyboard_checkReleasednow returnfalseforVK_NOKEY(0) onPLATFORM_VITA.pizza_enforce_default_input_bindingsnow resolvesINSTANCE_GLOBAL(inst_type == -5,var_id = 325..344) directly indataWin->vari.variables, restoring allglobal.key_*andglobal.key_*Cbindings onglobalScopeInstance.PizzaSage_applyPauseInputhooks the completion ofgml_Script_scr_getinputfor all instances and enforcesself.key_up = pad->buttonDown[12]andself.key_up2 = pad->buttonPressed[12].- Upward deflection on the left analog stick (
dy < 0) is clamped to0(ay >= 0), so Up is controlled exclusively by D-Pad Up (and touch Up when touch controls are enabled).
- Original SAGE Pause Menu on Start: Pressing Start during gameplay opens SAGE 2019's native pause screen (
obj_pause) with full controller navigation (D-Pad Up/Down and Cross) for Continue, Retry Level, and Title Screen. Pressing Select opens the port's native settings overlay.
6. Modern Options Menu and Font Atlas Cleanup
- Menu Unfreeze Fix: In the PC version, opening Options set
selected = 1inobj_mainmenuselect. When closing the custom settings menu,selectedwas left locked, permanently freezing main menu navigation. The runner now cleanly resets cursor control. - Font Atlas Polish: Cleaned up assets/ui/options_font.png, eliminating dark rectangular backgrounds (
RGB(30, 30, 40)) and removing debug index numbers rendered on top of glyphs ($y < 17$), leaving crisp white letters with clear black borders.
7. Pizza Time Panic and Camera Fixes
- Panic Zoom Adjustment: Normalized camera scaling during the "Pizza Time" escape sequence to avoid HUD clipping and display distortion on the Vita screen.
- Mini-Pillar Masks: Fixed collision mask toggling for
obj_reverseminipillarduring escape mode (global.panic == 1).
8. GMS 2.2 Compatibility Layer
- Implemented built-in functions introduced in GameMaker Studio 2.2 used by the demo:
layer_sprite_change,layer_background_get_*,layer_tile_destroy,gpu_set_texfilter_ext,surface_getpixel, andsprite_duplicate.
Requirements
- A PlayStation Vita running HENkaku / Enso on firmware 3.60 or 3.65;
- kubridge plugin installed;
- FdFix plugin installed (or equivalent rePatch file-descriptor handling);
libshacccg.suprxruntime shader compiler installed (using ShaRKBR3ED / VitaDB);- The free Pizza Tower SAGE 2019 Demo (v14) downloaded from Pizza Tower Demo by PizzaTowerGuy.
Download Instructions
You will need both the Vita port VPK and the original PC demo game files:
Step-by-Step Guide:
- Download the Port: Grab the latest
PizzaTowerSAGE-v0.62.vpkfrom GitHub Releases. - Download the Game Data: Visit Pizza Tower Demo by PizzaTowerGuy on itch.io and download the free demo package.
- Extract
data.win: Unzip the downloaded file on your computer and locatedata.win.
Installation Guide
- Install
PizzaTowerSAGE-v0.62.vpkon your PS Vita using VitaShell. - Connect your PS Vita to your PC (via USB or FTP in VitaShell).
- Ensure the folder
ux0:data/pizzatowersage/exists on your Vita memory card. If not, create it. - Copy the extracted
data.winfile to:text ux0:data/pizzatowersage/data.win - Close VitaShell and launch Pizza Tower SAGE 2019 directly from the LiveArea!
Building from Source
To compile the PlayStation Vita executable and package the VPK using the VitaSDK container:
./scripts/build-pizzatowersage-gl.ps1
The output VPK will be generated in:
artifacts/current/PizzaTowerSAGE-v0.62.vpk
Technology Stack
Official SAGE 2019 Demo data.win (PC/itch.io)
↓
Lazy OpenAL Audio Parser
↓
Custom Butterscotch Vita Runner
↓
GameMaker VM, Objects, GML Scripts
↓
VitaGL Modern-GL (PowerVR SGX543)
↓
PlayStation Vita Display and Controls
PizzaTowerSage2019Vita does not emulate Windows and does not execute the PC binary. It natively interprets the GameMaker bytecode through an optimized C/C++ runner.
Credits
- Tour De Pizza - creators of Pizza Tower.
- SAGE - Sonic Amateur Games Expo for hosting the legendary 2019 demo showcase.
- Butterscotch and contributors - open-source GameMaker runner foundation.
- VitaGL by Rinnegatamante - OpenGL acceleration for PS Vita.
- VitaSDK and the PlayStation Vita homebrew development community.
- UndertaleModTool - bytecode analysis and data validation.
Gemini 4 Argon was used as a development assistant for diagnostics, implementation support, project organization and technical documentation. All changes remain subject to project review and real-hardware testing.
License and Legal Notice
Butterscotch is distributed under the Mozilla Public License 2.0. Modified source files remain available under the same license, with their original notices preserved.
Pizza Tower, Peppino Spaghetti, characters, audio, and game assets are the intellectual property of Tour De Pizza. This is an unofficial, non-commercial fan port, not affiliated with or endorsed by Tour De Pizza. It does not distribute proprietary game assets.