// EMULATOR CONTROLS CONFIGURATION FILE
// This file is used to map the emulators controls on each platform/os.
// There is also a definition of the image to show to the user with
// the current controls configuration.
// ----------------------------------------------------------------------------
// STRUCTURE
// ----------------------------------------------------------------------------
// { gameboy
//
//   Platform's Controller Button list, it is used as master reference for
//   all successive definitions. These definitions are also the button labels
//   that will be printed to the screen.
//   [MST]hw_keys = Select, Start, A, B, Left, Right, Up, Down
// 
//   Emulator's Controller Image
//   [SST]image = db/emu-ctrl/images/gameboy.jpg
//
//   Controller Map : Defines where and how we have to show the current controls
//   for this emulated system.
//   { gfx_map
//
//     Describes the points where the physical buttons are showed in the image
//     { buttons
//
//       For each button defined in <hw_keys> there must be an entry like the
//       following. Coordinates must be expressed in % of the original image size.
//       0: Select (455, 865) - Control 0, as defined in <hw_keys>
//       [MFL]#0 = 0.3555, 0.8547
//
//       1: Start (668, 864) - Control 1, as defined in <hw_keys>
//       [MFL]#1 = 0.5219, 0.8547
//
//       2: A (1092, 499) -  - Control 2, as defined in <hw_keys>
//       [MFL]#2 = 0.8531, 0.4931
//
//       ...
//       } -- end of buttons
//
//     Describes the points where the labels should be rendered, the third parameter
//     represent the alignment (1=Left, 2=Right). Coordinates must be expressed in %
//     of the original image size.
//     { labels
//       Font size (% of the image height)
//       [SFL]font_size = 0.040
//
//       Font colors: label, current assignment, edge color in RGB or AARRGGBB format
//       [MCL]font_colors = $66FF00, $FFFFFF, $000000
//
//       Line and dots color indicators
//       [SCL]lines_color = $FF0000
//     
//       List of all labels paired with all controller's buttons. Format is
//       [MFL]control_id = %x_pos, %y_pos, alignment
//     
//       0: Select (532, 931)
//       [MFL]#0 = 0.4156, 0.9200, 1
//
//       1: Start (613, 931)
//       [MFL]#1 = 0.4789, 0.9200, 2
//
//       2: A (1171, 309)
//       [MFL]#2 = 0.9148, 0.3053, 1
//
//       ...
//       } -- end of labels
//     } -- end of gfx_map
//
//   The following section describes all emulators used to emulate the system
//   { emulators
//
//     For each emulator used describes its control system for each supported host os.
//     { VisualBoyAdvance
//
//       All supported host os are describet here
//       { Win32
//
//         Configuration file position (you can check multiple possible positions using
//         this format -> [MST]config = path1, path2, ...).
//         [SST]config = emulators/VisualBoyAdvance/vba.ini
//
//         Token / Value separator in the configuration file
//         [SST]token_separator = {EQUAL}
//
//         On Mednafen controls are defined using triplets [key] [type] [value]
//         [SBL]token_triplets = 0
//
//         Value type, possible values are : linux_key_codes, hex_ascii, sdl
//         [SST]value_type = linux_key_codes
//
//         Definition of the Key / Token pairing
//         { controls
//
//           Controller #0 description
//           { #0
//             Control id (defined by <hw_keys>) = config token, defaul value
//             [MST]#0 = Joy0_Select, 14
//             [MST]#1 = Joy0_Start, 28
//             [MST]#2 = Joy0_A, 44
//             [MST]#3 = Joy0_B, 45
//             [MST]#4 = Joy0_Left, 203
//             [MST]#5 = Joy0_Right, 205
//             [MST]#6 = Joy0_Up, 200
//             [MST]#7 = Joy0_Down, 208
//             } -- end of control #0
//           } -- end of controls
//         } -- end of Win32
//
//       { AROS
//         ...
//         } -- end of AROS
//
//       ...
//
//       } -- end of VisualBoyAdvance
//
//     { Mednafen
//       ...
//       } -- end of Mednafen
//
//     ...
//
//     } -- end of emulators
//   } -- end of gameboy
//
// { gameboycolor
//   ...
//   } -- end of gameboycolor
//
// ...







