1 /* 2 * The contents of this file are subject to the Mozilla Public License 3 * Version 1.0 (the "License"); you may not use this file except in 4 * compliance with the License. You may obtain a copy of the License at 5 * http://www.mozilla.org/MPL/ 6 * 7 * Software distributed under the License is distributed on an "AS IS" 8 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the 9 * License for the specific language governing rights and limitations 10 * under the License. 11 * 12 * The Initial Developer of this code is David Baum. 13 * Portions created by David Baum are Copyright (C) 1998 David Baum. 14 * All Rights Reserved. 15 * 16 * Portions created by John Hansen are Copyright (C) 2005 John Hansen. 17 * All Rights Reserved. 18 * 19 */ 20 21 #ifndef __RCX_Constants_h 22 #define __RCX_Constants_h 23 24 // opcodes 25 26 // outputs 27 #define kRCX_OutputModeOp 0x21 28 #define kRCX_OutputPowerOp 0x13 29 #define kRCX_OutputDirOp 0xe1 30 // inputs 31 #define kRCX_InputModeOp 0x42 32 #define kRCX_InputTypeOp 0x32 33 // sound 34 #define kRCX_PlaySoundOp 0x51 35 #define kRCX_PlayToneOp 0x23 36 // control flow 37 #define kRCX_TestOp 0x95 38 #define kRCX_STestOp 0x85 39 #define kRCX_JumpOp 0x72 40 #define kRCX_SJumpOp 0x27 41 #define kRCX_SetLoopOp 0x82 42 #define kRCX_CheckLoopOp 0x92 43 #define kRCX_SCheckLoopOp 0x37 44 #define kRCX_DecVarJmpLTZeroOp 0xf3 45 #define kRCX_SDecVarJmpLTZeroOp 0xf2 46 #define kRCX_ExitEventCheckOp 0xb0 47 #define kRCX_ExitAccessCtrlOp 0xa0 48 #define kRCX_SStartEventMonOp 0xb4 49 #define kRCX_StartEventMonOp 0xb5 50 #define kRCX_EnterAccessCtrlOp 0x73 51 52 // misc 53 #define kRCX_SetSrcValueOp 0x05 54 #define kRCX_DelayOp 0x43 55 #define kRCX_DisplayOp 0x33 56 #define kRCX_VarOp(code) (0x14 + ((code) * 16)) 57 #define kRCX_SendMessage 0xb2 58 #define kRCX_StartTaskOp 0x71 59 #define kRCX_StopTaskOp 0x81 60 #define kRCX_StopAllOp 0x50 61 #define kRCX_ClearTimerOp 0xa1 62 #define kRCX_ClearMsgOp 0x90 63 #define kRCX_SendMsgOp 0xb2 64 #define kRCX_ClearSensorOp 0xd1 65 #define kRCX_GoSubOp 0x17 66 #define kRCX_SetDatalogOp 0x52 67 #define kRCX_DatalogOp 0x62 68 #define kRCX_UploadDatalogOp 0xa4 69 70 // special 71 #define kRCX_ReadOp 0x12 72 #define kRCX_UnlockOp 0x15 73 #define kRCX_BeginTaskOp 0x25 74 #define kRCX_BeginSubOp 0x35 75 #define kRCX_DownloadOp 0x45 76 #define kRCX_DeleteTasksOp 0x40 77 #define kRCX_DeleteSubsOp 0x70 78 #define kRCX_BootModeOp 0x65 79 #define kRCX_BeginFirmwareOp 0x75 80 #define kRCX_BootOp 0xa5 81 #define kRCX_PingOp 0x10 82 #define kRCX_SelectProgramOp 0x91 83 #define kRCX_BatteryLevelOp 0x30 84 #define kRCX_SetWatchOp 0x22 85 #define kRCX_IRModeOp 0x31 86 #define kRCX_AutoOffOp 0xb1 87 88 #define kRCX_Message 0xf7 89 #define kRCX_Remote 0xd2 90 91 // cybermaster ops 92 #define kRCX_DriveOp 0x41 93 #define kRCX_OnWaitOp 0xc2 94 #define kRCX_OnWaitDifferentOp 0x53 95 #define kRCX_ClearTachoOp 0x11 96 97 // some scout ops 98 #define kRCX_GOutputModeOp 0x67 99 #define kRCX_GOutputPowerOp 0xa3 100 #define kRCX_GOutputDirOp 0x77 101 #define kRCX_PollMemoryOp 0x63 102 103 // some spybot ops 104 #define kRCX_PushStackEntryOp 0xe3 105 #define kRCX_PopStackEntryOp 0x01 106 #define kRCX_UploadEepromOp 0x11 107 #define kRCX_FindOp 0xd5 108 #define kRCX_ClearRelTableOp 0x36 109 #define kRCX_PlaySysMoodOp 0xc7 110 #define kRCX_PlaySysSndVarOp 0xe7 111 112 typedef enum 113 { 114 kRCX_VariableType = 0, 115 kRCX_TimerType, 116 kRCX_ConstantType, 117 kRCX_OutputStatusType, 118 kRCX_RandomType, 119 kRCX_TachCounterType, 120 kRCX_TachSpeedType, 121 kRCX_OutputCurrentType, 122 kRCX_ProgramType, 123 kRCX_InputValueType, 124 kRCX_InputTypeType, 125 kRCX_InputModeType, 126 kRCX_InputRawType, 127 kRCX_InputBooleanType, 128 kRCX_WatchType, 129 kRCX_MessageType, 130 kRCX_AGCType, // 16 131 kRCX_GlobalMotorStatusType, // = 17; 132 kRCX_SpybotStackType, // = 18; // spybot only 133 kRCX_SpybotTimerCtrlType, // = 19; // spybot only 134 kRCX_SpybotEepromType, // = 20; // spybot only 135 kRCX_CounterType, // = 21; // RCX2, scout, & spybot only 136 kRCX_SpybotLEDType, // = 22; // spybot only 137 kRCX_TaskEventsType, // = 23; // rcx2, scout, spybot 138 kRCX_ScoutEventFBType, // = 24; // scout only 139 kRCX_EventStateType, // = 25; // rcx2 & spybot 140 kRCX_TenMSTimerType, // = 26; // rcx2 & spybot fast timer 141 kRCX_ClickCounterType, // = 27; // rcx2 142 kRCX_UpperThresholdType, // = 28; // rcx2 & spybot 143 kRCX_LowerThresholdType, // = 29; // rcx2 & spybot 144 kRCX_HysteresisType, // = 30; // rcx2 & spybot 145 kRCX_DurationType, // = 31; // rcx2 & spybot 146 kRCX_SpybotTaskIDType, // = 32; // spybot only 147 kRCX_UARTSetupType, // = 33; // rcx2 & spybot 148 kRCX_BatteryLevelType, // = 34; // rcx2 & spybot 149 kRCX_FirmwareVersionType, // = 35; // rcx2 & spybot 150 kRCX_IndirectType, // = 36 151 kRCX_DatalogTypeInd, // = 37 152 kRCX_DatalogType, // = 38 153 kRCX_DatalogValueInd, // = 39 154 kRCX_DatalogValue, // = 40 155 kRCX_DatalogByteInd, // = 41 156 kRCX_DatalogByte, // = 42 157 kRCX_SpybotGameNotesType, // = 43; // spybot only 158 kRCX_SpybotType44, // = 44; // ???????? 159 kRCX_SpybotRobotDistType, // = 45; // spybot only 160 kRCX_SpybotRobotDirType, // = 46; // spybot only 161 kRCX_SpybotRobotOrientType, // = 47; // spybot only 162 kRCX_SpybotType48, // = 48; // ???????? 163 kRCX_SpybotRobotIDType, // = 49; // spybot only 164 kRCX_SpybotRobotTargetType, // = 50; // spybot only 165 kRCX_SpybotPingCtrlType, // = 51; // spybot only 166 kRCX_SpybotBeaconCtrlType, // = 52; // spybot only 167 kRCX_SpybotSoundCtrlType, // = 53; // spybot only 168 kRCX_SpybotIndEepromType // = 54; // spybot only 169 } RCX_ValueType; 170 171 const RCX_ValueType kRCX_NoType = (RCX_ValueType) -1; 172 173 // Swan types 174 const RCX_ValueType kRCX_GlobalVariableType = (RCX_ValueType) 43; 175 const RCX_ValueType kRCX_IndirectGlobalVarType = (RCX_ValueType) 44; 176 const RCX_ValueType kRCX_IndexedArrayType = (RCX_ValueType) 6; 177 178 typedef int RCX_Value; 179 180 #define kRCX_ValueUsesTemp 0x1000000 // flag used for indirects 181 #define RCX_VALUE(t, d) (((int)(t) << 16) | ((d) & 0xffff)) 182 #define RCX_VALUE_TYPE(v) ((RCX_ValueType)(((v)>>16) & 0xff)) 183 #define RCX_VALUE_DATA_INT(v) ((v) & 0xffff) 184 #define RCX_VALUE_DATA(v) ((short)RCX_VALUE_DATA_INT(v)) 185 186 typedef enum 187 { 188 kRCX_SetVar = 0, 189 kRCX_AddVar, 190 kRCX_SubVar, 191 kRCX_DivVar, 192 kRCX_MulVar, 193 kRCX_SgnVar, 194 kRCX_AbsVar, 195 kRCX_AndVar, 196 kRCX_OrVar, 197 kRCX_NotVar, // Swan only 198 kRCX_ModVar, // Swan only 199 kRCX_ShlVar, // Swan only 200 kRCX_ShrVar, // Swan only 201 kRCX_XOrVar, // Swan only 202 kRCX_IllegalVar = -1 203 } RCX_VarCode; 204 205 206 typedef enum 207 { 208 kRCX_OutputFloat = 0, 209 kRCX_OutputOff = 0x40, 210 kRCX_OutputOn = 0x80 211 } RCX_OutputMode; 212 213 214 typedef enum 215 { 216 kRCX_OutputBackward = 0, 217 kRCX_OutputToggle = 0x40, 218 kRCX_OutputForward = 0x80 219 } RCX_OutputDir; 220 221 222 typedef enum 223 { 224 kRCX_InputRaw = 0, 225 kRCX_InputBoolean = 0x20, 226 kRCX_InputEdgeCounter = 0x40, 227 kRCX_InputPeriodicCounter = 0x60, 228 kRCX_InputPercentage = 0x80, 229 kRCX_InputCelcius = 0xa0, 230 kRCX_InputFahrenheit = 0xc0, 231 kRCX_InputAngle = 0xe0 232 } RCX_InputMode; 233 234 typedef enum 235 { 236 kRCX_InputNone = 0, 237 kRCX_InputSwitch, 238 kRCX_InputTemp, 239 kRCX_InputLight, 240 kRCX_InputRotation, 241 kRCX_InputID0, 242 kRCX_InputID1, 243 kRCX_InputID2 244 } RCX_InputType; 245 246 247 typedef enum 248 { 249 kRCX_LessOrEqual = 0, 250 kRCX_GreaterOrEqual, 251 kRCX_NotEqualTo, 252 kRCX_EqualTo 253 } RCX_Relation; 254 255 256 typedef enum 257 { 258 kRCX_TaskChunk = 0, 259 kRCX_SubChunk, 260 kRCX_SoundChunk, 261 kRCX_AnimationChunk, 262 // kRCX_DataChunk, 263 264 kRCX_ChunkTypeCount // must be last entry 265 } RCX_ChunkType; 266 267 268 // Swan support code 269 //typedef char byte; 270 typedef unsigned char ubyte; 271 272 typedef enum 273 { 274 arithOffsetAddTo = 0, // Must be consecutive opcodes 275 arithOffsetMinusTo = 1, 276 arithOffsetTimesTo = 2, 277 arithOffsetDivideTo = 3, 278 arithOffsetAndTo = 4, 279 arithOffsetOrTo = 5, 280 arithOffsetBitComplement = 6, 281 arithOffsetModuloTo = 7 // Don't change order. Used as bounds in 'for' statements 282 } TArithOffsets; 283 284 typedef enum 285 { 286 rcxNoop = 0x00, // Uncertain of this. But keep it in 287 rcxDebugGetStatus = 0x01, // New 288 rcxPlayToneVar = 0x02, 289 rcxDirectEvent = 0x03, 290 rcxCalibrateEvent = 0x04, 291 rcxSetSourceValue = 0x05, 292 rcxClearAllEvents = 0x06, 293 rcxDebugUnsolicitedReport = 0x07, // New - actually not an opcode but a message generated by firmware. Needs an opcode value 294 295 // new arithmetic opcodes 296 rcxAddToSourceValue = (ubyte) 0x08, // Must be consecutive opcodes 297 rcxMinusToSourceValue = (ubyte) (rcxAddToSourceValue + (ubyte) arithOffsetMinusTo), 298 rcxTimesToSourceValue = (ubyte) (rcxAddToSourceValue + (ubyte) arithOffsetTimesTo), 299 rcxDivideToSourceValue = (ubyte) (rcxAddToSourceValue + (ubyte) arithOffsetDivideTo), 300 rcxAndToSourceValue = (ubyte) (rcxAddToSourceValue + (ubyte) arithOffsetAndTo), 301 rcxOrToSourceValue = (ubyte) (rcxAddToSourceValue + (ubyte) arithOffsetOrTo), 302 rcxBitComplementSourceValue = (ubyte) (rcxAddToSourceValue + (ubyte) arithOffsetBitComplement), 303 rcxModuloToSourceValue = (ubyte) (rcxAddToSourceValue + (ubyte) arithOffsetModuloTo), //0xDF 304 305 rcxAlive = 0x10, 306 rcxSetSourceValueByteConst = 0x11, // New 307 rcxGetValue = 0x12, 308 rcxSetMotorPower = 0x13, 309 rcxAssign = 0x14, 310 rcxGetVersion = 0x15, 311 rcxDebugClearException = 0x16, // New 312 rcxCallSub = 0x17, 313 314 // New arithmetic opcodes 315 rcxAddToLong = (ubyte) 0x18, // Must be consecutive opcodes and op % 8 == 0 316 rcxMinusToLong = (ubyte) (rcxAddToLong + (ubyte) arithOffsetMinusTo), 317 rcxTimesToLong = (ubyte) (rcxAddToLong + (ubyte) arithOffsetTimesTo), 318 rcxDivideToLong = (ubyte) (rcxAddToLong + (ubyte) arithOffsetDivideTo), 319 rcxAndToLong = (ubyte) (rcxAddToLong + (ubyte) arithOffsetAndTo), 320 rcxOrToLong = (ubyte) (rcxAddToLong + (ubyte) arithOffsetOrTo), 321 rcxBitComplementLong = (ubyte) (rcxAddToLong + (ubyte) arithOffsetBitComplement), 322 rcxModuloToLong = (ubyte) (rcxAddToLong + (ubyte) arithOffsetModuloTo), //0xDF 323 324 rcxGetMemoryMap = 0x20, 325 rcxSetMotorOnOffFloat = 0x21, 326 rcxSetTime = 0x22, 327 rcxPlayTone = 0x23, 328 rcxAddTo = 0x24, 329 rcxStartTaskDownload = 0x25, 330 rcxAssignLong = 0x26, // New 331 rcxBranchNear = 0x27, 332 333 rcxAssignLongConstantWord = 0x28, // Must be consecutive opcodes and op % 8 == 0 334 rcxAssignLongConstant = 0x29, // New 335 rcxArrayBounds = 0x2A, // New 336 rcxAssignGlobalConstantByte = 0x2B, // New - cannot be used for message opcode. Conflict, and length wrong 337 rcxAssignGlobalConstant = 0x2C, // New - cannot be used for message opcode. Conflict, and length wrong 338 rcxAssignGlobalVariable = 0x2D, // New - cannot be used for message opcode. Conflict, and length wrong 339 rcxBitComplement = 0x2E, // New opcode 340 rcxAssignSourceValue = 0x2F, // New 341 342 rcxGetBatteryVoltage = 0x30, 343 rcxSetXmitRange = 0x31, 344 rcxSetSensorType = 0x32, 345 rcxSetDisplay = 0x33, 346 rcxMinusTo = 0x34, 347 rcxStartSubroutineDownload = 0x35, 348 rcxSetSourceValueShortVariable = 0x36, // New 349 rcxPopLoopCounterShort = 0x37, 350 351 // New arithmetic opcodes 352 rcxAddToFloat = (ubyte) 0x38, // Must be consecutive opcodes 353 rcxMinusToFloat = (ubyte) (rcxAddToFloat + (ubyte) arithOffsetMinusTo), 354 rcxTimesToFloat = (ubyte) (rcxAddToFloat + (ubyte) arithOffsetTimesTo), 355 rcxDivideToFloat = (ubyte) (rcxAddToFloat + (ubyte) arithOffsetDivideTo), 356 357 /* 358 //rcxAddToFloatConstant = (ubyte) 0x3C, // Must be consecutive opcodes 359 //rcxMinusToFloatConstant = (ubyte) (rcxAddToFloatConstant + (ubyte) arithOffsetMinusTo), 360 //rcxTimesToFloatConstant = (ubyte) (rcxAddToFloatConstant + (ubyte) arithOffsetTimesTo), 361 //rcxDivideToFloatConstant = (ubyte) (rcxAddToFloatConstant + (ubyte) arithOffsetDivideTo), 362 */ 363 rcxTestAndBranchLongBigNear = 0x3C, // New 364 rcxTestAndBranchLongBigFar = 0x3D, // New 365 rcxTestAndBranchIntBigFar = 0x3E, // New 366 rcxTestAndBranchFloatBigFar = 0x3F, // New 367 368 rcxDeleteAllTasks = 0x40, 369 rcxSendMessageWith1ParmByte = 0x41, // New 370 rcxSetSensorMode = 0x42, 371 rcxWaitTimer10MSec = 0x43, 372 rcxDivideTo = 0x44, 373 rcxTransferData = 0x45, // Note this is same as reply to rcxSendMessage(0xB2/0xB8) 374 rcxUploadEventMap = 0x46, // New 375 rcxWaitTimer1MSec = 0x47, // New 376 377 // new arithmetic opcodes 378 rcxAddToGlobalUbyte = (ubyte) 0x48, // Must be consecutive opcodes and op % 8 == 0 379 rcxMinusToGlobalUbyte = (ubyte) (rcxAddToGlobalUbyte + (ubyte) arithOffsetMinusTo), 380 rcxTimesToGlobalUbyte = (ubyte) (rcxAddToGlobalUbyte + (ubyte) arithOffsetTimesTo), 381 rcxDivideToGlobalUbyte = (ubyte) (rcxAddToGlobalUbyte + (ubyte) arithOffsetDivideTo), 382 rcxAndToGlobalUbyte = (ubyte) (rcxAddToGlobalUbyte + (ubyte) arithOffsetAndTo), 383 rcxOrToGlobalUbyte = (ubyte) (rcxAddToGlobalUbyte + (ubyte) arithOffsetOrTo), 384 rcxBitComplementGlobalByte = (ubyte) (rcxAddToGlobalUbyte + (ubyte) arithOffsetBitComplement), 385 rcxModuloToGlobalUbyte = (ubyte) (rcxAddToGlobalUbyte + (ubyte) arithOffsetModuloTo), //0x4F 386 387 rcxStopAllTasks = 0x50, 388 rcxPlaySound = 0x51, 389 rcxSetDatalogSize = 0x52, 390 rcxBranchNearByte = 0x53, // New 391 rcxTimesTo = 0x54, 392 rcxBranchFarWord = 0x55, // New 393 // don't use 0x55 as an opcode that can be sent via message or it will screw up recognition of message headers 394 rcxTestAndBranchIntConstShortNear = (ubyte) 0x56, // New 395 rcxTestAndBranchIntConstBigNear = (ubyte) 0x57, // New 396 397 // new arithmetic opcodes 398 rcxAddToGlobalConstant = (ubyte) 0x58, // Must be consecutive opcodes and op % 8 == 0 399 rcxMinusToGlobalConstant = (ubyte) (rcxAddToGlobalConstant + (ubyte) arithOffsetMinusTo), 400 rcxTimesToGlobalConstant = (ubyte) (rcxAddToGlobalConstant + (ubyte) arithOffsetTimesTo), 401 rcxDivideToGlobalConstant = (ubyte) (rcxAddToGlobalConstant + (ubyte) arithOffsetDivideTo), 402 rcxAndToGlobalConstant = (ubyte) (rcxAddToGlobalConstant + (ubyte) arithOffsetAndTo), 403 rcxOrToGlobalConstant = (ubyte) (rcxAddToGlobalConstant + (ubyte) arithOffsetOrTo), 404 rcxBitComplementGlobalConstant = (ubyte) (rcxAddToGlobalConstant + (ubyte) arithOffsetBitComplement), 405 rcxModuloToGlobalConstant = (ubyte) (rcxAddToGlobalConstant + (ubyte) arithOffsetModuloTo), //0x5F 406 407 rcxPowerOff = 0x60, 408 rcxDeleteTask = 0x61, 409 rcxDatalogNext = 0x62, 410 rcxGetProgramDataBytes = 0x63, 411 rcxSignVariable = 0x64, 412 rcxDeleteFirmware = 0x65, 413 rcxAssert = 0x66, // New 414 rcxSetGlobalMotorControl = 0x67, 415 416 // new arithmetic opcodes 417 rcxAddToLongConstant = (ubyte) 0x68, // Must be consecutive opcodes and op % 8 == 0 418 rcxMinusToLongConstant = (ubyte) (rcxAddToLongConstant + (ubyte) arithOffsetMinusTo), 419 rcxTimesToLongConstant = (ubyte) (rcxAddToLongConstant + (ubyte) arithOffsetTimesTo), 420 rcxDivideToLongConstant = (ubyte) (rcxAddToLongConstant + (ubyte) arithOffsetDivideTo), 421 rcxAndToLongConstant = (ubyte) (rcxAddToLongConstant + (ubyte) arithOffsetAndTo), 422 rcxOrToLongConstant = (ubyte) (rcxAddToLongConstant + (ubyte) arithOffsetOrTo), 423 rcxBitComplementLongConstant = (ubyte) (rcxAddToLongConstant + (ubyte) arithOffsetBitComplement), 424 rcxModuloToLongConstant = (ubyte) (rcxAddToLongConstant + (ubyte) arithOffsetModuloTo), 425 426 rcxDeleteAllSubs = 0x70, 427 rcxStartTask = 0x71, 428 rcxBranchFar = 0x72, 429 rcxEnterAccessControl = 0x73, 430 rcxAbsoluteValue = 0x74, 431 rcxStartFirmwareDownload = 0x75, 432 rcxAssignLongConstantByte = 0x76, // New 433 rcxSetNormSetInvAltDir = 0x77, 434 435 rcxTestAndBranchIntShortConstNear = (ubyte) 0x78, // New 436 rcxTestAndBranchIntBigConstNear = (ubyte) 0x79, // New 437 rcxWaitTimerValue = (ubyte) 0x7A, // New 438 rcxAbsoluteValueSourceValue = (ubyte) 0x7B, // New 439 rcxSignValueSourceValue = (ubyte) 0x7C, // New 440 441 rcxBitTest = (ubyte) 0x7D, // New 442 rcxBitSet = (ubyte) 0x7E, // New 443 rcxBitClear = (ubyte) 0x7F, // New 444 445 rcxClearSound = (ubyte) 0x80, 446 rcxStopTask = (ubyte) 0x81, 447 rcxSetLoopCounter = (ubyte) 0x82, 448 rcxUploadGlobalVariables = (ubyte) 0x83, // New opcode 449 rcxAndTo = (ubyte) 0x84, 450 rcxTestAndBranchNear = (ubyte) 0x85, 451 rcxTestAndBranchFloatShortFar = (ubyte) 0x86, // New 452 rcxUploadEvent = (ubyte) 0x87, // New opcode 453 454 rcxXOr = (ubyte) 0x88, // New 455 rcxTestAndBranchFloatBigNear = (ubyte) 0x89, // New 456 rcxTestAndBranchFloatShortNear = (ubyte) 0x8A, // New 457 rcxTestAndBranchLongShortNear = (ubyte) 0x8B, // New 458 rcxFloatToLong = (ubyte) 0x8C, // New 459 rcxIntegerToLong = (ubyte) 0x8D, // New 460 rcxTestAndBranchIntShortNear = (ubyte) 0x8E, // New 461 rcxTestAndBranchIntBigNear = (ubyte) 0x8F, // New 462 463 rcxClearMessage = (ubyte) 0x90, 464 rcxSetProgramNumber = (ubyte) 0x91, 465 rcxPopLoopCounter = (ubyte) 0x92, 466 rcxSetEventDefinition = (ubyte) 0x93, 467 rcxOrTo = (ubyte) 0x94, 468 rcxTestAndBranchFar = (ubyte) 0x95, 469 rcxTestAndBranchLongShortFar = (ubyte) 0x96, // New 470 rcxIncCounter = (ubyte) 0x97, 471 472 rcxShiftLeft = (ubyte) 0x98, // New 473 rcxShiftRight = (ubyte) 0x99, // New 474 rcxTrinaryTimesConstant = (ubyte) 0x9A, // New 475 rcxNegate = (ubyte) 0x9B, // New 476 // unused 0x9C 477 // unused 0x9D 478 rcxSwitchIndexTableNear = (ubyte) 0x9E, // New 479 rcxSwitchIndexTableFar = (ubyte) 0x9F, // New 480 481 rcxExitAccessControl = (ubyte) 0xA0, 482 rcxClearTimer = (ubyte) 0xA1, 483 rcxSetMessageByteParm = (ubyte) 0xA2, // New opcode -- message ID plus one byte parm 484 rcxSetMaxPower = (ubyte) 0xA3, 485 rcxUploadDatalog = (ubyte) 0xA4, 486 rcxUnlockFirmware = (ubyte) 0xA5, 487 rcxTrinaryMinusConstant = (ubyte) 0xA6, // New 488 rcxDecCounter = (ubyte) 0xA7, 489 490 rcxTrinaryAdd = (ubyte) 0xA8, // New 491 rcxTrinaryMinus = (ubyte) 0xA9, // New 492 rcxTrinaryTimes = (ubyte) 0xAA, // New 493 // Don't use 0xAA [~0x55] as an opcode that can be sent via spurious message or reply could screw up recognition of message headers 494 rcxTrinaryAddConstant = (ubyte) 0xAB, // New 495 rcxIntegerToFloat = (ubyte) 0xAC, // New opcode 496 rcxLongToFloat = (ubyte) 0xAD, // New opcode 497 rcxFloatToInteger = (ubyte) 0xAE, // New opcode 498 rcxLongToInteger = (ubyte) 0xAF, // New opcode 499 500 rcxExitEventCheck = (ubyte) 0xB0, 501 rcxSetPowerDownDelay = (ubyte) 0xB1, 502 rcxSendMessage = (ubyte) 0xB2, // Note this is same as reply to rcxTransferData(0x45) 503 rcxSetMessageWordParm = (ubyte) 0xB3, // New opcode -- message ID plus one byte parm 504 rcxStartEventMonitorShort = (ubyte) 0xB4, 505 rcxStartEventMonitorLong = (ubyte) 0xB5, 506 rcxUploadTimers = (ubyte) 0xB6, // New opcode 507 rcxClearCounter = (ubyte) 0xB7, 508 509 // new arithmetic opcodes 510 rcxAddToShortVar = (ubyte) 0xB8, // Must be consecutive opcodes and op % 8 == 0 511 rcxMinusToShortVar = (ubyte) (rcxAddToShortVar + (ubyte) arithOffsetMinusTo), 512 rcxTimesToShortVar = (ubyte) (rcxAddToShortVar + (ubyte) arithOffsetTimesTo), 513 rcxDivideToShortVar = (ubyte) (rcxAddToShortVar + (ubyte) arithOffsetDivideTo), 514 rcxAndToShortVar = (ubyte) (rcxAddToShortVar + (ubyte) arithOffsetAndTo), 515 rcxOrToShortVar = (ubyte) (rcxAddToShortVar + (ubyte) arithOffsetOrTo), 516 rcxBitComplementShortVar = (ubyte) (rcxAddToShortVar + (ubyte) arithOffsetBitComplement), 517 rcxModuloToShortVar = (ubyte) (rcxAddToShortVar + (ubyte) arithOffsetModuloTo), //0xBF 518 519 // unused 0xC0 520 rcxDeleteSub = (ubyte) 0xC1, 521 rcxSendUARTData = (ubyte) 0xC2, 522 rcxSendMessageWithParm = (ubyte) 0xC3, // New opcode -- allows message plus optional parm 523 rcxSetMessageVariableParm = (ubyte) 0xC4, // New 524 rcxSwitch = (ubyte) 0xC5, // New 525 rcxSwitchByteCase = (ubyte) 0xC6, // New 526 rcxClearAll = (ubyte) 0xC7, // New opcode 527 528 // new arithmetic opcodes 529 rcxAddToGlobal = (ubyte) 0xC8, // Must be consecutive opcodes and op % 8 == 0 530 rcxMinusToGlobal = (ubyte) (rcxAddToGlobal + (ubyte) arithOffsetMinusTo), 531 rcxTimesToGlobal = (ubyte) (rcxAddToGlobal + (ubyte) arithOffsetTimesTo), 532 rcxDivideToGlobal = (ubyte) (rcxAddToGlobal + (ubyte) arithOffsetDivideTo), 533 rcxAndToGlobal = (ubyte) (rcxAddToGlobal + (ubyte) arithOffsetAndTo), 534 rcxOrToGlobal = (ubyte) (rcxAddToGlobal + (ubyte) arithOffsetOrTo), 535 rcxBitComplementGlobal = (ubyte) (rcxAddToGlobal + (ubyte) arithOffsetBitComplement), 536 rcxModuloToGlobal = (ubyte) (rcxAddToGlobal + (ubyte) arithOffsetModuloTo), //0xCF 537 538 rcxMuteSound = (ubyte) 0xD0, 539 rcxClearSensorValue = (ubyte) 0xD1, 540 rcxRemoteControlCommand = (ubyte) 0xD2, 541 rcxPlayKHertz = (ubyte) 0xD3, // New 542 rcxGetValueLong = (ubyte) 0xD4, // New -- not implemented 543 rcxTestAndBranchIntShortFar = (ubyte) 0xD5, // New 544 rcxUploadDeviceVariables = (ubyte) 0xD6, // New opcode 545 rcxSetPriority = (ubyte) 0xD7, 546 547 // new arithmetic opcodes 548 rcxAddToShortVarConstant = (ubyte) 0xD8, // Must be consecutive opcodes and op % 8 == 0 549 rcxMinusToShortVarConstant = (ubyte) (rcxAddToShortVarConstant + (ubyte) arithOffsetMinusTo), 550 rcxTimesToShortVarConstant = (ubyte) (rcxAddToShortVarConstant + (ubyte) arithOffsetTimesTo), 551 rcxDivideToShortVarConstant = (ubyte) (rcxAddToShortVarConstant + (ubyte) arithOffsetDivideTo), 552 rcxAndToShortVarConstant = (ubyte) (rcxAddToShortVarConstant + (ubyte) arithOffsetAndTo), 553 rcxOrToShortVarConstant = (ubyte) (rcxAddToShortVarConstant + (ubyte) arithOffsetOrTo), 554 rcxBitComplementShortVarConstant= (ubyte) (rcxAddToShortVarConstant + (ubyte) arithOffsetBitComplement), 555 rcxModuloToShortVarConstant = (ubyte) (rcxAddToShortVarConstant + (ubyte) arithOffsetModuloTo), //0xDF 556 557 rcxUnmuteSound = (ubyte) 0xE0, 558 rcxSetMotorDirection = (ubyte) 0xE1, 559 rcxDebugSuspendResumeStep = (ubyte) 0xE2, // New opcode 560 #ifndef KHxToneSupported 561 rcxPlayKHertzVariable = (ubyte) 0xE3, // New 562 #endif 563 rcxDebugSetBreakPoint = (ubyte) 0xE4, // New -- . 564 rcxSetDisplayVariable = (ubyte) 0xE5, // store a variable to update in the display 565 566 // New breakpoint opcodes 567 rcxBreakpoint0 = (ubyte) 0xE6, // Must be consecutive opcodes 568 rcxBreakpoint1 = (ubyte) 0xE7, 569 rcxBreakpoint2 = (ubyte) 0xE8, 570 rcxBreakpoint3 = (ubyte) 0xE9, 571 rcxBreakpoint4 = (ubyte) 0xEA, 572 rcxBreakpoint5 = (ubyte) 0xEB, 573 rcxBreakpoint6 = (ubyte) 0xEC, 574 rcxBreakpoint7 = (ubyte) 0xED, 575 rcxBreakpoint8 = (ubyte) 0xEE, 576 rcxBreakpoint9 = (ubyte) 0xEF, 577 578 // unused 0xF0 579 rcxSetMotorState = (ubyte) 0xF1, // New 580 rcxDecVarJumpLTZeroShort = (ubyte) 0xF2, 581 rcxDecVarJumpLTZeroLong = (ubyte) 0xF3, 582 rcxDebugSetProgramCounter = (ubyte) 0xF4, // New -- . 583 rcxModuloTo = (ubyte) 0xF5, // New -- . 584 rcxReturn = (ubyte) 0xF6, 585 rcxSetMessage = (ubyte) 0xF7, 586 587 // new arithmetic opcodes 588 rcxAddToGenericParms = (ubyte) 0xF8, // Must be consecutive opcodes and op % 8 = = 0 589 rcxMinusToGenericParms = (ubyte) (rcxAddToGenericParms + (ubyte) arithOffsetMinusTo), 590 rcxTimesToGenericParms = (ubyte) (rcxAddToGenericParms + (ubyte) arithOffsetTimesTo), 591 rcxDivideToGenericParms = (ubyte) (rcxAddToGenericParms + (ubyte) arithOffsetDivideTo), 592 rcxAndToGenericParms = (ubyte) (rcxAddToGenericParms + (ubyte) arithOffsetAndTo), 593 rcxOrToGenericParms = (ubyte) (rcxAddToGenericParms + (ubyte) arithOffsetOrTo), 594 rcxBitComplementGenericParms = (ubyte) (rcxAddToGenericParms + (ubyte) arithOffsetBitComplement), 595 rcxModuloToGenericParms = (ubyte) (rcxAddToGenericParms + (ubyte) arithOffsetModuloTo), //0xFF 596 597 rcxFirst = (ubyte) 0x00, 598 rcxBad = (ubyte) 0xFF, // May be something else 599 rcxLast = (ubyte) 0xFF 600 } TRCXop; 601 602 603 #endif 604