Formats/Common:SSH: Difference between revisions

From SSX Modding Wiki
(Pasted in SSH Research Data)
 
(cleanup)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
=== Overview ===
=== Overview ===
EA's SSH Texture Files
EA's SSH Texture Files

==== Magic words ====
==== Magic words ====
{| class="wikitable"
{| class="wikitable"
Line 13: Line 12:
|????
|????
|ShpS (SSX On Tour)
|ShpS (SSX On Tour)
|}
|}<!-- Editor's note: ShpS is the "new" format. Tools as early as 2004 call SHPS "old" -->

== SHPS ==
== SHPS ==

=== Header ===
=== Header ===
{| class="wikitable"
{| class="wikitable"
Line 32: Line 29:
|Gimex Version/Creator Code
|Gimex Version/Creator Code
|}
|}

=== Texture Entries ===
=== Texture Entries ===
{| class="wikitable"
| Type    |   Description  |
|+

!Type
|---------|----------------|
!Description

|-
| Char[4] | Short Name     |
|Char[4]

|Short Name
| UInt32  | Offset         |
|-

|UInt32
=== Header End ===<!-- Editor's note: I believe this is padding, and they chose to make it funny cause.. it's padding. -->
|Offset

|}
| Type   | Description |
=== Header End ===

{| class="wikitable"
|--------|------------|
|+

!Type
| Char[4]| Group      |
!Description

|-
| Char[4]| String?    |<!-- rewrite this section from #file-formats info -->
|Char[4]

|Group
|-
|Char[4]
|String?
|}
=== Texture Entry ===
=== Texture Entry ===

==== Entry Texture Types ====
==== Entry Texture Types ====
All shape entries start with a header that looks like this:<syntaxhighlight lang="c++" line="1">
All shape entries start with a header that looks like this:
struct ShapeChunkHeader {


<syntaxhighlight lang="c++" line="1">
uint8_t chunkType;
struct ShapeChunkHeader {

uint8_t chunkType;
uint24_t nextChunk;
uint24_t nextChunk;

// Note that the above isn't a standard type.
// Note that the above isn't a standard type.
// You can probably represent it as a bitfield if you want.

// You can probably represent it as a bitfield if you want.

// In layman's terms, if the next chunk offset is 0, then

// it's the end of this shape.

bool IsEndOfShape() {

return nextChunk == 0x0;

}


// In layman's terms, if the next chunk offset is 0, then
// it's the end of this shape.
bool IsEndOfShape() {
return nextChunk == 0;
}
};
};
</syntaxhighlight>| Chunk Type           | Description                  |
</syntaxhighlight>


{| class="wikitable"
|----------------------|-------------------------------|
|+

!Chunk Type
| 0x1                  | 4-Bit (16 Colours) Data       |
!Description

|-
| 0x2                  | 8-bit (256 Colours) Data      |
|0x1

|4-Bit (16 Colours) Data
| 0x5                  | 32-bit True Color Image       |
|-

|0x2
| 0x20                 | Palette/CLUT                  |
|8-bit (256 Colours) Data
|-
|0x5
|32-bit True Color Image
|-
|0x20
|Palette/CLUT
|-
|105
|Metal Bin (Metal Alpha)
|-
|0x70
|Long/Full Name
|-
|0x85 (`0x5 OR 0x80`)
|8-bit Data, RefPack Compressed
|}


If `(type & 0x80) == 1` (seemingly only used for image data) the data is compressed with [[Formats/Common:Refpack|RefPack]].
| 105                  | Metal Bin (Metal Alpha)            |

| 0x70                 | Long/Full Name                |

| 0x85 (`0x5 OR 0x80`)  | 8-bit Data, RefPack Compressed|

If `(type & 0x80) == 1` the data will be compressed with RefPack.