// EMULATED SYSTEMS
// ----------------
//=============================================================================
{ gameboy
//=============================================================================
  // List of the available Gameboy keys
  [MST]hw_keys = Select, Start, A, B, Left, Right, Up, Down
  
  // Image of the Gameboy controller
  [SST]image = db/emu-ctrl/images/gameboy.jpg
  
  // Map of the available buttons in the given image.
  { gfx_map
    
    // Defines the center point of each controller button, this list must
    // follow the key order used in <hw_keys>.
    { buttons

      // 0: Select (455, 865)
      [MFL]#0 = 0.3555, 0.8547
      
      // 1: Start (668, 864)
      [MFL]#1 = 0.5219, 0.8547
      
      // 2: A (1092, 499)
      [MFL]#2 = 0.8531, 0.4931
      
      // 3: B (886, 596)
      [MFL]#3 = 0.6922, 0.5889
      
      // 4: Left (161, 565)
      [MFL]#4 = 0.1258, 0.5583
      
      // 5: Right (357, 565)
      [MFL]#5 = 0.2789, 0.5583
      
      // 6: Up (259, 469)
      [MFL]#6 = 0.2023, 0.4634
      
      // 7: Down (259, 668)
      [MFL]#7 = 0.2023, 0.6601         
      }
      
    // Defines the point where the button labels must be printed, the
    // third parameters means : 1: Left Alignment, 2: Right Alignment
    { labels
      
      // Defines the font size, color and the color of the lines that connects the
      // connects the labels to the keys.
      [SFL]font_size = 0.040
      [MCL]font_colors = $66FF00, $FFFFFF, $000000
      [SCL]lines_color = $FF0000
      
      // 0: Select (532, 931)
      [MFL]#0 = 0.4156, 0.9200, 1
      
      // 1: Start (613, 931)
      [MFL]#1 = 0.4789, 0.9200, 2
      
      // 2: A (1171, 309)
      [MFL]#2 = 0.9148, 0.3053, 1
      
      // 3: B (948, 410)
      [MFL]#3 = 0.7406, 0.4051, 1
      
      // 4: Left (457, 518)
      [MFL]#4 = 0.0078, 0.5118, 2
      
      // 5: Right (10, 518)
      [MFL]#5 = 0.3570, 0.5118, 2
      
      // 6: Up (207, 319)
      [MFL]#6 = 0.1617, 0.3152, 2
      
      // 7: Down (207, 733)
      [MFL]#7 = 0.1617, 0.7243, 2
      }
    }

  // ::::::::::::::::::::::::::::::::::::::::::::::::::
  // :: List of all emulators used for this platform ::
  // ::::::::::::::::::::::::::::::::::::::::::::::::::
  { emulators

    // Emulator name as defined in the emulator database
    //-------------------------------------------------------------------------
    { VisualBoyAdvance
    //-------------------------------------------------------------------------
    
      //-----------------------------------------------------------------------
      { Win32
      //-----------------------------------------------------------------------
        [SST]config = emulators/VisualBoyAdvance/vba.ini
        [SST]token_separator = {EQUAL}
        [SBL]token_triplets = 0
        
        [SST]value_type = linux_key_codes
        
        { controls
          // Controller #0
          { #0
            [MST]#0 = Joy0_Select, 14
            [MST]#1 = Joy0_Start, 28
            [MST]#2 = Joy0_A, 44
            [MST]#3 = Joy0_B, 45
            [MST]#4 = Joy0_Left, 203
            [MST]#5 = Joy0_Right, 205
            [MST]#6 = Joy0_Up, 200
            [MST]#7 = Joy0_Down, 208
            }
          }
        }

      //-----------------------------------------------------------------------
      { AROS
      //-----------------------------------------------------------------------
        [SST]config = emulators/VisualBoyAdvance/vba.i386-aros/etc/VisualBoyAdvance.cfg
        [SST]token_separator = {EQUAL}
        [SBL]token_triplets = 0
        
        [SST]value_type = hex_ascii
        
        { controls
          // Controller #0
          { #0
            [MST]#0 = Joy0_Select, $0008
            [MST]#1 = Joy0_Start, $000d
            [MST]#2 = Joy0_A, $007a
            [MST]#3 = Joy0_B, $0078
            [MST]#4 = Joy0_Left, $0114
            [MST]#5 = Joy0_Right, $0113
            [MST]#6 = Joy0_Up, $0111
            [MST]#7 = Joy0_Down, $0112
            }
          }
        }
      
      //-----------------------------------------------------------------------
      { Linux
      //-----------------------------------------------------------------------
        [MST]config = $HOME/VisualBoyAdvance.cfg,$HOME/.vba/VisualBoyAdvance.cfg,/etc/VisualBoyAdvance.cfg
        [SST]token_separator = {EQUAL}
        [SBL]token_triplets = 0
        
        [SST]value_type = hex_ascii
        
        { controls
          // Controller #0
          { #0
            [MST]#0 = Joy0_Select, $0008
            [MST]#1 = Joy0_Start, $000d
            [MST]#2 = Joy0_A, $007a
            [MST]#3 = Joy0_B, $0078
            [MST]#4 = Joy0_Left, $0114
            [MST]#5 = Joy0_Right, $0113
            [MST]#6 = Joy0_Up, $0111
            [MST]#7 = Joy0_Down, $0112
            }
          }
        }
      }

    //-------------------------------------------------------------------------
    { Mednafen
    //-------------------------------------------------------------------------

      //-----------------------------------------------------------------------
      { Linux
      //-----------------------------------------------------------------------
        [MST]config = $HOME/mednafen.cfg,$HOME/.mednafen/mednafen.cfg,/etc/mednafen.cfg, $HOME/mednafen-09x.cfg,$HOME/.mednafen/mednafen-09x.cfg,/etc/mednafen-09x.cfg
        [SST]token_separator = {SPACE}
        [SBL]token_triplets = 1
        
        [SST]value_type = sdl
        
        { controls
          // Controller #0
          { #0
            // Control id (defined by <hw_keys>) = config token, defaul value
            [MST]#0 = gb.input.builtin.gamepad.select, keyboard, 9
            [MST]#1 = gb.input.builtin.gamepad.start, keyboard, 13
            [MST]#2 = gb.input.builtin.gamepad.a, keyboard, 259
            [MST]#3 = gb.input.builtin.gamepad.b, keyboard, 258
            [MST]#4 = gb.input.builtin.gamepad.left, keyboard, 97
            [MST]#5 = gb.input.builtin.gamepad.right, keyboard, 115
            [MST]#6 = gb.input.builtin.gamepad.up, keyboard, 119
            [MST]#7 = gb.input.builtin.gamepad.down, keyboard, 122
            }
          }
        }
      }
    }
  }
  
