;-------------------------------------------------------------------------------

; #alert "alert text goes here - if uncommented, it will be displayed in a pop-up dialog  whever a project using this INI is opened"
; INI date: May30/08 12:52PM PDT

[MegaTune]
   MTversion      = 2.25 ; MegaTune itself; needs to match exec version.

   versionInfo    = "S"  ; Put this in the title bar.
   queryCommand   = "Q"  ; Verify against signature.
   signature      = "MSII Rev 2.88600   " ; MS-II sends a null at 20th byte.
                   ; 123456789.123456789.

;-------------------------------------------------------------------------------
;
; PREAMBLE
;
; There are several main sections (with brackets around the [section] heading) in this INI file:
;
; - Constants - this is divided into two pages (for recent MS-II code versions, 
;               at least). Page 1 is based on the source code inpram structure
;               Page 2 is based on the source code in2ram structure. All of the 
;               values are inputs sent from MegaTune to the MegaSquirt-II
; - Menu (& User Defined) - these define most of the mennus in MegaTune (except 
;                           those that are 'built-in' like the accel wizrd, etc.)
; - Curve Editor and Table Editor
; - Gauge Configuration
; - Front Page & RuntTime & Tuning Config
; - Burst Mode Config
; - Output Channels - this mirrors the OUTPC structure from the source code. All 
;                     of the values are sent from MegaSquirt-II to MegaTune on the PC.
; - Datalog - select output channels to log to the PC hard drive
;
; Note: 
;       - To add an input variable to MegaTune, you need to add it to the inpram (or in2ram) 
;         structure in the MegaSquirt source code noting the correct offset (and recompile, 
;         of course), to the Constants section, and to one of the menus.
;       - To add an output variable to MegaTune (for monitoring, logging, or switching purposes),
;         you need to add it to the outpc structure in the source code, to the OuptChannels, and 
;         to the datalog section (and/or the gauge configurations, if you wish to see it directly 
;         in MegaTune). 
;
; In general, the respective notation for variables from the source code to the INI are:
;
;                         signed          unsigned      bytes
;                         ------          --------      ----- 
;             - char =      S08              U08          1
;             - int  =      S16              U16          2
;             - long =      S32              U32          4
;
; Where the maximum range is:
;
;                         signed           unsigned
;                         ------           --------
;             - char =   -128 to 127       0 to 255
;             - int  =   -32768 to 32767   0 to 65535
;             - long =   -2147483648       0 to 4294967295        
;                         to 2147483647

[Constants]

   ;----------------------------------------------------------------------------
   ; Constants Definition
   ; --------------------
   ;
   ; Scalar Values
   ; -------------
   ; The scaling and translation values are used as follows:
   ;    msValue   = userValue / scale - translate
   ;    userValue = (msValue + translate) * scale
   ;
   ; I've got no good way to handle a few of these things yet.
   ;
   ; Temperatures are fine, check out the Fielding IAC example (fastIdleTemp).
   ;
   ; The TPS stuff is a problem, because we have to modify the INI file for
   ; each TPS installation and again whenever we move the TPS...
   ;
   ; Array Values
   ; ------------
   ; Arrays are specified just like scalars, except that they have a "shape"
   ; entry in the fourth parameter.  The shape allows you to define lists or
   ; tables, for example [8] defines a list with eight values and [2x4] defines
   ; a table with eight values (two rows and four columns).  Tables may be
   ; stored in either "X-" or "Y-order."  X-order means that memory is laid
   ; out as follows:
   ;
   ;     [x1,y1] [x2,y1]...[xn,y1] [x1,y2]...
   ;
   ; Y-order would be
   ;
   ;     [x1,y1] [x1,y2]...[x1,yn] [x2,y1]...
   ;
   ; To use the TableEditor, you must define two lists and a table, and
   ; the lengths of the lists must correspond to the shape of the table.
   ;
   ; Bit Fields
   ; ----------
   ; Bits are numbered 0-7, the rightmost being bit zero.  The basic
   ; data word that stores bit fields must be unsigned.
   ;
   ; You need NOT supply the correct number of labels matching the
   ; number of bits you've specified (one bit requires 2 values, two
   ; bits requires 4 values and so on).  If you neglect to supply enough
   ; labels, they will be synthesized using the sequence "1", "2" and so
   ; on based upon their position in the sequence (the cltType and matType
   ; will end up with identical lists).
   ;
   ;----------------------------------------------------------------------------

   pageActivationDelay =  50 ; Milliseconds delay after burn command.
   blockReadTimeout    = 200 ; Milliseconds total timeout for reading page.

   endianness          = big
   nPages              = 2
   pageSize            = 994,            946
   pageIdentifier      = "\x00\x04",     "\x00\x05"
   burnCommand         = "b%2i",         "b%2i"
   pageReadCommand     = "r%2i%2o%2c",   "r%2i%2o%2c"
   pageValueWrite      = "w%2i%2o%2c%v", "w%2i%2o%2c%v"
   pageChunkWrite      = "w%2i%2o%2c%v", "w%2i%2o%2c%v"

   page = 1
   ;  name            = class,  type, offset,      shape,  units,       scale, translate,    lo,      hi, digits
      nCylinders      = bits  ,  U08,      0,      [0:3], "INVALID"                                              ; *
      no_skip_pulses  = scalar,  U08,      1,             "",         1.00000,   0.00000,  1.00,  255.00,      0 ; * (  1 byte)
      ICIgnCapture    = bits  ,  U08,      2,      [0:0], "Falling Edge", "Rising Edge"                          ; *
      ICCrankTrigger  = bits  ,  U08,      2,      [1:2], "Calculated", "Trigger Return", "Trigger Rise",    "INVALID" ; *
      ICIgnOption     = bits  ,  U08,      2,      [4:5], "Standard Coil Charge", "EDIS", "EDIS Multispark", "INVALID" ; *
      spkout_hi_lo    = bits  ,  U08,      3,      [0:0], "Going Low (Normal)", "Going High (Inverted)"          ; *
      max_coil_dur    = scalar,  U08,      4,             "msec",       0.10000,   0.00000,  1.00,    8.00,      1 ; * (  1 byte)
      max_spk_dur     = scalar,  U08,      5,             "msec",       0.10000,   0.00000,  0.00,   25.50,      1 ; * (  1 byte)
      dwellAcc        = scalar,  U08,      6,             "msec",       0.10000,   0.00000,  0.00,   25.50,      1 ; * (  1 byte)
      dwellVolts      = array ,  S08,      7,    [    5], "V",        0.10000,   0.00000,-12.80,   12.70,      1 ; * (  5 bytes)
      dwellDuration   = array ,  S08,     12,    [    5], "msec",       0.10000,   0.00000,-12.80,   12.70,      1 ; * (  5 bytes)
      RevLimOption    = bits  ,  U08,     17,      [0:1], "None", "Spark Retard", "Fuel Cut", "INVALID"          ; * (  1 byte)
      RevLimMaxRtd    = scalar,  U08,     18,             "deg",      0.10000,   0.00000,  0.00,   25.50,      1 ; * (  1 byte)
      PredOpt         = bits  ,  U08,     19,      [0:1], "Last Interval", "Alpha-Beta-Gamma Filter", "INVALID", "INVALID" ; *
      crankingRPM     = scalar,  S16,     20,             "RPM",      1.00000,   0.00000,  0.00,  3000.0,      0 ; * (  2 bytes)
      cold_adv_table  = array ,  S16,     22,    [   10], "deg",      0.10000,   0.00000,-10.00,   10.00,      1 ; * ( 20 bytes)
      triggerOffset   = scalar,  S16,     42,             "deg",      0.10000,   0.00000,-359.0,  359.00,      2 ; * (  2 bytes)
      RevLimRpm1      = scalar,  S16,     44,             "RPM",      1.00000,   0.00000,  0.00,15000.00,      0 ; * (  2 bytes)
      RevLimRpm2      = scalar,  S16,     46,             "RPM",      1.00000,   0.00000,  0.00,15000.00,      0 ; * (  2 bytes)
#if LAMBDA
      afrTable1       = array ,  U08,     48,    [12x12], "Lambda",  0.006803,   0.00000,  0.00,    2.00,      3 ; * (144 bytes)
      afrTable2       = array ,  U08,    192,    [12x12], "Lambda",  0.006803,   0.00000,  0.00,    2.00,      3 ; * (144 bytes)
#else
      afrTable1       = array ,  U08,     48,    [12x12], "AFR",      0.10000,   0.00000,  9.00,   20.00,      1
      afrTable2       = array ,  U08,    192,    [12x12], "AFR",      0.10000,   0.00000,  9.00,   20.00,      1
#endif
      wueBins         = array ,  U08,    336,    [   10], "%",        1.00000,   0.00000,  0.00,  255.00,      0 ; * ( 10 bytes)
      taeBins         = array ,  U08,    346,    [    4], "msec",     0.10000,   0.00000,  0.00,   25.50,      1 ; * (  4 bytes)
      maeBins         = array ,  U08,    350,    [    4], "msec",     0.10000,   0.00000,  0.00,   25.50,      1 ; * (  4 bytes)
      iacstepTable    = array ,  S16,    354,    [   10], "steps",    1.00000,   0.00000,  0.00,  500.00,      0 ; * ( 20 bytes)
      ipwmTable       = array ,  S16,    354,    [   10], "%",        1.00000,   0.00000,  0.00,  100.00,      0
      frpm_table      = array ,  U16,    374,    [   12], "RPM",      1.00000,   0.00000,  0.00,15000.00,      0 ; * ( 24 bytes)
      srpm_table      = array ,  U16,    398,    [   12], "RPM",      1.00000,   0.00000,  0.00,15000.00,      0 ; * ( 24 bytes)
      fmap_table      = array ,  S16,    422,    [   12], "kPa",      0.10000,   0.00000,  0.00,  400.00,      1 ; * ( 24 bytes)
      smap_table      = array ,  S16,    446,    [   12], "kPa",      0.10000,   0.00000,  0.00,  400.00,      1 ; * ( 24 bytes)
#if CELSIUS
      tempTable       = array ,  S16,    470,    [   10], "°C",       0.05555,  -320.000,-40.00,  100.00,      1 ; * ( 20 bytes) Temperature bins for cranking, cold AE and WUE
#else
      tempTable       = array ,  S16,    470,    [   10], "°F",       0.10000,   0.00000,-40.00,  200.00,      1
#endif
      taeRates        = array ,  S16,    490,    [    4], "%/sec",    1.00000,   0.00000,  0.00, 32767.0,      0 ; * (  8 bytes) tpsDot bins used for AE: x for TAE interpolation
      maeRates        = array ,  S16,    498,    [    4], "kPa/sec",  1.00000,   0.00000,  0.00, 32767.0,      0 ; * (  8 bytes) mapDot bins used for AE: x for MAE
      map0            = scalar,  S16,    506,             "kPa",      0.10000,   0.00000, -100.0, 3276.7,      1 ; * (  2 bytes)
      mapmax          = scalar,  S16,    508,             "kPa",      0.10000,   0.00000, -100.0, 3276.7,      1 ; * (  2 bytes)
#if CELSIUS
      clt0            = scalar,  S16,    510,             "°C",       0.05555,  -320.000, -100.0,  500.0,      1 ; * (  2 bytes)
      cltmult         = scalar,  S16,    512,             "%",        1.00000,   0.00000, -200.0,  200.0,      0 ; * (  2 bytes)
      mat0            = scalar,  S16,    514,             "°C",       0.05555,  -320.000, -100.0,  500.0,      1 ; * (  2 bytes)
#else
      clt0            = scalar,  S16,    510,             "°F",       0.10000,   0.00000, -100.0,  500.0,      1
      cltmult         = scalar,  S16,    512,             "%",        1.00000,   0.00000, -200.0,  200.0,      0
      mat0            = scalar,  S16,    514,             "°F",       0.10000,   0.00000, -100.0,  500.0,      1
#endif
      matmult         = scalar,  S16,    516,             "%",        1.00000,   0.00000, -200.0,  200.0,      0 ; * (  2 bytes)
      tpsMin          = scalar,  S16,    518,             "ADC",      1.00000,   0.00000,    0.0, 1023.0,      0 ; * (  2 bytes)
      tpsMax          = scalar,  S16,    520,             "ADC",      1.00000,   0.00000,    0.0, 1023.0,      0 ; * (  2 bytes)
      batt0           = scalar,  S16,    522,             "V",        0.10000,   0.00000,    0.0, 3276.7,      1 ;   (  2 bytes)
      battmax         = scalar,  S16,    524,             "V",        0.10000,   0.00000,-3276.8, 3276.7,      1 ;   (  2 bytes)
      ego0            = scalar,  S16,    526,             "afr",      0.10000,   0.00000,-3276.8, 3276.7,      1 ;   (  2 bytes)
      egomult         = scalar,  S16,    528,             "%",        1.00000,   0.00000, -200.0,  200.0,      0 ;   (  2 bytes)
      baro0           = scalar,  S16,    530,             "kPa",      0.10000,   0.00000,-3276.8, 3276.7,      1 ; * (  2 bytes)
      baromax         = scalar,  S16,    532,             "kPa",      0.10000,   0.00000,-3276.8, 3276.7,      1 ; * (  2 bytes)
      bcor0           = scalar,  S16,    534,             "%",        1.00000,   0.00000,-3276.8, 3276.7,      1 ; * (  2 bytes)
      bcormult        = scalar,  S16,    536,             "%",        1.00000,   0.00000, -200.0,  200.0,      0 ; * (  2 bytes)
      knock0          = scalar,  S16,    538,             "V",        0.01000,   0.00000,    0.0,    5.0,      1 ; * (  2 bytes)
      knockmax        = scalar,  S16,    540,             "V",        0.01000,   0.00000,    0.0,    5.0,      1 ; * (  2 bytes)
      Dtpred_Gain     = scalar,  S16,    542,             "%",        1.00000,   0.00000, -200.0,  200.0,      0 ; * (  2 bytes)
      crankTolerance  = scalar,  U08,    544,             "%",        1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      asTolerance     = scalar,  U08,    545,             "%",        1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      pulseTolerance  = scalar,  U08,    546,             "%",        1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      IdleCtl         = bits  ,  U08,    547,      [0:2], "None", "Solenoid", "IAC Stepper Moving Only", "IAC Stepper Always On", "PWM Warmup", "15-Minute IAC", "INVALID", "INVALID" ; *
      IACtstep        = scalar,  U08,    548,             "msec",       0.10000,   0.00000,  0.00,   25.50,      1 ; * (  1 byte)
      IACaccstep      = scalar,  U08,    549,             "msec",       0.10000,   0.00000,  0.00,   25.50,      1 ; * (  1 byte)
      IACminstep      = scalar,  U08,    550,          "steps",       1.00000,   0.00000,  1.00,  255.00,      0 ; * (  1 byte)
      IACpwm_step     = scalar,  U08,    551,             "Hz",      80.00000,   0.00000, 80.00,  800.00,      0 ; * (  1 byte)
      IACStart        = scalar,  S16,    552,             "",         1.00000,   0.00000,  0.00, 4000.00,      0 ; * (  1 byte)
