LMS 2012
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
bytecodes.h
Go to the documentation of this file.
1 /*
2  * LEGO® MINDSTORMS EV3
3  *
4  * Copyright (C) 2010-2013 The LEGO Group
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 
22 #ifndef BYTECODES_H_
23 #define BYTECODES_H_
24 
25 #define BYTECODE_VERSION 1.04
26 
37 // HARDWARE
38 
39 #define vmOUTPUTS 4
40 #define vmINPUTS 4
41 #define vmBUTTONS 6
42 #define vmLEDS 4
43 
44 #define vmLCD_WIDTH 178
45 #define vmLCD_HEIGHT 128
46 #define vmTOPLINE_HEIGHT 10
47 #define vmLCD_STORE_LEVELS 3
48 
49 #define vmDEFAULT_VOLUME 100
50 #define vmDEFAULT_SLEEPMINUTES 30
51 
52 // SOFTWARE
53 
54 #define vmFG_COLOR 1
55 #define vmBG_COLOR 0
56 
57 #define vmCHAIN_DEPT 4
58 
59 #define FILEPERMISSIONS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
60 #define DIRPERMISSIONS (S_IRWXU | S_IRWXG | S_IRWXO)
61 #define SYSPERMISSIONS (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)
62 
63 #define vmPATHSIZE 84
64 #define vmNAMESIZE 32
65 #define vmEXTSIZE 5
66 #define vmFILENAMESIZE 120
67 #define vmMACSIZE 18
68 #define vmIPSIZE 16
69 #define vmBTADRSIZE 13
70 
71 #define vmERR_STRING_SIZE 32 // Inclusive zero termination
72 
73 #define vmEVENT_BT_PIN 1
74 #define vmEVENT_BT_REQ_CONF 2
75 
76 #define vmMAX_VALID_TYPE 101
77 
78 // FOLDERS
79 
80 #define vmMEMORY_FOLDER "/mnt/ramdisk"
81 #define vmPROGRAM_FOLDER "../prjs/BrkProg_SAVE"
82 #define vmDATALOG_FOLDER "../prjs/BrkDL_SAVE"
83 #define vmSDCARD_FOLDER "../prjs/SD_Card"
84 #define vmUSBSTICK_FOLDER "../prjs/USB_Stick"
85 
86 #define vmPRJS_DIR "../prjs"
87 #define vmAPPS_DIR "../apps"
88 #define vmTOOLS_DIR "../tools"
89 #define vmTMP_DIR "../tmp"
90 
91 #define vmSETTINGS_DIR "../sys/settings"
92 
93 #define vmDIR_DEEPT 127
94 
95 // FILES USED IN APPLICATION
96 
97 #define vmLASTRUN_FILE_NAME "lastrun"
98 #define vmCALDATA_FILE_NAME "caldata"
99 
100 // FILES USED IN APPS
101 
102 #define vmSLEEP_FILE_NAME "Sleep"
103 #define vmVOLUME_FILE_NAME "Volume"
104 #define vmWIFI_FILE_NAME "WiFi"
105 #define vmBLUETOOTH_FILE_NAME "Bluetooth"
106 
107 // EXTENSIONS
108 
109 #define vmEXT_SOUND ".rsf"
110 #define vmEXT_GRAPHICS ".rgf"
111 #define vmEXT_BYTECODE ".rbf"
112 #define vmEXT_TEXT ".rtf"
113 #define vmEXT_DATALOG ".rdf"
114 #define vmEXT_PROGRAM ".rpf"
115 #define vmEXT_CONFIG ".rcf"
116 #define vmEXT_ARCHIVE ".raf"
117 
118 // NAME LENGTHs
119 
120 #define vmBRICKNAMESIZE 120
121 #define vmBTPASSKEYSIZE 7
122 #define vmWIFIPASSKEYSIZE 33
123 
124 // VALID CHARACTERS
125 
126 #define vmCHARSET_NAME 0x01
127 #define vmCHARSET_FILENAME 0x02
128 #define vmCHARSET_BTPASSKEY 0x04
129 #define vmCHARSET_WIFIPASSKEY 0x08
130 #define vmCHARSET_WIFISSID 0x10
131 
132 
133 /* \endverbatim */
134 
135 
140 typedef enum
141 {
142 // \endverbatim \ref VM \verbatim
143 // 0000....
144  opERROR = 0x00, // 0000
145  opNOP = 0x01, // 0001
146  opPROGRAM_STOP = 0x02, // 0010
147  opPROGRAM_START = 0x03, // 0011
148  opOBJECT_STOP = 0x04, // 0100
149  opOBJECT_START = 0x05, // 0101
150  opOBJECT_TRIG = 0x06, // 0110
151  opOBJECT_WAIT = 0x07, // 0111
152  opRETURN = 0x08, // 1000
153  opCALL = 0x09, // 1001
154  opOBJECT_END = 0x0A, // 1010
155  opSLEEP = 0x0B, // 1011
156  opPROGRAM_INFO = 0x0C, // 1100
157  opLABEL = 0x0D, // 1101
158  opPROBE = 0x0E, // 1110
159  opDO = 0x0F, // 1111
160 
161 // \endverbatim \ref cMath "MATH" \verbatim
162 // 0001....
163 // ADD 00..
164  opADD8 = 0x10, // 00
165  opADD16 = 0x11, // 01
166  opADD32 = 0x12, // 10
167  opADDF = 0x13, // 11
168 // SUB 01..
169  opSUB8 = 0x14, // 00
170  opSUB16 = 0x15, // 01
171  opSUB32 = 0x16, // 10
172  opSUBF = 0x17, // 11
173 // MUL 10..
174  opMUL8 = 0x18, // 00
175  opMUL16 = 0x19, // 01
176  opMUL32 = 0x1A, // 10
177  opMULF = 0x1B, // 11
178 // DIV 11..
179  opDIV8 = 0x1C, // 00
180  opDIV16 = 0x1D, // 01
181  opDIV32 = 0x1E, // 10
182  opDIVF = 0x1F, // 11
183 
184 // \endverbatim \ref Logic "LOGIC" \verbatim
185 // LOGIC 0010....
186 // OR 00..
187  opOR8 = 0x20, // 00
188  opOR16 = 0x21, // 01
189  opOR32 = 0x22, // 10
190 
191 // AND 01..
192  opAND8 = 0x24, // 00
193  opAND16 = 0x25, // 01
194  opAND32 = 0x26, // 10
195 
196 // XOR 10..
197  opXOR8 = 0x28, // 00
198  opXOR16 = 0x29, // 01
199  opXOR32 = 0x2A, // 10
200 
201 // RL 11..
202  opRL8 = 0x2C, // 00
203  opRL16 = 0x2D, // 01
204  opRL32 = 0x2E, // 10
205 
206 // \endverbatim \ref cMove "MOVE" \verbatim
207  opINIT_BYTES = 0x2F, // 1111
208 // MOVE 0011....
209 // MOVE8_ 00..
210  opMOVE8_8 = 0x30, // 00
211  opMOVE8_16 = 0x31, // 01
212  opMOVE8_32 = 0x32, // 10
213  opMOVE8_F = 0x33, // 11
214 // MOVE16_ 01..
215  opMOVE16_8 = 0x34, // 00
216  opMOVE16_16 = 0x35, // 01
217  opMOVE16_32 = 0x36, // 10
218  opMOVE16_F = 0x37, // 11
219 // MOVE32_ 10..
220  opMOVE32_8 = 0x38, // 00
221  opMOVE32_16 = 0x39, // 01
222  opMOVE32_32 = 0x3A, // 10
223  opMOVE32_F = 0x3B, // 11
224 // MOVEF_ 11..
225  opMOVEF_8 = 0x3C, // 00
226  opMOVEF_16 = 0x3D, // 01
227  opMOVEF_32 = 0x3E, // 10
228  opMOVEF_F = 0x3F, // 11
229 
230 // \endverbatim \ref cBranch "BRANCH" \verbatim
231 // BRANCH 010000..
232  opJR = 0x40, // 00
233  opJR_FALSE = 0x41, // 01
234  opJR_TRUE = 0x42, // 10
235  opJR_NAN = 0x43, // 11
236 
237 // \endverbatim \ref cCompare "COMPARE" \verbatim
238 // COMPARE 010.....
239 // CP_LT 001..
240  opCP_LT8 = 0x44, // 00
241  opCP_LT16 = 0x45, // 01
242  opCP_LT32 = 0x46, // 10
243  opCP_LTF = 0x47, // 11
244 // CP_GT 010..
245  opCP_GT8 = 0x48, // 00
246  opCP_GT16 = 0x49, // 01
247  opCP_GT32 = 0x4A, // 10
248  opCP_GTF = 0x4B, // 11
249 // CP_EQ 011..
250  opCP_EQ8 = 0x4C, // 00
251  opCP_EQ16 = 0x4D, // 01
252  opCP_EQ32 = 0x4E, // 10
253  opCP_EQF = 0x4F, // 11
254 // CP_NEQ 100..
255  opCP_NEQ8 = 0x50, // 00
256  opCP_NEQ16 = 0x51, // 01
257  opCP_NEQ32 = 0x52, // 10
258  opCP_NEQF = 0x53, // 11
259 // CP_LTEQ 101..
260  opCP_LTEQ8 = 0x54, // 00
261  opCP_LTEQ16 = 0x55, // 01
262  opCP_LTEQ32 = 0x56, // 10
263  opCP_LTEQF = 0x57, // 11
264 // CP_GTEQ 110..
265  opCP_GTEQ8 = 0x58, // 00
266  opCP_GTEQ16 = 0x59, // 01
267  opCP_GTEQ32 = 0x5A, // 10
268  opCP_GTEQF = 0x5B, // 11
269 
270 // \endverbatim \ref Select "SELECT" \verbatim
271 // SELECT 010111..
272  opSELECT8 = 0x5C, // 00
273  opSELECT16 = 0x5D, // 01
274  opSELECT32 = 0x5E, // 10
275  opSELECTF = 0x5F, // 11
276 
277 
278 // \endverbatim \ref VM \verbatim
279  opSYSTEM = 0x60,
280  opPORT_CNV_OUTPUT = 0x61,
281  opPORT_CNV_INPUT = 0x62,
282  opNOTE_TO_FREQ = 0x63,
283 
284 // \endverbatim \ref cBranch "BRANCH" \verbatim
285 // BRANCH 011000..
286  //? 00
287  //? 01
288  //? 10
289  //? 11
290 // JR_LT 001..
291  opJR_LT8 = 0x64, // 00
292  opJR_LT16 = 0x65, // 01
293  opJR_LT32 = 0x66, // 10
294  opJR_LTF = 0x67, // 11
295 // JR_GT 010..
296  opJR_GT8 = 0x68, // 00
297  opJR_GT16 = 0x69, // 01
298  opJR_GT32 = 0x6A, // 10
299  opJR_GTF = 0x6B, // 11
300 // JR_EQ 011..
301  opJR_EQ8 = 0x6C, // 00
302  opJR_EQ16 = 0x6D, // 01
303  opJR_EQ32 = 0x6E, // 10
304  opJR_EQF = 0x6F, // 11
305 // JR_NEQ 100..
306  opJR_NEQ8 = 0x70, // 00
307  opJR_NEQ16 = 0x71, // 01
308  opJR_NEQ32 = 0x72, // 10
309  opJR_NEQF = 0x73, // 11
310 // JR_LTEQ 101..
311  opJR_LTEQ8 = 0x74, // 00
312  opJR_LTEQ16 = 0x75, // 01
313  opJR_LTEQ32 = 0x76, // 10
314  opJR_LTEQF = 0x77, // 11
315 // JR_GTEQ 110..
316  opJR_GTEQ8 = 0x78, // 00
317  opJR_GTEQ16 = 0x79, // 01
318  opJR_GTEQ32 = 0x7A, // 10
319  opJR_GTEQF = 0x7B, // 11
320 
321 // \endverbatim \ref VM \verbatim
322  opINFO = 0x7C, // 01111100
323  opSTRINGS = 0x7D, // 01111101
324  opMEMORY_WRITE = 0x7E, // 01111110
325  opMEMORY_READ = 0x7F, // 01111111
326 
327 // SYSTEM 1.......
328 
329 // \endverbatim \ref cUi "UI" \verbatim
330 // UI 100000..
331  opUI_FLUSH = 0x80, // 00
332  opUI_READ = 0x81, // 01
333  opUI_WRITE = 0x82, // 10
334  opUI_BUTTON = 0x83, // 11
335  opUI_DRAW = 0x84, // 10000100
336 
337 // \endverbatim \ref cTimer "TIMER" \verbatim
338  opTIMER_WAIT = 0x85, // 10000101
339  opTIMER_READY = 0x86, // 10000110
340  opTIMER_READ = 0x87, // 10000111
341 
342 // \endverbatim \ref VM \verbatim
343 // BREAKPOINT 10001...
344  opBP0 = 0x88, // 000
345  opBP1 = 0x89, // 001
346  opBP2 = 0x8A, // 010
347  opBP3 = 0x8B, // 011
348  opBP_SET = 0x8C, // 10001100
349  opMATH = 0x8D, // 10001101
350  opRANDOM = 0x8E, // 10001110
351 
352 // \endverbatim \ref cTimer "TIMER" \verbatim
353  opTIMER_READ_US = 0x8F, // 10001111
354 
355 // \endverbatim \ref cUi "UI" \verbatim
356  opKEEP_ALIVE = 0x90, // 10010000
357 
358 // \endverbatim \ref cCom "COM" \verbatim
359 // 100100
360  opCOM_READ = 0x91, // 01
361  opCOM_WRITE = 0x92, // 10
362 
363 // \endverbatim \ref cSound "SOUND" \verbatim
364 // 100101
365  opSOUND = 0x94, // 00
366  opSOUND_TEST = 0x95, // 01
367  opSOUND_READY = 0x96, // 10
368 
369 // \endverbatim \ref cInput "INPUT" \verbatim
370 //
371  opINPUT_SAMPLE = 0x97, // 10010111
372 
373 // 10011...
374  opINPUT_DEVICE_LIST = 0x98, // 000
375  opINPUT_DEVICE = 0x99, // 001
376  opINPUT_READ = 0x9A, // 010
377  opINPUT_TEST = 0x9B, // 011
378  opINPUT_READY = 0x9C, // 100
379  opINPUT_READSI = 0x9D, // 101
380  opINPUT_READEXT = 0x9E, // 110
381  opINPUT_WRITE = 0x9F, // 111
382 // \endverbatim \ref cOutput "OUTPUT" \verbatim
383 // 101.....
384  opOUTPUT_GET_TYPE = 0xA0, // 00000
385  opOUTPUT_SET_TYPE = 0xA1, // 00001
386  opOUTPUT_RESET = 0xA2, // 00010
387  opOUTPUT_STOP = 0xA3, // 00011
388  opOUTPUT_POWER = 0xA4, // 00100
389  opOUTPUT_SPEED = 0xA5, // 00101
390  opOUTPUT_START = 0xA6, // 00110
391  opOUTPUT_POLARITY = 0xA7, // 00111
392  opOUTPUT_READ = 0xA8, // 01000
393  opOUTPUT_TEST = 0xA9, // 01001
394  opOUTPUT_READY = 0xAA, // 01010
395  opOUTPUT_POSITION = 0xAB, // 01011
396  opOUTPUT_STEP_POWER = 0xAC, // 01100
397  opOUTPUT_TIME_POWER = 0xAD, // 01101
398  opOUTPUT_STEP_SPEED = 0xAE, // 01110
399  opOUTPUT_TIME_SPEED = 0xAF, // 01111
400 
401  opOUTPUT_STEP_SYNC = 0xB0, // 10000
402  opOUTPUT_TIME_SYNC = 0xB1, // 10001
403  opOUTPUT_CLR_COUNT = 0xB2, // 10010
404  opOUTPUT_GET_COUNT = 0xB3, // 10011
405 
406  opOUTPUT_PRG_STOP = 0xB4, // 10100
407 
408 // \endverbatim \ref cMemory "MEMORY" \verbatim
409 // 11000...
410  opFILE = 0xC0, // 000
411  opARRAY = 0xC1, // 001
412  opARRAY_WRITE = 0xC2, // 010
413  opARRAY_READ = 0xC3, // 011
414  opARRAY_APPEND = 0xC4, // 100
415  opMEMORY_USAGE = 0xC5, // 101
416  opFILENAME = 0xC6, // 110
417 
418 // \endverbatim \ref cMove "READ" \verbatim
419 // 110010..
420  opREAD8 = 0xC8, // 00
421  opREAD16 = 0xC9, // 01
422  opREAD32 = 0xCA, // 10
423  opREADF = 0xCB, // 11
424 
425 // \endverbatim \ref cMove "WRITE" \verbatim
426 // 110011..
427  opWRITE8 = 0xCC, // 00
428  opWRITE16 = 0xCD, // 01
429  opWRITE32 = 0xCE, // 10
430  opWRITEF = 0xCF, // 11
431 
432 // \endverbatim \ref cCom "COM" \verbatim
433 // 11010...
434  opCOM_READY = 0xD0, // 000
435  opCOM_READDATA = 0xD1, // 001
436  opCOM_WRITEDATA = 0xD2, // 010
437  opCOM_GET = 0xD3, // 011
438  opCOM_SET = 0xD4, // 100
439  opCOM_TEST = 0xD5, // 101
440  opCOM_REMOVE = 0xD6, // 110
441  opCOM_WRITEFILE = 0xD7, // 111
442 
443 // 11011...
444  opMAILBOX_OPEN = 0xD8, // 000
445  opMAILBOX_WRITE = 0xD9, // 001
446  opMAILBOX_READ = 0xDA, // 010
447  opMAILBOX_TEST = 0xDB, // 011
448  opMAILBOX_READY = 0xDC, // 100
449  opMAILBOX_CLOSE = 0xDD, // 101
450 
451 // SPARE 111.....
452 
453 // \endverbatim \ref TST \verbatim
454  opTST = 0xFF // 11111111
455 }
456 OP;
457 /*
458  * \endverbatim
459  */
460 
461 
467 
468 typedef enum
469 {
470  GET_VBATT = 1,
471  GET_IBATT = 2,
472  GET_OS_VERS = 3,
473  GET_EVENT = 4,
474  GET_TBATT = 5,
475  GET_IINT = 6,
476  GET_IMOTOR = 7,
477  GET_STRING = 8,
478  GET_HW_VERS = 9,
479  GET_FW_VERS = 10,
480  GET_FW_BUILD = 11,
481  GET_OS_BUILD = 12,
482  GET_ADDRESS = 13,
483  GET_CODE = 14,
484  KEY = 15,
485  GET_SHUTDOWN = 16,
486  GET_WARNING = 17,
487  GET_LBATT = 18,
488  TEXTBOX_READ = 21,
489  GET_VERSION = 26,
490  GET_IP = 27,
491  GET_POWER = 29,
492  GET_SDCARD = 30,
493  GET_USBSTICK = 31,
494 
495  UI_READ_SUBCODES
496 }
497 UI_READ_SUBCODE;
498 
500 
501 
507 
508 typedef enum
509 {
510  WRITE_FLUSH = 1,
511  FLOATVALUE = 2,
512  STAMP = 3,
513  PUT_STRING = 8,
514  VALUE8 = 9,
515  VALUE16 = 10,
516  VALUE32 = 11,
517  VALUEF = 12,
518  ADDRESS = 13,
519  CODE = 14,
520  DOWNLOAD_END = 15,
521  SCREEN_BLOCK = 16,
522  TEXTBOX_APPEND = 21,
523  SET_BUSY = 22,
524  SET_TESTPIN = 24,
525  INIT_RUN = 25,
526  UPDATE_RUN = 26,
527  LED = 27,
528  POWER = 29,
529  GRAPH_SAMPLE = 30,
530  TERMINAL = 31,
531 
532  UI_WRITE_SUBCODES
533 }
534 UI_WRITE_SUBCODE;
535 
537 
538 
544 
545 typedef enum
546 {
547  SHORTPRESS = 1,
548  LONGPRESS = 2,
549  WAIT_FOR_PRESS = 3,
550  FLUSH = 4,
551  PRESS = 5,
552  RELEASE = 6,
553  GET_HORZ = 7,
554  GET_VERT = 8,
555  PRESSED = 9,
556  SET_BACK_BLOCK = 10,
557  GET_BACK_BLOCK = 11,
558  TESTSHORTPRESS = 12,
559  TESTLONGPRESS = 13,
560  GET_BUMBED = 14,
561  GET_CLICK = 15,
562 
563  UI_BUTTON_SUBCODES
564 }
565 UI_BUTTON_SUBCODE;
566 
568 
569 
575 
576 typedef enum
577 {
578  COMMAND = 14,
579 
580  COM_READ_SUBCODES
581 }
582 COM_READ_SUBCODE;
583 
585 
586 
592 
593 typedef enum
594 {
595  REPLY = 14,
596 
597  COM_WRITE_SUBCODES
598 }
599 COM_WRITE_SUBCODE;
600 
602 
603 
608 
609 typedef enum
610 {
611  GET_ON_OFF = 1,
612  GET_VISIBLE = 2,
613  GET_RESULT = 4,
614  GET_PIN = 5,
615  SEARCH_ITEMS = 8,
616  SEARCH_ITEM = 9,
617  FAVOUR_ITEMS = 10,
618  FAVOUR_ITEM = 11,
619  GET_ID = 12,
620  GET_BRICKNAME = 13,
621  GET_NETWORK = 14,
622  GET_PRESENT = 15,
623  GET_ENCRYPT = 16,
624  CONNEC_ITEMS = 17,
625  CONNEC_ITEM = 18,
626  GET_INCOMING = 19,
627  GET_MODE2 = 20,
628 
629  COM_GET_SUBCODES
630 }
631 COM_GET_SUBCODE;
632 
634 
635 
640 
641 typedef enum
642 {
643  SET_ON_OFF = 1,
644  SET_VISIBLE = 2,
645  SET_SEARCH = 3,
646  SET_PIN = 5,
647  SET_PASSKEY = 6,
648  SET_CONNECTION = 7,
649  SET_BRICKNAME = 8,
650  SET_MOVEUP = 9,
651  SET_MOVEDOWN = 10,
652  SET_ENCRYPT = 11,
653  SET_SSID = 12,
654  SET_MODE2 = 13,
655 
656  COM_SET_SUBCODES
657 }
658 COM_SET_SUBCODE;
659 
661 
662 
668 
669 typedef enum
670 {
671  GET_FORMAT = 2,
672  CAL_MINMAX = 3,
673  CAL_DEFAULT = 4,
674  GET_TYPEMODE = 5,
675  GET_SYMBOL = 6,
676  CAL_MIN = 7,
677  CAL_MAX = 8,
678  SETUP = 9,
679  CLR_ALL = 10,
680  GET_RAW = 11,
681  GET_CONNECTION = 12,
682  STOP_ALL = 13,
683  GET_NAME = 21,
684  GET_MODENAME = 22,
685  SET_RAW = 23,
686  GET_FIGURES = 24,
687  GET_CHANGES = 25,
688  CLR_CHANGES = 26,
689  READY_PCT = 27,
690  READY_RAW = 28,
691  READY_SI = 29,
692  GET_MINMAX = 30,
693  GET_BUMPS = 31,
694 
695  INPUT_DEVICESUBCODES
696 }
697 INPUT_DEVICE_SUBCODE;
698 
700 
701 
707 
708 typedef enum
709 {
710  OBJ_STOP = 0, // VM
711  OBJ_START = 4, // VM
712  GET_STATUS = 22, // VM
713  GET_SPEED = 23, // VM
714  GET_PRGRESULT = 24, // VM
715  SET_INSTR = 25, // VM
716 
717  PROGRAM_INFO_SUBCODES,
718 }
719 PROGRAM_INFO_SUBCODE;
720 
722 
723 
729 
730 typedef enum
731 {
732  UPDATE = 0,
733  CLEAN = 1,
734  PIXEL = 2,
735  LINE = 3,
736  CIRCLE = 4,
737  TEXT = 5,
738  ICON = 6,
739  PICTURE = 7,
740  VALUE = 8,
741  FILLRECT = 9,
742  RECT = 10,
743  NOTIFICATION = 11,
744  QUESTION = 12,
745  KEYBOARD = 13,
746  BROWSE = 14,
747  VERTBAR = 15,
748  INVERSERECT = 16,
749  SELECT_FONT = 17,
750  TOPLINE = 18,
751  FILLWINDOW = 19,
752  SCROLL = 20,
753  DOTLINE = 21,
754  VIEW_VALUE = 22,
755  VIEW_UNIT = 23,
756  FILLCIRCLE = 24,
757  STORE = 25,
758  RESTORE = 26,
759  ICON_QUESTION = 27,
760  BMPFILE = 28,
761  POPUP = 29,
762  GRAPH_SETUP = 30,
763  GRAPH_DRAW = 31,
764  TEXTBOX = 32,
765 
766  UI_DRAW_SUBCODES
767 }
768 UI_DRAW_SUBCODE;
769 
771 
772 
778 
779 typedef enum
780 {
781  OPEN_APPEND = 0,
782  OPEN_READ = 1,
783  OPEN_WRITE = 2,
784  READ_VALUE = 3,
785  WRITE_VALUE = 4,
786  READ_TEXT = 5,
787  WRITE_TEXT = 6,
788  CLOSE = 7,
789  LOAD_IMAGE = 8,
790  GET_HANDLE = 9,
791  MAKE_FOLDER = 10,
792  GET_POOL = 11,
793  SET_LOG_SYNC_TIME = 12,
794  GET_FOLDERS = 13,
795  GET_LOG_SYNC_TIME = 14,
796  GET_SUBFOLDER_NAME = 15,
797  WRITE_LOG = 16,
798  CLOSE_LOG = 17,
799  GET_IMAGE = 18,
800  GET_ITEM = 19,
801  GET_CACHE_FILES = 20,
802  PUT_CACHE_FILE = 21,
803  GET_CACHE_FILE = 22,
804  DEL_CACHE_FILE = 23,
805  DEL_SUBFOLDER = 24,
806  GET_LOG_NAME = 25,
807 
808  OPEN_LOG = 27,
809  READ_BYTES = 28,
810  WRITE_BYTES = 29,
811  REMOVE = 30,
812  MOVE = 31,
813 
814  FILE_SUBCODES
815 }
816 FILE_SUBCODE;
817 
819 
820 
826 
827 typedef enum
828 {
829  DELETE = 0,
830  CREATE8 = 1,
831  CREATE16 = 2,
832  CREATE32 = 3,
833  CREATEF = 4,
834  RESIZE = 5,
835  FILL = 6,
836  COPY = 7,
837  INIT8 = 8,
838  INIT16 = 9,
839  INIT32 = 10,
840  INITF = 11,
841  SIZE = 12,
842  READ_CONTENT = 13,
843  WRITE_CONTENT = 14,
844  READ_SIZE = 15,
845 
846  ARRAY_SUBCODES
847 }
848 ARRAY_SUBCODE;
849 
851 
852 
857 
858 typedef enum
859 {
860  EXIST = 16,
861  TOTALSIZE = 17,
862  SPLIT = 18,
863  MERGE = 19,
864  CHECK = 20,
865  PACK = 21,
866  UNPACK = 22,
867  GET_FOLDERNAME = 23,
868 
869  FILENAME_SUBCODES
870 }
871 FILENAME_SUBCODE;
872 
874 
875 
881 
882 typedef enum
883 {
884  SET_ERROR = 1,
885  GET_ERROR = 2,
886  ERRORTEXT = 3,
887 
888  GET_VOLUME = 4,
889  SET_VOLUME = 5,
890  GET_MINUTES = 6,
891  SET_MINUTES = 7,
892 
893  INFO_SUBCODES
894 }
895 INFO_SUBCODE;
896 
898 
899 
905 
906 typedef enum
907 {
908  BREAK = 0,
909  TONE = 1,
910  PLAY = 2,
911  REPEAT = 3,
912  SERVICE = 4,
913 
914  SOUND_SUBCODES
915 }
916 SOUND_SUBCODE;
917 
919 
920 
926 
927 typedef enum
928 {
929  GET_SIZE = 1, // VM get string size
930  ADD = 2, // VM add two strings
931  COMPARE = 3, // VM compare two strings
932  DUPLICATE = 5, // VM duplicate one string to another
933  VALUE_TO_STRING = 6,
934  STRING_TO_VALUE = 7,
935  STRIP = 8,
936  NUMBER_TO_STRING = 9,
937  SUB = 10,
938  VALUE_FORMATTED = 11,
939  NUMBER_FORMATTED = 12,
940 
941  STRING_SUBCODES
942 }
943 STRING_SUBCODE;
944 
946 
947 
954 typedef enum
955 {
956  GUI_SLOT = 0,
957  USER_SLOT = 1,
958  CMD_SLOT = 2,
959  TERM_SLOT = 3,
960  DEBUG_SLOT = 4,
961 
962  SLOTS,
963 
964  // ONLY VALID IN opPROGRAM_STOP
965  CURRENT_SLOT = -1
966 }
967 SLOT;
968 
969 /* \endverbatim */
970 
971 
976 typedef enum
977 {
978  NO_BUTTON = 0,
979  UP_BUTTON = 1,
980  ENTER_BUTTON = 2,
981  DOWN_BUTTON = 3,
982  RIGHT_BUTTON = 4,
983  LEFT_BUTTON = 5,
984  BACK_BUTTON = 6,
985  ANY_BUTTON = 7,
986 
987  BUTTONTYPES = 8
988 }
989 BUTTONTYPE;
990 
991 /* \endverbatim */
992 
993 
998 typedef enum
999 {
1000  EXP = 1,
1001  MOD = 2,
1002  FLOOR = 3,
1003  CEIL = 4,
1004  ROUND = 5,
1005  ABS = 6,
1006  NEGATE = 7,
1007  SQRT = 8,
1008  LOG = 9,
1009  LN = 10,
1010  SIN = 11,
1011  COS = 12,
1012  TAN = 13,
1013  ASIN = 14,
1014  ACOS = 15,
1015  ATAN = 16,
1016  MOD8 = 17,
1017  MOD16 = 18,
1018  MOD32 = 19,
1019  POW = 20,
1020  TRUNC = 21,
1021 
1022  MATHTYPES
1023 }
1024 MATHTYPE;
1025 
1026 /* \endverbatim */
1027 
1028 
1033 
1034 typedef enum
1035 {
1036  TST_OPEN = 10,
1037  TST_CLOSE = 11,
1038  TST_READ_PINS = 12,
1039  TST_WRITE_PINS = 13,
1040  TST_READ_ADC = 14,
1041  TST_WRITE_UART = 15,
1042  TST_READ_UART = 16,
1043  TST_ENABLE_UART = 17,
1044  TST_DISABLE_UART = 18,
1045  TST_ACCU_SWITCH = 19,
1046  TST_BOOT_MODE2 = 20,
1047  TST_POLL_MODE2 = 21,
1048  TST_CLOSE_MODE2 = 22,
1049  TST_RAM_CHECK = 23,
1050 
1051  TST_SUBCODES
1052 }
1053 TST_SUBCODE;
1054 
1056 
1057 
1062 typedef enum
1063 {
1064  BROWSE_FOLDERS = 0,
1065  BROWSE_FOLDS_FILES = 1,
1066  BROWSE_CACHE = 2,
1067  BROWSE_FILES = 3,
1068 
1069  BROWSERTYPES
1070 }
1071 BROWSERTYPE;
1072 
1073 /* \endverbatim */
1074 
1075 
1080 typedef enum
1081 {
1082  NORMAL_FONT = 0,
1083  SMALL_FONT = 1,
1084  LARGE_FONT = 2,
1085  TINY_FONT = 3,
1086 
1087  FONTTYPES
1088 }
1089 FONTTYPE;
1090 
1091 /* \endverbatim */
1092 
1093 
1098 typedef enum
1099 {
1100  NORMAL_ICON = 0,
1101  SMALL_ICON = 1,
1102  LARGE_ICON = 2,
1103  MENU_ICON = 3,
1104  ARROW_ICON = 4,
1105 
1106  ICONTYPES
1107 }
1108 ICONTYPE;
1109 
1110 
1111 typedef enum
1112 {
1113  SICON_CHARGING = 0,
1114  SICON_BATT_4 = 1,
1115  SICON_BATT_3 = 2,
1116  SICON_BATT_2 = 3,
1117  SICON_BATT_1 = 4,
1118  SICON_BATT_0 = 5,
1119  SICON_WAIT1 = 6,
1120  SICON_WAIT2 = 7,
1121  SICON_BT_ON = 8,
1122  SICON_BT_VISIBLE = 9,
1123  SICON_BT_CONNECTED = 10,
1124  SICON_BT_CONNVISIB = 11,
1125  SICON_WIFI_3 = 12,
1126  SICON_WIFI_2 = 13,
1127  SICON_WIFI_1 = 14,
1128  SICON_WIFI_CONNECTED = 15,
1129 
1130  SICON_USB = 21,
1131 
1132  S_ICON_NOS
1133 }
1134 S_ICON_NO;
1135 
1136 
1137 typedef enum
1138 {
1139  ICON_NONE = -1,
1140  ICON_RUN = 0,
1141  ICON_FOLDER = 1,
1142  ICON_FOLDER2 = 2,
1143  ICON_USB = 3,
1144  ICON_SD = 4,
1145  ICON_SOUND = 5,
1146  ICON_IMAGE = 6,
1147  ICON_SETTINGS = 7,
1148  ICON_ONOFF = 8,
1149  ICON_SEARCH = 9,
1150  ICON_WIFI = 10,
1151  ICON_CONNECTIONS = 11,
1152  ICON_ADD_HIDDEN = 12,
1153  ICON_TRASHBIN = 13,
1154  ICON_VISIBILITY = 14,
1155  ICON_KEY = 15,
1156  ICON_CONNECT = 16,
1157  ICON_DISCONNECT = 17,
1158  ICON_UP = 18,
1159  ICON_DOWN = 19,
1160  ICON_WAIT1 = 20,
1161  ICON_WAIT2 = 21,
1162  ICON_BLUETOOTH = 22,
1163  ICON_INFO = 23,
1164  ICON_TEXT = 24,
1165 
1166 
1167  ICON_QUESTIONMARK = 27,
1168  ICON_INFO_FILE = 28,
1169  ICON_DISC = 29,
1170  ICON_CONNECTED = 30,
1171  ICON_OBP = 31,
1172  ICON_OBD = 32,
1173  ICON_OPENFOLDER = 33,
1174  ICON_BRICK1 = 34,
1175  N_ICON_NOS
1176 }
1177 N_ICON_NO;
1178 
1179 
1180 typedef enum
1181 {
1182  YES_NOTSEL = 0,
1183  YES_SEL = 1,
1184  NO_NOTSEL = 2,
1185  NO_SEL = 3,
1186  OFF = 4,
1187  WAIT_VERT = 5,
1188  WAIT_HORZ = 6,
1189  TO_MANUAL = 7,
1190  WARNSIGN = 8,
1191  WARN_BATT = 9,
1192  WARN_POWER = 10,
1193  WARN_TEMP = 11,
1194  NO_USBSTICK = 12,
1195  TO_EXECUTE = 13,
1196  TO_BRICK = 14,
1197  TO_SDCARD = 15,
1198  TO_USBSTICK = 16,
1199  TO_BLUETOOTH = 17,
1200  TO_WIFI = 18,
1201  TO_TRASH = 19,
1202  TO_COPY = 20,
1203  TO_FILE = 21,
1204  CHAR_ERROR = 22,
1205  COPY_ERROR = 23,
1206  PROGRAM_ERROR = 24,
1207 
1208 
1209  WARN_MEMORY = 27,
1210  L_ICON_NOS
1211 }
1212 L_ICON_NO;
1213 
1214 
1215 typedef enum
1216 {
1217  ICON_STAR = 0,
1218  ICON_LOCKSTAR = 1,
1219  ICON_LOCK = 2,
1220  ICON_PC = 3,
1221  ICON_PHONE = 4,
1222  ICON_BRICK = 5,
1223  ICON_UNKNOWN = 6,
1224  ICON_FROM_FOLDER = 7,
1225  ICON_CHECKBOX = 8,
1226  ICON_CHECKED = 9,
1227  ICON_XED = 10,
1228 
1229  M_ICON_NOS
1230 }
1231 M_ICON_NO;
1232 
1233 
1234 typedef enum
1235 {
1236 
1237  ICON_LEFT = 1,
1238  ICON_RIGHT = 2,
1239 
1240  A_ICON_NOS
1241 }
1242 A_ICON_NO;
1243 
1244 
1245 /* \endverbatim */
1246 
1247 
1252 typedef enum
1253 {
1254  BTTYPE_PC = 3,
1255  BTTYPE_PHONE = 4,
1256  BTTYPE_BRICK = 5,
1257  BTTYPE_UNKNOWN = 6,
1258 
1259  BTTYPES
1260 }
1261 BTTYPE;
1262 
1263 
1264 /* \endverbatim */
1265 
1266 
1271 typedef enum
1272 {
1273  LED_BLACK = 0,
1274  LED_GREEN = 1,
1275  LED_RED = 2,
1276  LED_ORANGE = 3,
1277  LED_GREEN_FLASH = 4,
1278  LED_RED_FLASH = 5,
1279  LED_ORANGE_FLASH = 6,
1280  LED_GREEN_PULSE = 7,
1281  LED_RED_PULSE = 8,
1282  LED_ORANGE_PULSE = 9,
1283 
1284  LEDPATTERNS
1285 }
1286 LEDPATTERN;
1287 
1288 
1289 /* \endverbatim */
1290 
1291 
1292 typedef enum
1293 {
1294  LED_ALL = 0,
1295  LED_RR = 1,
1296  LED_RG = 2,
1297  LED_LR = 3,
1298  LED_LG = 4
1299 }
1300 LEDTYPE;
1301 
1302 
1308 typedef enum
1309 {
1310  FILETYPE_UNKNOWN = 0x00,
1311  TYPE_FOLDER = 0x01,
1312  TYPE_SOUND = 0x02,
1313  TYPE_BYTECODE = 0x03,
1314  TYPE_GRAPHICS = 0x04,
1315  TYPE_DATALOG = 0x05,
1316  TYPE_PROGRAM = 0x06,
1317  TYPE_TEXT = 0x07,
1318  TYPE_SDCARD = 0x10,
1319  TYPE_USBSTICK = 0x20,
1320 
1321  FILETYPES,
1322 
1323  TYPE_RESTART_BROWSER = -1,
1324  TYPE_REFRESH_BROWSER = -2
1325 }
1326 FILETYPE;
1327 
1328 /* \endverbatim */
1329 
1330 
1338 typedef enum
1339 {
1340  OK = 0,
1341  BUSY = 1,
1342  FAIL = 2,
1343  STOP = 4
1344 }
1345 RESULT;
1346 
1347 /* \endverbatim */
1348 
1349 
1356 typedef enum
1357 {
1358  DATA_8 = 0x00,
1359  DATA_16 = 0x01,
1360  DATA_32 = 0x02,
1361  DATA_F = 0x03,
1362  DATA_S = 0x04,
1363  DATA_A = 0x05,
1364 
1365  DATA_V = 0x07,
1366 
1367  DATA_PCT = 0x10,
1368  DATA_RAW = 0x12,
1369  DATA_SI = 0x13,
1370 
1371  DATA_FORMATS
1372 }
1373 DATA_FORMAT;
1374 
1375 /*\endverbatim
1376  *
1377  * \n
1378  */
1379 
1380 
1387 typedef enum
1388 {
1389  DEL_NONE = 0,
1390  DEL_TAB = 1,
1391  DEL_SPACE = 2,
1392  DEL_RETURN = 3,
1393  DEL_COLON = 4,
1394  DEL_COMMA = 5,
1395  DEL_LINEFEED = 6,
1396  DEL_CRLF = 7,
1397 
1398  DELS
1399 }
1400 DEL;
1401 
1402 /*\endverbatim
1403  *
1404  * \n
1405  */
1406 
1407 
1412 typedef enum
1413 {
1414  HW_USB = 1,
1415  HW_BT = 2,
1416  HW_WIFI = 3,
1417 
1418  HWTYPES
1419 }
1420 HWTYPE;
1421 
1422 /* \endverbatim */
1423 
1424 
1429 typedef enum
1430 {
1431  ENCRYPT_NONE = 0,
1432  ENCRYPT_WPA2 = 1,
1433 
1434  ENCRYPTS
1435 }
1436 ENCRYPT;
1437 
1438 /* \endverbatim */
1439 
1440 
1441 typedef enum
1442 {
1445 
1447 }
1448 MIX;
1449 
1450 
1451 typedef enum
1452 {
1453  RED = 0,
1454  GREEN = 1,
1455  BLUE = 2,
1456  BLANK = 3,
1458 }
1459 COLOR;
1460 
1461 
1462 /* Constants related to color sensor value using */
1463 /* Color sensor as color detector */
1464 typedef enum
1465 {
1472 }
1473 NXTCOLOR;
1474 
1475 
1476 typedef enum
1477 {
1483 
1486 
1487  WARNINGS = 0x3F
1488 }
1489 WARNING;
1490 
1491 
1492 #define DATA8_NAN ((DATA8)(-128))
1493 #define DATA16_NAN ((DATA16)(-32768))
1494 #define DATA32_NAN ((DATA32)(0x80000000))
1495 #define DATAF_NAN ((float)0 / (float)0) //(0x7FC00000)
1496 
1497 #define DATA8_MIN (-127)
1498 #define DATA8_MAX (127)
1499 #define DATA16_MIN (-32767)
1500 #define DATA16_MAX (32767)
1501 #define DATA32_MIN (-2147483647)
1502 #define DATA32_MAX (2147483647)
1503 #define DATAF_MIN (-2147483647)
1504 #define DATAF_MAX (2147483647)
1505 
1506 
1507 
1508 
1513 typedef enum
1514 {
1515  RUNNING = 0x0010,
1516  WAITING = 0x0020,
1517  STOPPED = 0x0040,
1518  HALTED = 0x0080,
1519 }
1520 OBJSTAT;
1521 
1522 
1529 typedef enum
1530 {
1531  DEVCMD_RESET = 0x11,
1532  DEVCMD_FIRE = 0x11,
1533  DEVCMD_CHANNEL = 0x12,
1534 
1535  DEVCMDS
1536 }
1537 DEVCMD;
1538 
1539 /*\endverbatim
1540  *
1541  * \n
1542  */
1543 
1544 
1545 // GRAPHICS
1546 
1547 #define vmPOP3_ABS_X 16 //
1548 #define vmPOP3_ABS_Y 50 //
1549 
1550 #define vmPOP3_ABS_WARN_ICON_X 64
1551 #define vmPOP3_ABS_WARN_ICON_X1 40
1552 #define vmPOP3_ABS_WARN_ICON_X2 72
1553 #define vmPOP3_ABS_WARN_ICON_X3 104
1554 #define vmPOP3_ABS_WARN_ICON_Y 60
1555 #define vmPOP3_ABS_WARN_SPEC_ICON_X 88
1556 #define vmPOP3_ABS_WARN_SPEC_ICON_Y 60
1557 #define vmPOP3_ABS_WARN_TEXT_X 80
1558 #define vmPOP3_ABS_WARN_TEXT_Y 68
1559 #define vmPOP3_ABS_WARN_YES_X 72
1560 #define vmPOP3_ABS_WARN_YES_Y 90
1561 #define vmPOP3_ABS_WARN_LINE_X 21
1562 #define vmPOP3_ABS_WARN_LINE_Y 89
1563 #define vmPOP3_ABS_WARN_LINE_ENDX 155
1564 
1565 
1566 #define LONGToBytes(_x) (UBYTE)((_x) & 0xFF),(UBYTE)((_x >> 8) & 0xFF),(UBYTE)((_x >> 16) & 0xFF),(UBYTE)((_x >> 24) & 0xFF)
1567 #define WORDToBytes(_x) (UBYTE)((_x) & 0xFF),(UBYTE)((_x >> 8) & 0xFF)
1568 #define BYTEToBytes(_x) (UBYTE)((_x) & 0xFF)
1569 
1570 #define PROGRAMHeader(VersionInfo,NumberOfObjects,GlobalBytes)\
1571  'L','E','G','O',LONGToBytes(0),WORDToBytes((UWORD)(BYTECODE_VERSION * 100.0)),WORDToBytes(NumberOfObjects),LONGToBytes(GlobalBytes)
1572 
1573 #define VMTHREADHeader(OffsetToInstructions,LocalBytes)\
1574  LONGToBytes(OffsetToInstructions),0,0,0,0,LONGToBytes(LocalBytes)
1575 
1576 #define SUBCALLHeader(OffsetToInstructions,LocalBytes)\
1577  LONGToBytes(OffsetToInstructions),0,0,1,0,LONGToBytes(LocalBytes)
1578 
1579 #define BLOCKHeader(OffsetToInstructions,OwnerObjectId,TriggerCount)\
1580  LONGToBytes(OffsetToInstructions),WORDToBytes(OwnerObjectId),WORDToBytes(TriggerCount),LONGToBytes(0)
1581 
1582 // MACROS FOR PRIMITIVES AND SYSTEM CALLS
1583 
1584 #define PRIMPAR_SHORT 0x00
1585 #define PRIMPAR_LONG 0x80
1586 
1587 #define PRIMPAR_CONST 0x00
1588 #define PRIMPAR_VARIABEL 0x40
1589 #define PRIMPAR_LOCAL 0x00
1590 #define PRIMPAR_GLOBAL 0x20
1591 #define PRIMPAR_HANDLE 0x10
1592 #define PRIMPAR_ADDR 0x08
1593 
1594 #define PRIMPAR_INDEX 0x1F
1595 #define PRIMPAR_CONST_SIGN 0x20
1596 #define PRIMPAR_VALUE 0x3F
1597 
1598 #define PRIMPAR_BYTES 0x07
1599 
1600 #define PRIMPAR_STRING_OLD 0
1601 #define PRIMPAR_1_BYTE 1
1602 #define PRIMPAR_2_BYTES 2
1603 #define PRIMPAR_4_BYTES 3
1604 #define PRIMPAR_STRING 4
1605 
1606 #define PRIMPAR_LABEL 0x20
1607 
1608 #define HND(x) PRIMPAR_HANDLE | x
1609 #define ADR(x) PRIMPAR_ADDR | x
1610 
1611 #define LCS (PRIMPAR_LONG | PRIMPAR_STRING)
1612 
1613 #define LAB1(v) (PRIMPAR_LONG | PRIMPAR_LABEL),(v & 0xFF)
1614 
1615 #define LC0(v) ((v & PRIMPAR_VALUE) | PRIMPAR_SHORT | PRIMPAR_CONST)
1616 #define LC1(v) (PRIMPAR_LONG | PRIMPAR_CONST | PRIMPAR_1_BYTE),(v & 0xFF)
1617 #define LC2(v) (PRIMPAR_LONG | PRIMPAR_CONST | PRIMPAR_2_BYTES),(v & 0xFF),((v >> 8) & 0xFF)
1618 #define LC4(v) (PRIMPAR_LONG | PRIMPAR_CONST | PRIMPAR_4_BYTES),((ULONG)v & 0xFF),(((ULONG)v >> (ULONG)8) & 0xFF),(((ULONG)v >> (ULONG)16) & 0xFF),(((ULONG)v >> (ULONG)24) & 0xFF)
1619 #define LCA(h) (PRIMPAR_LONG | PRIMPAR_CONST | PRIMPAR_1_BYTE | PRIMPAR_ARRAY),(i & 0xFF)
1620 
1621 #define LV0(i) ((i & PRIMPAR_INDEX) | PRIMPAR_SHORT | PRIMPAR_VARIABEL | PRIMPAR_LOCAL)
1622 #define LV1(i) (PRIMPAR_LONG | PRIMPAR_VARIABEL | PRIMPAR_LOCAL | PRIMPAR_1_BYTE),(i & 0xFF)
1623 #define LV2(i) (PRIMPAR_LONG | PRIMPAR_VARIABEL | PRIMPAR_LOCAL | PRIMPAR_2_BYTES),(i & 0xFF),((i >> 8) & 0xFF)
1624 #define LV4(i) (PRIMPAR_LONG | PRIMPAR_VARIABEL | PRIMPAR_LOCAL | PRIMPAR_4_BYTES),(i & 0xFF),((i >> 8) & 0xFF),((i >> 16) & 0xFF),((i >> 24) & 0xFF)
1625 #define LVA(h) (PRIMPAR_LONG | PRIMPAR_VARIABEL | PRIMPAR_LOCAL | PRIMPAR_1_BYTE | PRIMPAR_ARRAY),(i & 0xFF)
1626 
1627 #define GV0(i) ((i & PRIMPAR_INDEX) | PRIMPAR_SHORT | PRIMPAR_VARIABEL | PRIMPAR_GLOBAL)
1628 #define GV1(i) (PRIMPAR_LONG | PRIMPAR_VARIABEL | PRIMPAR_GLOBAL | PRIMPAR_1_BYTE),(i & 0xFF)
1629 #define GV2(i) (PRIMPAR_LONG | PRIMPAR_VARIABEL | PRIMPAR_GLOBAL | PRIMPAR_2_BYTES),(i & 0xFF),((i >> 8) & 0xFF)
1630 #define GV4(i) (PRIMPAR_LONG | PRIMPAR_VARIABEL | PRIMPAR_GLOBAL | PRIMPAR_4_BYTES),(i & 0xFF),((i >> 8) & 0xFF),((i >> 16) & 0xFF),((i >> 24) & 0xFF)
1631 #define GVA(h) (PRIMPAR_LONG | PRIMPAR_VARIABEL | PRIMPAR_GLOBAL | PRIMPAR_1_BYTE | PRIMPAR_ARRAY),(i & 0xFF)
1632 
1633 // MACROS FOR SUB CALLS
1634 
1635 
1636 #define CALLPAR_IN 0x80
1637 #define CALLPAR_OUT 0x40
1638 
1639 #define CALLPAR_TYPE 0x07
1640 #define CALLPAR_DATA8 DATA_8
1641 #define CALLPAR_DATA16 DATA_16
1642 #define CALLPAR_DATA32 DATA_32
1643 #define CALLPAR_DATAF DATA_F
1644 #define CALLPAR_STRING DATA_S
1645 
1646 #define IN_8 (CALLPAR_IN | CALLPAR_DATA8)
1647 #define IN_16 (CALLPAR_IN | CALLPAR_DATA16)
1648 #define IN_32 (CALLPAR_IN | CALLPAR_DATA32)
1649 #define IN_F (CALLPAR_IN | CALLPAR_DATAF)
1650 #define IN_S (CALLPAR_IN | CALLPAR_STRING)
1651 #define OUT_8 (CALLPAR_OUT | CALLPAR_DATA8)
1652 #define OUT_16 (CALLPAR_OUT | CALLPAR_DATA16)
1653 #define OUT_32 (CALLPAR_OUT | CALLPAR_DATA32)
1654 #define OUT_F (CALLPAR_OUT | CALLPAR_DATAF)
1655 #define OUT_S (CALLPAR_OUT | CALLPAR_STRING)
1656 
1657 #define IO_8 IN_8 | OUT_8
1658 #define IO_16 IN_16 | OUT_16
1659 #define IO_32 IN_32 | OUT_32
1660 #define IO_F IN_F | OUT_F
1661 #define IO_S IN_S | OUT_S
1662 
1663 
1664 #endif /* BYTECODES_H_ */
All LEDs.
Definition: bytecodes.h:1294
Object is halted because a call is in progress.
Definition: bytecodes.h:1518
#define OP(a, b, c, d, s, T)
Object is waiting for final trigger.
Definition: bytecodes.h:1516
COLOR
Definition: bytecodes.h:1451
MIX
Definition: bytecodes.h:1441
LEDTYPE
Definition: bytecodes.h:1292
WARNING
Definition: bytecodes.h:1476
Right red.
Definition: bytecodes.h:1295
Right green.
Definition: bytecodes.h:1296
Object code is running.
Definition: bytecodes.h:1515
Left green.
Definition: bytecodes.h:1298
Left red.
Definition: bytecodes.h:1297
Object is stopped or not triggered yet.
Definition: bytecodes.h:1517
OBJSTAT
Definition: bytecodes.h:1513
NXTCOLOR
Definition: bytecodes.h:1464