//=============================================================================
{ gameboycolor
//=============================================================================
  [MST]hw_keys = Select, Start, A, B, Left, Right, Up, Down
  [SST]image = db/emu-ctrl/images/gameboycolor.jpg
  
  { gfx_map
    
    { buttons

      // 0: Select (558, 854)
      [MFL]#0 = 0.4359, 0.8204
      
      // 1: Start (740, 854)
      [MFL]#1 = 0.5781, 0.8204
      
      // 2: A (1089, 459)
      [MFL]#2 = 0.8508, 0.4409
      
      // 3: B (863, 533)
      [MFL]#3 = 0.6742, 0.5120
      
      // 4: Left (197, 506)
      [MFL]#4 = 0.1539, 0.4861
      
      // 5: Right (387, 506)
      [MFL]#5 = 0.3023, 0.4861
      
      // 6: Up (290, 408)
      [MFL]#6 = 0.2266, 0.3919
      
      // 7: Down (290, 603)
      [MFL]#7 = 0.2266, 0.5793         
      }
      
    { labels
      [SFL]font_size = 0.040
      [MCL]font_colors = $66FF00, $FFFFFF, $000000
      [SCL]lines_color = $FF0000
      
      // 0: Select (604, 916)
      [MFL]#0 = 0.4719, 0.8799, 1
      
      // 1: Start (690, 916)
      [MFL]#1 = 0.5391, 0.8799, 2
      
      // 2: A (1125, 287)
      [MFL]#2 = 0.8813, 0.2757, 1
      
      // 3: B (912, 385)
      [MFL]#3 = 0.7125, 0.3698, 1
      
      // 4: Left (46, 223)
      [MFL]#4 = 0.0359, 0.2142, 2
      
      // 5: Right (464, 545)
      [MFL]#5 = 0.3625, 0.5235, 2
      
      // 6: Up (369, 343)
      [MFL]#6 = 0.2883, 0.3295, 2
      
      // 7: Down (247, 673)
      [MFL]#7 = 0.1930, 0.6465, 2
      }
    }

  { emulators

    //-------------------------------------------------------------------------
    { VisualBoyAdvance
    //-------------------------------------------------------------------------
    
      //-----------------------------------------------------------------------
      { Win32
      //-----------------------------------------------------------------------
        [SST]config = emulators/VisualBoyAdvance/vba.ini
        [SST]token_separator = {EQUAL}
        [SBL]token_triplets = 0
        
        [SST]value_type = linux_key_codes
        
        { controls
          // Controller #0
          { #0
            [MST]#0 = Joy0_Select, 14
            [MST]#1 = Joy0_Start, 28
            [MST]#2 = Joy0_A, 44
            [MST]#3 = Joy0_B, 45
            [MST]#4 = Joy0_Left, 203
            [MST]#5 = Joy0_Right, 205
            [MST]#6 = Joy0_Up, 200
            [MST]#7 = Joy0_Down, 208
            }
          }
        }

      //-----------------------------------------------------------------------
      { AROS
      //-----------------------------------------------------------------------
        [SST]config = emulators/VisualBoyAdvance/vba.i386-aros/etc/VisualBoyAdvance.cfg
        [SST]token_separator = {EQUAL}
        [SBL]token_triplets = 0
        
        [SST]value_type = hex_ascii
        
        { controls
          // Controller #0
          { #0
            [MST]#0 = Joy0_Select, $0008
            [MST]#1 = Joy0_Start, $000d
            [MST]#2 = Joy0_A, $007a
            [MST]#3 = Joy0_B, $0078
            [MST]#4 = Joy0_Left, $0114
            [MST]#5 = Joy0_Right, $0113
            [MST]#6 = Joy0_Up, $0111
            [MST]#7 = Joy0_Down, $0112
            }
          }
        }
      
      //-----------------------------------------------------------------------
      { Linux
      //-----------------------------------------------------------------------
        [MST]config = $HOME/VisualBoyAdvance.cfg,$HOME/.vba/VisualBoyAdvance.cfg,/etc/VisualBoyAdvance.cfg
        [SST]token_separator = {EQUAL}
        [SBL]token_triplets = 0
        
        [SST]value_type = hex_ascii
        
        { controls
          // Controller #0
          { #0
            [MST]#0 = Joy0_Select, $0008
            [MST]#1 = Joy0_Start, $000d
            [MST]#2 = Joy0_A, $007a
            [MST]#3 = Joy0_B, $0078
            [MST]#4 = Joy0_Left, $0114
            [MST]#5 = Joy0_Right, $0113
            [MST]#6 = Joy0_Up, $0111
            [MST]#7 = Joy0_Down, $0112
            }
          }
        }
      }
    
    //-------------------------------------------------------------------------
    { Mednafen
    //-------------------------------------------------------------------------
    
      //-----------------------------------------------------------------------
      { Linux
      //-----------------------------------------------------------------------
        [MST]config = $HOME/mednafen.cfg,$HOME/.mednafen/mednafen.cfg,/etc/mednafen.cfg, $HOME/mednafen-09x.cfg,$HOME/.mednafen/mednafen-09x.cfg,/etc/mednafen-09x.cfg
        [SST]token_separator = {SPACE}
        [SBL]token_triplets = 1
        
        [SST]value_type = sdl
        
        { controls
          // Controller #0
          { #0
            [MST]#0 = gbc.input.builtin.gamepad.select, keyboard, 9
            [MST]#1 = gbc.input.builtin.gamepad.start, keyboard, 13
            [MST]#2 = gbc.input.builtin.gamepad.a, keyboard, 259
            [MST]#3 = gbc.input.builtin.gamepad.b, keyboard, 258
            [MST]#4 = gbc.input.builtin.gamepad.left, keyboard, 97
            [MST]#5 = gbc.input.builtin.gamepad.right, keyboard, 115
            [MST]#6 = gbc.input.builtin.gamepad.up, keyboard, 119
            [MST]#7 = gbc.input.builtin.gamepad.down, keyboard, 122
            }
          }
        }
      }
    }
  }