#if CELSIUS
      IdleHyst        = scalar,  S16,    554,             "°C",       0.05555,  -320.000, -40.0,  150.0,       1 ; * (  2 bytes)
#else
      IdleHyst        = scalar,  S16,    554,             "°F",       0.10000,   0.00000, -40.0,  300.0,       1
#endif
      IACcrankpos     = scalar,  S16,    556,             "steps",    1.00000,   0.00000,  0.00, 4000.00,      0 ; * (  2 bytes)
      IACcrankxt      = scalar,  S16,    558,             "sec",      1.00000,   0.00000,  0.00,32767.00,      0 ; * (  2 bytes)
#if CELSIUS
      IACcoldtmp      = scalar,  S16,    560,             "°C",       0.05555,  -320.000, -40.0,  150.0,       1 ; * (  2 bytes)
#else
      IACcoldtmp      = scalar,  S16,    560,             "°F",       0.10000,   0.00000,-40.00,  300.00,      1
#endif
      IACcoldpos      = scalar,  S16,    562,             "steps",    1.00000,   0.00000,  0.00, 4000.00,      0 ; * (  2 bytes)
      IACcoldxt       = scalar,  S16,    564,             "sec",      1.00000,   0.00000,  0.00,32767.00,      0 ; * (  2 bytes)
      primePulseCold  = scalar,  S16,    566,             "msec",     0.10000,   0.00000,  0.00,   65.00,      1 ; * (  2 bytes)
      primePulseHot   = scalar,  S16,    568,             "msec",     0.10000,   0.00000,  0.00,   65.00,      1 ; * (  2 bytes)
      crankCold       = scalar,  S16,    570,             "msec",     0.10000,   0.00000,  0.00,   65.00,      1 ; * (  1 byte)
      crankHot        = scalar,  S16,    572,             "msec",     0.10000,   0.00000,  0.00,   65.00,      1 ; * (  1 byte)
      asePctCold      = scalar,  S16,    574,             "%",        1.00000,   0.00000,  0.00,  400.00,      0 ; * (  2 bytes)
      asePctHot       = scalar,  S16,    576,             "%",        1.00000,   0.00000,  0.00,  400.00,      0 ; * (  2 bytes)
      aseCountCold    = scalar,  S16,    578,             "cycles",   1.00000,   0.00000,  0.00,32767.00,      0 ; * (  2 bytes)
      aseCountHot     = scalar,  S16,    580,             "cycles",   1.00000,   0.00000,  0.00,32767.00,      0 ; * (  2 bytes)
      taeColdA        = scalar,  U08,    582,             "msec",     0.10000,   0.00000,  0.00,  25.500,      1 ; * (  1 byte)
      taeColdM        = scalar,  U08,    583,             "%",        1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      tpsThresh       = scalar,  U08,    584,             "%/sec",    1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      mapThresh       = scalar,  U08,    585,             "kPa/sec",  1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte) threshold for MAE
      taeTime         = scalar,  U08,    586,             "sec",      0.10000,   0.00000,  0.00,   25.50,      1 ; * (  1 byte)
      tdePct          = scalar,  U08,    587,             "",         1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      floodClear      = scalar,  S16,    588,             "%",        0.10000,   0.00000,  0.00,  100.00,      1 ; * (  2 bytes)
      TPSOXLimit      = scalar,  S16,    590,             "%",        0.10000,   0.00000,  0.00,  100.00,      1 ; * (  2 bytes)
      tpsProportion   = scalar,  U08,    592,             "%",        1.00000,   0.00000,  0.00,  100.00,      0 ; * (  1 byte)
      baroCorr        = bits  ,  U08,    593,      [0:1], "None", "Initial MAP Reading", "Two Independent Sensors", "INVALID"        ; *
      egoType         = bits  ,  U08,    594,      [0:2], "Disabled", "Narrow Band", "Dual Narrow Band", "Single Wide Band", "Dual Wide Band", "INVALID", "INVALID", "INVALID" ; *
      egoCount        = scalar,  U08,    595,             "",         1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      egoDelta        = scalar,  U08,    596,             "%",        1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      egoLimit        = scalar,  U08,    597,             "%",        1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
#if   NARROW_BAND_EGO
      egoTarget       = scalar,  U08,    598,             "v",        0.01000,   0.00000,  0.00,    2.00,      4 ; * (  1 byte)
#elif LAMBDA
      AFRTarget       = scalar,  U08,    598,             "Lambda",   0.006803,   0.00000,  0.00,   2.00,      3
#else
      AFRTarget       = scalar,  U08,    598,             "AFR",      0.10000,   0.00000,  0.00,   25.50,      1
#endif
      tempUnits       = bits  ,  U08,    599,      [0:0], "Coolant/IAT Tables in °F", "Coolant/IAT Tables in °C"  ; * (  1 byte)
      MAFOption       = bits  ,  U08,    600,      [0:1], "No MAF",  "MAF Only", "MAF/MAP blend", "INVALID",      ; * 
      MAFpin          = bits  ,  U08,    600,      [4:5], "MAF on MAP pin", "MAF on Baro Pin", "MAF on Knock Pin", "INVALID" ; *
      DualSpkOptn     = bits  ,  U08,    601,      [0:3]  "No Dual Spark", "Dual Tach Inputs", "Falling Cam Sync with Tach or Wheel", "Rising Cam Sync with Tach or Wheel", "Single Crank Wheel Input", "Single Cam Wheel Input", "Dual Inputs, Timing from 1 cam tooth", "M-0 Wheel w/ Falling Crank Sync", "M-0 Wheel w/ Rising Crank Sync", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" ; * (1 byte)
#if CELSIUS
      fastIdleT       = scalar,  S16,    602,             "°C",       0.05555,  -320.000,-40.00,  150.00,      1 ; * (  2 bytes)
      egoTemp         = scalar,  S16,    604,             "°C",       0.05555,  -320.000,-40.00,  150.00,      1 ; * (  2 bytes)
#else
      fastIdleT       = scalar,  S16,    602,             "°F",       0.10000,   0.00000,-40.00,  300.00,      1
      egoTemp         = scalar,  S16,    604,             "°F",       0.10000,   0.00000,-40.00,  300.00,      1
#endif
      egoRPM          = scalar,  S16,    606,             "RPM",      1.00000,   0.00000,  0.00, 15000.0,      0 ; * (  2 bytes)
      reqFuel         = scalar,  U16,    608,             "msec",       0.00100,   0.00000,  0.00,  65.536,      2 ; * (  2 bytes)
      divider         = scalar,  U08,    610,             "",         1.00000,   0.00000,  0.00,     255,      0 ; * (  1 byte)
      alternate       = bits,    U08,    611,      [0:0], "Simultaneous", "Alternating"                          ; * (  1 byte)
      injOpen         = scalar,  U08,    612,             "msec",     0.10000,   0.00000,  0.00,   25.50,      1 ; * (  1 byte)
      injPwmT         = scalar,  U08,    613,             "msec",     0.10000,   0.00000,  0.00,   25.50,      1 ; * (  1 byte)
      injPwmPd        = scalar,  U08,    614,             "µsec",     1.00000,   0.00000, 40.00,  100.00,      0 ; * (  1 byte)
      injPwmP         = scalar,  U08,    615,             "%",        1.00000,   0.00000,  0.00,  100.00,      0 ; * (  1 byte)
      battFac         = scalar,  U08,    616,             "ms/v",     0.0166667, 0.00000,  0.00,    1.00,      2 ; * (  1 byte)
      twoStroke       = bits,    U08,    617,      [0:0], "Four-stroke",    "Two-stroke"                         ; *
      injType         = bits,    U08,    618,      [0:0], "Port Injection", "Throttle Body"                      ; *
      nInjectors      = bits,    U08,    619,      [0:4], "INVALID"                                              ; *
      OddAng          = scalar,  S16,    620,      "degrees",         0.10000,   0.00000,-350.0,  350.00,      1
      rpmLF           = scalar,  U08,    622,             "",         1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      mapLF           = scalar,  U08,    623,             "",         1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      tpsLF           = scalar,  U08,    624,             "",         1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      egoLF           = scalar,  U08,    625,             "",         1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      adcLF           = scalar,  U08,    626,             "",         1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      knkLF           = scalar,  U08,    627,             "",         1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      AMCOption       = bits,    U08,    628,      [0:1], "Disabled", "RAM Update", "FLASH Update", "INVALID"    ; * (  1 byte)
      dualTable       = bits,    U08,    629,      [0:0], "Single Table", "Dual Table"                           ; *
      algorithm       = bits,    U08,    630,      [0:1], "Speed Density", "Blend SD/Alpha-N", "Pure Alpha-N", "INVALID" ; *
      an_direction    = bits,    U08,    630,      [4:5], "Blend SD (hi_rpm)/Alpha-N (lo_rpm)","Blend SD (lo_rpm)/Alpha-N (hi_rpm)". "INVALID", "INVALID";
      IgnAlpha        = scalar,  U08,    631,             "",         1.00000,   0.00000,  0.00,  255.00,      0 ; U (  1 byte) UNUSED
      AfrAlpha        = scalar,  U08,    632,             "",         1.00000,   0.00000,  0.00,  255.00,      0 ; U (  1 byte) UNUSED
      AFRStoich       = scalar,  U08,    633,          "AFR",         0.10000,   0.00000,  0.00,   20.00,      1 ; * (  1 byte)
      AFRStoichWB     = scalar,  U08,    633,          "AFR",         0.10000,   0.00000,  0.00,   20.00,      1 ; * (  1 byte)
      AFRStoichNB     = scalar,  U08,    633,             "Volts",    0.01000,   0.00000,  0.00,    7.00,      3 ; * (1 byte)
      alpha_lorpm     = scalar,  S16,    634,          "RPM",         1.00000,   0.00000,  0.00,15000.00,      0 ; * (  2 bytes)
      alpha_hirpm     = scalar,  S16,    636,          "RPM",         1.00000,   0.00000,  0.00,15000.00,      0 ; * (  2 bytes)
      alphaMAPtable   = array ,  S16,    638,    [ 6x 6], "kPa",      0.10000,   0.00000,  0.00,  200.00,      1 ; * ( 72 bytes)
      amap_tps        = array ,  S16,    710,    [    6], "%",        0.10000,   0.00000,   0.0,  100.00,      1 ; * ( 12 bytes)
      amap_rpm        = array ,  U16,    722,    [    6], "RPM",      1.00000,   0.00000,  0.00,15000.00,      0 ; * ( 12 bytes)
      baud            = scalar,  U32,    734,            "",          1.00000,   0.00000,9600.0,115200.0,      0 ; x (  4 bytes)
      MAPOXLimit      = scalar,  S16,    738,         "kPa",          0.10000,   0.00000,  0.00,  300.00,      2 ; * (  2 bytes)
      board_type      = scalar,  U08,    740,            "",          1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      mycan_id        = scalar,  U08,    741,            "",          1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)               
      fet_delay       = scalar,  U08,    742,        "µsec",          1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      vr_delay        = scalar,  U08,    743, "µsec/1000rpm",         1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)   
      ECUType         = scalar,  U08,    744, "1=MS-II, 2=MicroSquirt",   1.00000,   0.00000,  0.00,    9.00,  0 ; * (  1 byte)

      MapThreshXTD2   = scalar,  U08,    745,    "-kpa/sec",          1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)

#if n2o
      n2oEnrich       = scalar,  U08,    746,           "%",          1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
#else
      pwImpulse       = scalar,  U08,    746,        "msec",          0.10000,   0.00000,  0.00,   25.50,      1 ; * (  1 byte)
