Difference between revisions of "HP Prime/File Format"

From TI-Planet's HP Calcs Wiki
Jump to navigation Jump to search
(Add information about program files)
(titles.)
Line 7: Line 7:
  
  
 +
=== App / App Data ===
 
* '''"*.hpapp", "*.hpappnote", "*.hpapprgm"''': data for applications, built-in or others.
 
* '''"*.hpapp", "*.hpappnote", "*.hpapprgm"''': data for applications, built-in or others.
 
For built-in applications, *.hpappnote files are 2+ bytes long, and *.hpappprgm files are 22+ bytes long.
 
For built-in applications, *.hpappnote files are 2+ bytes long, and *.hpappprgm files are 22+ bytes long.
  
  
* '''"*.hpprgm": user BASIC programs'''.<br />
+
=== User BASIC programs ===
 +
* '''"*.hpprgm"'''<br />
 
There is a bit of metadata at the beginning, then the text of the program is stored as Unicode (UTF-16 little-endian).<br />
 
There is a bit of metadata at the beginning, then the text of the program is stored as Unicode (UTF-16 little-endian).<br />
 
(''The metadata at the beginning is about "information about exported variables/programs (so the system knows how to recognize them, and number of arguments for example), a compiled bytecode area, and the source."''<ref>Tim Wessman, Aug. 20 2013  -  http://www.omnimaga.org/index.php?topic=16826.msg304202#msg304202</ref>)
 
(''The metadata at the beginning is about "information about exported variables/programs (so the system knows how to recognize them, and number of arguments for example), a compiled bytecode area, and the source."''<ref>Tim Wessman, Aug. 20 2013  -  http://www.omnimaga.org/index.php?topic=16826.msg304202#msg304202</ref>)
Line 17: Line 19:
  
  
 +
=== Settings ===
 
* '''"calc.settings", "cas.settings, "settings"''': binary information about settings.
 
* '''"calc.settings", "cas.settings, "settings"''': binary information about settings.
 
** calc.settings contains a number of UTF-16 little-endian strings, among which some names for built-in apps, and the user input in the home screen (under a semi-internal form: strings such as "EVALLIST" and "NEG" can be seen).
 
** calc.settings contains a number of UTF-16 little-endian strings, among which some names for built-in apps, and the user input in the home screen (under a semi-internal form: strings such as "EVALLIST" and "NEG" can be seen).
  
  
 +
=== Lists ===
 
* '''"*.hplist": list files''': <br/> Some facts gathered over time: (''Some unknown bytes are about "flags indicating status, location in memory, or similar"''<ref>Tim Wessman, Aug. 20 2013  -  http://www.omnimaga.org/index.php?topic=16826.msg304191#msg304191</ref>)
 
* '''"*.hplist": list files''': <br/> Some facts gathered over time: (''Some unknown bytes are about "flags indicating status, location in memory, or similar"''<ref>Tim Wessman, Aug. 20 2013  -  http://www.omnimaga.org/index.php?topic=16826.msg304191#msg304191</ref>)
 
** The first group appears to contain a common "header" : [01/02] 00 16 00. The first byte apparently is 01 for a calculator-generated list or 02 for a connectivity-kit generated one.
 
** The first group appears to contain a common "header" : [01/02] 00 16 00. The first byte apparently is 01 for a calculator-generated list or 02 for a connectivity-kit generated one.
Line 44: Line 48:
  
  
 +
=== Matrices ===
 
* '''"*.hpmat": matrix files''': <br/> The "header" appears to be : 01 00 14 01
 
* '''"*.hpmat": matrix files''': <br/> The "header" appears to be : 01 00 14 01
 
** [ [ 0 ] ] (default) is a 24-byte file:   01 00 14 01 02 00 00 00 <ins>01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 '''00'''</ins>
 
** [ [ 0 ] ] (default) is a 24-byte file:   01 00 14 01 02 00 00 00 <ins>01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 '''00'''</ins>
Line 49: Line 54:
  
  
 +
=== Notes ===
 
* '''"*.hpnote": note (text) files''':
 
* '''"*.hpnote": note (text) files''':
 
** the file seems to contain the text of the note as UTF-16 little endian, followed by a null byte (U+0000), followed by some formatting information starting by "CSWD110".
 
** the file seems to contain the text of the note as UTF-16 little endian, followed by a null byte (U+0000), followed by some formatting information starting by "CSWD110".
  
  
 +
=== Test modes ===
 
* '''"testmodes.hptestmodes"''': current settings for the exam mode ?
 
* '''"testmodes.hptestmodes"''': current settings for the exam mode ?
 +
  
 
== References ==
 
== References ==
 
  <references/>
 
  <references/>

Revision as of 20:42, 21 September 2013

This page aims at providing information about the file types of the HP Prime and their storage format (on both the computer side and the calculator side, if they're different).

Known file types

This list was extracted from the folder used by the computer version of the HP Prime software (dated August 15th, 2013), namely %appdata%/HP_Prime on Windows, and through the files generated by the HP (Prime) Connectivity Kit, located in %home%\Documents\HP Connectivity Kit\Calculators\MyCalc.
So far, it is believed that the text is in UTF-16 little endian. For other data, it appears to be sized in multiples of 4 (bytes grouped by 4).
Everything below is in hexadecimal.


App / App Data

  • "*.hpapp", "*.hpappnote", "*.hpapprgm": data for applications, built-in or others.

For built-in applications, *.hpappnote files are 2+ bytes long, and *.hpappprgm files are 22+ bytes long.


User BASIC programs

  • "*.hpprgm"

There is a bit of metadata at the beginning, then the text of the program is stored as Unicode (UTF-16 little-endian).
(The metadata at the beginning is about "information about exported variables/programs (so the system knows how to recognize them, and number of arguments for example), a compiled bytecode area, and the source."[1]) "On poweroff, the source is saved to flash if it has been modified. The bytecode is discarded."[2]


Settings

  • "calc.settings", "cas.settings, "settings": binary information about settings.
    • calc.settings contains a number of UTF-16 little-endian strings, among which some names for built-in apps, and the user input in the home screen (under a semi-internal form: strings such as "EVALLIST" and "NEG" can be seen).


Lists

  • "*.hplist": list files:
    Some facts gathered over time: (Some unknown bytes are about "flags indicating status, location in memory, or similar"[3])
    • The first group appears to contain a common "header" : [01/02] 00 16 00. The first byte apparently is 01 for a calculator-generated list or 02 for a connectivity-kit generated one.
    • The second group contains the number of elements in the list (only the 1st byte of the group ?), which we'll call n.
    • The next group(s) (n different instances of this kind of group) contains some kind of timestamp as its bytes changes over time for a same, given, list.
    • The next 4 group(s) (n different instances of this kind of 4-groups) contain the element's actual data (elements in reverse order of the list) :
      • The first (and second ?) subgroup contains some info about the number, like '01' on the 4th byte if positive (or zero), or 'FF' if negative
      • The first 3 bytes of this subgroup are, as far as we know, not about the element itself.
      • The 2nd subgroup's indicates the exponent (length of the number, minus 1). If positive, it's directly given (in hex) on the first byte (the 3 remaining right bytes being 0), and if negative, it's given by substracting from 0x100 the absolute value of the exponent (e.g. 'FD' for -3). The 3 remaining right bytes are FF.
      • The 2 last subgroups contain the number, from right to left, little endian.
        Examples :
    • {} (default/empty): a 8-byte file:          01 00 16 00  00 00 00 00
    • {0} is stored as a 28-byte file:            01 00 16 00  01 00 00 00  18 2D 23 01  00 00 00 01  00 00 00 00  00 00 00 00  00 00 00 00
    • {1} is stored as a 28-byte file:            01 00 16 00  01 00 00 00  38 2D 23 01  00 00 00 01  00 00 00 00  00 00 00 00  00 00 00 01
    • {2} is stored as a 28-byte file:            01 00 16 00  01 00 00 00  58 2D 23 01  00 00 00 01  00 00 00 00  00 00 00 00  00 00 00 02
    • {1337} is stored as a 28-byte file:       01 00 16 00  01 00 00 00  40 75 8D 01  02 00 10 01  03 00 00 00  00 00 00 00  00 70 33 01
    • {9001} is stored as a 28-byte file:       01 00 16 00  01 00 00 00  80 75 8D 01  01 00 10 01  03 00 00 00  00 00 00 00  00 10 00 09
    • {-9001} is stored as a 28-byte file:      01 00 16 00  01 00 00 00 A0 75 8D 01  01 00 10 FF  03 00 00 00  00 00 00 00  00 10 00 09
    • {-1} is stored as a 28-byte file:           01 00 16 00  01 00 00 00  08 2D 23 01  00 00 00 FF  00 00 00 00  00 00 00 00  00 00 00 01
    • {1.23456789012E19} [...] 28-byte:      01 00 16 01  01 00 00 00  D8 5B AD 01 01 00 10 01  13 00 00 00  00 20 01 89  67 45 23 01
    • {0.00123} is stored as a 28-byte file:  02 00 16 01  01 00 00 00  E8 60 AD 01 01 00 10 01  FD FF FF FF 00 00 00 00  00 00 23 01
    • {1,2} is stored as a 48-byte file:         01 00 16 00  02 00 00 00  18 2D 23 01  38 2D 23 01  00 00 00 01  00 00 00 00  00 00 00 00  00 00 00 02  00 00 00 01  00 00 00 00  00 00 00 00  00 00 00 01
    • {-9001,1337,2} is [...] 68-byte file:      01 00 16 00  03 00 00 00  80 75 8D 01  50 75 8D 01  38 2D 23 01  00 00 00 01  00 00 00 00  00 00 00 00  00 00 00 02  02 00 10 01  03 00 00 00  00 00 00 00  00 70 33 01  01 00 10 FF  03 00 00 00  00 00 00 00  00 10 00 09


Matrices

  • "*.hpmat": matrix files:
    The "header" appears to be : 01 00 14 01
    • [ [ 0 ] ] (default) is a 24-byte file:   01 00 14 01 02 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00
    • [ [ 1 ] ] is stored as a 24-byte file: 01 00 14 01 02 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 01


Notes

  • "*.hpnote": note (text) files:
    • the file seems to contain the text of the note as UTF-16 little endian, followed by a null byte (U+0000), followed by some formatting information starting by "CSWD110".


Test modes

  • "testmodes.hptestmodes": current settings for the exam mode ?


References