//=============================================================================
{ gameboyadvance
//=============================================================================
  [MST]hw_keys = Select, Start, A, B, Left, Right, Up, Down, L, R
  [SST]image = db/emu-ctrl/images/gameboyadvance.jpg
  
  { gfx_map
    
    { buttons

      // 0: Select (269, 573)
      [MFL]#0 = 0.2102, 0.7650
      
      // 1: Start (269, 507)
      [MFL]#1 = 0.2102, 0.6769
      
      // 2: A (1157, 316)
      [MFL]#2 = 0.9039, 0.4219
      
      // 3: B (1044, 353)
      [MFL]#3 = 0.8156, 0.4713
      
      // 4: Left (129, 336)
      [MFL]#4 = 0.1008, 0.4486
      
      // 5: Right (232, 336)
      [MFL]#5 = 0.1813, 0.4486
      
      // 6: Up (181, 284)
      [MFL]#6 = 0.1414, 0.3792
      
      // 7: Down (181, 385)
      [MFL]#7 = 0.1414, 0.5140
      
      // 8: Left Shoulder (160, 90)
      [MFL]#8 = 0.1250, 0.1202
      
      // 9: Right Shoulder (1147, 90)
      [MFL]#9 = 0.8961, 0.1202
      }
      
    { labels
      [SFL]font_size = 0.055
      [MCL]font_colors = $66FF00, $FFFFFF, $000000
      [SCL]lines_color = $FF0000
      
      // 0: Select (332, 574)
      [MFL]#0 = 0.2594, 0.7664, 2
      
      // 1: Start (332, 506)
      [MFL]#1 = 0.2594, 0.6756, 2
      
      // 2: A (1150, 221)
      [MFL]#2 = 0.8984, 0.2951, 1
      
      // 3: B (1050, 424)
      [MFL]#3 = 0.8203, 0.5661, 2
      
      // 4: Left (128, 437)
      [MFL]#4 = 0.1000, 0.5834, 2
      
      // 5: Right (306, 331)
      [MFL]#5 = 0.2391, 0.4419, 2
      
      // 6: Up (250, 244)
      [MFL]#6 = 0.1953, 0.3258, 2
      
      // 7: Down (250, 400)
      [MFL]#7 = 0.1953, 0.5340, 2
      
      // 8: Left Shoulder (210, 138)
      [MFL]#8 = 0.1641, 0.1842, 2
      
      // 9: Right Shoulder (1065, 138)
      [MFL]#9 = 0.8320, 0.1842, 1
      }
    }

  { emulators

    //-------------------------------------------------------------------------
    { VisualBoyAdvance
    //-------------------------------------------------------------------------
    
      //-----------------------------------------------------------------------
      { Win32
      //-----------------------------------------------------------------------
        [SST]config = emulators/VisualBoyAdvance/vba.ini
        [SST]token_separator = {EQUAL}
        [SBL]token_triplets = 0
        
        [SST]value_type = linux_key_codes
        
        { controls
          // Controller #0
          { #0
            [MST]#0 = Joy0_Select, 14
            [MST]#1 = Joy0_Start, 28
            [MST]#2 = Joy0_A, 44
            [MST]#3 = Joy0_B, 45
            [MST]#4 = Joy0_Left, 203
            [MST]#5 = Joy0_Right, 205
            [MST]#6 = Joy0_Up, 200
            [MST]#7 = Joy0_Down, 208
            [MST]#8 = Joy0_L, 30
            [MST]#9 = Joy0_R, 31
            }
          }
        }

      //-----------------------------------------------------------------------
      { AROS
      //-----------------------------------------------------------------------
        [SST]config = emulators/VisualBoyAdvance/vba.i386-aros/etc/VisualBoyAdvance.cfg
        [SST]token_separator = {EQUAL}
        [SBL]token_triplets = 0
        
        [SST]value_type = hex_ascii
        
        { controls
          // Controller #0
          { #0
            [MST]#0 = Joy0_Select, $0008
            [MST]#1 = Joy0_Start, $000d
            [MST]#2 = Joy0_A, $007a
            [MST]#3 = Joy0_B, $0078
            [MST]#4 = Joy0_Left, $0114
            [MST]#5 = Joy0_Right, $0113
            [MST]#6 = Joy0_Up, $0111
            [MST]#7 = Joy0_Down, $0112
            [MST]#8 = Joy0_L, $0061
            [MST]#9 = Joy0_R, $0073
            }
          }
        }
      
      //-----------------------------------------------------------------------
      { Linux
      //-----------------------------------------------------------------------
        [MST]config = $HOME/VisualBoyAdvance.cfg,$HOME/.vba/VisualBoyAdvance.cfg,/etc/VisualBoyAdvance.cfg
        [SST]token_separator = {EQUAL}
        [SBL]token_triplets = 0
        
        [SST]value_type = hex_ascii
        
        { controls
          // Controller #0
          { #0
            [MST]#0 = Joy0_Select, $0008
            [MST]#1 = Joy0_Start, $000d
            [MST]#2 = Joy0_A, $007a
            [MST]#3 = Joy0_B, $0078
            [MST]#4 = Joy0_Left, $0114
            [MST]#5 = Joy0_Right, $0113
            [MST]#6 = Joy0_Up, $0111
            [MST]#7 = Joy0_Down, $0112
            [MST]#8 = Joy0_L, $0061
            [MST]#9 = Joy0_R, $0073
            }
          }
        }
      }
    
    //-------------------------------------------------------------------------
    { Mednafen
    //-------------------------------------------------------------------------
    
      //-----------------------------------------------------------------------
      { Linux
      //-----------------------------------------------------------------------
        [MST]config = $HOME/mednafen.cfg,$HOME/.mednafen/mednafen.cfg,/etc/mednafen.cfg, $HOME/mednafen-09x.cfg,$HOME/.mednafen/mednafen-09x.cfg,/etc/mednafen-09x.cfg
        [SST]token_separator = {SPACE}
        [SBL]token_triplets = 1
        
        [SBL]token_triplets = 1
        
        [SST]value_type = sdl
        
        { controls
          // Controller #0
          { #0
            [MST]#0 = gba.input.builtin.gamepad.select, keyboard, 9
            [MST]#1 = gba.input.builtin.gamepad.start, keyboard, 13
            [MST]#2 = gba.input.builtin.gamepad.a, keyboard, 259
            [MST]#3 = gba.input.builtin.gamepad.b, keyboard, 258
            [MST]#4 = gba.input.builtin.gamepad.left, keyboard, 97
            [MST]#5 = gba.input.builtin.gamepad.right, keyboard, 115
            [MST]#6 = gba.input.builtin.gamepad.up, keyboard, 119
            [MST]#7 = gba.input.builtin.gamepad.down, keyboard, 122
            [MST]#8 = gba.input.builtin.gamepad.shoulder_l, keyboard, 261
            [MST]#9 = gba.input.builtin.gamepad.shoulder_r, keyboard, 262
            }
          }
        }
      }
    }
  }

