A82: 82p file hacked!!!


[Prev][Next][Index][Thread]

A82: 82p file hacked!!!



I just completed the hack of the TI-82 PRGM file.  Those of you who want to
write your own shell for the 82, it just became one step closer.  For those
of you who want to create modular add-on levels to your games...well, same
thing.  The attached file (25K) contains ALL my notes on the 82p file
format.  Enjoy!

**************************  TI-82 Program Info.  ****************************

I.  Introduction
II.  TI-82 Program Header Info.
III.  Decimal/Hexidecimal Breakdown Of TI-82 Commands
IV.  Calculating The Checksum
V.  Credits
VI.  Conclusion



I.  Introduction
  I needed some information on the format of a *.82p file for SQRXZ 82.  The
purpose of doing this would be so people could create add-on modules for the
game without too much hassle.  The information that I will present here will
prove VERY useful if you ever plan to write your own shell.  I hope that it
will prove as beneficial to you as it did me.

NOTE:  Values in brackets throughout this document mean that the number is in
       decimal.  Otherwise, assume hex.



II.  TI-82 Program Header Info.
  The following is a table of the bytes that make up the header of the *.82p
file:

  Byte(s) (in decimal)             What It Contains
  ------------------------------------------------------
  1-11                             **TI82**[26][10][0]
  12-53                            Comment
  54-55                            (69-70)+15 or (71-72)+17
  56-57                            [11][0]
  58-59                            Repeats 69-70
  60                               [5] unprotected
                                   [6] protected
  61-68                            Name of program
  69-70                            (71-72)+2
  71-72                            Length of file to end minus Checksum
  73-(n-2)                         Actual program
  (n-1)-(n)                        Checksum

NOTE:  n is the length of the file in bytes.



III.  Decimal/Hexidecimal Breakdown Of TI-82 Commands
  The following table breaks down EVERY command possible to the TI-82.  This
information is VERY useful for creating checksums for shells.  It also helps
in making add-on modules for games.

