JPA (File Format)
JPA stands for JPArticle, and is part of Nintendo's JSystem. The version of JPA documented here is JPAC2-10.
This page is a work in progress.
JPA Header
The file starts with this Header
| Offset | Type | Description |
|---|---|---|
| 0x00 | String | JPAC2-10 in ASCII |
| 0x08 | UInt16 | Particle Count |
| 0x0A | UInt16 | Image Count |
| 0x0C | UInt32 | Offset to the TEX1 section |
| 0x10 | UInt32 | Unknown |
| 0x14 | UInt32 | Unknown |
BEM1
This section is the Base Emitter, which contains settings for the emitter object.
This chunk is required for every particle
| Offset | Type | Description |
|---|---|---|
| 0x00 | String | BEM1 in ASCII |
| 0x04 | UInt32 | Section Length |
| 0x08 | UInt32 | Flags. VolumeType = (flags >> 8) & 0x07. See the Volume Type Table |
| 0x0C | UInt32 | Unknown |
| 0x10 | Single | Emitter Scale X |
| 0x14 | Single | Emitter Scale Y |
| 0x18 | Single | Emitter Scale Z |
| 0x1C | Single | Emitter Translation X |
| 0x20 | Single | Emitter Translation Y |
| 0x24 | Single | Emitter Translation Z |
| 0x28 | Single | Emitter Direction X |
| 0x2C | Single | Emitter Direction Y |
| 0x30 | Single | Emitter Direction Z |
| 0x34 | Single | Initial Velocity Omni-Directional (?) |
| 0x38 | Single | Initial Velocity Axis |
| 0x3C | Single | Initial Velocity Random |
| 0x40 | Single | Initial Velocity Direction |
| 0x44 | Single | Spread |
| 0x48 | Single | Initial Velocity Ratio |
| 0x4C | Single | Rate |
| 0x50 | Single | Rate Random |
| 0x54 | Single | Lifetime Random |
| 0x58 | Single | Volume Sweep |
| 0x5C | Single | Volume Minimum Radius |
| 0x60 | Single | Air Resistance |
| 0x64 | Single | Moment Random |
| 0x68 | Int16 | Emitter Rotation X in Degrees |
| 0x6A | Int16 | Emitter Rotation Y in Degrees |
| 0x6C | Int16 | Emitter Rotation Z in Degrees |
| 0x6E | Int16 | Max Frame |
| 0x70 | Int16 | Start Frame |
| 0x72 | Int16 | Lifetime |
| 0x74 | Int16 | Volume Size |
| 0x76 | Int16 | Division Number |
| 0x78 | UInt8 | Rate Step |
| 0x79 | UInt8[3] | Padding |
BSP1
This section is the Basic Shape, which contains settings on how to draw the particle.
This chunk is required for every particle
| Offset | Type | Description |
|---|---|---|
| 0x00 | String | BSP1 in ASCII |
| 0x04 | UInt32 | Section Length |
| 0x08 | UInt32 | Flags: ShapeType = flags & 0x0F. See the Shape Type Table |
| 0x0C | UInt16 | Primary Colour Data Offset. ColourFlags & 0x02 must equal 0 |
| 0x0E | UInt16 | Environment Colour Data Offset. ColourFlags & 0x08 must equal 0 |
| 0x10 | Single | BaseSizeX |
| 0x14 | Single | BaseSizeY |
| 0x18 | UInt16 | Blend Mode Flags |
| 0x1A | UInt8 | Alpha Compare Flags |
| 0x1B | UInt8 | Alpha Reference 0 |
| 0x1C | UInt8 | Alpha Reference 0 |
| 0x1D | UInt8 | Z Mode Flags |
| 0x1E | UInt8 | Texture Flags: Texture Calculate Index Type = (TextureFlags >> 2) & 0x07. See the Calculate Index Type Table |
| 0x1F | UInt8 | Texture Index Animation Count TexIDAnimCount |
| 0x20 | UInt8 | TextureIndex |
| 0x21 | UInt8 | Colour Flags: Colour Calculate Index Type = (ColourFlags >> 0x04) & 0x07 |
| 0x22 | UInt8 | Primary Colour Animation Data Count. ColourFlags & 0x02 must equal 0 |
| 0x23 | UInt8 | Environment Colour Animation Data Count. ColourFlags & 0x08 must equal 0 |
| 0x24 | UInt16 | Colour Animation Max Frame |
| 0x26 | Colour RGBA UInt8[4] |
Primary Colour |
| 0x2A | Colour RGBA UInt8[4] |
Environment Colour |
| 0x2E | UInt8 | Animation Random |
| 0x2F | UInt8 | Colour Loop Offset Mask |
| 0x30 | UInt8 | Texture Index Loop Offset Mask |
| 0x34 | UInt8[3] | Padding |
Extra BSP1 Data
This extra data exists if IsEnableTextureScrollAnimation is TRUE
| Offset | Type | Description |
|---|---|---|
| 0x00 | Single | Texture Init Translation X |
| 0x04 | Single | Texture Init Translation Y |
| 0x08 | Single | Texture Init Scale X |
| 0x0C | Single | Texture Init Scale Y |
| 0x10 | Single | Texture Init Rotation |
| 0x14 | Single | Texture Increment Translation X |
| 0x18 | Single | Texture Increment Translation Y |
| 0x1C | Single | Texture Increment Scale X |
| 0x20 | Single | Texture Increment Scale Y |
| 0x24 | Single | Texture Increment Rotation |
| 0x28 | UInt8[TexIDAnimCount] | A list of bytes representing texture IDs |
ESP1
Extra settings for how to draw the particle. This chunk is optional.
| Offset | Type | Description |
|---|---|---|
| 0x00 | String | ESP1 in ASCII |
| 0x04 | UInt32 | Section Length |
| 0x08 | UInt32 | Flags. bool IsEnableScale = !(flags & 0x01) |
| 0x0C | Single | Scale In Timing |
| 0x10 | Single | Scale Out Timing |
| 0x14 | Single | Scale In Value X |
| 0x18 | Single | Scale Out Value X |
| 0x1C | Single | Scale In Value Y |
| 0x20 | Single | Scale Out Value Y |
| 0x24 | Single | Scale Out Random |
| 0x28 | UInt16 | Scale Animation X Max Frame |
| 0x2A | UInt16 | Scale Animation Y Max Frame |
| 0x2C | Single | Alpha In Timing |
| 0x30 | Single | Alpha Out Timing |
| 0x34 | Single | Alpha In Value |
| 0x38 | Single | Alpha Base Value |
| 0x3C | Single | Alpha Out Value |
| 0x40 | Single | Alpha Wave Frequency |
| 0x44 | Single | Alpha Wave Random |
| 0x48 | Single | Alpha Wave Amplitude |
| 0x4C | Single | Rotate Angle |
| 0x50 | Single | Rotate Angle Random |
| 0x54 | Single | Rotate Speed |
| 0x58 | Single | Rotate Speed Random |
| 0x5C | Single | Rotate Direction |
SSP1
Settings for child particles that are spawned from the parent particle
| Offset | Type | Description |
|---|---|---|
| 0x00 | String | SSP1 in ASCII |
| 0x04 | UInt32 | Section Length |
| 0x08 | UInt32 | Flags: ShapeType = flags & 0x0F. See the Shape Type Table |
| 0x0C | Single | Position Random |
| 0x10 | Single | Base Velocity |
| 0x14 | Single | Base Velocity Random |
| 0x18 | Single | Velocity Inf Rate |
| 0x1C | Single | Gravity |
| 0x20 | Single | Global Scale 2D X |
| 0x24 | Single | Global Scale 2D Y |
| 0x28 | Single | Inherit Scale |
| 0x2C | Single | Inherit Alpha |
| 0x30 | Single | Inherit RGB |
| 0x34 | Colour RGBA UInt8[4] |
Primary Colour |
| 0x38 | Colour RGBA UInt8[4] |
Environment Colour |
| 0x3C | Single | Timing |
| 0x40 | UInt16 | Life |
| 0x42 | UInt16 | Rate |
| 0x44 | UInt8 | Step |
| 0x45 | UInt8 | Texture Index |
| 0x46 | UInt16 | Rotate Speed |
ETX1
Settings for configuring two or three textures on a particle
| Offset | Type | Description |
|---|---|---|
| 0x00 | String | ETX1 in ASCII |
| 0x04 | UInt32 | Section length |
| 0x08 | UInt32 | Flags: IndirectTextureMode = flags & 0x01. See the Indirect Texture Mode Table |
| 0x0C | Single | Indirect Texture Matrix. Item00 |
| 0x10 | Single | Indirect Texture Matrix. Item01 |
| 0x14 | Single | Indirect Texture Matrix. Item02 |
| 0x18 | Single | Indirect Texture Matrix. Item10 |
| 0x1C | Single | Indirect Texture Matrix. Item11 |
| 0x20 | Single | Indirect Texture Matrix. Item12 |
| 0x24 | Int8 | Matrix Scale |
| 0x25 | UInt8 | Indirect Texture Index |
| 0x26 | UInt8 | Second Texture Index. Set to -1 if (flags & 0x00000100) is true |
| 0x27 | UInt8[2] | Padding |
KFA1
Contains curve animation tracks that can affect various properties of the emitter over time
| Offset | Type | Description |
|---|---|---|
| 0x00 | String | KFA1 in ASCII |
| 0x04 | UInt32 | Section length |
| 0x08 | UInt8 | Key Type. See the JPA Key Types Table |
| 0x09 | UInt8 | Key Count |
| 0x0A | UInt8 | Padding |
| 0x0B | bool | Loop |
| 0x0C | J3DKeyframe[] | Keyframes |
J3D Keyframe
| Offset | Type | Description |
|---|---|---|
| 0x00 | Single | Time |
| 0x04 | Single | Value |
| 0x08 | Single | Tangent In |
| 0x0C | Single | Tangent Out |
FLD1
Defines different physics simulation fields that affect the particles
| Offset | Type | Description |
|---|---|---|
| 0x00 | String | FLD1 in ASCII |
| 0x04 | UInt32 | Section length |
| 0x08 | UInt32 | Flags: Type = flags & 0x0F. See the Field Type Table |
| 0x0C | Single | Position X |
| 0x10 | Single | Position Y |
| 0x14 | Single | Position Z |
| 0x18 | Single | Direction X |
| 0x1C | Single | Direction Y |
| 0x20 | Single | Direction Z |
| 0x24 | Single | Param 1 |
| 0x28 | Single | Param 2 |
| 0x2C | Single | Param 3 |
| 0x30 | Single | Fade In |
| 0x34 | Single | Fade Out |
| 0x38 | Single | Enter Time (?) |
| 0x3C | Single | Distance Time |
| 0x40 | UInt8 | Cycle |
| 0x41 | UInt8[3] | Padding |
TDB1
This "chunk" stores a mapping of particle texture indices to the JPAC texture indices.
This chunk is required for every particle
| Offset | Type | Description |
|---|---|---|
| 0x00 | String | TDB1 in ASCII |
| 0x04 | UInt32 | Section length - 0x08 |
| 0x08 | UInt16[] | JPAC Texture Indices |
Type Lists
Volume Types
| Value | Type |
|---|---|
| 0x00 | CUBE |
| 0x01 | SPHERE |
| 0x02 | CYLINDER |
| 0x03 | TORUS |
| 0x04 | POINT |
| 0x05 | CIRCLE |
| 0x06 | LINE |
Shape Types
| Value | Type |
|---|---|
| 0x00 | POINT |
| 0x01 | LINE |
| 0x02 | BILLBOARD |
| 0x03 | DIRECTION |
| 0x04 | DIRECTIONCROSS |
| 0x05 | STRIPE |
| 0x06 | STRIPECROSS |
| 0x07 | ROTATION |
| 0x08 | ROTATIONCROSS |
| 0x09 | DIRBILLBOARD |
| 0x0A | YBILLBOARD |
Direction Types
| Value | Type |
|---|---|
| 0x00 | VELOCITY |
| 0x01 | POSITION |
| 0x02 | POSITIONINVERSE |
| 0x03 | EMITTERDIRECTION |
| 0x04 | PREVIOUSPARTICLE |
Rotation Types
| Value | Type |
|---|---|
| 0x00 | X |
| 0x01 | Y |
| 0x02 | Z |
| 0x03 | XYZ |
| 0x04 | YJIGGLE |
Plane Types
| Value | Type |
|---|---|
| 0x00 | XY |
| 0x01 | YZ |
| 0x02 | X |
Calculate Index Types
| Value | Type |
|---|---|
| 0x00 | NORMAL |
| 0x01 | REPEAT |
| 0x02 | REVERSE |
| 0x03 | MERGE |
| 0x04 | RANDOM |
Calculate Scale Animation Types
| Value | Type |
|---|---|
| 0x00 | NORMAL |
| 0x01 | REPEAT |
| 0x02 | REVERSE |
Calculate Alpha Wave Types
| Value | Type |
|---|---|
| 0xFF | NONE |
| 0x00 | NORMALSIN |
| 0x01 | ADDSIN |
| 0x02 | MULTIPLYSIN |
Indirect Texture Mode
| Value | Mode |
|---|---|
| 0x00 | OFF |
| 0x01 | NORMAL |
| 0x02 | SUBTRACT |
Field Types
| Value | Type |
|---|---|
| 0x00 | GRAVITY |
| 0x01 | AIR |
| 0x02 | MAGNET |
| 0x03 | NEWTON |
| 0x04 | VORTEX |
| 0x05 | RANDOM |
| 0x06 | DRAG |
| 0x07 | CONVECTION |
| 0x08 | SPIN |
Field Add Types
| Value | Type |
|---|---|
| 0x00 | FIELDACCELERATION |
| 0x01 | BASEVELOCITY |
| 0x02 | FIELDVELOCITY |
JPA Key Types
| Value | Type |
|---|---|
| 0x00 | RATE |
| 0x01 | VOLUMESIZE |
| 0x02 | VOLUMESWEEP |
| 0x03 | VOLUMEMINIMUMRADIUS |
| 0x04 | LIVETIME |
| 0x05 | MOMENT |
| 0x06 | INITIALVELOCITYOMNIDIRECTIONAL (?) |
| 0x07 | INITIALVELOCITYAXIS |
| 0x08 | INITIALVELOCIRTDIRECTION |
| 0x09 | SPREAD |
| 0x0A | SCALE |
(Source: noclip.website source code)