Difference between revisions of "Jsystem"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
(Created page with "__TOC__ ==What Jsystem is== Jsystem is a dev lib that nintendo used around the gc/wii era for devlopment before being replaced by NintendoWare toolkit later in the wiis life....")
 
Line 5: Line 5:
  
  
 +
== Header ==
  
 +
{| class="wikitable"
 +
|-
 +
! Offset                !! Type !! Name !! Description
 +
|-
 +
| <center>0x00</center> || char[4] || Subsystem Version || Some code for the JSYSTEM library that this file is used in, along with a version, like "J3D2" or "JPA2". Sometimes this is a generic code, like "MESG" for [[BMG]] files.
 +
|-
 +
| <center>0x04</center> || char[4] || File Type || The kind of file used by this subsystem, like "bmd1", "bmg1". Usually the same as the file extension of the file.
 +
|-
 +
| <center>0x08</center> || int || File Size || The total size of the file.
 +
|-
 +
| <center>0x0C</center> || int || Chunk Count || The number of "chunks" that follow.
 +
|-
 +
| <center>0x10</center> || char[4] || (Optional) Subversion || "SVRn" with some number might appear, or it might be 0xFF padding like below. It is ignored. It is hypothesized that this was a marker was used to track data migration during the development of the game.
 +
|-
 +
| <center>0x14</center> || char[12] || Padding || This was likely reserved space in case they wanted to expand the header later. It is ignored. Official files have it as 0xFF padding.
 +
|-
 +
|}
  
{{credits|GameCubing8619}}
+
== Chunk Data ==
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Offset                !! Type              !! Name !! Description
 +
|-
 +
| <center>0x00</center> || char[4] || Chunk Type || A FourCC code describing the contents of the chunk. This is chunk-specific.
 +
|-
 +
| <center>0x04</center> || int || Size || The size of the chunk, including this header. In some cases, this has been known to be off slightly and run off the end of the file. It is used to locate the next chunk.
 +
|}
 +
 
 +
Each chunk is aligned to a 0x20 boundary, and the size is the aligned version. If the data does is not aligned to 0x20, then Nintendo's official tooling uses a custom string to fill the remaining chunk contents. The longest known version of this string is:
 +
 
 +
This is padding data to alignme
 +
 
 +
The rest of the data is file and chunk-specific. See the format's page for further information.
 +
 
 +
== Name Tables ==
 +
 
 +
Name tables are pools of strings used by multiple different JSYSTEM files, under the class name JUTNameTab. They collect all strings used in a chunk or section so that multiple references to the same string can be referenced by an index into the name table. A name table is laid out like this:
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Offset                !! Type              !! Name !! Description
 +
|-
 +
| <center>0x00</center> || int || Name Count || The number of names in this Name Table.
 +
|-
 +
| <center>0x04</center> || JUTNameTabEntry[Count] || Entries || A variable-length set of entries.
 +
|}
 +
 
 +
Each entry consists of the following.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Offset                !! Type              !! Name !! Description
 +
|-
 +
| <center>0x00</center> || short || Hash Code || A hash code of the string for fast lookup.
 +
|-
 +
| <center>0x02</center> || short || String Offset || An offset, relative to the start of the name table, containing the string contents followed by a NUL byte.
 +
|}
 +
 
 +
= Known JSYSTEM libraries =
 +
 
 +
== JUtility ==
 +
 
 +
Utility toolkit with various bits and bobs. Contains JKernel, which are the core routines for doing I/O from disc, and memory management.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Extension !! JSYSTEM Class Name !! Description
 +
|-
 +
| [[SZS]] || JKRDecomp || Yaz0 Compression
 +
|-
 +
| [[SZP]] || JKRDecomp || Yay0 Compression
 +
|-
 +
| [[ARC]] || JKRArchive || File Archive
 +
|-
 +
| [[BTI]] || JUTTexture || Binary Texture Image
 +
|-
 +
| [[BFN]] || JUTResFont || Binary Font
 +
|}
 +
 
 +
== J3DGraph ==
 +
 
 +
J3DGraph is a 3D rendering library.
 +
 
 +
=== J3DGraphBase ===
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Extension !! JSYSTEM Class Name !! Description
 +
|-
 +
| [[BMD and BDL|BMD]] || J3DModelData || Binary Model
 +
|-
 +
| [[BMD and BDL|BDL]] || J3DModelData || Binary Display List
 +
|-
 +
| [[BMT]] || J3DMaterialTable || Binary Material Table
 +
|-
 +
| [[BLS]] || J3DClusterLoader || Binary cLuSter (Alternate vertex cluster shapes)
 +
|}
 +
 
 +