#endif

      impulseSec      = scalar,  U08,    747,         "sec",          1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      nImpulse        = scalar,  U08,    748,            "",          1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      mapdotSample    = scalar,  U08,    749,        "msec",          1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      tpsdotSample    = scalar,  U08,    750,        "msec",          1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte) 
      ASEHot          =   bits,  U08,    751,      [0:0], "Disable ASE on Hot Start", "Enable ASE on Hot Start"
      InjStart        = scalar,  U08,    752,           "%",          1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte) 
      MapThreshXTD    = scalar,  U08,    753,    "-kpa/sec",          1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      MapThreshXTA    = scalar,  U08,    754,     "kpa/sec",          1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      trendmapLimit   = scalar,  U08,    755,         "kpa",          1.00000,   0.00000,  0.00,  255.00,      0 ; * (  1 byte)
      ; Port Settings constants
      psEnabled       = array ,  U08,    756,    [    7], "on/off",   1.00000,   0.00000,   0.00,    1.00,     0 ; * (  2 bytes)
      psCondition     = array ,  U08,    763,    [  7x2], "",         1.00000,   0.00000,-128.00,  127.00,     0 ; * (  2 bytes)
      psConnector     = array ,  U08,    777,    [    7], "",         1.00000,   0.00000,-128.00,  127.00,     0 ; * (  2 bytes)
      psInitValue     = array ,  U08,    784,    [    7], "",         1.00000,   0.00000,-128.00,  127.00,     0 ; * (  2 bytes)
      psPortValue     = array ,  U08,    791,    [    7], "",         1.00000,   0.00000,-128.00,  127.00,     0 ; * (  2 bytes)
      psOutSize       = array ,  U08,    798,    [  7x2], "",         1.00000,   0.00000,-128.00,  127.00,     0 ; * (  2 bytes)
      psOutOffset     = array ,  U16,    812,    [  7x2], "",         1.00000,   0.00000,-128.00,  127.00,     0 ; * (  2 bytes)
      psThreshold     = array ,  U16,    840,    [  7x2], "",         1.00000,   0.00000,-32768.0,32767.0,     0 ; * (  4 bytes)
      psHysteresis    = array ,  U16,    868,    [  7x2], "",         1.00000,   0.00000,-32768.0,32767.0,     0 ; * (  4 bytes)
      aeTaperTime     = scalar,  U08,    896,             "sec",        0.10000,   0.00000,  0.00,   25.50,      1 ; * (  1 byte)
      AFRMult         = bits,    U08,    897,      [0:1], "Use Combined VE/AFR table", "Separate VE & AFR table w/ NB EGO", "Separate VE & AFR table w/ WB EGO", "INVALID"  ; * (  1 byte)
      aeEndPW         = scalar,  S16,    898,             "msec",       0.10000,   0.00000,  0.00, 1000.00,      1 ; *
      egoAlgorithm    = bits  ,  U08,    900,      [0:1], "Simple", "Transport Delay", "PID/Smith Predictor", "INVALID" ; * (  1 byte)
      egoKP           = scalar,  U08,    901,             "%",        1.00000,   0.00000,  0.00,  100.00,      0 ; * (  1 byte)
      egoKI           = scalar,  U08,    902,             "%",        1.00000,   0.00000,  0.00,  100.00,      0 ; * (  1 byte)
      egoKD           = scalar,  U08,    903,             "%",        1.00000,   0.00000,  0.00,  100.00,      0 ; * (  1 byte)
      egoKdelay1      = scalar,  U16,    904,             "msec",       1.00000,   0.00000,  0.00,   65535,      0 ; * (  2 bytes)
      egoKdelay2      = scalar,  U16,    906,             "revs",     1.00000,   0.00000,  0.00,   65535,      0 ; * (  2 bytes)
      flexFuel        = bits  ,  U08,    908,      [0:0], "Disabled", "Enabled"                                  ; * (  1 byte)
      prime_delay     = scalar,  U08,    909,             "sec",      1.00000,   0.00000,  0.00,     255,      0 ; * (  1 byte)
      fuelFreq        = array ,  U08,    910,    [    2], "Hz",       1.00000,   0.00000,  0.00,     255,      0 ; * (  2 bytes)
         fuelFreq0    = scalar,  U08,    910,             "Hz",       1.00000,   0.00000,  0.00,     255,      0
         fuelFreq1    = scalar,  U08,    911,             "Hz",       1.00000,   0.00000,  0.00,     255,      0
      fuelCorr        = array ,  U08,    912,    [    2], "%",        1.00000,   0.00000,  0.00,     255,      0 ; * (  2 bytes)
         fuelCorr0    = scalar,  U08,    912,             "%",        1.00000,   0.00000,  0.00,     255,      0
         fuelCorr1    = scalar,  U08,    913,             "%",        1.00000,   0.00000,  0.00,     255,      0
      AMCstep         = scalar,  U08,    914,             "%",        1.00000,   0.00000,  0.00,     255,      0 ; * (  2 bytes)
      AMCdve          = scalar,  U08,    915,             "%",        1.00000,   0.00000,  0.00,     255,      0 ; * (  2 bytes)
      AMCve_rpm       = scalar,  U16,    916,             "RPM",      1.00000,   0.00000,  0.00,15000.00,      0 ; * (  2 bytes)
      AMCve_map       = scalar,  U16,    918,             "kPa",      0.10000,   0.00000,  0.00,  300.00,      2 ; * (  2 bytes)
      AMCramve_dt     = scalar,  U16,    920,             "sec",      1.0,       0.0,      0.0,   300.0,       0 ; * (  2 bytes)
      AMCT_thresh     = scalar,  U16,    922,             "sec",      1.0,       0.0,      0.0,  1800.0,       0 ; * (  2 bytes)
      AMCupdate_thresh= scalar,  U16,    924,             "events",   1.0,       0.0,      0.0, 30000.0,       0 ; * (  2 bytes)
      CWOption        = bits  ,  U08,    926,      [0:0], "Two-Point", "Table"                                   ; * (  1 byte )
      knkOption       = bits  ,  U08,    927,      [0:1], "Disabled", "Safe Mode", "Aggressive Mode", "INVALID"  ; * (  1 byte )
      knkDirection    = bits  ,  U08,    927,      [4:4], "Below threshold", "Above threshold"                   ; *
      knk_maxrtd      = scalar,  U08,    928,             "deg",      0.1,       0.0,      0.0,    25.5,       1 ; * (  1 byte )
      knk_step1       = scalar,  U08,    929,             "deg",      0.1,       0.0,      0.0,    25.5,       1 ; * (  1 byte )
      knk_step2       = scalar,  U08,    930,             "deg",      0.1,       0.0,      0.0,    25.5,       1 ; * (  1 byte )
      knk_trtd        = scalar,  U08,    931,             "sec",      0.1,       0.0,      0.0,    25.5,       1 ; * (  1 byte )
      knk_tadv        = scalar,  U08,    932,             "sec",      0.1,       0.0,      0.0,    25.5,       1 ; * (  1 byte )
      knk_dtble_adv   = scalar,  U08,    933,             "deg",      0.1,       0.0,      0.0,    25.5,       1 ; * (  1 byte )
      knk_ndet        = scalar,  U08,    934,             "knocks",   1.0,       0.0,      0.0,     255,       0 ; * (  1 byte )
     ;pad             = scalar,  U08,    935,
      knk_maxmap      = scalar,  U16,    936,             "kPa",      0.1,       0.0,      0.0,   300.0,       1 ; * (  2 bytes)
      knk_lorpm       = scalar,  U16,    938,             "rpm",      1.0,       0.0,      0.0,   10000,       0 ; * (  2 bytes)
      knk_hirpm       = scalar,  U16,    940,             "rpm",      1.0,       0.0,      0.0,   10000,       0 ; * (  2 bytes)
      knk_rpm         = array ,  U16,    942,    [    6], "rpm",      1.0,       0.0,      0.0,    6000,       0 ; * (  2 bytes)
      knk_thresh      = array ,  U16,    954,    [    6], "v",        0.01,      0.0,      0.0,    5.00,       2 ; * (  2 bytes)
      triggerTeeth    = scalar,  U16,    966,             "teeth",    1.0,       0.0,      0.0,     512,       0 ; * (  2 bytes)
      No_Miss_Teeth   = scalar,  U08,    968,             "teeth",    1.0,       0.0,      0.0,     255,       0 ; * (  1 byte )
      No_Skip_Teeth   = scalar,  U08,    969,             "teeth",    1.0,       0.0,      0.0,     255,       0 ; * (  1 byte )
      Delay_Teeth     = scalar,  U08,    970,             "teeth",    1.0,       0.0,      0.0,     255,       0 ; * (  1 byte )
      ICISR_tmask     = scalar,  U08,    971,             "msec",       0.1,       0.0,      0.0,    25.5,       1 ; * (  1 byte )
      ICISR_pmask     = scalar,  U08,    972,             "%",        1.0,       0.0,      0.0,     200,       0 ; * (  1 byte )
      injTestMode     = bits  ,  U08,    973,      [0:1], "Normal Mode", "Test Mode", "Repeat Test", "INVALID"   ;   (  1 byte )
      ae_lorpm        = scalar,  U16,    974,             "rpm",      1.0,       0.0,      0.0,   10000,       0 ; * (  2 bytes)
      ae_hirpm        = scalar,  U16,    976,             "rpm",      1.0,       0.0,      0.0,   10000,       0 ; * (  2 bytes)
      fuelSpkDel      = array ,  S16,    978,    [    2], "deg",      0.10000,   0.00000,-45.00,   45.00,      1 ; * (  4 bytes)
         fuelSpkDel0  = scalar,  S16,    978,             "deg",      0.10000,   0.00000,-45.00,   45.00,      1
         fuelSpkDel1  = scalar,  S16,    980,             "deg",      0.10000,   0.00000,-45.00,   45.00,      1
      injTestSqrts    = scalar,  U16,    982,             "squirts",  1,         0,           0,   65000,      0 ;   (  2 bytes)
      injTestPW       = scalar,  U16,    984,             "msec",     0.001,     0,           0,      65,      3 ;   (  2 bytes)
      injTestOffTime  = scalar,  U16,    986,             "msec",     0.1,       0,           0,    6500,      1 ;   (  2 bytes)
      CID             = scalar,  U16,    988,             "cu.in.",   1,         0,           0,     700,      1 ;   (  2 bytes)         
      alpha           = scalar,  U08,    990,             "%",        1.0,       0.0,        50,     150,      0 ; * (  1 byte ) 
      beta            = scalar,  U08,    991,             "%",        1.0,       0.0,       0.0,     100,      0 ; * (  1 byte )
      gamma           = scalar,  U08,    992,             "%",        1.0,       0.0,       0.0,      50,      0 ; * (  1 byte )
      acc_synchk      = bits,    U08,    993,      [0:1], "Check Only at Steady Speed", "Check Accel and Steady Speed", "Check Decel and Steady Speed", "Check Always" ;  (1 byte)        
  
;     pageSize =  994

   page = 2
      veTable1        = array ,  U08,      0,    [12x12], "%",        1.00000,   0.00000,  0.00,  255.00,      0 ; * (144 bytes)
      veTable2        = array ,  U08,    144,    [12x12], "%",        1.00000,   0.00000,  0.00,  255.00,      0 ; * (144 bytes)
      advanceTable    = array ,  S16,    288,    [12x12], "deg",      0.10000,   0.00000,-10.00,   90.00,      1 ; * (288 bytes)
      AMCNBurns       = scalar,  U16,    576,             "burns",    1,         0,           0,   65000,      0 ; x (  2 bytes)
      primePWTable    = array ,  S16,    578,    [   10], "msec",       0.10000,   0.00000,  0.00,   65.00,      1 ; * ( 20 bytes)
      crankPWTable    = array ,  S16,    598,    [   10], "msec",       0.10000,   0.00000,  0.00,   65.00,      1 ; * ( 20 bytes)
      asePctTable     = array ,  S16,    618,    [   10], "%",        1.00000,   0.00000,  0.00,  400.00,      0 ; * (  2 bytes)
      aseCntTable     = array ,  S16,    638,    [   10], "cycles",   1.00000,   0.00000,  0.00, 2500.00,      0 ; * (  2 bytes)
#if CELSIUS
      matTemps        = array ,  S16,    658,    [    6], "°C",       0.05555,  -320.000,-40.00,  150.00,      1 ; * ( 12 bytes)
#else
      matTemps        = array ,  S16,    658,    [    6], "°F",       0.10000,   0.00000,-40.00,  300.00,      1
#endif
      matRetard       = array ,  U08,    670,    [    6], "deg",      0.10000,   0.00000,  0.00,    25.5,      1 ; * (  6 bytes)
      xTauOption      = bits  ,  U08,    676,      [0:1], "Off", "Accel/Decel Only", "Warm-up + Accel/Decel", "INVALID" ; * (  1 byte )
      spkN2O          = scalar,  U08,    677,             "deg",      0.10000,   0.00000,  0.00,    25.5,      1 ; * (  1 bytes)
      XAccTable       = array,   U16,    678,     [   5],  "%",       0.10000,   0.00000,  5.00,      90,      1 ; * ( 10 bytes)
      TauAccTable     = array,   U16,    688,     [   5],"msec",      1.00000,   0.00000,  2.00,   20000,      0 ; * ( 10 bytes)
      XDecTable       = array,   U16,    698,     [   5],  "%",       0.10000,   0.00000,  5.00,      90,      1 ; * ( 10 bytes)
      TauDecTable     = array,   U16,    708,     [   5],"msec",      1.00000,   0.00000,  2.00,   20000,      0 ; * ( 10 bytes)
      XTrpms          = array,   U16,    718,     [   5], "rpm",      1.00000,   0.00000,  0.00,   10000,      0 ; * ( 10 bytes)
      XClt            = array,   U16,    728,     [  10],   "%",      1.00000,   0.00000,  0.00,     600,      0 ; * ( 20 bytes)
      TauClt          = array,   U16,    748,     [  10],   "%",      1.00000,   0.00000,  0.00,     600,      0 ; * ( 20 bytes)
      ipada           = array,   S16,    768,     [   48],   "",      1.00000,   0.00000,  0.00,     300,      0 ; * ( 96 bytes)
      ; Supplemental corrections for barometer and IAT.
      baroCorrVals    = array ,  S16,    864,    [    6], "kPa",      0.10000,   0.00000,  80.0,  120.00,      1 ; * ( 24 bytes)
#if CELSIUS
      matCorrTemps    = array ,  S16,    876,    [    6],  "°C",      0.05555,  -320.000,-40.00,  150.00,      1 ; * ( 12 bytes)
#else
      matCorrTemps    = array ,  S16,    876,    [    6],  "°F",      0.10000,   0.00000,-40.00,  300.00,      1
#endif
      baroCorrDelta   = array ,  S08,    888,    [    6],   "%",      1.00000,   0.00000,-100.0,   120.0,      1 ; * (  6 bytes)
      matCorrDelta    = array ,  S08,    894,    [    6],   "%",      1.00000,   0.00000,-100.0,   120.0,      1 ; * (  6 bytes)
      MAFFlow         = array ,  U16,    900,    [   12], "gram/sec",   0.01000,   0.00000,  0.00,   650.0,      1 ; * ( 24 bytes)      
      MAFCor          = array ,  U08,    924,    [   12],   "%",      1.00000,   0.00000,  0.00,   255.0,      0 ; * ( 12 bytes)   
      MAFRPM1         = scalar,  U16,    936,             "rpm",      1.00000,   0.00000,  0.00,   10000,      0 ; * (  2 bytes)
      MAFRPM2         = scalar,  U16,    938,             "rpm",      1.00000,   0.00000,  0.00,   10000,      0 ; * (  2 bytes)
      MAFDir          = bits  ,  U08,    940,      [0:0], "Use Above", "Invert Above"                             ; * (  1 byte )
      VEIXOptn        = bits  ,  U08,    941,      [0:0], "Use MAP only", "Adjust MAP for Baro"                   ; * (  1 byte )
      MatRtdRPMHi     = scalar,  U16,    942,             "rpm",      1.00000,   0.00000,  0.00,   10000,      0 ; * (  2 bytes)  
      MatRtdRPMLo     = scalar,  U16,    944,             "rpm",      1.00000,   0.00000,  0.00,   10000,      0 ; * (  2 bytes)

;     pageSize =  946

[Menu]

   ;----------------------------------------------------------------------------
   ;  There are five pre-defined values that may be used to define your menus.
   ;  The first four allow access to the "standard" dialog boxes, the last one
   ;  merely draws a separator (horizontal line) in the menu.
   ;
   ;     std_constants
   ;     std_enrichments
   ;     std_realtime
   ;     std_warmup
   ;     std_accel
   ;
   ;     std_separator
   ;
   ;  Additionally, to support MegaSquirt-II firmware, there are two standard
   ;  dialogs to generate its three embedded tables.  The first of these acts
   ;  like Roger Enns' EasyTherm, but only works for MS-II.  The second one
   ;  generates the internal AFR table required for proper closed loop operation
   ;  in MS-II.  Use these without page numbers, as they will just be ignored
   ;  in any case.
   ;
   ;     std_ms2gentherm
   ;     std_ms2geno2
   ;
   ;  If you use any of the std_constants, std_enrichments or std_warmup
   ;  editors, they may be optionally suffixed with a page number (only
   ;  useful for multi-page code variants), which causes them to edit the
   ;  specified page.  If you leave off the page specifier, they edit logical
   ;  page one as specified in the Constants section.
   ;
   ;  There are four special menu names, which when used append to the standard
   ;  menus of the same name instead of creating a new one.  The menu names
   ;  are "File", "Communications", "Tools" and "Help".
   ;
   ;----------------------------------------------------------------------------

   menuDialog = main
      menu = "Fuel &Set-Up"
         subMenu = generalSettings, "&General"
         subMenu = idleControl,     "I&dle Control",                   0,  { ECUType == 1 || ECUType == 2}
         subMenu = std_port_edit,   "Spare &Port Settings",            0,  { ECUType == 1 || ECUType == 2}
         subMenu = std_separator,   ;----------------------------------------------
         subMenu = injChars,        "I&njector Characteristics",       0,  { ECUType == 1 || ECUType == 2}
         subMenu = std_injection,   "Injection &Control",              0,  { ECUType == 1 || ECUType == 2}
         subMenu = revLimiter,      "&Rev Limiter",                    0,  { ECUType == 1 || ECUType == 2}
         subMenu = aseSettings,     "After&Start Enrichment" ,         0,  { ECUType == 1 || ECUType == 2}
         subMenu = accSettings,     "Acce&l Enrichment Config",        0,  { ECUType == 1 || ECUType == 2}
         subMenu = otherFuel,       "&Other Fuel Settings",            0,  { ECUType == 1 || ECUType == 2}
         subMenu = baroCorrection,  "2-Point &Barometric Correction",  0,  { ECUType == 1 || ECUType == 2}
         subMenu = flexFuelSettings,"&Flex Fuel",                      0,  { ECUType == 1 || ECUType == 2}
         subMenu = egoControl,      "&EGO Control",                    0,  { ECUType == 1 || ECUType == 2}
         subMenu = amcSettings,     "Automatic &Mixture Control",      0,  { ECUType == 1 || ECUType == 2}
	 subMenu = std_separator    ;----------------------------------------------
	 subMenu = alphaNOptions,   "&Alpha-N Blending",               0,  { algorithm  > 0 && (ECUType == 1 || ECUType == 2)}
	 subMenu = MAFSettings,     "MAP vrs. MAF &Usage",             0,  { ECUType == 1 || ECUType == 2}

   menuDialog = main
       menu = "&Ignition Set-Up"
         subMenu = ignitionOptions, "&Base Ignition Settings",         0,  { ECUType == 1 || ECUType == 2}
         subMenu = dwellSettings,   "D&well Settings",                 0,  { ECUType == 1 || ECUType == 2}
         subMenu = AdvncdignitionOptions, "&Advanced Ignition Options",0,  { ECUType == 1 || ECUType == 2}
         subMenu = knockThreshold,  "&Knock Threshold",                0,  { ECUType == 1 || ECUType == 2}  

   menuDialog = knockThreshold
      menu = "&Settings"
         subMenu = knockSettings,   "&Knock Sensor Settings",          0,  { ECUType == 1 || ECUType == 2}

   menuDialog = main
      menu = "B&asic Tables"