=== Texture Header ===
=== Texture Header ===
{| class="wikitable"
| Type   | Description |
|+

!Type
|--------|-------------|
!Description

|-
| Byte   | Entry Type  |
|Byte

|Entry Type
| UInt24 | Size        |
|-

|UInt24
| UInt16 | Width       |
|Size

|-
| UInt16 | Height      |
|UInt16

|Width
| UInt16 | XAxis       |
|-

| UInt16 | YAxis       |
|UInt16
|Height

|-
| UInt16 | Swizzled    |
|UInt16

|XAxis
| UInt16 | Unknown     |
|-

|UInt16
|YAxis
|-
|UInt16
|Swizzled
|-
|UInt16
|Unknown
|}
The data following this header can be:
The data following this header can be:
{| class="wikitable"
|+
!Image Type
!Data Type
|-
|4-bit
|4-bit indexes into Palette/CLUT
|-
|8-bit
|8-bit indexes into Palette/CLUT
|-
|32-bit
|BGRA8888 Direct Colors
|}


=== Colour Palette Header ===
| Image Type | Data Type                       |


(this is the same as the image header, it's just [color count] x 1 sized)
|------------|---------------------------------|


{| class="wikitable"
| 4-bit      | 4-bit indexes into Palette/CLUT |
|+

!Type
| 8-bit      | 8-bit indexes into Palette/CLUT |
!Description

|-
| 32-bit     | BGRA8888 Direct Colors          |
|Byte

|Entry Type
=== Colour Pallet Header ===
|-
| Type   | Description |
|UInt24

|Size
|--------|-------------|
|-

|UInt16
| Byte   | Entry Type  |
|Width
|-
|UInt16
|Height
|-
|UInt16
|Total
|-
|UInt16
|Unknown
|-
|UInt16
|Swizzled
|-
|UInt16
|Unknown
|}


After the header is *Width* count BGRA8888 colors used to make up the palette.
| UInt24 | Size        |

| UInt16 | Width       |

| UInt16 | Height      |

| UInt16 | Total       |

| UInt16 | Unknown     |

| UInt16 | Swizzled    |

| UInt16 | Unknown     |

After the header is *Width* count BGRA8888 colors.


=== Long Name Header ===
=== Long Name Header ===
| Type     | Description  |


{| class="wikitable"
|----------|--------------|
|+

!Type
| Byte     | Entry Type   |
!Description

|-
| UInt24   | Size         |
|Byte

|Entry Type
| C String | Long Name    |
|-
|UInt24
|Size
|-
|C String
|Long Name
|}

Latest revision as of 23:52, 16 June 2023

Overview

EA's SSH Texture Files

Magic words

Hex ASCII
???? SHPS (SSX, SSX Tricky, SSX 3)
???? ShpS (SSX On Tour)

SHPS

Header

Type Description
UInt32 SSH File Size
UInt32 Texture Count
Char[4] Gimex Version/Creator Code

Texture Entries

Type Description
Char[4] Short Name
UInt32 Offset

Header End

Type Description
Char[4] Group
Char[4] String?

Texture Entry

Entry Texture Types

All shape entries start with a header that looks like this:

struct ShapeChunkHeader {
    uint8_t chunkType;
    uint24_t nextChunk;
    // Note that the above isn't a standard type.
    // You can probably represent it as a bitfield if you want.

    // In layman's terms, if the next chunk offset is 0, then
    // it's the end of this shape.
    bool IsEndOfShape() {
         return nextChunk == 0;
    }
};
Chunk Type Description
0x1 4-Bit (16 Colours) Data
0x2 8-bit (256 Colours) Data
0x5 32-bit True Color Image
0x20 Palette/CLUT
105 Metal Bin (Metal Alpha)
0x70 Long/Full Name
0x85 (`0x5 OR 0x80`) 8-bit Data, RefPack Compressed

If `(type & 0x80) == 1` (seemingly only used for image data) the data is compressed with RefPack.

Texture Header

Type Description
Byte Entry Type
UInt24 Size
UInt16 Width
UInt16 Height
UInt16 XAxis
UInt16 YAxis
UInt16 Swizzled
UInt16 Unknown

The data following this header can be:

Image Type Data Type
4-bit 4-bit indexes into Palette/CLUT
8-bit 8-bit indexes into Palette/CLUT
32-bit BGRA8888 Direct Colors

Colour Palette Header

(this is the same as the image header, it's just [color count] x 1 sized)

Type Description
Byte Entry Type
UInt24 Size
UInt16 Width
UInt16 Height
UInt16 Total
UInt16 Unknown
UInt16 Swizzled
UInt16 Unknown

After the header is *Width* count BGRA8888 colors used to make up the palette.

Long Name Header

Type Description
Byte Entry Type
UInt24 Size
C String Long Name