FANDOM


File Formats - Petit ComputerEdit

This is a comprehensive list of the of the information contained in each file format used by Petit computer.


Common HeadingEdit

Total Size: 48 Bytes

Byte(s) Contained information
0-3 Petit Computer header: Always contains "PX01"
4-11 Number of bytes after header
12-19 File name
20-35 MD5 hash string. See notes
36-47 File type: Given in each category

Notes:Edit

The hash string is made from the following information.

  • PETITCOM
  • Data after header
  • File type


You can use the following C++ library to generate MD5 hash strings. it is very portable and each encryption is broken into modules. The only thing you need to include to use this is the relavant header("md5.h") and "<string>".  http://create.stephan-brumme.com/hash-library/

Since writing a tutorial on MD5 hash generation would require a page of its own, and because I do not have time to break the whole algorithm down I will leave a link to how the algorithm operates if you want to make it yourself.

https://www.ietf.org/rfc/rfc1321.txt


PRG FileEdit

File Type: PETC0300RPRG

Total Size(Without Heading): 12+ Bytes

Byte(s) Contained information
48-56 Unused(needs to be tested)
57-59 The number of characters in file(Including spaces, carriage returns, etc.). See notes
60+ Petit computer character data: See Character Table for reference

Notes:Edit

The absolute maximum number of characters that can be in a program is 524,228(07 FF CF), which for whatever reason is less than the maximum value that 3 bytes can store.


CHR FileEdit

File Type: PETC0100RCHR

Total Size(Without Heading): 8193

Byte(s) Contained information
48-8240 Each byte makes up two pixels units which can have a value pointing to one of the 16(0-15) palette indexes.

Format:Edit

Each character block is made up of 64 pixel elements which is stored into 32 bytes. The data for the character to the right(or first position next column) after this block. The following image will help to visualize how each block is stored

Chr-format

How a CHR file is stored

COL FileEdit

File Type: PETC0100RCOL

Total Size(Without Heading): 512 Bytes

Byte(s) Contained information
48-560 Palette data: See below for format

Format:Edit

Each color consists of 2 bytes(16 bits) and the color is read in the following format.

GGGRRRRR GBBBBBGG

Each color has 5 bits except for green which has 6

Coming SoonEdit

  • GRP
  • SCR

CreditsEdit

  • Petrified lasagna: Most of the above article
  • Randomouscrap98: Creation of this that contains information about the header
  • Discostew: Knowing about the information in the header in the first place!

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.