-
Notifications
You must be signed in to change notification settings - Fork 15
/
MakeHex_ReadMe.txt
242 lines (185 loc) · 10.4 KB
/
MakeHex_ReadMe.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
ReadMe for MakeHex version 5 Copyright 2004 John S. Fine
You may use, copy, modify and/or distribute this program for private or
commercial use provided that:
1) You do not hold me responsible for any damage or negative consequences
resulting from those activities.
2) You include this copyright notice and disclaimer in any copy of any part
or all of this program.
I do not provide any warranty of the correctness, safety, or suitibility of
this program for any purpose.
If you do not agree to these conditions, you have no permission to use, copy,
modify or distribute this program.
-------------------------------------------------------------------------------
This program reads a .IRP file and creates a .HEX file containing the Pronto
hex sequences for the IR commands specified by that .IRP file. To use:
1) Select the .IRP file that corresponds to the IR protocol you want to use.
2) Edit that .IRP file with a text editor. MAKEHEX takes all its input from
the .IRP file including the device number and the range of function numbers.
You should change the "Device=" and "Function=" lines in the .IRP file to
specify the IR commands you want. You may want to change other values in
the .IRP file.
3a) In Windows file Explorer, drag the icon of the .irp file onto the
icon for MakeHex.exe
or
3b) In command line mode, type: "makehex FILE.irp"
(See command line options below for extra features).
or
3c) If you have edited and installed the .reg file (see below) you can run
MakeHex by double clicking or right clicking the icon for a .irp file.
Any way you run it, MakeHex will create a new file with the same base name as
the .irp file and the extension of .hex. (That new file will replace any
preexisting file with that name and the extension .hex).
4) Open the .hex file with a text editor or viewer.
5) Copy the hex sequences into your .CCF file.
5a) There is a program named IrPanels avaliable from
http://www.remotecentral.com/cgi-bin/files/rcfiles.cgi?area=pronto&db=other&br=utilities&dv=irprograms&md=ccfpanels&fc=&kw=&st=&dt=&so=&pg=1&file=utilities/irpanels.zip
that can be used to create a new CCF file with all the functions arranged in
panels for easy testing. After creating a .HEX file, open it with a text editor
such as NotePad. Use "Edit" "Select All", then "Edit" "Copy" to copy all the
text. Then start IrPanels and use ^V to paste the text into its window. Follow
IrPanels documentation for further steps.
--------------------------------------------------------------------------------
Edit existing .IRP files
Device= Normally, this is set to a single number which is the device code.
Some protocols (NEC, NEC2, and Panasonic) have an optional second
number in their device code. When using a second number you must
put a single dot between the two numbers.
Function= Normally, this is a pair of numbers with .. between them representing
a range of functions to be generated in the .hex file.
Define X= A few protocols (Nokia32, Pioneer2, etc.) have extra parts to a
command beyond the device and function numbers. These may need to be edited to
match related fields in the decoded signal.
--------------------------------------------------------------------------------
Command line options:
You can use -H or -B as a command line option before the file name, to specify
hex function numbering or both decimal and hex (the default is just decimal). For
example:
MakeHex -B nec1.irp
will generate nec1.hex with functions labeled in both decimal and hex.
This affects only the label generated above each sample of Pronto Hex. It doesn not
have any effect on the Pronto Hex itself. Also, the IrPanels program assumes
decimal function numbering, so you should not use these options to create input for
IrPanels.
--------------------------------------------------------------------------------
.REG file for Windows Right Click Menu:
If you use MakeHex a lot, or you want to use the command line options -H or -B
without using a command prompt, you should edit and install the enclosed .reg file
to define the double click and right click actions for .irp files.
Open irp.reg in a text editor (such as Windows Notepad).
Change at least the path to each program to correctly indicate where those
programs are on your computer.
Once you've saved the edited .reg file, double click it and respond to the
prompts to add it to the registry.
The first line of the .reg file may limit which versions of Windows this file
can be used on. If the .reg file is rejected when you double click it, use the
regedit program and export and key to a different .reg file, in order to find
out what Windows wants the first line of a .reg file to look like.
Notice that every string value in a .reg file is enclosed in quotes and that
within those quotes every quote and every backslash must be prefixed with an
extra backslash. For example, the string for the edit command is
C:\WINDOWS\notepad.exe "%1"
but to include that in the .reg file, it needed to be written as
"C:\\WINDOWS\\notepad.exe \"%1\""
You may also want to add more commands to the list, or change their names or
change which is the default (the one used if you double click rather than
right click).
The two lines in the .reg file that look like
[HKEY_CLASSES_ROOT\irp_auto_file\shell]
@="makehex"
specify the internal name (makehex) of the default command.
For each command, there are four lines such as:
[HKEY_CLASSES_ROOT\irp_auto_file\shell\makehex2]
@="MakeHex-&H"
[HKEY_CLASSES_ROOT\irp_auto_file\shell\makehex2\command]
@="C:\\IR\\MakeHex\\release\\MakeHex.exe -h \"%1\""
The internal name of the command (makehex2) on the first and third of these
lines is used only within this registry entry. It isn't displayed and doesn't
affect what the command does. You can pick any name you want, but using blanks
or other special characters in that name may cause problems, so don't.
The second line gives the visible (on the right click menu) name of the
command. Blanks an special charaters are fine in that name, if that's what you
want displayed.
The fourth line tells how the command should be executed.
--------------------------------------------------------------------------------
Building new .IRP files
Device=
This can be one value (which is used as D) or two values seperated by '.' (which
are used as D and S).
Function=
This can be one value (which is used as F) or two values seperated by '.' (which
are used as F and N). In either case it can be a range seperated by '..'
Function=a F is a
Function=a.b F is a, N is b
Function=a..b F from a to b
Function=a.b..c.d N from b to d for each possible f from a to c.
Define X=
Default X=
These act the same in the current version. Either defines a letter using an
expression (see below). D and F cannot be defined this way. S and N can be
defined this way and those definitions act only as defaults, which are
overriden if S or N are specified by the Device or Function line.
These can be used as in the U= of Tivo-NEC1 to specify extra input beyond
device and function. Or they can be used as in the C= of Panasonic to
compute intermediate results.
The positions of these lines within the file has no effect on the results.
You can use a letter before or after defining it. But for clarity, put
these lines right after Device or Function when they give extra input and
put them right before where they are used when they compute intermediate
results.
Protocol=
In this version, this is just a comment.
Frequency=
Sets the modulation frequency.
Timebase=
Sets the multiple used for any time values that aren't suffixed with 'u' or 'm'.
This line should come before any lines that use time values.
MessageTime=
Sets the duration of a frame. Unlike prior versions of MakeHex, this value
uses Timebase by default. If you don't want multiples of Timebase, suffix with
'u' or 'm'.
FIRSTBIT=MSB
If this line is present, any conversions of bit fields to signals is done MSB
first. Otherwise, those default to LSB first.
ZERO=
ONE=
PREFIX=
SUFFIX=
R-PREFIX=
R-SUFFIX=
Each of these defines a chunk of signal in the same syntax (see below) that
Form= defines the whole signal. However, these can each only refer to letters
and other chunks that were defined before them, while Form= can refer to
anything. Normally these are each just a list of positive and negaitive
durations.
FORM=
Defines the overall structure of the signal.
It is a list of expressions (see below) and the special characters '*' and '_'
seperated by commas and optionally one semi-colon.
The semi-colon marks the boundary between the one-time part and the repeat
part.
A '*' marks a point at which a prefix is inserted. An '_' marks a point at
which a suffix is inserted.
If MessageTime is specified, each of the two parts (single and repeat) if it
contains anything at all will padded up to MessageTime. For more flexible
specification of frame totals, use ^ in expressions.
Expressions
An expression defines either a duration or a bit-field.
A bit-field is either X:Y or X:Y:Z, where each of X, Y and Z are subexpressions.
If Y is positive X:Y means the low Y bits of X.
If Y is negative X:Y means the low abs(Y) bits of X, reversed to the opposite sequence,
so 4:3 and 1:-3 both are a 3 bit field with a value of 4.
X:Y:Z means discard the low Z bits of X and take the low abs(Y) bits of what's left
(reversed if Y is negative). So 32:3:3 or 8:-3:3 are two more ways to make a 3 bit
field with a value of 4. (Z should never be negative).
Subexpressions within an expression can be bit-fields or simple numbers. Any whole
expression that is not identifiable as a bit field will be treated as a duration.
A duration is multiplied by Timebase unless it is identifiably in units of 'u' or
'm'.
You can use () in an expression to make the intent clearer or to override the default
operator precidence. For example, A+B:8 means the same as (A+B):8 but the latter is
much clearer, and if you wanted A+(B:8) you need the ().
You can use '*', '+', '-', and '^' as infix operators and '-' and '~' as prefix
operators.
On a whole duration (not a subexpression) you can use '^' as a prefix operator to
create a padding gap duration which brings the total (since the beginning of the
one-time or repeating frame) to the indicated value (unless it's already larger).