//=============================================================================
{ nintendoentertainmentsystem
//=============================================================================

// ****************************************************************************
// ATTENZIONE : STRUTTURA DATI USATA SOLO COME PLACEHOLDER, I VALORI NON SONO
//              VERI, FINO A CHE NON DECODIFICO IL FORMATO DI CONFIGURAZIONE
//              NON POSSO DEFINIRE QUESTA PARTE.
// ****************************************************************************

  [MST]hw_keys = Select, Start, A, B, Left, Right, Up, Down
  [SST]image = db/emu-ctrl/images/gameboyadvance.jpg
  
  { gfx_map
    
    { buttons

      // 0: Select (483, 371)
      [MFL]#0 = 0.3982, 0.7067
      
      // 1: Start (641, 371)
      [MFL]#1 = 0.5284, 0.7067
      
      // 2: A (1008, 371)
      [MFL]#2 = 0.8310, 0.7067
      
      // 3: B (849, 371)
      [MFL]#3 = 0.6999, 0.7067
      
      // 4: Left (140, 314)
      [MFL]#4 = 0.1154, 0.5981
      
      // 5: Right (281, 314)
      [MFL]#5 = 0.2316, 0.5981
      
      // 6: Up (211, 244)
      [MFL]#6 = 0.1739, 0.4647
      
      // 7: Down (211, 383)
      [MFL]#7 = 0.1739, 0.7295
      }
      
    { labels
      [SFL]font_size = 0.055
      [MCL]font_colors = $66FF00, $FFFFFF, $000000
      [SCL]lines_color = $FF0000
      
      // 0: Select (486, 241)
      [MFL]#0 = 0.4007, 0.4590, 2
      
      // 1: Start (638, 282)
      [MFL]#1 = 0.5260, 0.5371, 2
      
      // 2: A (1004, 446)
      [MFL]#2 = 0.8277, 0.8495, 2
      
      // 3: B (850, 258)
      [MFL]#3 = 0.70007, 0.4914, 2
      
      // 4: Left (137, 436)
      [MFL]#4 = 0.1129, 0.8305, 2
      
      // 5: Right (364, 287)
      [MFL]#5 = 0.3001, 0.5467, 2
      
      // 6: Up (218, 144)
      [MFL]#6 = 0.1797, 0.2743, 2
      
      // 7: Down (289, 373)
      [MFL]#7 = 0.2382, 0.7105, 2
      }
    }

  { emulators

    //--Fceux------------------------------------------------------------------
    { NintendoEntertainmentSystem
    //-------------------------------------------------------------------------
      // Purtroppo FCEUX usa una codifica base64 che non permette di comprendere
      // come sono mappati i controlli...
      // Quindi mi invento un metodo per mostrare i controlli di default e
      // avviso l'utente che l'immagine riporta solo i controlli di default.
      // Potrei usare
      // [SST]config = DEFAULT_VALUES
      // In questo caso, anzichè caricare il file di config uso i valori di
      // default indicati nella sezione <controls>.
      //-----------------------------------------------------------------------
      //   Win32   NOT YET IMPLEMENTED!!
      //-----------------------------------------------------------------------

      //-----------------------------------------------------------------------
      //   AROS    NOT YET IMPOLEMENTED!! Stesso problema di FCEUX...
      //-----------------------------------------------------------------------
          
      //-------------------------------------------------------------------------
      //{ Mednafen
      //-------------------------------------------------------------------------
      
        //-----------------------------------------------------------------------
      //  { Linux   NON TROVO LA CONFIGURAZIONE PER LA TASTIERA!
        //-----------------------------------------------------------------------

          //}
        //}
      }
    }
  }


