JSystem is Nintendo’s internal C++ framework library, reused across a wide range of GameCube and Wii games. In Petari it provides the foundational infrastructure on top of which the Super Mario Galaxy 1 game layer is built: 3D model loading and rendering, an audio sequencer, heap and archive management, a particle system, math utilities, and a set of debug/utility modules. The JSystem code in this repository is sourced from the doldecomp/tp (Twilight Princess) and doldecomp/ogws (One Piece: Unlimited Adventure) decompilation projects.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/SMGCommunity/Petari/llms.txt
Use this file to discover all available pages before exploring further.
Subsystems
JSystem is organized into eleven top-level directories undersrc/JSystem/. Each directory corresponds to a self-contained subsystem with its own namespace and header tree.
J3DGraphBase — core 3D rendering primitives
J3DGraphBase — core 3D rendering primitives
J3DSys state object.Key source files: J3DMaterial.cpp, J3DTevs.cpp, J3DShape.cpp, J3DVertex.cpp, J3DSys.cppJ3DGraphAnimator — model, joint, and animation data
J3DGraphAnimator — model, joint, and animation data
J3DModel, J3DModelData) and the skeletal animation system (J3DJoint, J3DJointTree, J3DAnimation). Also handles skin deformation (J3DSkinDeform) and the per-frame matrix buffer (J3DMtxBuffer).Key source files: J3DModel.cpp, J3DModelData.cpp, J3DAnimation.cpp, J3DJoint.cpp, J3DSkinDeform.cppJ3DGraphLoader — BMD/BCA file parsing
J3DGraphLoader — BMD/BCA file parsing
.bmd/.bdl) and animation formats (.bca, .bck, etc.) from memory and populates the J3D data structures. Factory classes handle versioned material formats.Key source files: J3DModelLoader.cpp, J3DAnmLoader.cpp, J3DMaterialFactory.cpp, J3DShapeFactory.cppJ2DGraph — 2D orthographic rendering
J2DGraph — 2D orthographic rendering
nw4r::lyt concepts but at a lower level.Key source files: J2DScreen.cpp, J2DPane.cpp, J2DPicture.cpp, J2DOrthoGraph.cppJAudio2 — audio sequencer
JAudio2 — audio sequencer
JASSeqCtrl drives a JASSeqParser to step through MIDI-like sequence data tick-by-tick, dispatching events to JASTrack objects for sound synthesis.Key source files: JASSeqCtrl.cpp, JASSeqParser.cpp, JASSeqReader.cpp, JASTrack.cppJKernel — heap and archive management
JKernel — heap and archive management
JKRHeap and JKRExpHeap implement zone-based memory allocation. Archive classes (JKRArchive, JKRDvdArchive, JKRAramArchive, JKRMemArchive, JKRCompArchive) wrap different storage backends behind a unified file-lookup API. JKRThread wraps OS threads.Key source files: JKRHeap.cpp, JKRExpHeap.cpp, JKRDvdArchive.cpp, JKRDecomp.cpp, JKRThread.cppJParticle (JPa) — particle system
JParticle (JPa) — particle system
.jpa resource files. JPAEmitterManager owns a pool of JPAEmitter instances; each emitter generates JPAParticle objects shaped by JPABaseShape, JPAExtraShape, JPADynamicsBlock, and JPAFieldBlock descriptors.Key source files: JPAEmitterManager.cpp, JPAEmitter.cpp, JPAParticle.cpp, JPAResourceLoader.cpp, JPAResourceManager.cppJMath — math utilities
JMath — math utilities
JMath.cpp, JMATrigonometric.cpp, random.cppJGadget — generic data structures
JGadget — generic data structures
linklist.cpp, hashcode.cppJSupport — stream and list utilities
JSupport — stream and list utilities
JSUInputStream, JSUMemoryStream) and an intrusive doubly-linked list (JSUList) used for serialization and object management.Key source files: JSUInputStream.cpp, JSUMemoryStream.cpp, JSUList.cppJUtility — debug and rendering utilities
JUtility — debug and rendering utilities
JUTXfb) management. Primarily used during development and in debug builds.Key source files: JUTAssert.cpp, JUTConsole.cpp, JUTFont.cpp, JUTTexture.cpp, JUTException.cppDecompilation status
JSystem modules vary in completion. Some files — particularly inJKernel and J3DGraphBase — are fully matched to the original binary. Others, especially parts of JAudio2 and JParticle, contain non-matching stubs that are still under active work. Check decomp.dev/SMGCommunity/Petari for up-to-date per-file progress.