=== J3DGraphAnimator ===
 +
 
 +
J3DGraphAnimator is a helper library that can animate various parts of J3D objects. Most animations come in two forms, "full", where each frame of an animation is serialized its entirety, and "key", where only key frames are serialized, and the runtime interpolates between key frames.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Extension !! JSYSTEM Class Name !! Description
 +
|-
 +
| [[BTK]] || J3DAnmTextureSRTKey || Texture SRT Animation (Key)
 +
|-
 +
| [[BCK]] || J3DAnmTransformKey || Joint Animation (Key)
 +
|-
 +
| [[BRK]] || J3DAnmTevRegKey || Texture Register Animation (Key)
 +
|-
 +
| [[BPK]] || J3DAnmColor || Color Animation (Key)
 +
|-
 +
| [[BTP]] || J3DAnmTexPattern || Texture Palette Animation (Full)
 +
|-
 +
| [[BCA]] || J3DAnmTransformFull || Joint Animation (Full)
 +
|-
 +
| [[BVA]] || J3DAnmVisibilityFull || Visibility Animation (Full)
 +
|-
 +
| [[BLA]] || J3DAnmClusterFull || Cluster Animation (Full)
 +
|-
 +
| [[BLK]] || J3DAnmClusterKey || Cluster Animation (Key)
 +
|-
 +
| ??? || J3DAnmColorFull || Color Animation (Full) (No Known Usages)
 +
|-
 +
| ??? || J3DAnmVtxColorFull || Vertex Color Animation (Full) (No Known Usages)
 +
|-
 +
| ??? || J3DAnmVtxColorKey || Vertex Color Animation (Key) (No Known Usages)
 +
|}
 +
 
 +
== J2DGraph ==
 +
 
 +
J2DGraph is a 2D rendering and UI library.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Extension !! JSYSTEM Class Name !! Description
 +
|-
 +
| [[BLO]] || || Binary Layout
 +
|-
 +
| [[BMG]] || || Binary Message
 +
|-
 +
| [[BMC]] || || Binary Message Color (?)
 +
|}
 +
 
 +
== JParticle ==
 +
 
 +
[[JParticle]] is a particle and effects system.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Extension !! JSYSTEM Class Name !! Description
 +
|-
 +
| [[JParticle|JPC]] || JPAEmitterArchiveLoaderDataBase || JParticle Archive
 +
|-
 +
| [[JParticle|JPA]] || JPAEmitterLoaderDataBase || Particle
 +
|}
 +
 
 +
== JAudio ==
 +
 
 +
JAudio is a music and audio system, which encompasses audio and music playback.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Extension !! JSYSTEM Class Name !! Description
 +
|-
 +
| [[AAF]] || || Audio Archive File
 +
|-
 +
| [[BAA]] || || Binary Audio Archive
 +
|-
 +
| [[BMS]] || || Binary Music Sequence
 +
|-
 +
| [[AW]] || || Wave Archive
 +
|}
 +
 
 +
Maybe also BAS (Binary Animation Sound)
 +
 
 +
== JStudio ==
 +
 
 +
JStudio is a cutscene recording & playback library able to sequence and play back prerecorded animations for multiple actors, objects, lights.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Extension !! JSYSTEM Class Name !! Description
 +
|-
 +
| [[STB]] || JStudio::TParse || JStudio Binary
 +
|}
 +
 
 +
== JMap ==
 +
 
 +
JMap is a helper library for serializing map layouts. It has been seen in Luigi's Mansion and Super Mario Galaxy 1 and 2.
 +
 
 +
{| class="wikitable"
 +
|-
 +
! Extension !! JSYSTEM Class Name !! Description
 +
|-
 +
| [[BCSV]] || JMapInfo || Binary CSV, a miscellaneous serialization format.
 +
|}
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
 
 +
{{credits|GameCubing8619,cloudmodding}}

Revision as of 00:52, 12 March 2024

What Jsystem is

Jsystem is a dev lib that nintendo used around the gc/wii era for devlopment before being replaced by NintendoWare toolkit later in the wiis life. and is not only used in pikmin 1 and 2 but is also used for games such as twilight princess and super mario sunshine.


Header

Offset Type Name Description
0x00
char[4] Subsystem Version Some code for the JSYSTEM library that this file is used in, along with a version, like "J3D2" or "JPA2". Sometimes this is a generic code, like "MESG" for BMG files.
0x04
char[4] File Type The kind of file used by this subsystem, like "bmd1", "bmg1". Usually the same as the file extension of the file.
0x08
int File Size The total size of the file.
0x0C
int Chunk Count The number of "chunks" that follow.
0x10
char[4] (Optional) Subversion "SVRn" with some number might appear, or it might be 0xFF padding like below. It is ignored. It is hypothesized that this was a marker was used to track data migration during the development of the game.
0x14
char[12] Padding This was likely reserved space in case they wanted to expand the header later. It is ignored. Official files have it as 0xFF padding.