Command                        Byte(s)             Hex.
-----------------------------------------------------------
>DMS                           [001]               01
>Dec                           [002]               02
>Frac                          [003]               03
->                             [004]               04
Boxplot                        [005]               05
[                              [006]               06
]                              [007]               07
{                              [008]               08
}                              [009]               09
r                              [010]               0A
(Degree)                       [011]               0B
^-1                            [012]               0C
^2                             [013]               0D
T                              [014]               0E
^3                             [015]               0F
(                              [016]               10
)                              [017]               11
round(                         [018]               12
pxl-Test(                      [019]               13
augment(                       [020]               14
rowSwap(                       [021]               15
row+(                          [022]               16
*row(                          [023]               17
*row+(                         [024]               18
max(                           [025]               19
min(                           [026]               1A
R>Pr(                          [027]               1B
R>P0(                          [028]               1C
P>Rx(                          [029]               1D
P>Ry(                          [030]               1E
median(                        [031]               1F
randM(                         [032]               20
mean(                          [033]               21
solve(                         [034]               22
seq(                           [035]               23
fnInt(                         [036]               24
nDeriv(                        [037]               25
fMin(                          [039]               27
fMax(                          [040]               28
                               [041]               29
"                              [042]               2A
,                              [043]               2B
!                              [045]               2D
CubicReg                       [046]               2E
QuartReg                       [047]               2F
0                              [048]               30
1                              [049]               31
2                              [050]               32
3                              [051]               33
4                              [052]               34
5                              [053]               35
6                              [054]               36
7                              [055]               37
8                              [056]               38
9                              [057]               39
.                              [058]               3A
EE                             [059]               3B
 or                            [060]               3C
 xor                           [061]               3D
:                              [062]               3E
(Hard Return)                  [063]               3F
 and                           [064]               40
A                              [065]               41
B                              [066]               42
C                              [067]               43
D                              [068]               44
E                              [069]               45
F                              [070]               46
G                              [071]               47
H                              [072]               48
I                              [073]               49
J                              [074]               4A
K                              [075]               4B
L                              [076]               4C
M                              [077]               4D
N                              [078]               4E
O                              [079]               4F
P                              [080]               50
Q                              [081]               51
R                              [082]               52
S                              [083]               53
T                              [084]               54
U                              [085]               55
V                              [086]               56
W                              [087]               57
X                              [088]               58
Y                              [089]               59
Z                              [090]               5A
0                              [091]               5B
[A]                            [092][0]            5C 00
[B]                            [092][1]            5C 01
[C]                            [092][2]            5C 02
[D]                            [092][3]            5C 03
[E]                            [092][4]            5C 04
L1                             [093][0]            5D 00
L2                             [093][1]            5D 01
L3                             [093][2]            5D 02
L4                             [093][3]            5D 03
L5                             [093][4]            5D 04
L6                             [093][5]            5D 05
Y1                             [094][016]          5E 10
Y2                             [094][017]          5E 11
Y3                             [094][018]          5E 12
Y4                             [094][019]          5E 13
Y5                             [094][020]          5E 14
Y6                             [094][021]          5E 15
Y7                             [094][022]          5E 16
Y8                             [094][023]          5E 17
Y9                             [094][024]          5E 18
Y0                             [094][025]          5E 19
X1T                            [094][032]          5E 20
Y1T                            [094][033]          5E 21
X2T                            [094][034]          5E 22
Y2T                            [094][035]          5E 23
X3T                            [094][036]          5E 24
Y3T                            [094][037]          5E 25
X4T                            [094][038]          5E 26
Y4T                            [094][039]          5E 27
X5T                            [094][040]          5E 28
Y5T                            [094][041]          5E 29
X6T                            [094][042]          5E 2A
Y6T                            [094][043]          5E 2B
r1                             [094][064]          5E 40
r2                             [094][065]          5E 41
r3                             [094][066]          5E 42
r4                             [094][067]          5E 43
r5                             [094][068]          5E 44
r6                             [094][069]          5E 45
Un                             [094][128]          5E 80
Vn                             [094][129]          5E 81
prgm                           [095]               5F
Pic1                           [096][0]            60 00
Pic2                           [096][1]            60 01
Pic3                           [096][2]            60 02
Pic4                           [096][3]            60 03
Pic5                           [096][4]            60 04
Pic6                           [096][5]            60 05
GDB1                           [097][0]            61 00
GDB2                           [097][1]            61 01
GDB3                           [097][2]            61 02
GDB4                           [097][3]            61 03
GDB5                           [097][4]            61 04
GDB6                           [097][5]            61 05
n                              [098][02]           62 02
(x with overscore)             [098][03]           62 03
(summation)x                   [098][04]           62 04
(summation)x^2                 [098][05]           62 05
Sx                             [098][06]           62 06
(Sigma x)                      [098][07]           62 07
minX                           [098][08]           62 08
maxX                           [098][09]           62 09
minY                           [098][10]           62 0A
maxY                           [098][11]           62 0B
(y with overscore)             [098][12]           62 0C
(summation)y                   [098][13]           62 0D
(summation)y^2                 [098][14]           62 0E
Sy                             [098][15]           62 0F
(Sigma y)                      [098][16]           62 10
(summation)xy                  [098][17]           62 11
r                              [098][18]           62 12
Med                            [098][19]           62 13
Q1                             [098][20]           62 14
Q3                             [098][21]           62 15
a                              [098][22]           62 16
b                              [098][23]           62 17
c                              [098][24]           62 18
d                              [098][25]           62 19
e                              [098][26]           62 1A
x1                             [098][27]           62 1B
x2                             [098][28]           62 1C
x3                             [098][29]           62 1D
y1                             [098][30]           62 1E
y2                             [098][31]           62 1F
y3                             [098][32]           62 20
n                              [098][33]           62 21
ZXscl                          [099][00]           63 00
ZYscl                          [099][01]           63 01
Xscl                           [099][02]           63 02
Yscl                           [099][03]           63 03
UnStart                        [099][04]           63 04
VnStart                        [099][05]           63 05
Un-1                           [099][06]           63 06
Vn-1                           [099][07]           63 07
ZUnStart                       [099][08]           63 08
ZVnStart                       [099][09]           63 09
Xmin                           [099][10]           63 0A
Xmax                           [099][11]           63 0B
Ymin                           [099][12]           63 0C
Ymax                           [099][13]           63 0D
Tmin                           [099][14]           63 0E
Tmax                           [099][15]           63 0F
0min                           [099][16]           63 10
0max                           [099][17]           63 11
ZXmin                          [099][18]           63 12
ZXmax                          [099][19]           63 13
ZYmin                          [099][20]           63 14
ZYmax                          [099][21]           63 15
Z0min                          [099][22]           63 16
Z0max                          [099][23]           63 17
ZTmin                          [099][24]           63 18
ZTmax                          [099][25]           63 19
TblMin                         [099][26]           63 1A
nMin                           [099][27]           63 1B
ZnMin                          [099][28]           63 1C
nMax                           [099][29]           63 1D
ZnMax                          [099][30]           63 1E
nStart                         [099][31]           63 1F
ZnStart                        [099][32]           63 20
/_\Tbl                         [099][33]           63 21
Tstep                          [099][34]           63 22
0step                          [099][35]           63 23
ZTstep                         [099][36]           63 24
Z0step                         [099][37]           63 25
/_\X                           [099][38]           63 26
/_\Y                           [099][39]           63 27
XFact                          [099][40]           63 28
YFact                          [099][41]           63 29
TblInput                       [099][42]           63 2A
Radian                         [100]               64
Degree                         [101]               65
Normal                         [102]               66
Sci                            [103]               67
Eng                            [104]               68
Float                          [105]               69
=                              [106]               6A
<                              [107]               6B
>                              [108]               6C
<=                             [109]               6D
>=                             [110]               6E
!=                             [111]               6F
+                              [112]               70
-                              [113]               71
Ans                            [114]               72
Fix 0                          [115][48]           73 30
Fix 1                          [115][49]           73 31
Fix 2                          [115][50]           73 32
Fix 3                          [115][51]           73 33
Fix 4                          [115][52]           73 34
Fix 5                          [115][53]           73 35
Fix 6                          [115][54]           73 36
Fix 7                          [115][55]           73 37
Fix 8                          [115][56]           73 38
Fix 9                          [115][57]           73 39
Split                          [116]               74
FullScreen                     [117]               75
Func                           [118]               76
Param                          [119]               77
Polar                          [120]               78
Seq                            [121]               79
IndpntAuto                     [122]               7A
IndpntAsk                      [123]               7B
DependAuto                     [124]               7C
DependAsk                      [125]               7D
Sequential                     [126][0]            7E 00
Simul                          [126][1]            7E 01
Connected                      [126][6]            7E 06
Dot                            [126][7]            7E 07
(Plot box)                     [127]               7F
(Plot plus)                    [128]               80
(Plot dot)                     [129]               81
*                              [130]               82
/                              [131]               83
ClrDraw                        [133]               85
ZStandard                      [134]               86
ZTrig                          [135]               87
ZBox                           [136]               88
Zoom In                        [137]               89
Zoom Out                       [138]               8A
ZSquare                        [139]               8B
ZInteger                       [140]               8C
ZPrevious                      [141]               8D
ZDecimal                       [142]               8E
ZoomStat                       [143]               8F
ZoomRcl                        [144]               90
PrintScreen                    [145]               91
ZoomSto                        [146]               92
Text(                          [147]               93
 nPr                           [148]               94
 nCr                           [149]               95
FnOn                           [150]               96
FnOff                          [151]               97
StorePic                       [152]               98
RecallPic                      [153]               99
StoreGDB                       [154]               9A
RecallGDB                      [155]               9B
Line(                          [156]               9C
Vertical                       [157]               9D
Pt-On(                         [158]               9E
Pt-Off(                        [159]               9F
Pt-Change(                     [160]               A0
Pxl-On(                        [161]               A1
Pxl-Off(                       [162]               A2
Pxl-Change(                    [163]               A3
Shade(                         [164]               A4
Circle(                        [165]               A5
Horizontal                     [166]               A6
Tangent(                       [167]               A7
DrawInv                        [168]               A8
DrawF                          [169]               A9
rand                           [171]               AB
(PI)                           [172]               AC
getKey                         [173]               AD
' (Minute)                     [174]               AE
?                              [175]               AF
-                              [176]               B0
int                            [177]               B1
abs                            [178]               B2
det                            [179]               B3
identity                       [180]               B4
dim                            [181]               B5
sum                            [182]               B6
prod                           [183]               B7
not                            [184]               B8
iPart                          [185]               B9
^(1/2) (Square Root)           [188]               BC
^(1/3) (Cube Root)             [189]               BD
ln                             [190]               BE
e^                             [191]               BF
log                            [192]               C0
10^                            [193]               C1
sin                            [194]               C2
sin-1                          [195]               C3
cos                            [196]               C4
cos-1                          [197]               C5
tan                            [198]               C6
tan-1                          [199]               C7
sinh                           [200]               C8
sinh-1                         [201]               C9
cosh                           [202]               CA
cosh-1                         [203]               CB
tanh                           [204]               CC
tanh-1                         [205]               CD
If                             [206]               CE
Then                           [207]               CF
Else                           [208]               D0
While                          [209]               D1
Repeat                         [210]               D2
For(                           [211]               D3
End                            [212]               D4
Return                         [213]               D5
Lbl                            [214]               D6
Goto                           [215]               D7
Pause                          [216]               D8
Stop                           [217]               D9
IS>(                           [218]               DA
DS<(                           [219]               DB
Input                          [220]               DC
Prompt                         [221]               DD
Disp                           [222]               DE
DispGraph                      [223]               DF
Output(                        [224]               E0
ClrHome                        [225]               E1
Fill(                          [226]               E2
SortA(                         [227]               E3
SortD(                         [228]               E4
DispTable                      [229]               E5
Menu(                          [230]               E6
Send(                          [231]               E7
Get(                           [232]               E8
PlotsOn                        [233]               E9
PlotsOff                       [234]               EA
Plot1(                         [236]               EC
Plot2(                         [237]               ED
Plot3(                         [238]               EE
^                              [240]               F0
^(1/x) (xth Root)              [241]               F1
1-Var Stats                    [242]               F2
2-Var Stats                    [243]               F3
LinReg(a+bx)                   [244]               F4
ExpReg                         [245]               F5
LnReg                          [246]               F6
PwrReg                         [247]               F7
Med-Med                        [248]               F8
QuadReg                        [249]               F9
ClrList                        [250]               FA
ClrTable                       [251]               FB
Histogram                      [252]               FC
xyLine                         [253]               FD
Scatter                        [254]               FE
LinReg(ax+b)                   [255]               FF



IV.  Calculating The Checksum
  The two bytes at the end of any *.82p file are the checksum to make sure
nothing in the file has been tampered with.  If you are writing a shell, you
will need to make a program that adjusts these bytes so they can be sent
across a link cable.  FIX.COM is a good program that does this, but it is not
very nice looking when compiling programs for a shell.  So, if you want to
make your own program that creates a header and writes the checksum all in
one step, this section is for you.
  First, you need to create the header and have two bytes reserved at the end
of the program for the checksum.  Next, ADD all the bytes from byte 37-(n-2).
Now, find the **remainder** of the added bytes when you divide it by 65535
(added bytes MOD 65535).  This is to get the checksum down to a two byte
integer.  Now you have the checksum and can put it into the file.



V.  Credits
  Name                            E-mail Address          Accomplishment
-----------------------------------------------------------------------------
  Thomas J. Hruska                thruska@tir.com         This document
  David Boozer                                            Checksum section



VI.  Conclusion
  This file was basically designed to help me decide how I would make the
SQRXZ 82 modular add-on levels.  However, there are a wide variety of uses
for this file, so I decided to release my findings to the public.  I hope
that many programmers will benefit from my notes on the *.82p file format.
This is just one more way that Shining Light Productions is meeting the needs
of fellow programmers.

Signed,
Thomas J. Hruska
thruska@tir.com

Shining Light Productions
"Meeting the Needs of Fellow Programmers"
C/C++
JavaScript
QBasic
TI-82 ASM
TI-BASIC
HTML

                 Thomas J. Hruska -- thruska@tir.com
Shining Light Productions -- "Meeting the needs of fellow programmers"
         http://www.geocities.com/SiliconValley/Heights/8504
                    http://shinelight.home.ml.org