//=============================================================================
{ supernes
//=============================================================================
  [MST]hw_keys = Select, Start, X, A, L, Y, B, R, Left, Right, Up, Down
  [SST]image = db/emu-ctrl/images/supernes.jpg
  
  { gfx_map
    
    { buttons

      // 0: Select
      [MFL]#0 = 0.4131, 0.5798
      
      // 1: Start
      [MFL]#1 = 0.5176, 0.5798
      
      // 2: X
      [MFL]#2 = 0.7754, 0.3696
      
      // 3: A
      [MFL]#3 = 0.8691, 0.5117
      
      // 4: L
      [MFL]#4 = 0.2383, 0.1245
      
      // 5: Y
      [MFL]#5 = 0.6797, 0.5156
      
      // 6: B
      [MFL]#6 = 0.7754, 0.6654
      
      // 7: R
      [MFL]#7 = 0.7764, 0.1245
      
      // 8: Left
      [MFL]#8 = 0.165, 0.5311
      
      // 9: Right
      [MFL]#9 = 0.2783, 0.5311
      
      // 10: Up
      [MFL]#10 = 0.2217, 0.4144
      
      // 11: Down
      [MFL]#11 = 0.2217, 0.6381
      }
      
    { labels
      [SFL]font_size = 0.055
      [MCL]font_colors = $66FF00, $FFFFFF, $000000
      [SCL]lines_color = $FF0000
      
      // 0: Select
      [MFL]#0 = 0.4131, 0.7626, 2
      
      // 1: Start
      [MFL]#1 = 0.5176, 0.8035, 2
      
      // 2: X
      [MFL]#2 = 0.7754, 0.2549, 2
      
      // 3: A
      [MFL]#3 = 0.8691, 0.7782, 1
      
      // 4: L
      [MFL]#4 = 0.2383, 0.0622, 2
      
      // 5: Y
      [MFL]#5 = 0.6797, 0.1984, 2
      
      // 6: B
      [MFL]#6 = 0.7754, 0.8560, 1
      
      // 7: R
      [MFL]#7 = 0.7764, 0.0622, 2
      
      // 8: Left
      [MFL]#8 = 0.1001, 0.2451, 2
      
      // 9: Right
      [MFL]#9 = 0.3437, 0.4319, 2
      
      // 10: Up
      [MFL]#10 = 0.2217, 0.286, 2
      
      // 11: Down
      [MFL]#11 = 0.2217, 0.7568, 2
      }
    }

  { emulators

    //--ZSNES------------------------------------------------------------------
    { ZSNES
    //-------------------------------------------------------------------------
      //-----------------------------------------------------------------------
      { Win32
      //-----------------------------------------------------------------------
        [SST]config = emulators/ZsNES/zinput.cfg
        [SST]token_separator = {EQUAL}
        [SBL]token_triplets = 0
        
        [SST]value_type = linux_key_codes
        
        { controls
          // Controller #0
          { #0
            [MST]#0 = pl1selk, 54
            [MST]#1 = pl1startk, 28
            [MST]#2 = pl1Xk, 31
            [MST]#3 = pl1Ak, 45
            [MST]#4 = pl1Lk, 32
            [MST]#5 = pl1Yk, 30
            [MST]#6 = pl1Bk, 44
            [MST]#7 = pl1Rk, 46
            [MST]#8 = pl1leftk, 203
            [MST]#9 = pl1rightk, 205
            [MST]#10 = pl1upk, 200
            [MST]#11 = pl1downk, 208
            }
          }
        }
        
      //-----------------------------------------------------------------------
      // AROS : No emulators available
      //-----------------------------------------------------------------------
        
      }

    //-------------------------------------------------------------------------
    { Mednafen
    //-------------------------------------------------------------------------
      //-----------------------------------------------------------------------
      { Linux
      //-----------------------------------------------------------------------
        [MST]config = $HOME/mednafen.cfg,$HOME/.mednafen/mednafen.cfg,/etc/mednafen.cfg, $HOME/mednafen-09x.cfg,$HOME/.mednafen/mednafen-09x.cfg,/etc/mednafen-09x.cfg
        [SST]token_separator = {SPACE}
        [SBL]token_triplets = 1
        
        [SBL]token_triplets = 1
        
        [SST]value_type = sdl
        
        { controls
          // Controller #0
          { #0
            [MST]#0 = snes.input.port1.gamepad.select, keyboard, 9
            [MST]#1 = snes.input.port1.gamepad.start, keyboard, 13
            [MST]#2 = snes.input.port1.gamepad.x, keyboard, 264
            [MST]#3 = snes.input.port1.gamepad.a, keyboard, 262
            [MST]#4 = snes.input.port1.gamepad.l, keyboard, 263
            [MST]#5 = snes.input.port1.gamepad.y, keyboard, 260
            [MST]#6 = snes.input.port1.gamepad.b, keyboard, 258
            [MST]#7 = snes.input.port1.gamepad.r, keyboard, 265
            [MST]#8 = snes.input.port1.gamepad.left, keyboard, 97
            [MST]#9 = snes.input.port1.gamepad.right, keyboard, 100
            [MST]#10 = snes.input.port1.gamepad.up, keyboard, 119
            [MST]#11 = snes.input.port1.gamepad.down, keyboard, 115
            }
          }
        }
      }
    }
  }
  
