Please create an account or Login! Have fun!

C2H: Difference between revisions

Jump to navigation Jump to search
imported>Stubbscroll
(added external link)
 
No edit summary
Line 1: Line 1:
=== Overview ===
A '''C2H ''' file (having the extension .c2h) is the file format where [[Chip's Challenge 2]] stores the best scores and times for each level.
A '''C2H ''' file (having the extension .c2h) is the file format where [[Chip's Challenge 2]] stores the best scores and times for each level.


Line 6: Line 5:
All data in the file is little-endian.
All data in the file is little-endian.


=== Section header format ===
== Format ==
{| class="article-table"
=== Section header ===
{| class="wikitable" border="1"
!Bytes
!Bytes
!Content
!Content
Line 19: Line 19:


=== Section types ===
=== Section types ===
{| class="article-table"
{| class="wikitable" border="1"
!Section ID
!Section ID
!Content Type
!Content Type
Line 51: Line 51:
=== SAVE section ===
=== SAVE section ===


{| class="article-table"
{| class="wikitable" border="1"
!Offset
!Offset
!Bytes
!Bytes
Line 68: Line 68:
|Highest bonus score achieved (does not include bonus from time left)
|Highest bonus score achieved (does not include bonus from time left)
|-
|-
|...
|0x0C
|
|4
|Unknown
|Sixtieths of a second left
|-
|0x10
|4
|Chips left
|-
|-
|0x14
|0x14
|4
|4
|Base level score, (level number)*500
|Time bonus
|-
|-
|0x18
|0x18
Line 80: Line 84:
|Level number
|Level number
|-
|-
|...
|0x1C
|
|4
|Unknown
|Initial time, in seconds
|-
|0x20
|4
|Number of level attempts before completion
|-
|0x24
|4
|Exit gender
|-
|0x28
|4
|Entry point that was used (advanced scripting)
|-
|0x2C
|4
|Exit that was used (advanced scripting)
|-
|-
|0x30
|0x30
Line 88: Line 108:
|1 if level is solved, 0 if unsolved
|1 if level is solved, 0 if unsolved
|-
|-
|...
|0x34
|
|4
|Unknown
|Result (advanced scripting)
|-
|0x38
|4
|Register 1 (advanced scripting)
|-
|0x3C
|4
|Register 2 (advanced scripting)
|-
|0x40
|4
|Register 3 (advanced scripting)
|-
|0x44
|4
|Register 4 (advanced scripting)
|-
|0x48
|4
|Menu processing
|-
|0x4C
|4
|Internal flags
|-
|0x50
|4
|Tools carried on exit
|-
|0x54
|4
|Keys carried on exit
|-
|-
|0x58
|0x58
Line 96: Line 148:
|Highest level time achieved
|Highest level time achieved
|-
|-
|0x5c
|0x5C
|4
|4
|Highest level score achieved (including base level score)
|Highest level score achieved (including base level score)
Line 102: Line 154:
|0x60
|0x60
|4
|4
|Unknown
|Level checksum
|}
|}


== External Links ==
== External Links ==


*[http://www.pvv.org/~spaans/c2h.txt Notes on the .c2m file format by Ruben Spaans]
*[http://www.pvv.org/~spaans/CC2fileformat.txt Skype message from Chuck Sommerville about .c2h file format]
*[http://www.pvv.org/~spaans/c2h.txt Notes on the .c2h file format by Ruben Spaans]
 
[[Category:Terminology]]
[[Category:Terminology]]

Revision as of 18:26, 6 February 2019

A C2H file (having the extension .c2h) is the file format where Chip's Challenge 2 stores the best scores and times for each level.

The file is a binary file consisting of several sections one after the other, terminated by the END section. Each section begins with a section header, which is followed by the section's data. Each level in the set that the player has encountered has its own copy of the FILE, TYPE, NAME and SAVE sections.

All data in the file is little-endian.

Format

Section header

Bytes Content
4 Four character code identifying the section, see table below. Codes shorter than 4 characters (such as "END") are padded with spaces (making "END " in this case).
4 The length of the section's data

Section types

Section ID Content Type Content
CC2H Null-terminated string The file's version. The latest version is "7".
FILE Null-terminated string The level's file name
TYPE Null-terminated string Usually the name of the levelset. For the base game, it's "Chips Challenge 2". In some cases it contains an empty string.
NAME Null-terminated string The level's title
SAVE 100 bytes Miscellaneous data
END No content (length is 0) Signifies end of file

SAVE section

Offset Bytes Content
0x00 4 Line number into c2g file where music and level file name can be found
0x04 4 Some kind of total score, in most cases slightly lower than the actual total score
0x08 4 Highest bonus score achieved (does not include bonus from time left)
0x0C 4 Sixtieths of a second left
0x10 4 Chips left
0x14 4 Time bonus
0x18 4 Level number
0x1C 4 Initial time, in seconds
0x20 4 Number of level attempts before completion
0x24 4 Exit gender
0x28 4 Entry point that was used (advanced scripting)
0x2C 4 Exit that was used (advanced scripting)
0x30 4 1 if level is solved, 0 if unsolved
0x34 4 Result (advanced scripting)
0x38 4 Register 1 (advanced scripting)
0x3C 4 Register 2 (advanced scripting)
0x40 4 Register 3 (advanced scripting)
0x44 4 Register 4 (advanced scripting)
0x48 4 Menu processing
0x4C 4 Internal flags
0x50 4 Tools carried on exit
0x54 4 Keys carried on exit
0x58 4 Highest level time achieved
0x5C 4 Highest level score achieved (including base level score)
0x60 4 Level checksum

External Links