GlovePIE:MAME/MAME32 - 2 to 4 players 1 or 2 kits (wiimotes+classic controllers)

From WiiLi

Jump to: navigation, search


[edit] GlovePIE Script

/*******************************************************************
// 2 to 4 Players by combining Wii remotes and Classic controllers
// for classic 2/3 buttons Beat-em' up games.
//
// Config:
// P1 (Wiimote1)   |   P2 (Classic1)   [kit1]
// P3 (Wiimote2)   |   P4 (classic2)   [kit2]
//
// Build for MAME/MAME32
// Tested on MAME32
//
// Created by Marc-Andre Larouche
// marclar83@gmail.com
// The Classic controller is mandatory
// Version 0.3
// tested on GlovePIE 0.29
// September 2007
//
// Work great with:
//
// Double dragon (technos),
// Metal Slug series,
// Simpsons: The Arcade Game,
// Teenage Mutant ninja turtles: Turtles in time
// and many others...
//
********************************************************************/
//                            READ THIS
// ************************   Important   ***************************
//
// By default the 4th player input is not configured.
// In order to correct this problem, please remap
// the Player 4 controls to the following keys.
//      (you can use this script with the wiimote to do that)
//
//  UP: Numpad 8              |  Y: Keyboard P
//  DOWN: Numpad 2            |  B: Keyboard L
//  LEFT: Numpad 4            |  A: Keyboard O
//  RIGHT: Numpad 6


// LED P1 / P2
Wiimote1.LED1 = true;
Wiimote1.LED2 = Wiimote1.HasClassic;
Wiimote1.LED3 = false;
Wiimote1.LED4 = false;
// LED P3 / P4
Wiimote2.LED1 = false;
Wiimote2.LED2 = false;
Wiimote2.LED3 = true;
Wiimote2.LED4 = Wiimote2.HasClassic;
//
// P1 Mapping  (Wiimote 1)
//
// Controls
   Key.Right = Wiimote.Down;
   Key.Up = Wiimote.Right;
   Key.Down = Wiimote.Left;
   Key.Left = Wiimote.Up;
// Emulator keys
   Key.one = Wiimote.Plus;
   Key.Five = Wiimote.Minus;
   Key.F10 = Wiimote.Home;
// Actions   
   Key.LeftControl = Wiimote.One;
   Key.LeftAlt = Wiimote.Two;
   Key.Space = Wiimote.A;
//
// P2 Mapping  (Classic controller 1)
//
// Controls
   Key.G = Wiimote.Classic.Right;
   Key.R = Wiimote.Classic.Up;
   Key.F = Wiimote.Classic.Down;
   Key.D = Wiimote.Classic.Left;
// Emulator keys
   Key.two = Wiimote.Classic.Plus;
   Key.six = Wiimote.Classic.Minus;
   Key.F10 = Wiimote.Classic.Home;
// Pause
   Key.P = Wiimote.Classic.ZL;
   Key.P = Wiimote.Classic.ZR;
// Actions 
   Key.A = Wiimote.Classic.y;
   Key.S = Wiimote.Classic.b;
   Key.A = Wiimote.Classic.a;
   Key.S = Wiimote.Classic.x;

// The following script mapped the Classic analog stick to the character' displacement
   Key.D = Wiimote.Classic.Joy1X <= -35%
   Key.G = Wiimote.Classic.Joy1X >= 35%
   Key.R = Wiimote.Classic.Joy1Y <= -35%
   Key.F = Wiimote.Classic.Joy1Y >= 35%
//
// P3 Mapping  (Wiimote 2)
//
// Controls
   Key.L = Wiimote2.Down;
   Key.I = Wiimote2.Right;
   Key.K = Wiimote2.Left;
   Key.J = Wiimote2.Up;
// Emulator keys
   Key.three = Wiimote2.Plus;
   Key.seven = Wiimote2.Minus;
   Key.F10 = Wiimote2.Home;
// Actions   
   Key.RightControl = Wiimote2.One;
   Key.RightShift = Wiimote2.Two;
   Key.Enter = Wiimote2.A;
//
// P4 Mapping  (Classic controller 2)
//
// Controls
   Key.NUMPAD6 = Wiimote2.Classic.Right;
   Key.NUMPAD8 = Wiimote2.Classic.Up;
   Key.NUMPAD2 = Wiimote2.Classic.Down;
   Key.NUMPAD4 = Wiimote2.Classic.Left;
// Emulator keys
   Key.four = Wiimote2.Classic.Plus;
   Key.eight = Wiimote2.Classic.Minus;
   Key.F10 = Wiimote2.Classic.Home;
// Pause
   Key.P = Wiimote2.Classic.ZL;
   Key.P = Wiimote2.Classic.ZR;
// Actions 
   Key.NUMPAD5 = Wiimote2.Classic.y;
   Key.NUMPAD7 = Wiimote2.Classic.b;
   Key.NUMPAD9 = Wiimote2.Classic.a;
// The following script mapped the Classic analog stick to the character' displacement
   Key.NUMPAD4 = Wiimote2.Classic.Joy1X <= -35%
   Key.NUMPAD6 = Wiimote2.Classic.Joy1X >= 35%
   Key.NUMPAD8 = Wiimote2.Classic.Joy1Y <= -35%
   Key.NUMPAD2 = Wiimote2.Classic.Joy1Y >= 35%
Personal tools