Chunk Data

Offset Type Name Description
0x00
char[4] Chunk Type A FourCC code describing the contents of the chunk. This is chunk-specific.
0x04
int Size The size of the chunk, including this header. In some cases, this has been known to be off slightly and run off the end of the file. It is used to locate the next chunk.

Each chunk is aligned to a 0x20 boundary, and the size is the aligned version. If the data does is not aligned to 0x20, then Nintendo's official tooling uses a custom string to fill the remaining chunk contents. The longest known version of this string is:

This is padding data to alignme

The rest of the data is file and chunk-specific. See the format's page for further information.

Name Tables

Name tables are pools of strings used by multiple different JSYSTEM files, under the class name JUTNameTab. They collect all strings used in a chunk or section so that multiple references to the same string can be referenced by an index into the name table. A name table is laid out like this:

Offset Type Name Description
0x00
int Name Count The number of names in this Name Table.
0x04
JUTNameTabEntry[Count] Entries A variable-length set of entries.

Each entry consists of the following.

Offset Type Name Description
0x00
short Hash Code A hash code of the string for fast lookup.
0x02
short String Offset An offset, relative to the start of the name table, containing the string contents followed by a NUL byte.

Known JSYSTEM libraries

JUtility

Utility toolkit with various bits and bobs. Contains JKernel, which are the core routines for doing I/O from disc, and memory management.

Extension JSYSTEM Class Name Description
SZS JKRDecomp Yaz0 Compression
SZP JKRDecomp Yay0 Compression
ARC JKRArchive File Archive
BTI JUTTexture Binary Texture Image
BFN JUTResFont Binary Font

J3DGraph

J3DGraph is a 3D rendering library.

J3DGraphBase

Extension JSYSTEM Class Name Description
BMD J3DModelData Binary Model
BDL J3DModelData Binary Display List
BMT J3DMaterialTable Binary Material Table
BLS J3DClusterLoader Binary cLuSter (Alternate vertex cluster shapes)

J3DGraphAnimator

J3DGraphAnimator is a helper library that can animate various parts of J3D objects. Most animations come in two forms, "full", where each frame of an animation is serialized its entirety, and "key", where only key frames are serialized, and the runtime interpolates between key frames.

Extension JSYSTEM Class Name Description
BTK J3DAnmTextureSRTKey Texture SRT Animation (Key)
BCK J3DAnmTransformKey Joint Animation (Key)
BRK J3DAnmTevRegKey Texture Register Animation (Key)
BPK J3DAnmColor Color Animation (Key)
BTP J3DAnmTexPattern Texture Palette Animation (Full)
BCA J3DAnmTransformFull Joint Animation (Full)
BVA J3DAnmVisibilityFull Visibility Animation (Full)
BLA J3DAnmClusterFull Cluster Animation (Full)
BLK J3DAnmClusterKey Cluster Animation (Key)
??? J3DAnmColorFull Color Animation (Full) (No Known Usages)
??? J3DAnmVtxColorFull Vertex Color Animation (Full) (No Known Usages)
??? J3DAnmVtxColorKey Vertex Color Animation (Key) (No Known Usages)

J2DGraph

J2DGraph is a 2D rendering and UI library.

Extension JSYSTEM Class Name Description
BLO Binary Layout
BMG Binary Message
BMC Binary Message Color (?)

JParticle

JParticle is a particle and effects system.

Extension JSYSTEM Class Name Description
JPC JPAEmitterArchiveLoaderDataBase JParticle Archive
JPA JPAEmitterLoaderDataBase Particle

JAudio

JAudio is a music and audio system, which encompasses audio and music playback.

Extension JSYSTEM Class Name Description
AAF Audio Archive File
BAA Binary Audio Archive
BMS Binary Music Sequence
AW Wave Archive

Maybe also BAS (Binary Animation Sound)

JStudio

JStudio is a cutscene recording & playback library able to sequence and play back prerecorded animations for multiple actors, objects, lights.

Extension JSYSTEM Class Name Description
STB JStudio::TParse JStudio Binary

JMap

JMap is a helper library for serializing map layouts. It has been seen in Luigi's Mansion and Super Mario Galaxy 1 and 2.

Extension JSYSTEM Class Name Description
BCSV JMapInfo Binary CSV, a miscellaneous serialization format.




Credits: GameCubing8619,cloudmodding