How bucanero/pkgi-ps3 works
Project Type and Purpose
• Project Type: Native console (PS3) homebrew application written in C, using PSL1GHT SDK.
• Purpose: Presents a UI to browse a text-based database of .pkg payloads, supports filtering/searching, downloads via direct HTTP or PS3’s native Download Manager, generates .rif activation files, and manages local files.
File Structure
• source/ + include/: Core C modules and headers, implementing subsystems—menu, dialog, config, DB parser, downloader, SHA256, TTF renderer, PS3-specific code, rif generation, audio via MikMod.
• data/ + pkgfiles/: Static assets (images, fonts, sample USRDIR layout) shipped with the app.
• docs/: Build/deploy scripts, site config.
• Top-level: Makefile, build config, CI workflows, licensing, README, CHANGELOG.
README for Architecture & Dependencies
• Layers described: UI, database format parser, download manager (direct vs. background), content activation, update checker.
• External dependencies: PSL1GHT, Tiny3D + YA2D (rendering), PolarSSL (crypto), libcurl (HTTP), MikMod (audio), Mini18n (i18n), dbglogger (logging).
1. UI Layer
– Tiny3D + YA2D + ttf_render
– Menu Controller, Dialog Controller
2. Core Logic
– pkgi.c (app entry, event loop)
– Config Manager (pkgi_config)
– DB Parser / Manager (pkgi_db, custom dbformat)
– Download Manager (pkgi_download)
– Activation Engine (rifrap + ecdsa)
– Update Checker (online sync)
3. Libraries & Helpers
– libcurl (HTTP client for direct mode)
– PSL1GHT SDK (PS3 syscalls: File I/O, threads, DM API)
– PolarSSL (SHA256, ECDSA)
– MikMod Loader
– Mini18n (localization)
– dbglogger (UDP debug logging)
4. File System & Runtime Environment
– /dev_hdd0/game/NP00PKGI3/USRDIR/ (pkgi.txt, config.txt, dbformat.txt)
– /dev_hdd0/exdata/ (generated .rap files)
– /dev_hdd0/tmp/pkgi/ (in-progress .pkg)
5. External Services
– Remote CSV/TSV URL endpoints for online DB
– HTTP servers hosting .pkg files
– UI Layer → Core Logic (user inputs → commands)
– Core Logic → DB Manager (load/parse local or remote DB)
– Core Logic → Download Manager → External HTTP Servers or PS3 Download Manager
– Download Manager → File System (write .pkg to tmp)
– Activation Engine → PSL1GHT Crypto API → File System (.rap in exdata)
– Update Checker → External Services → DB Manager (refresh local DB)
– Core Logic → Logging (dbglogger → UDP multicast)
– Core Logic → Audio (MikMod → sound output)
c. Architectural Patterns & Principles
– Layered architecture (UI / application logic / services / OS)
– Separation of concerns: UI vs. data vs. networking vs. activation
– Pluggable DB format (strategy pattern for delimiters/columns)
– Dual-mode download (direct HTTP vs. background DM)
d. Key Technologies / Frameworks
– PSL1GHT (PS3 native APIs)
– Tiny3D + YA2D (2D rendering engine)
– libcurl (network)
– PolarSSL (crypto)
– MikMod (audio)
– Mini18n (i18n)
Capturing Essential Details
• Custom DB format loader as a configurable strategy object.
• Build-time dependencies (Makefile → PSL1GHT, YA2D, PolarSSL, libcurl, MikMod, mini18n, dbglogger).
• Optionally, illustrate the CI workflow (.github/workflows/build.yml) as a side note.