//=============================================================================
{ segamegadrive
//=============================================================================
  [MST]hw_keys = Start, Left, Right, Up, Down, A, B, C
  
  [SST]image = db/emu-ctrl/images/segamegadrive.jpg
  
  { gfx_map
  
    { buttons
      // Image Size : 1280x762
      
      // 0: Start (890, 153)
      [MFL]#0 = 0.6953, 0.2007
      
      // 1: Left (203, 320)
      [MFL]#1 = 0.1586, 0.4199
      
      // 2: Right (363, 320)
      [MFL]#2 = 0.2836, 0.4199
      
      // 3: Up (288, 235)
      [MFL]#3 = 0.2250, 0.3084
      
      // 4: Down (288, 402)
      [MFL]#4 = 0.2250, 0.5276
      
      // 5: A (857, 384)
      [MFL]#5 = 0.6695, 0.5039
      
      // 6: B (983, 315)
      [MFL]#6 = 0.7680, 0.4134
      
      // 7: C (1108, 270)
      [MFL]#7 = 0.8656, 0.3543
      }
      
    { labels
      [SFL]font_size = 0.040
      [MCL]font_colors = $66FF00, $FFFFFF, $000000
      [SCL]lines_color = $FF0000
    
      // 0: Start (890, 50)
      [MFL]#0 = 0.6953, 0.0656, 1
      
      // 1: Left (203, 547)
      [MFL]#1 = 0.1585, 0.7178, 1
      
      // 2: Right (460, 320)
      [MFL]#2 = 0.3594, 0.4199, 1
      
      // 3: Up (460, 235)
      [MFL]#3 = 0.3594, 0.3084, 1
      
      // 4: Down (460, 402)
      [MFL]#4 = 0.3594, 0.5276, 1
      
      // 5: A (857, 525)
      [MFL]#5 = 0.6695, 0.6890, 1
      
      // 6: B (983, 440)
      [MFL]#6 = 0.7680, 0.7318, 1
      
      // 7: C (1108, 600)
      [MFL]#7 = 0.8656, 0.7874, 2
      }
  
    }
  
  { emulators
  
    //-------------------------------------------------------------------------
    { Fusion
    //-------------------------------------------------------------------------

      //-----------------------------------------------------------------------
      { Win32
      //-----------------------------------------------------------------------
        [SST]config = emulators/Fusion/Fusion.ini
        [SST]token_separator = {EQUAL}
        [SBL]token_triplets = 0
        
        [SST]value_type = linux_key_codes

        { controls
          // Controller #0
          { #0
            [SST]indexed_key = Player1Keys
            [SST]indexed_separator = {COMMA}
            
            ; Player1Keys=Up,Down,Left,Right,A,B,C,Start,X,Y,Z,M ode,?,?,?,?ù
            
            ; Index, Value
            [MST]#0 = 7, 28
            [MST]#1 = 2, 203
            [MST]#2 = 3, 205            
            [MST]#3 = 0, 200
            [MST]#4 = 1, 208
            [MST]#5 = 4, 30
            [MST]#6 = 5, 31
            [MST]#7 = 6, 32
            }
          }
        }
  
      }
      
    //-------------------------------------------------------------------------
    { Mednafen
    //-------------------------------------------------------------------------

      //-----------------------------------------------------------------------
      { Linux
      //-----------------------------------------------------------------------
        [MST]config = $HOME/mednafen.cfg,$HOME/.mednafen/mednafen.cfg,/etc/mednafen.cfg, $HOME/mednafen-09x.cfg,$HOME/.mednafen/mednafen-09x.cfg,/etc/mednafen-09x.cfg
        [SST]token_separator = {SPACE}
        [SBL]token_triplets = 1
        
        [SST]value_type = sdl
        
        { controls
          // Controller #0
          { #0
            // Control id (defined by <hw_keys>) = config token, defaul value
            [MST]#0 = md.input.port1.gamepad6.start, keyboard, 13
            [MST]#1 = md.input.port1.gamepad6.left, keyboard, 13
            [MST]#2 = md.input.port1.gamepad6.right, keyboard, 259
            [MST]#3 = md.input.port1.gamepad6.up, keyboard, 258
            [MST]#4 = md.input.port1.gamepad6.down, keyboard, 97
            [MST]#5 = md.input.port1.gamepad6.a, keyboard, 115
            [MST]#6 = md.input.port1.gamepad6.b, keyboard, 119
            [MST]#7 = md.input.port1.gamepad6.c, keyboard, 122
            }
          }

        }
  
      }
      
    //-------------------------------------------------------------------------
    { DGen
    //-------------------------------------------------------------------------

      //-----------------------------------------------------------------------
      { AROS
      //-----------------------------------------------------------------------
        [SST]config = emulators/DGen/dgen/.dgen/dgenrc
        [SST]token_separator = {EQUAL}

        [SBL]token_triplets = 0

        [SST]value_type = raw
        
        { controls
          { #0
            // Controller #0
            [MST]#0 = key_pad1_start = return
            [MST]#1 = key_pad1_left = left
            [MST]#2 = key_pad1_right = right
            [MST]#3 = key_pad1_up = up
            [MST]#4 = key_pad1_down = down
            [MST]#5 = key_pad1_a = w
            [MST]#6 = key_pad1_b = x
            [MST]#7 = key_pad1_c = c
            }
          }
        }
  
      }

    }
    
  }
      
// MANCA ANCORA IL MEGADRIVE (segamegadrive)
//   Fusion   : Win32
//   Mednafen : Linux
//   AROS     : DGen