#if MAPbaro
	 subMenu = std_separator    ;----------------------------------------------
         subMenu = veTable1Tbl,     "&VE Table 1 (MAP/Baro)",         0,  { MAFOption != 1 && VEIXOptn  > 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = afrTable1Tbl,    "&AFR Table 1 (MAP/Baro)",        0,  { egoType >= 3   && VEIXOptn  > 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = veTable2Tbl,     "V&E Table 2 (MAP/baro)",         0,  { MAFOption != 1 && dualTable && VEIXOptn > 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = afrTable2Tbl,    "AFR &Table 2 (MAP/Baro)",        0,  { egoType >= 3   && dualTable && VEIXOptn > 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = ignitionTbl,     "&Spark Advance Table (MAP/Baro)",0,  { VEIXOptn  > 0  && (ECUType == 1 || ECUType == 2)}

#else
         subMenu = veTable1Tbl,     "VE Table &1 (MAP)",              0,  { MAFOption != 1 && VEIXOptn == 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = afrTable1Tbl,    "A&FR Table 1 (MAP)",             0,  { egoType >= 3   && VEIXOptn == 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = veTable2Tbl,     "VE Table &2 (MAP)",              0,  { MAFOption != 1 && dualTable && VEIXOptn == 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = afrTable2Tbl,    "AF&R Table 2 (MAP)"              0,  { egoType >= 3   && dualTable && VEIXOptn == 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = ignitionTbl,     "S&park Advance Table (MAP)",     0,  { VEIXOptn == 0  && (ECUType == 1 || ECUType == 2)}
#endif
  
     menuDialog = main
      menu = "Othe&r Tables" 
         subMenu = tempTableBins,   "&Temperature Table Values",      0,  { ECUType == 1 || ECUType == 2}
         subMenu = alphaMAPTbl,     "&Alpha-N MAP Table",             0, { algorithm > 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = barometerCorr,   "Barometric &Correction",         0, { CWOption > 0  && (ECUType == 1 || ECUType == 2)}
         subMenu = std_separator    ;----------------------------------------------   
         subMenu = primingPW,       "Pri&ming Pulse",                 0, { CWOption > 0  && (ECUType == 1 || ECUType == 2)}
         subMenu = crankingPW,      "Cra&nking Pulse",                0, { CWOption > 0  && (ECUType == 1 || ECUType == 2)}
         subMenu = asePct,          "A&SE Percentage",                0, { CWOption > 0  && (ECUType == 1 || ECUType == 2)}
         subMenu = aseTaper,        "AS&E Taper",                     0, { CWOption > 0  && (ECUType == 1 || ECUType == 2)}

   menuDialog = veTable1Tbl
      menu = "&Edit Bins"
	 subMenu = fmapTableBins,   "Edit Fuel &MAP Bins"
	 subMenu = frpmTableBins,   "Edit Fuel &RPM Bins"

   menuDialog = veTable2Tbl
      menu = "&Edit Bins"
	 subMenu = fmapTableBins,   "Edit Fuel &MAP Bins"
	 subMenu = frpmTableBins,   "Edit Fuel &RPM Bins"


   menuDialog = ignitionTbl
      menu = "&Edit Bins"
	 subMenu = smapTableBins,   "Edit Spark &MAP Bins"
	 subMenu = srpmTableBins,   "Edit Spark &RPM Bins"		 

   menuDialog = main
      menu = "&Tuning"
         subMenu = std_realtime,    "&Realtime Display",              0,  { ECUType == 1 || ECUType == 2}

#if MAPbaro
         subMenu = std_separator    ;----------------------------------------------
         subMenu = veTable1Map,     "VE &Table 1 (MAP/Baro)",         0, { MAFOption != 1 && VEIXOptn  > 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = veTable2Map,     "VE T&able 2 (MAP/Baro)",         0, { MAFOption != 1 && dualTable && VEIXOptn  > 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = afrTable1Map,    "A&FR Ta&ble 1 (MAP/Baro)",       0, { egoType   >= 3 && VEIXOptn  > 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = afrTable2Map,    "A&FR Tabl&e 2 (MAP/Baro)",       0, { egoType   >= 3 && dualTable && VEIXOptn  > 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = ignitionMap,     "I&gnition Advance Table (MAP/Baro)",    0, { VEIXOptn  > 0  && VEIXOptn  > 0 && (ECUType == 1 || ECUType == 2)}

#else
         subMenu = std_separator    ;----------------------------------------------
         subMenu = veTable1Map,     "VE Table &1 (MAP)",              0, { MAFOption != 1 && VEIXOptn == 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = veTable2Map,     "VE Table &2 (MAP)",              0, { MAFOption != 1 && dualTable && (ECUType == 1 || ECUType == 2)}
         subMenu = afrTable1Map,    "A&FR Table 1 (MAP)",             0, { egoType   >= 3 && VEIXOptn == 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = afrTable2Map,    "AF&R Table 2 (MAP)",             0, { egoType   >= 3 && dualTable && VEIXOptn == 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = ignitionMap,     "&Spark Advance Table (MAP)",     0, { VEIXOptn == 0 && (ECUType == 1 || ECUType == 2)}
#endif

         subMenu = std_separator    ;----------------------------------------------
         subMenu = std_warmup,      "&Warmup Wizard",                 0,  { ECUType == 1 || ECUType == 2}
         subMenu = std_accel,       "Acce&leration Wizard",           0,  { ECUType == 1 || ECUType == 2}       

   menuDialog = main
       menu = "X-Ta&u Tuning"
         subMenu = XAccTable,       "Puddling Factors (&accel)",      0, { xTauOption > 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = XDecTable,       "Puddling Factors (&decel)",      0, { xTauOption > 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = TauAccTable,     "Time Factors (a&ccel)",          0, { xTauOption > 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = TauDecTable,     "Time Factors (d&ecel)",          0, { xTauOption > 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = XCltTable,       "&X (Puddling) Temp. Corrections",0, { xTauOption > 0 && (ECUType == 1 || ECUType == 2)}    
         subMenu = TCltTable,       "&Tau (Time) Temp. Corrections",  0, { xTauOption > 0 && (ECUType == 1 || ECUType == 2)}
         subMenu = std_separator    ;---------------------------------------------- 
         subMenu = xTauSettings,    "&MAPdot Settings",               0, { xTauOption > 0 && (ECUType == 1 || ECUType == 2)}    
         subMenu = XTrpmsdial,      "&RPM Values",                    0, { xTauOption > 0 && (ECUType == 1 || ECUType == 2)}

   menuDialog = main
       menu = "Oth&er Tuning"
         subMenu = coldAdvance,     "&Cold Advance",                  0,  { ECUType == 1 || ECUType == 2}
         subMenu = std_separator    ;----------------------------------------------
         subMenu = manifoldTempCorr,"I&AT-Based Fuel Correction",     0,  { ECUType == 1 || ECUType == 2}
         subMenu = matBasedRetard,  "IAT-&Based Timing Retard",       0,  { ECUType == 1 || ECUType == 2}
         subMenu = std_separator    ;----------------------------------------------	
         subMenu = iacSteps,        "I&dle Steps",                    0, { IdleCtl == 2 || IdleCtl == 3 || IdleCtl == 5 && (ECUType == 1 || ECUType == 2)}
         subMenu = ipwBins,         "Idle &PWM Dutycycle",            0, { IdleCtl == 4 }	
         subMenu = std_separator    ;----------------------------------------------
         subMenu = alphaMAPMap,     "Alpha-&N MAP Table",             0, { algorithm > 0 && (ECUType == 1 || ECUType == 2)} 
         subMenu = std_separator    ;----------------------------------------------
         subMenu = MAFtable1,       "&MAF Correction Table",          0, { MAFOption > 0 && (ECUType == 1 || ECUType == 2)}
 
   menuDialog = main
      menu = "Tools"
         subMenu = std_ms2gentherm, "Calibrate T&hermistor Tables...",0,  { ECUType == 1 || ECUType == 2}
         subMenu = std_ms2geno2,    "Calibrate &AFR Table...",        0,  { ECUType == 1 || ECUType == 2}
         subMenu = sensorCal,       "&Sensor Calibration...",         0,  { ECUType == 1 || ECUType == 2}
         subMenu = std_trigwiz,     "Tri&gger Wizard...",             0,  { ECUType == 1 || ECUType == 2}
	 subMenu = injector_test,   "&Injector Test Mode",            0,  { ECUType == 1 || ECUType == 2}     

   menu = "Help"
         subMenu = helpGeneral,     "&MS-II Info"
         subMenu = sensorHelp,      "&Sensor Calibration"
         subMenu = burnHelp,        "&Burning Values to ECU"

;-------------------------------------------------------------------------------

[UserDefined]

   dialog = generalSettings, "General Settings"
      topicHelp = "http://www.megamanual.com/mt28.htm#sg"
      field = "ECU Type",                 ECUType
      field = "!MUST set ECU Type before editting other values."
      field = "Engine displacement",      CID,                 { ECUType == 1 || ECUType == 2}
      field = "Injection Timing Delay",   InjStart,            { ECUType == 1 || ECUType == 2}
;     field = "#System"
;     field = "Temperature Units",        tempUnits,           { ECUType == 1 || ECUType == 2}
      field = "Dual Table Use",           dualTable,           { ECUType == 1 || ECUType == 2}
      field = "Barometric Correction",    baroCorr,            { ECUType == 1 || ECUType == 2}
      #  set X_TAU_VISIBLE
      #if X_TAU_VISIBLE
      field = "X-Tau Usage",            xTauOption,            { ECUType == 1 || ECUType == 2}
      #endif
      field = "Prime, ASE, WUE & Baro Tables", CWOption,       { ECUType == 1 || ECUType == 2}

   field = "#Input Smoothing Factors"
      field = "MAP/MAF Averaging Lag Factor", mapLF,           { ECUType == 1 || ECUType == 2}
      field = "RPM Averaging Lag Factor",    rpmLF,            { ECUType == 1 || ECUType == 2}
      field = "TPS Averaging Lag Factor",    tpsLF,            { ECUType == 1 || ECUType == 2}
      field = "Lambda Averaging Lag Factor", egoLF,            { ECUType == 1 || ECUType == 2}
      field = "CLT/IAT/Battery Lag Factor",  adcLF,            { ECUType == 1 || ECUType == 2}
      field = "Knock Averaging Lag Factor",  knkLF,            { ECUType == 1 || ECUType == 2}

   field = "#Sampling Rates"
      field = "TPS Sample Rate",             tpsdotSample,     { ECUType == 1 || ECUType == 2}
      field = "MAP Sample Rate",             mapdotSample,     { ECUType == 1 || ECUType == 2}

   dialog = revLimiter, "Rev Limiter"
      topicHelp = "http://www.megamanual.com/mt28.htm#sr"
      field = "Algorithm",                   RevLimOption
      field = "Maximum Retard",              RevLimMaxRtd, { RevLimOption == 1 }
      field = "Lower Rev Limit",             RevLimRpm1
      field = "Upper Rev Limit",             RevLimRpm2

   dialog = flexFuelSettings, "Flex Fuel Settings"
      topicHelp = "http://www.megamanual.com/mt28.htm#sf"
      field = "Flex Fuel Sensor",           flexFuel
      field = "Frequency (low)",            fuelFreq0,   { flexFuel > 0 }
      field = "Fuel Correction (low)",      fuelCorr0,   { flexFuel > 0 }
      field = "Timing Correction (low)",    fuelSpkDel0, { flexFuel > 0 }
      field = "Frequency (high)",           fuelFreq1,   { flexFuel > 0 }
      field = "Fuel Correction (high)",     fuelCorr1,   { flexFuel > 0 }
      field = "Timing Correction (high)",   fuelSpkDel1, { flexFuel > 0 }

   dialog = otherFuel, "Other Fuel Settings"
      topicHelp = "http://www.megamanual.com/mt28.htm#so"	  
      field = "#Engine Start Up"
      field = "Max. Cranking Speed",        crankingRPM,      { 1 }
      field = "#VE Table Adjustments"
      field = "(May have to save MSQ and reload to get to stick)"
      field = "Use MAP/baro for tables",    VEIXOptn,         { 1 }
      field = "    - Must also set/unset MAPbaro in settings.ini -"
      field = "AFR Table Fuel Calc Usage",  AFRMult,          { 1 }
      field = "AFR Stioch. Ratio",          AFRStoichNB,      { AFRMult == 1 }
      field = "AFR Stioch. Ratio",          AFRStoichWB,      { AFRMult == 2 }
      field = "#Two-Point Prime"
      field = "Prime Pulse Cold PW",        primePulseCold,   { CWOption == 0 }
      field = "Prime Pulse Hot PW",         primePulseHot,    { CWOption == 0 }
      field = "Prime Delay", prime_delay
      field = "#Additional Fuel (switched by E0 low or cyclic)"

#if n2o
      field = "Nitrous Oxide Enrichment",   n2oEnrich
	  field = "Spark Retard When N2O Active", spkN2O
#else 
      field = "Fuel Added to Base PW",      pwImpulse
      field = "#Additional Fuel (cyclic only)"
      field = "Time Between Added Fuel",    impulseSec
      field = "Number of Cycles",           nImpulse
#endif
   
  dialog = aseSettings, "AfterStart Enrichment Settings"
      topicHelp = "http://www.megamanual.com/mt28.htm#ss"    
      field = "#Hot AfterStart Enrichment"
      field = "ASE Hot Start Enable",    ASEHot

      field = "#Two-Point AfterStart Enrich"
      field = "ASE Cold Percent",        asePctCold,    { CWOption == 0 }
      field = "ASE Hot Percent",         asePctHot,     { CWOption == 0 }
      field = "ASE Cold Count",          aseCountCold,  { CWOption == 0 }
      field = "ASE Hot Count",           aseCountHot,   { CWOption == 0 }
  
  dialog = accSettings, "Accel Enrichment Configuration"
      topicHelp = "http://www.megamanual.com/mt28.htm#sl"
      field = "#AE RPM Scaling (for non-XTau accel)"
      field = "Low RPM Threshold",       ae_lorpm,
      field = "High RPM Threshold",      ae_hirpm,
  
   dialog = baroCorrection, "2-Point Barometric Correction"
      topicHelp = "http://www.megamanual.com/mt28.htm#sb"
      field = "#Barometric Correction"
      field =    "At total vacuum ",     bcor0
      field =    "Rate",                 bcormult

   dialog = xTauSettings, "X-Tau MAPdot Settings"
      topicHelp = "http://www.megamanual.com/mt28.htm#um"
      field = "#MAPdot Thresholds for transition to X, Tau Decel Tables"
      field = "Start Transition",  MapThreshXTD
      field = "Finish Transition",  MapThreshXTD2      
      field = "#"
      field = "#MAPdot trending threshhold is the start of"
      field = "#Map Trending for faster AE/ XTau enrichment"
      field = "MAPdot Trending Threshhold",        MapThreshXTA
      field = "Max. MAP added per sample",         trendmapLimit
	  
   dialog = injChars, "Injector Characteristics"
      topicHelp = "http://www.megamanual.com/mt28.htm#sn"
      field = "Injector Open Time",         injOpen
      field = "Battery Voltage Correction", battFac
      field = "PWM Current Limit",          injPwmP
      field = "PWM Time Threshold",         injPwmT
      field = "!Injector PWM Period",       injPwmPd ; !
      field = "!Red settings require an MS-II reboot!"

   dialog = egoControl, "EGO Control"
      topicHelp = "http://www.megamanual.com/mt28.htm#se"
      field = "EGO Sensor Type",           egoType
   #if   NARROW_BAND_EGO
      field = "NB Voltage Target",         egoTarget,    { egoType == 1 || egoType == 2}
   #elif LAMBDA
      field = "NB Lambda Target",          AFRTarget,    { egoType == 1 || egoType == 2}
   #else
      field = "NB AFR Target",             AFRTarget,    { egoType == 1 || egoType == 2}
   #endif
      field = "Ignition Events per Step",  egoCount,     { egoType == 1 || egoType == 2 ||  egoType >  2  && egoAlgorithm == 0}

      field = "Controller Step Size",      egoDelta,     { egoType == 1 || egoType == 2}
      field = "Controller Authority ±",    egoLimit,     { egoType >  0 }
      field = "Active Above Coolant Temp", egoTemp,      { egoType >  0 }
      field = "Active Above RPM",          egoRPM,       { egoType >  0 }
      field = "Active Below TPS",          TPSOXLimit,   { egoType >  0 }
      field = "Active Below MAP",          MAPOXLimit,   { egoType >  0 }

   field = "#WB Controller Settings"
      field = "Algorithm",                 egoAlgorithm, { egoType >  2 }
      field = "PID Proportional Gain",     egoKP,        { egoType >  2 }
      field = "Transport Delay 1",         egoKdelay1,   { egoType >  2 && egoAlgorithm > 0 }
      field = "Transport Delay 2",         egoKdelay2,   { egoType >  2 && egoAlgorithm > 0 }
      field = "PID Integral",              egoKI,        { egoType >  2 && egoAlgorithm > 1 }
      field = "PID Derivative",            egoKD,        { egoType >  2 && egoAlgorithm > 1 }

   dialog = amcSettings, "Automatic Mixture Control"
      topicHelp = "http://www.megamanual.com/mt28.htm#sm"
      field = "!Must have EGO correction enabled for AMC to operate!"
      field = "Automatic Mixture Control", AMCOption,    { egoType   > 0 }
      field = "Step size",                 AMCstep,      { AMCOption > 0 }
      field = "Minimum VE Change",         AMCdve,       { AMCOption > 0 }
      field = "Vertex Tolerance",          AMCve_rpm,    { AMCOption > 0 }
      field = "Vertex Tolerance",          AMCve_map,    { AMCOption > 0 }
      field = "Table Change Interval",     AMCramve_dt,  { AMCOption > 0 }
      field = "Flash Update Interval",     AMCT_thresh,  { AMCOption > 1 }
      field = "Update After",              AMCupdate_thresh, { AMCOption > 1 }
   
   dialog = alphaNOptions, "Alpha-N Blending"
      topicHelp = "http://www.megamanual.com/mt28.htm#sa"
      field = "Alpha-N Usage",              an_direction, {algorithm == 1}
      field = "Pure AN to Blend Threshold", alpha_lorpm
      field = "Blend to SD Threshold",      alpha_hirpm

   dialog = ignitionOptions, "Base Ignition Settings"
      topicHelp = "http://www.megamanual.com/mt28.htm#ib"
      field = "#General Ignition"
      field = "Trigger Offset",            triggerOffset
      field = "Skip Pulses",               no_skip_pulses
      field = "#Prediction Settings",      
      field = "Predictor Algorithm",       PredOpt
      field = "Alpha",                     alpha,           { PredOpt == 1 }
      field = "Beta",                      beta,            { PredOpt == 1 }
      field = "Gamma",                     gamma,           { PredOpt == 1 }
      field = "#Tach Signal Masking" 
      field = "Time Mask",                 ICISR_tmask
      field = "Percentage Mask",           ICISR_pmask
      field = "#Next-Pulse Tolerance"
      field = "   Cranking",               crankTolerance
      field = "   After-start",            asTolerance
      field = "   Normal Running",         pulseTolerance
      field = "Check Tach Sync Options",   acc_synchk,      { triggerTeeth == 0 }
      field = "!Ignition Input Capture",   ICIgnCapture,    { ICIgnOption != 2 && ICIgnOption != 3 } ; !
      field = "!Cranking Trigger",         ICCrankTrigger,  { ICIgnOption != 2 && ICIgnOption != 3 } ; !
      field = "!Coil Charging Scheme",     ICIgnOption  ; !
      field = "!Spark Output",             spkout_hi_lo ; !

 
   dialog = AdvncdignitionOptions, "Advanced Ignition Options"
      topicHelp = "http://www.megamanual.com/mt28.htm#ia"
      field = "#Trigger Wheel Only (0 is no trigger wheel)"
      field = "#Set only with ENGINE OFF"
      field = "!Trigger Wheel Teeth",          triggerTeeth
      field = "!Missing Teeth",                No_Miss_Teeth,  { triggerTeeth > 0 }
      field = "!Skip Teeth",                   No_Skip_Teeth,  { triggerTeeth > 0 }
      field = "!Delay Teeth",                  Delay_Teeth,    { triggerTeeth > 0 }
      field = "#Dual Spark Ignition Options"
      field = "!Dual Spark Options",            DualSpkOptn
      field = "Offset (advance) for Output #2", OddAng
      field = "#IAT-based Spark Retard Limiting Options"
      field = "Start IAT Retard ",              MatRtdRPMLo
      field = "Full IAT Retard ",               MatRtdRPMHi
      field = "#Signal Delay Parameters"
      field = "FET Ouput Delay",                fet_delay
      field = "VR Input Delay",                 vr_delay     
      field = "!Red settings require an MS-II reboot!"

   dialog = dwellSettings, "Dwell Settings"
      topicHelp = "http://www.megamanual.com/mt28.htm#iw"
      field = "Maximum Dwell Duration",        max_coil_dur
      field = "Maximum Spark Duration",        max_spk_dur
      field = "Acceleration Compensation",     dwellAcc
      field = "#Battery Voltage Compensation"
      ; Make this an array2D when available.
      array1D   = "", "Voltage  %INDEX% ", dwellVolts
      array1D   = "", "Duration at Voltage %INDEX% ", dwellDuration

   dialog = idleControl, "Idle Control"
      topicHelp = "http://www.megamanual.com/mt28.htm#sd"
      field = "Algorithm",                     IdleCtl
      field = "Fast Idle Temperature",         fastIdleT,    { IdleCtl == 1 }
      field = "Time Step Size",                IACtstep,     { IdleCtl == 2 || IdleCtl == 3 || IdleCtl == 5 }
      field = "Acceleration Step Size",        IACaccstep,   { IdleCtl == 2 || IdleCtl == 3 || IdleCtl == 5 }
      field = "Minimum # steps to move",       IACminstep,   { IdleCtl == 2 || IdleCtl == 3 || IdleCtl == 5 }
      field = "!PWM Frequency",                IACpwm_step,  { IdleCtl == 4 }
      field = "!Start Value (retract)",        IACStart,     { IdleCtl > 1 } ; !
      field = "Cranking Position (extend)",    IACcrankpos,  { IdleCtl > 1 }
      field = "Crank-to-Run Taper Time",       IACcrankxt,   { IdleCtl > 1 }
      field = "Hysteresis",                    IdleHyst,     { IdleCtl > 1 }
      field = "#Time-Based After Start (extended warm-up)"
      field = "   Cold Temperature",           IACcoldtmp,   { IdleCtl > 1 }
      field = "   Cold Position",              IACcoldpos,   { IdleCtl > 1 }
      field = "   Cold Taper Time",            IACcoldxt,    { IdleCtl > 1 }

   dialog = sensorCal, "Sensor Calibration"
      topicHelp = sensorHelp
      field = "#MAP Sensor (F1 for common values)"
      field =    "Value at 0.0 volts",   map0
      field =    "Value at 5.0 volts",   mapmax
      field = "#Barometer Sensor (usually identical to MAP)"
      field =    "Value at 0.0 volts",   baro0
      field =    "Value at 5.0 volts",   baromax

   dialog = knockSettings, "Knock Sensor Settings"
      topicHelp = "http://www.megamanual.com/mt28.htm#ik"
      field = "Knock Control",        knkOption
      field = "#Detection"
      field = "Threshold Direction",  knkDirection,   { knkOption > 0 }
      field = "Threshold",            knock0
      field = "Peak",                 knockmax
      field = "Knock Count",          knk_ndet,       { knkOption > 0 }
      field = "No Knock Above MAP",   knk_maxmap,     { knkOption > 0 }
      field = "No Knock Below RPM",   knk_lorpm,      { knkOption > 0 }
      field = "No Knock Above RPM",   knk_hirpm,      { knkOption > 0 }
      field = "#Retarding"
      field = "Maximum Retard",       knk_maxrtd,     { knkOption > 0 }
      field = "Retard Check Time",    knk_trtd,       { knkOption > 0 }
      field = "Retard Step Size",     knk_step1,      { knkOption > 0 }
      field = "#Recovery"
      field = "Advance Check Time",   knk_tadv,       { knkOption > 0 }
      field = "Advance Step Size",    knk_step2,      { knkOption > 0 }
      field = "Recovery Advance",     knk_dtble_adv,  { knkOption > 1 }

   dialog = injector_test, "Injector Test Mode"
      topicHelp = "http://www.megamanual.com/mt28.htm#oi"
      field = "!Injector test mode",  injTestMode ; !
      field = "Injector test squirts",  injTestSqrts,    { injTestMode > 0 }
      field = "Injector test PW",  injTestPW,            { injTestMode > 0 }
      field = "Injector test offtime",  injTestOffTime,  { injTestMode > 0 }
      field = "!Reboot to test, set to 'Normal Mode' to reset"

   dialog = frpmTableBins, "RPM Table Bins for Fuel Tables"
      topicHelp="http://www.megamanual.com/mt28.htm#"
      array1D   = "", "Fuel RPM  %INDEX% ", frpm_table
      field = "#Close and re-open Table(s) to see changes"

   dialog = fmapTableBins, "MAP Table Bins for Fuel Table(s)"
      topicHelp="http://www.megamanual.com/mt28.htm#"
      array1D   = "", "Fuel MAP  %INDEX% ", fmap_table
      field = "#Close and re-open Table(s) to see changes"

   dialog = srpmTableBins, "RPM Table Bins for Spark Table"
      topicHelp="http://www.megamanual.com/mt28.htm#"
      array1D   = "", "Spark RPM  %INDEX% ", srpm_table
      field = "#Close and re-open Table(s) to see changes"

   dialog = smapTableBins, "MAP Table Bins for Spark Table"
      topicHelp="http://www.megamanual.com/mt28.htm#"
      array1D   = "", "Spark MAP  %INDEX% ", smap_table
      field = "#Close and re-open Table(s) to see changes"

   dialog = tempTableBins, "Temperature Table Values"
      topicHelp="http://www.megamanual.com/mt28.htm#at"
      array1D   = "", "Temperature  %INDEX% ", tempTable
      
    dialog = XtempTableBins, "X Temperature Correction Values"
      topicHelp="http://www.megamanual.com/mt28.htm#at"
      field = "#Temperature Correction for X Enrichments"
      array1D   = "", "Correction  %INDEX% ", XClt
  
      dialog = TtempTableBins, "Tau Temperature Correction Values"
      topicHelp="http://www.megamanual.com/mt28.htm#at"
      array1D   = "", "Correction  %INDEX% ", TauClt
 

   dialog = XTrpmsdial, "X-Tau RPM Values"
      topicHelp="http://www.megamanual.com/mt28.htm#ur"
      field = "#RPM Bins for X-Tau Enrichments"                                                    
      array1D   = "", "X-Tau RPM  %INDEX% ", XTrpms

   dialog = MAFSettings, "MAF vrs. MAP Usage"
      topicHelp = "http://www.megamanual.com/mt28.htm#su"
      field = "#See Tables for MAF flow setting"
      field = "Enable MAF Use",             MAFOption
      field = "MAF Hardware Configuration", MAFpin,   { MAFOption > 0 }
      field = "Note: MAF must NOT be on MAP pin for MAF/MAP blend."
      field = "#MAP MAF Blend Settings"
      field = "MAP Only Above RPM",         MAFRPM1,  { MAFOption > 1 }
      field = "MAF Only Below RPM",         MAFRPM2,  { MAFOption > 1 }
      field = "Invert above MAP/MAF settings",       MAFDir,  { MAFOption > 1 }
      field = "#Viewing MAF in Real Time"
      field = "You can set one of the gauges on the front page to mafGauge"
      field = "to see the MAF in real time. Right click on any gauge and"
      field = "select mafGuage "
	  
   help = burnHelp, "Burning Values to ECU"
      webHelp = "http://www.megamanual.com/mt28.htm"
      text = "Occassionally, you may have trouble getting values to 'stick'"
      text = "in MegaTune. There are a few things you can try if this happens:<br><br>"
      text = "\tHit TAB after entering the value. This forces MegaTune to" 
      text = "recognize the changed value.<br>" 
      text = "\tThen 'Burn to ECU'<br><br>"	
      text = "If that doesn't work:<br><br>"	
      text = "\tChange the value (as above) and immediately save the MSQ file ('File/Save').<br>"
      text = "\tThen reload the file you just saved, and burn it when prompted.<br><br>"
      text = "This forces all the values to be burned to both flash and RAM memory, and"
      text = "should solve the problem."	
 
	  
   help = sensorHelp, "Sensor Calibration"
      webHelp = "http://www.megamanual.com/mt28.htm#os"
      text = "MAP Sensor Calibration<br>"
      text = "<br>"
      text = "For the\tMPX4115   use\t10.6 and \t121.7<br>"
      text = "\tMPX4250\t\t10.0\t260.0<br>"
      text = "\tMPXH6300\t1.1\t315.5<br>"
      text = "\tGM 3-BAR\t1.1\t315.5<br>"
      text = "\tMPXH6400\t3.5\t416.5<br>"
      text = "<br>"
      text = "(GM 3-bar data from Dave Hartnell, http://www.not2fast.com/electronics/component_docs/MAP_12223861.pdf)<br>"
      text = "<br>"
      text = "\tSensor type\tvLo\tpLo\tvHi\tpHi\tvRef<br>"
      text = "\tMPX4115 \t0.204 v\t15 kPa\t4.794 v\t115 kPa\t5.100 v<br>"
      text = "\tMPX4250 \t0.204 v\t20 kPa\t4.896 v\t250 kPa\t5.100 v<br>"
      text = "\tMPXH6300\t0.306 v\t20 kPa\t4.913 v\t304 kPa\t5.100 v<br>"
      text = "\tGM 3-BAR\t0.631 v\t40 kPa\t4.914 v\t304 kPa\t5.100 v<br>"
      text = "\tMPXH6400\t0.200 v\t20 kPa\t4.800 v\t400 kPa\t5.000 v<br>"
      text = "<br>"
      text = "In general, use values derived from these equations:<br>"
      text = "<br>"
      text = "\tm = (pHi-pLo)/(vHi-vLo)<br>"
      text = "\tpv1 = pLo - m * vLo<br>"
      text = "\tpv2 = pv1 + m * vRef<br>"
      text = "<br>"
      text = "References:<br>"
      text = "\thttp://www.freescale.com/files/sensors/doc/data_sheet/MPX4115A.pdf<br>"
      text = "\thttp://www.freescale.com/files/sensors/doc/data_sheet/MPX4250A.pdf<br>"
      text = "\thttp://www.freescale.com/files/sensors/doc/data_sheet/MPXH6300A.pdf<br>"
      text = "\thttp://www.freescale.com/files/sensors/doc/data_sheet/MPXH6400A.pdf<br>"
      text = "<br>"
      text = "Barometer Sensor Calibration<br>"
      text = "<br>"
      text = "If your system has an external barometer sensor, separate from the MAP"
      text = "sensor, then use these values to calibrate it properly.  If you have"
      text = "a standard MS installation, then copy your MAP sensor values here.<br>"
      text = "<br>"
      text = "Barometric Correction Calibration<br>"
      text = "<br>"
      text = "Correction for barometric effects is performed using the linear function below.<br>"
      text = "<br>"
      text = "\tcorrection = correction_0 + (rate * barometer) / 100<br>"
      text = "<br>"
      text = "'At total vacuum' contains the total correction at a barometer reading"
      text = "of 0 kPa (you are on the moon).  The 'Rate' contains the percentage per 100"
      text = "kPa to scale the barometer value.  Using the default values of 147 and -47,"
      text = "we see that for a barometer of 100 kPa, we have 100% correction.<br>"
      text = "<br>"
      text = "\tcorrection = 147 + (-47*100) / 100 = 100%"


   help = helpGeneral, "MS-II General Help"
      webHelp = "http://www.megamanual.com/mt28.htm"
      text = "Al Grippo and Bruce Bowling have created MegaSquirt-II, which"
      text = "is a plug-in daughter card that replaces the 8-bit MC68HC908GP32"
      text = "with a 16-bit MC9S12C64 processor.  MegaSquirt-II is an intermediate"
      text = "step from the original MegaSquirt towards UltraMegaSquirt.<br>"
      text = "<br>"
      text = "It is basically a plug-in processor card that has the MC9S12C64"
      text = "processor plus support hardware as well as a stepper motor chip,"
      text = "and an ignition module controller.  The embedded code is written"
      text = "in C, rather than assembly language, so it should be more accessible"
      text = "to more programmers (Stephane Carrez has ported GCC to the HC12"
      text = "processor so, although it doesn't use the full 9S12 instruction"
      text = "set, we are able to use his version to write code for the MS-II).<br>"
      text = "<br>"
      text = "For current documentation, click the Web Help button below, or for"
      text = "support questions visit http://www.msefi.com/."

;-------------------------------------------------------------------------------

[CurveEditor]
   curve = coldAdvance, "Cold Ignition Advance Offset"
      topicHelp   = "http://www.megamanual.com/mt28.htm#ec"
      columnLabel = "Coolant", "Offset"
      xAxis       = -40, 200, 9
      yAxis       = -10,  10, 5
      xBins       = tempTable, coolant
      yBins       = cold_adv_table
      gauge       = cltGauge

   curve = iacSteps, "IAC Steps"
      topicHelp   = "http://www.megamanual.com/mt28.htm#ed"
      columnLabel = "Coolant", "IAC Steps"
      xAxis       = -40, 200, 9
      yAxis       =   0, 300, 7
      xBins       = tempTable, coolant
      yBins       = iacstepTable
      gauge       = cltGauge

   curve = ipwBins, "PWM Idle Duty Cycle"
      topicHelp   = "http://www.megamanual.com/mt28.htm#ep"
      columnLabel = "Coolant", "Idle PWM"
      xAxis       = -40, 200, 9
      yAxis       =   0, 100, 6
      xBins       = tempTable, coolant
      yBins       = ipwmTable
      gauge       = cltGauge

   curve = primingPW, "Priming Pulsewidth"
     topicHelp   = "http://www.megamanual.com/mt28.htm#rm"
      columnLabel = "Coolant", "Prime PW"
      xAxis       = -40, 200, 9
      yAxis       =   0,  20, 5
      xBins       = tempTable, coolant
      yBins       = primePWTable
      gauge       = cltGauge

   curve = crankingPW, "Cranking Pulsewidth"
     topicHelp   = "http://www.megamanual.com/mt28.htm#rn"
      columnLabel = "Coolant", "Cranking PW"
      xAxis       = -40, 200, 9
      yAxis       =   0,  20, 5
      xBins       = tempTable, coolant
      yBins       = crankPWTable
      gauge       = cltGauge

   curve = asePct, "Afterstart Enrichment Percentage"
     topicHelp   = "http://www.megamanual.com/mt28.htm#rs"
      columnLabel = "Coolant", "Afterstart"
      xAxis       = -40, 200, 9
      yAxis       =   0, 100, 6
      xBins       = tempTable, coolant
      yBins       = asePctTable
      gauge       = cltGauge

   curve = aseTaper, "Afterstart Enrichment Taper"
     topicHelp   = "http://www.megamanual.com/mt28.htm#re"
      columnLabel = "Coolant", "Taper"
      xAxis       = -40, 200, 9
      yAxis       =   0, 500, 6
      xBins       = tempTable, coolant
      yBins       = aseCntTable
      gauge       = cltGauge

   curve = matBasedRetard, "IAT-Based Spark Timing Retard"
     topicHelp   = "http://www.megamanual.com/mt28.htm#eb"
      columnLabel = "IAT", "Retard"
      xAxis       = 100, 300, 9
      yAxis       =   0,  15, 7
      xBins       = matTemps, mat
      yBins       = matRetard
      gauge       = matGauge

   curve = knockThreshold, "Knock Threshold"
     topicHelp   = "http://www.megamanual.com/mt28.htm#ik"
      columnLabel = "RPM", "Threshold"
      xAxis       =   0, 6000, 7
      yAxis       =   0,  5.0, 6
      xBins       = knk_rpm, rpm
      yBins       = knk_thresh
      gauge       = tachometer

   curve = barometerCorr, "Non-Linear Barometric Correction"
     topicHelp   = "http://www.megamanual.com/mt28.htm#rc"
      columnLabel = "Barometer", "Correction"
      xAxis       =  60, 120, 7
      yAxis       = -30,  30, 7
      xBins       = baroCorrVals, barometer
      yBins       = baroCorrDelta
      gauge       = barometerGauge

   curve = manifoldTempCorr, "Non-Linear IAT (intake air temperature) Fuel Correction"
     topicHelp   = "http://www.megamanual.com/mt28.htm#ea"
      columnLabel = "IAT", "Correction"
      xAxis       =  -40, 200, 9
      yAxis       =  -30,  30, 7
      xBins       = matCorrTemps, mat
      yBins       = matCorrDelta
      gauge       = matGauge
   
   curve = XAccTable, "X Accel Fuel Correction"
     topicHelp   = "http://www.megamanual.com/mt28.htm#ua"
      columnLabel = "RPM", "Correction"
      xAxis       =    0,  8000, 4
      yAxis       =    0,   120, 4
      xBins       = XTrpms, rpm
      yBins       = XAccTable
      gauge       = xTauGauge1
        
   curve = XDecTable, "X Decel Fuel Correction"
     topicHelp   = "http://www.megamanual.com/mt28.htm#ud"
      columnLabel = "RPM", "Correction"
      xAxis       =    0,  8000, 9
      yAxis       =    0,   120, 9
      xBins       = XTrpms, rpm
      yBins       = XDecTable
      gauge       = xTauGauge1
       
   curve = TauAccTable, "Tau Accel Fuel Correction"
     topicHelp   = "http://www.megamanual.com/mt28.htm#uc"
      columnLabel = "RPM", "time"
      xAxis       =    0,  8000, 9
      yAxis       =    0,  1000, 9
      xBins       = XTrpms, rpm
      yBins       = TauAccTable
      gauge       = xTauGauge1
 
   curve = TauDecTable, "Tau Decel Correction"
     topicHelp   = "http://www.megamanual.com/mt28.htm#ue"
      columnLabel = "RPM", "time"
      xAxis       =    0,  8000, 9
      yAxis       =    0,  1000, 9
      xBins       = XTrpms, rpm
      yBins       = TauDecTable
      gauge       = xTauGauge1 
      
   curve = XCltTable, "X (Puddling) Temp. Correction Factors"
     topicHelp   = "http://www.megamanual.com/mt28.htm#ux"
      columnLabel = "Temperature", "Correction"
      xAxis       =  -40,   200, 9
      yAxis       =    0,   600, 9
      xBins       = tempTable
      yBins       = XClt
      gauge       = cltGauge 
      
   curve = TCltTable, "Tau (Time) Temp. Correction Factors"
     topicHelp   = "http://www.megamanual.com/mt28.htm#ut"
      columnLabel = "Temperature", "time"
      xAxis       =  -40,   200, 9
      yAxis       =    0,   600, 9
      xBins       = tempTable
      yBins       = TauClt
      gauge       = cltGauge                 

	  
   curve = MAFtable1, "MAF Correction Table (to alter default MAF curve)"
     topicHelp   = "http://www.megamanual.com/mt28.htm#em"
      columnLabel = "MAF Flow", "Correction"
      xAxis       =  0, 300, 11
      yAxis       =  0, 255, 11
      xBins       = MAFFlow, maf
      yBins       = MAFCor
      gauge       = mafGauge
	  
	  
[TableEditor]

#if MAPbaro

   table = veTable1Tbl, veTable1Map, "VE Table 1 (MAP/baro)", 2
     topicHelp   = "http://www.megamanual.com/mt28.htm#a1"
      ;             constant,   variable
      xBins       = frpm_table, rpm,   readonly
      yBins       = fmap_table, kpaix, readonly
      zBins       = veTable1

      upDownLabel = "RICHER", "LEANER"
      gridHeight  = 2.0
      gridOrient  = 250,   0, 340 ; Space 123 rotation of grid in degrees.

   table = veTable2Tbl, veTable2Map, "VE Table 2", 2
     topicHelp   = "http://www.megamanual.com/mt28.htm#a1"
      xBins       = frpm_table, rpm,   readonly
      yBins       = fmap_table, kpaix, readonly
      zBins       = veTable2

      upDownLabel = "RICHER", "LEANER"
      gridHeight  = 2.0
      gridOrient  = 250,   0, 340


#else

   ;       table_id,    map3d_id,    "title",      page
   table = veTable1Tbl, veTable1Map, "VE Table 1 (MAP)", 2
     topicHelp   = "http://www.megamanual.com/mt28.htm#a1"
      ;             constant,   variable
      xBins       = frpm_table, rpm,     readonly
      yBins       = fmap_table, calcMAP, readonly
      zBins       = veTable1

      upDownLabel = "RICHER", "LEANER"
      gridHeight  = 2.0
      gridOrient  = 250,   0, 340 ; Space 123 rotation of grid in degrees.


   table = veTable2Tbl, veTable2Map, "VE Table 2", 2
     topicHelp   = "http://www.megamanual.com/mt28.htm#a1"
      xBins       = frpm_table, rpm,     readonly
      yBins       = fmap_table, calcMAP, readonly
      zBins       = veTable2

      upDownLabel = "RICHER", "LEANER"
      gridHeight  = 2.0
      gridOrient  = 250,   0, 340

#endif

#if LAMBDA
   table = afrTable1Tbl, afrTable1Map, "Lambda Table 1", 1
      gridHeight  = 3.0
#else
   table = afrTable1Tbl, afrTable1Map, "AFR Table 1", 1
      gridHeight  = 1.0
#endif
     topicHelp   = "http://www.megamanual.com/mt28.htm#af"
      xBins       = frpm_table, rpm,     readonly
      yBins       = fmap_table, calcMAP, readonly
      zBins       = afrTable1
      upDownLabel = "LEANER", "RICHER"
      gridOrient  = 250,   0, 340

#if LAMBDA
   table = afrTable1Tblix, afrTable1MapIX, "Lambda Table 1", 1
      gridHeight  = 3.0
#else
   table = afrTable1Tblix, afrTable1MapIX, "AFR Table 1", 1
      gridHeight  = 1.0
#endif
     topicHelp   = "http://www.megamanual.com/mt28.htm#af"
      xBins       = frpm_table, rpm,     readonly
      yBins       = fmap_table, kpaix,   readonly
      zBins       = afrTable1
      upDownLabel = "LEANER", "RICHER"
      gridOrient  = 250,   0, 340

#if LAMBDA
   table = afrTable2Tbl, afrTable2Map, "Lambda Table 2", 1
      gridHeight  = 3.0
#else
   table = afrTable2Tbl, afrTable2Map, "AFR Table 2", 1
      gridHeight  = 1.0
#endif
     topicHelp   = "http://www.megamanual.com/mt28.htm#af"
      xBins       = frpm_table, rpm,     readonly
      yBins       = fmap_table, calcMAP, readonly
      zBins       = afrTable2
      upDownLabel = "LEANER", "RICHER"
      gridOrient  = 250,   0, 340

#if LAMBDA
   table = afrTable2Tblix, afrTable2MapIX, "Lambda Table 2", 1
      gridHeight  = 3.0
#else
   table = afrTable2Tblix, afrTable2MapIX, "AFR Table 2", 1
      gridHeight  = 1.0
#endif
     topicHelp   = "http://www.megamanual.com/mt28.htm#af"
      xBins       = frpm_table, rpm,     readonly
      yBins       = fmap_table, kpaix,   readonly
      zBins       = afrTable2
      upDownLabel = "LEANER", "RICHER"
      gridOrient  = 250,   0, 340

#if MAPbaro

   table = ignitionTbl, ignitionMap, "Spark Advance Table", 2
     topicHelp   = "http://www.megamanual.com/mt28.htm#ap"
      xBins       = srpm_table, rpm, readonly
      yBins       = smap_table, kpaix, readonly
      zBins       = advanceTable
      upDownLabel = "ADVANCING", "RETARDING"
      gridHeight  = 3.0
      gridOrient  = 250,   0, 340

#else

   table = ignitionTbl, ignitionMap, "Spark Advance Table", 2
     topicHelp   = "http://www.megamanual.com/mt28.htm#ap"
      xBins       = srpm_table, rpm, readonly
      yBins       = smap_table, calcMAP, readonly
      zBins       = advanceTable
      upDownLabel = "ADVANCING", "RETARDING"
      gridHeight  = 3.0
      gridOrient  = 250,   0, 340

#endif

   table = alphaMAPTbl, alphaMAPMap, "Alpha-N MAP Table", 1
     topicHelp   = "http://www.megamanual.com/mt28.htm#en"
      xBins       = amap_rpm, rpm
      yBins       = amap_tps, tps
      zBins       = alphaMAPtable
      upDownLabel = "UP", "DOWN"
      gridHeight  = 2.0
      gridOrient  = 250,   0, 340


;-------------------------------------------------------------------------------

[GaugeConfigurations]

   ;-------------------------------------------------------------------------------
   ;  Notes on some of the gauges.
   ;
   ;  The accelEnrichGauge is now a composite of both acceleration enrichment
   ;  and deceleration enleanment numbers.  See the definition of the variable
   ;  accDecEnrich in the OutputChannels section.
   ;
   ;  David Hooke contributed the lambda gauge and associated transfer
   ;  function files.
   ;
   ;  The lambda gauge is the best way (my opinion) to report data from a
   ;  wide band EGO gauge, it standardizes the output irrespective of fuel
   ;  or mix of fuels, so you needn't do any brainwork to know if your 75%
   ;  gasoline and 25% methanol is rich at 10:1 or not.
   ;
   ;  Use the file WBlambda100AVR.inc, if using a standard ADC (e.g., AVR cpu).
   ;  Use the file WBlambda100MOT.inc, if using a biased ADC (e.g., MOT cpu).
   ;-------------------------------------------------------------------------------
   ; Define a gauge's characteristics here, then go to a specific layout
   ; block (Tuning or FrontPage) and use the name you've defined here to
   ; display that gauge in a particular position.
   ;
   ; Name  = Case-sensitive, user-defined name for this gauge configuration.
   ; Var   = Case-sensitive name of variable to be displayed, see the
   ;         OutputChannels block in this file for possible values.
   ; Title = Title displayed at the top of the gauge.
   ; Units = Units displayed below value on gauge.
   ; Lo    = Lower scale limit of gauge.
   ; Hi    = Upper scale limit of gauge.
   ; LoD   = Lower limit at which danger color is used for gauge background.
   ; LoW   = Lower limit at which warning color is used.
   ; HiW   = Upper limit at which warning color is used.
   ; HiD   = Upper limit at which danger color is used.
   ; vd    = Decimal places in displayed value
   ; ld    = Label decimal places for display of Lo and Hi, above.

   ;Name               Var            Title                 Units     Lo     Hi     LoD    LoW   HiW   HiD vd ld

   advBucketGauge    = veTuneValue,   "Advance Bucket",     "degrees", 0,    55,    -1,     -1,  999,  999, 1, 1
   advdegGauge       = advance,       "Ignition Advance",   "degrees", 5,    50,    -1,     -1,  999,  999, 1, 1

   IACgauge          = iacstep,       "IAC position",       "steps",   0,   255,    -1,     -1,  999,  999, 0, 0
   dwellGauge        = dwell,         "Dwell",              "mSec",    0,    10,   0.5,    1.0,  6.0,  8.0, 1, 1
;  IAC step == idle pwm, when using pwm idle control.
   PWMIdlegauge      = idleDC,        "Idle PWM%",          "%",       0,   100,    -1,     -1,  999,   90, 0, 0

   accelEnrichGauge  = accDecEnrich,  "Accel Enrich",       "%",      50,   150,     -1,    -1,  999,  999, 0, 0
   afr1Gauge         = afr1,          "Air:Fuel Ratio",     "",       10,  19.4,     12,    13,   15,   16, 2, 2
   afr2Gauge         = afr2,          "Air:Fuel Ratio 2",   "",       10,  19.4,     12,    13,   15,   16, 2, 2
   clockGauge        = seconds,       "Clock",              "Seconds", 0,   255,     10,    10,  245,  245, 0, 0
   deadGauge         = deadValue,     "---",                "",        0,     1,     -1,    -1,    2,    2, 0, 0
   dutyCycle1Gauge   = dutyCycle1,    "Duty Cycle 1",       "%",       0,   100,     -1,    -1,   85,   90, 1, 1
   dutyCycle2Gauge   = dutyCycle2,    "Duty Cycle 2",       "%",       0,   100,     -1,    -1,   85,   90, 1, 1
   egoCorrGauge      = egoCorrection, "EGO Correction",     "%",      50,   150,     90,    99,  101,  110, 0, 0
   egoCorrGauge1     = egoCorrection1,"EGO Correction 1",   "%",      50,   150,     90,    99,  101,  110, 0, 0
   egoCorrGauge2     = egoCorrection2,"EGO Correction 2",   "%",      50,   150,     90,    99,  101,  110, 0, 0
   egoGauge          = egoVoltage,    "Exhaust Gas Oxygen", "volts",   0,   1.0,    0.2,   0.3,  0.7,  0.8, 2, 2
   kpabaroGauge      = kpaix,         "Engine MAP/baro",    "kPa",     0,   255,      0,    20,  200,  245, 1, 0
   knockGauge        = knockRetard    "Knock Retard",       "deg",     0,  25.0,     -1,    -1,  5.0, 10.0, 1, 1
   lambda1Gauge      = lambda1,       "Lambda",             "",      0.5,   1.5,    0.5,   0.7,    2,  1.1, 2, 2
   lambda2Gauge      = lambda2,       "Lambda",             "",      0.5,   1.5,    0.5,   0.7,    2,  1.1, 2, 2

   gammaEnrichGauge  = gammaEnrich,   "Gamma Enrichment",   "%",      50,   150,     -1,    -1,  151,  151, 0, 0
   mapGauge          = map,           "Engine MAP",         "kPa",     0,   255,      0,    20,  200,  245, 1, 0
   mafGauge          = maf,           "MAF Air flow",       "g/sec",   0,   650,      0,   200,  480,  550, 0, 0
   barometerGauge    = barometer,     "Barometer",          "kPa",    60,   120,      0,    20,  200,  245, 1, 0
   calcMapGauge      = calcMAP,       "Estimated MAP",      "kPa",     0,   255,      0,    20,  200,  245, 1, 0
   pulseWidth1Gauge  = pulseWidth1,   "Pulse Width 1",      "mSec",    0,  25.5,    1.0,   1.2,   20,   25, 3, 1
   pulseWidth2Gauge  = pulseWidth2,   "Pulse Width 2",      "mSec",    0,  25.5,    1.0,   1.2,   20,   25, 3, 1
   tachometer        = rpm,           "Engine Speed",       "RPM",     0,  10000,    300,   500, 9000, 9500, 0, 0
   throttleGauge     = throttle,      "Throttle Position",  "%",       0,   100,     -1,     1,   90,  100, 0, 0
;   timmingErrGauge   = timingErr,     "Timing Error",       "degrees",-10,   10,    -10,    -5,    5,   10, 1, 1 
   deltaTGauge       = deltaT,        "Timing Delta",       "uS",      0, 25000,      0,     0,25000, 25000, 0, 0 
   veBucketGauge     = veTuneValue,   "VE Value",           "%",       0,   120,     -1,    -1,  999,  999, 0, 0
   veGauge           = veCurr1,       "VE Current",         "%",       0,   120,     -1,    -1,  999,  999, 0, 0
   voltMeter         = batteryVoltage, "Battery Voltage",    "volts",   7,    21,     9,    10,   16,   17, 2, 2
   warmupEnrichGauge = warmupEnrich,  "Warmup Enrichment",  "%",     100,   150,     -1,    -1,  101,  105, 0, 0

;  Name               Var            Title                 Units     Lo     Hi     LoD    LoW   HiW   HiD vd ld
   xTauGauge1        = xTauFuelCorr1, "X-Tau Correction1",   "%",       0,   200,     40,    70,  130,  160, 0, 0
   xTauGauge2        = xTauFuelCorr2, "X-Tau Correction2",   "%",       0,   200,     40,    70,  130,  160, 0, 0

#if CELSIUS
   cltGauge          = coolant,       "Coolant Temp",       "C",    -40,   120,    -15,     0,   95,  105, 0, 0
   matGauge          = mat,           "Intake Air Temp",  "C",      -40,   110,    -15,     0,   95,  100, 0, 0
#else
   cltGauge          = coolant,       "Coolant Temp",       "°F",    -40,   250,      0,    30,  200,  220, 0, 0
   matGauge          = mat,           "Intake Air Temp",    "°F",    -40,   215,      0,    30,  200,  210, 0, 0
#endif

   e85Gauge          = fuelCorrection,"E85 Fuel Correction", "%",    100,   200,     99,    99,  164,  170, 0, 0 
   ethanolGas        = fuelComposition, "Ethanol Percentage","%",      0,   100,     -1,    -1,   85,  101, 0, 0
   triggers±         = trig_fix,      "Triggers add/sub",     "",   -200,   200,   -100,   -10,   10,  100, 0, 0
   tachCount         = tachCount,     "Number Tach Pulses",   "",      0,  1000,     -1,    -1, 1000, 1000, 0, 0   

;-------------------------------------------------------------------------------

[FrontPage]
#if   NARROW_BAND_EGO
   egoLEDs         =  0.0, 1.0,  0.5 ; Voltage settings.
#elif LAMBDA
   egoLEDs         =  1.5, 0.5,  1.0 ; Lambda settings.
#else
   egoLEDs         = 19.7, 9.7, 14.7 ; Afr settings.
#endif

   ; Gauges are numbered left to right, top to bottom.
   ;
   ;    1  2  3  4
   ;    5  6  7  8

   gauge1 = tachometer
   gauge2 = throttleGauge
   gauge3 = pulseWidth1Gauge
#if   NARROW_BAND_EGO
   gauge4 = egoGauge
#elif LAMBDA
   gauge4 = lambda1Gauge
#else
   gauge4 = afr1Gauge
#endif
   gauge5 = mapGauge
#if IAC_GAUGE
   gauge6 = IACgauge
#elif PWM_GAUGE
   gauge6 = PWMIdlegauge
#else ; FIDLE_GAUGE
   gauge6 = matGauge
#endif
   gauge6 = voltMeter
   gauge7 = advdegGauge
   gauge8 = dwellGauge


   ;----------------------------------------------------------------------------
   ; Indicators
   ;               expr         off-label          on-label, off-bg, off-fg, on-bg, on-fg
   ;   indicator = { tpsaen }, "Not Accelerating", "AE",     cyan,   white,  red,   black
   ;
   ; Look in the new colorScheme.ini for the basic ones, add more or tell me what to add.

   indicator = { ECUType == 1 || ECUType == 2 }, "SET ECU!!",    "ECU Set",  red, black, white, green
   indicator = { crank              }, "Not Cranking", "Cranking",    white, black, black, white
   indicator = { startw             }, "ASE off",      "ASE ON",         white, black, cyan,   black
   indicator = { warmup             }, "WUE off",      "WUE ON",         white, black, blue, white
   indicator = { tpsaen             }, "Accel Enrich",   "Accel Enrich",   white, black, green, black
   indicator = { tpsden             }, "Decel Cut",      "Decel Cut", white, black, green, black
   indicator = { tps > floodClear && crank }, "Flood clear off", "FLOOD CLEAR ON", white, black, red, black
   indicator = { batteryVoltage < 10.5 }, "Battery OK",  "Battery LOW", green, black, red,   black
   indicator = { port0              },  "Port 0 Off",  "Port 0 On",   white, black, red,   black

;-------------------------------------------------------------------------------

[RunTime]
   barHysteresis = 2.5 ; Seconds
#if CELSIUS
   coolantBar    = -40,  100
   matBar        = -40,  100
#else
   coolantBar    = -40,  215
   matBar        = -40,  215
#endif

   batteryBar    =   6,   15
   dutyCycleBar  =   0,  100
#if   NARROW_BAND_EGO
   egoBar        = 0.0 ,  1.0
#elif LAMBDA
   egoBar        = 0.5,   1.5
#else
   egoBar        = 9.7,  19.7
#endif
   gammaEBar     =   0,  200
   mapBar        =   0,  255
   pulseWidthBar =   0, 25.5
   rpmBar        =   0, 8000
   throttleBar   =   0,  100

   egoCorrBar    =   0,  200
   baroCorrBar   =   0,  200
   warmupCorrBar =   0,  200
   airdenCorrBar =   0,  200
   veCorrBar     =   0,  200
   accCorrBar    =   0,  100

;-------------------------------------------------------------------------------

[Tuning]
#if   NARROW_BAND_EGO
   egoLEDs         =  0.0, 1.0,  0.5 ; Voltage settings.
#elif LAMBDA
   egoLEDs         =  1.5, 0.5,  1.0 ; Lambda settings.
#else
   egoLEDs         = 19.7, 9.7, 14.7 ; Afr settings.
#endif

;  font            = "Lucida Console", 12
;  font            = "Courier", 14
   spotDepth       =   2 ; 0 = no indicators, 1 = Z only, 2 = XYZ indicators.
   cursorDepth     =   2 ; Same as spot depth.

   ; The four radio buttons on the tuning screen select a "page" of six
   ; gauges.  The gauge numbering is the same as the front page, across
   ; then down.
   ;             1  2
   ;             3  4
   ;             5  6
   ;
   ; gaugeColumns allows you to hide or show gauges in column 2 (i.e.,
   ; gauges 2, 4 and 6).

   gaugeColumns = 2 ; Only 1 or 2 are valid.

   ;              Page 1            Page 2             Page 3            Page 4
   pageButtons  = "&EGO",           "&WUE",            "PW&1",           "PW&2"
   gauge1       = tachometer,       tachometer,        tachometer,       tachometer
   gauge2       = mapGauge,         mapGauge,          mapGauge,         mapGauge
#if   NARROW_BAND_EGO
   gauge3       = egoGauge,         egoGauge,          egoGauge,         egoGauge
#elif LAMBDA
   gauge3       = lambda1Gauge,     lambda1Gauge,      lambda1Gauge,     lambda1Gauge
#else
   gauge3       = afr1Gauge,        afr1Gauge,         afr1Gauge,        afr1Gauge
#endif
   gauge4       = egoCorrGauge,     warmupEnrichGauge, pulseWidth1Gauge, pulseWidth2Gauge
   gauge5       = veBucketGauge,    veBucketGauge,     veBucketGauge,    veBucketGauge
   gauge6       = accelEnrichGauge, accelEnrichGauge,  dutyCycle1Gauge,  dutyCycle2Gauge

;-------------------------------------------------------------------------------

[AccelerationWizard]
   tpsDotBar = 0, 100
   mapDotBar = 0, 200

;-------------------------------------------------------------------------------

[BurstMode]
   getCommand       = "a\x00\x06"

[OutputChannels]
   deadValue        = { 0 } ; Convenient unchanging value.

   ochBlockSize     = 112
   ochGetCommand    = "a\x00\x06" ; Lower case so we don't get confused.

   seconds          = scalar, U16,    0, "s",     1.000, 0.0
   secl = { seconds % 256 }, "s" ; For runtime screen.
   pulseWidth1      = scalar, U16,    2, "s",     0.001, 0.0
   pulseWidth2      = scalar, U16,    4, "s",     0.001, 0.0
   pulseWidth       = { pulseWidth1 }, "s" ; For runtime screen.

   rpm              = scalar, U16,    6, "RPM",   1.000, 0.0
   advance          = scalar, S16,    8, "deg",   0.100, 0.0

   ; unsigned char squirt,engine,afrtgt1,afrtgt2;    // afrtgt in afr x 10
   squirt           = scalar, U08,   10, "bit", 1.000, 0.0
   ; Squirt Event Scheduling Variables - bit fields for "squirt" variable above
   ; inj1:    equ    3       ; 0 = no squirt         1 = squirt
   ; inj2:    equ    5       ; 0 = no squirt         1 = squirt
   ; sched1:  equ    2       ; 0 = nothing scheduled 1 = scheduled to squirt
   ; firing1: equ    0       ; 0 = not squirting     1 = squirting
   ; sched2:  equ    4
   ; firing2: equ    1
   firing1          = bits,   U08,   10, [0:0]
   firing2          = bits,   U08,   10, [1:1]
   sched1           = bits,   U08,   10, [2:2]
   inj1             = bits,   U08,   10, [3:3]
   sched2           = bits,   U08,   10, [4:4]
   inj2             = bits,   U08,   10, [5:5]

   engine           = scalar, U08,   11, "bit",   1.000, 0.0
   ; Engine Operating/Status variables - bit fields for "engine" variable above
   ; ready:  equ     0       ; 0 = engine not ready 1 = ready to run
   ; crank:  equ     1       ; 0 = engine not cranking 1 = engine cranking
   ; startw: equ     2       ; 0 = not in startup warmup 1 = in warmup enrichment
   ; warmup: equ     3       ; 0 = not in warmup 1 = in warmup
   ; tpsaen: equ     4       ; 0 = not in TPS acceleration mode 1 = TPS acceleration mode
   ; tpsden: equ     5       ; 0 = not in deacceleration mode 1 = in deacceleration mode
   ; mapaen: equ     6       ; 0 = not in MAP acceleration mode 1 = MAP deaceeleration mode; not implemented
   ready            = bits,   U08,   11, [0:0]
   crank            = bits,   U08,   11, [1:1]
   startw           = bits,   U08,   11, [2:2]
   warmup           = bits,   U08,   11, [3:3]
   tpsaen           = bits,   U08,   11, [4:4]
   tpsden           = bits,   U08,   11, [5:5]
   mapaen           = bits,   U08,   11, [6:6]

   afrtgt1          = scalar, U08,   12, "AFR",   0.100, 0.0
   afrtgt2          = scalar, U08,   13, "AFR",   0.100, 0.0

   ; unsigned char wbo2_en1,wbo2_en2; // from wbo2 - indicates whether wb afr valid
   wbo2_en1         = scalar, U08,   14, "",      1.000, 0.0
   wbo2_en2         = scalar, U08,   15, "",      1.000, 0.0

   ; int baro,map,mat,clt,tps,batt,ego1,ego2,knock, // baro   - kpa x 10
   ;                                                // map    - kpa x 10
   ;                                                // mat, clt deg(C/F)x 10
   ;                                                // tps    - % x 10
   ;                                                // batt   - vlts x 10
   ;                                                // ego1,2 - afr x 10
   ;                                                // knock  - volts x 10
   barometer        = scalar, S16,   16, "kPa",   0.100, 0.0
   map              = scalar, S16,   18, "kPa",   0.100, 0.0
#if CELSIUS
   mat              = scalar, S16,   20, "°C",   0.05555, -320.0
   coolant          = scalar, S16,   22, "°C",   0.05555, -320.0
#else
   mat              = scalar, S16,   20, "°F",    0.100, 0.0
   coolant          = scalar, S16,   22, "°F",    0.100, 0.0
#endif
   tps              = scalar, S16,   24, "%",     0.100, 0.0
   tpsADC           = { tps*10.23 }, "ADC" ; Fake for calibrator and file indexing.
   throttle         = { tps }, "%"
   batteryVoltage   = scalar, S16,   26, "v",     0.100, 0.0
   afr1             = scalar, S16,   28, "AFR",   0.100, 0.0
   afr2             = scalar, S16,   30, "AFR",   0.100, 0.0
   lambda1          = { afr1 / 14.7 }, "Lambda"
   lambda2          = { afr2 / 14.7 }, "Lambda"
   knock            = scalar, S16,   32, "v",     0.100, 0.0

   ; egocor1,egocor2,aircor,warmcor,     // all in %
   egoCorrection1   = scalar, S16,   34, "%",     1.000, 0.0
   egoCorrection    = { ( egoCorrection1 + egoCorrection2) / 2 }, "%" ; Alias for old gauges.
   egoCorrection2   = scalar, S16,   36, "%",     1.000, 0.0
   airCorrection    = scalar, S16,   38, "%",     1.000, 0.0
   warmupEnrich     = scalar, S16,   40, "%",     1.000, 0.0

   fuelComposition  = { (fuelCorrection - 100)*1.587 }, % ; works with default sensor values

   ; tpsaccel,tpsfuelcut,barocor,gammae, // tpsaccel - acc enrich(.1 ms units)
   ;                                     // tpsfuelcut - %
   ;                                     // barcor,gammae - %
   accelEnrich      = scalar, S16,   42, "msec",    0.100, 0.0
   tpsfuelcut       = scalar, S16,   44, "%",     1.000, 0.0
   baroCorrection   = scalar, S16,   46, "%",     1.000, 0.0
   gammaEnrich      = scalar, S16,   48, "%",     1.000, 0.0

   ;  vecurr1,vecurr2,iacstep,cold_adv_deg;           // vecurr - %
   ;                                                  // iacstep - steps
   ;                                                  // cold_adv_deg - deg x 10
   veCurr1          = scalar, S16,   50, "%",     1.000, 0.0
   veCurr2          = scalar, S16,   52, "%",     1.000, 0.0
   veCurr           = { veCurr1 }, "%" ; For runtime display.
   iacstep          = scalar, S16,   54, "",      1.000, 0.0
   idleDC           = { iacstep } ; Close enough.
   coldAdvDeg       = scalar, S16,   56, "deg",   0.100, 0.0
   tpsDOT           = scalar, S16,   58, "%/sec",   1.000, 0.0
   mapDOT           = scalar, S16,   60, "kPa/sec", 1.000, 0.0
   dwell            = scalar, S16,   62, "msec",    0.100, 0.0
   maf              = scalar, S16,   64, "g/sec", 0.010, 0.0
   calcMAP          = scalar, S16,   66, "kPa",   0.100, 0.0 ; Blend of MAP and TPS, depends on algorithm
   fuelCorrection   = scalar, S16,   68, "%",     1.000, 0.0 ; Percent alcohol in fuel.

   portStatus       = scalar, U08,   70, "bit",   1.000, 0.0 ; Spare port status bits
   port0            = bits,   U08,   70, [0:0]
   port1            = bits,   U08,   70, [1:1]
   port2            = bits,   U08,   70, [2:2]
   port3            = bits,   U08,   70, [3:3]
   port4            = bits,   U08,   70, [4:4]
   port5            = bits,   U08,   70, [5:5]
   port6            = bits,   U08,   70, [6:6]

   knockRetard      = scalar, U08,   71, "deg",   0.100, 0.0
   xTauFuelCorr1    = scalar, S16,   72, "%",     1.000, 0.0
   egoV1            = scalar, S16,   74, "Volts", 0.010, 0.0
   egoV2            = scalar, S16,   76, "Volts", 0.010, 0.0
   amcUpdates       = scalar, S16,   78,  "",     1.000, 0.0
   kpaix            = scalar, S16,   80,  "kPa",  0.100, 0.0
   xTauFuelCorr2    = scalar, S16,   82, "%",     1.000, 0.0
   spare1           = scalar, S16,   84,  "",     1.000, 0.0
   spare2           = scalar, S16,   86,  "",     1.000, 0.0
   trig_fix         = scalar, S16,   88,  "",     1.000, 0.0
   spare4           = scalar, S16,   90,  "",     1.000, 0.0
   spare5           = scalar, S16,   92,  "",     1.000, 0.0
   spare6           = scalar, S16,   94,  "",     1.000, 0.0
   spare7           = scalar, S16,   96,  "",     1.000, 0.0
   spare8           = scalar, S16,   98,  "",     1.000, 0.0
   spare9           = scalar, S16,  100,  "",     1.000, 0.0
   spare10          = scalar, S16,  102,  "",     1.000, 0.0
   tachCount        = scalar, U16,  104,  "",     1.000, 0.0
   ospare           = scalar, U08,  106,  "",     1.000, 0.0
   cksum            = scalar, U08,  107,  "",     1.000, 0.0
   deltaT           = scalar, U32,  108,  "uS",   1.000, 0.0 ; Normalized time between trigger pulses,
                                                             ; "fills in" missing teeth.


   accDecEnrich     = { accelEnrich + (tpsden ? tpsfuelcut : 100)      }, "%"
   time             = { timeNow                                        }, "s"
   rpm100           = { rpm / 100.0                                    }

   altDiv1          = { alternate ? 2 : 1                              }
   altDiv2          = { alternate ? 2 : 1                              }

   cycleTime1       = { 60000.0 / rpm * (2.0-twoStroke)                }, "ms"
   nSquirts1        = { nCylinders/divider                             }
   dutyCycle1       = { 100.0*nSquirts1/altDiv1*pulseWidth1/cycleTime1 }, "%"

   cycleTime2       = { 60000.0 / rpm * (2.0-twoStroke)                }, "ms"
   nSquirts2        = { nCylinders/divider                             }
   dutyCycle2       = { 100.0*nSquirts2/altDiv2*pulseWidth2/cycleTime2 }, "%"

#if   NARROW_BAND_EGO
   egoVoltage = { egoV1            }, "V"      ; For LED bars...
#elif LAMBDA
   egoVoltage = { lambda1          }, "Lambda" ; For LED bars...
#else
   egoVoltage = { afr1             }, "AFR"    ; For LED bars...
#endif
;     pageSize =  112

;-------------------------------------------------------------------------------
;--  The entries are saved in the datalog file in the order in which they     --
;--  appear in the list below.                                                --
;--                                                                           --
;--   Channel - Case sensitive name of output channel to be logged.           --
;--   Label   - String written to header line of log.  Be careful             --
;--             about changing these, as programs like MSLVV and              --
;--             MSTweak key off specific column names.                        --
;--   Type    - Data type of output, converted before writing.                --
;--   Format  - C-style output format of data.                                --

[Datalog]
   ;       Channel          Label          Type    Format
   ;       --------------   ----------     -----   ------
   entry = time,            "Time",        float,  "%.3f"
   entry = seconds,         "SecL",        int,    "%d"
   entry = rpm,             "RPM",         int,    "%d"
   entry = map,             "MAP",         float,  "%.1f"
   entry = kpaix,           "MAP/baro",    float,  "%.1f"
   entry = maf,             "MAF",         float,  "%d"
   entry = throttle,        "TP",          int,    "%d"
   entry = batteryVoltage,  "vBatt",       float,  "%.2f"

#if   NARROW_BAND_EGO
   entry = egoVoltage,      "O2",          float,  "%.3f"
#elif LAMBDA
   entry = lambda1,         "Lambda",      float,  "%.3f"
#else
   entry = afr1,            "AFR",         float,  "%.2f"
#endif
   entry = mat,             "IAT",         float,  "%.1f"
   entry = coolant,         "CLT",         float,  "%.1f"
   entry = engine,          "Engine",      int,    "%d"

   entry = egoCorrection,   "Gego",        int,    "%d"
   entry = airCorrection,   "Gair",        int,    "%d"
   entry = warmupEnrich,    "Gwarm",       int,    "%d"
   entry = baroCorrection,  "Gbaro",       int,    "%d"
   entry = gammaEnrich,     "Gammae",      int,    "%d"
   entry = accDecEnrich,    "AccelEnrich", int,    "%d"

   entry = veCurr1,         "Gve",         int,    "%d"
   entry = pulseWidth1,     "PW",          float,  "%.3f"
   entry = dutyCycle1,      "DutyCycle1",  float,  "%.1f"

   entry = veCurr2,         "Gve2",        int,    "%d"
   entry = pulseWidth2,     "PW2",         float,  "%.3f"
   entry = dutyCycle2,      "DutyCycle2",  float,  "%.1f"

   entry = advance,         "SparkAdv",    float,  "%.1f"
   entry = knockRetard,     "knockRet",    float,  "%.1f"
   entry = coldAdvDeg,      "ColdAdv",     float,  "%.1f"
   entry = dwell,           "Dwell",       float,  "%.2f"
   entry = tpsDOT,          "tpsDOT",      int,    "%d"
   entry = mapDOT,          "mapDOT",      int,    "%d"
   entry = iacstep,         "IAC",         int,    "%d"
   entry = deltaT,          "deltaT",      float,  "%.0f"
   entry = trig_fix,        "Trigger±",    int,    "%d"
   entry = tachCount,       "tachCount",   int,    "%d"
   entry = xTauFuelCorr1    "XTau1",       int,    "%d"
   entry = xTauFuelCorr2    "XTau2",       int,    "%d"
   entry = fuelCorrection,  "E85fuelCorr", int,    "%d"
   entry = fuelComposition, "Ethanol%",    int,    "%d"
   entry = afrtgt1,         "AFRtrgt1",    float,  "%.2f"
   
;-------------------------------------------------------------------------------
