Notes
- Generational indices prevent use-after-free. If generation doesn’t match, the asset was freed and the slot reused.
- Fixed pools (64 per type) avoid malloc. 64 textures × ~64KB average = ~4MB VRAM budget, reasonable.
- Pool sizes are compile-time configurable for different games.
- No string-based lookup at runtime. Load returns an ID; game caches the ID.
sh_assets_gc()is the scene transition cleanup — release everything that’s no longer held.
Spec 8:
Performance Profiler (shachi/profiler.h)
Problem
Need frame-level performance insight during development. KOS has
excellent low-level tools (perfctr.h for SH4 hardware
counters, perf_monitor.h for probe points, dcload for file
output). Shachi wraps these into a game-level profiler.