GlovePIE: ZSNES Classic Controller

From WiiLi

(Redirected from ZSNES Classic Controller)
Jump to: navigation, search

The following is an algorithm for The Classic Controller written for GlovePIE. The control is mapped for two players on ZSNES. Please take note, the default configuration of ZSNES has common keys for both players, so you have to change the configuration of the second player buttons mapping on ZSNES to prevent any problems.

[edit] Script

The Left Analog stick is mapped on the four keys as the directional Pad

/********************************************************************
* This code must be use with ZSNES emulator
* and 1 or 2 the classic controllers
* GPL License
* Writen by Marc-Andre Larouche
* marclar83@gmail.com
* Version 0.4
* tested on GlovePIE 0.29
* September 2007
********************************************************************/
//                            READ THIS
// ************************   Important   ***************************
//
// By default the second player buttons mapping share 2 of them with
// the player one !!! In order to correct this problem, please remap
// the Player 2 input to the following keys.
//      (you can use this script with the wiimote to do that)
//
//  UP: Numpad 8              |  A: Keyboard P      |  L: Keyboard I
//  DOWN: Numpad 2            |  B: Keyboard L      |  R: Keyboard J
//  LEFT: Numpad 4            |  X: Keyboard O      |  Select: Left Alt
//  RIGHT: Numpad 6           |  Y: Keyboard K      |  Start: Left Ctrl
//

// P1 button mapping
Key.Z = Wiimote1.Classic.b
Key.X = Wiimote1.Classic.a
Key.A = Wiimote1.Classic.y
Key.S = Wiimote1.Classic.x
Key.D = Wiimote1.Classic.L
Key.C = Wiimote1.Classic.R
Key.Up = Wiimote1.Classic.Up
Key.Down = Wiimote1.Classic.Down
Key.Left = Wiimote1.Classic.Left
Key.Right = Wiimote1.Classic.Right
Key.RightShift = Wiimote1.Classic.Minus
Key.Enter = Wiimote1.Classic.Plus

// P2 button mapping
Key.L = Wiimote2.Classic.b
Key.P = Wiimote2.Classic.a
Key.K = Wiimote2.Classic.y
Key.O = Wiimote2.Classic.x
Key.I = Wiimote2.Classic.L
Key.J = Wiimote2.Classic.R
Key.NUMPAD8 = Wiimote2.Classic.Up
Key.NUMPAD2 = Wiimote2.Classic.Down
Key.NUMPAD4 = Wiimote2.Classic.Left
Key.NUMPAD6 = Wiimote2.Classic.Right
Key.LeftAlt = Wiimote2.Classic.Minus
Key.LeftControl = Wiimote2.Classic.Plus

// Emulator Shared key
Key.Console = Wiimote1.Classic.Home
Key.F4 = Wiimote1.Classic.ZL
Key.F2 = Wiimote1.Classic.ZR

Key.Console = Wiimote2.Classic.Home
Key.F4 = Wiimote2.Classic.ZL
Key.F2 = Wiimote2.Classic.ZR

// LED P1
Wiimote1.LED1 = true;
Wiimote1.LED2 = false;
Wiimote1.LED3 = false;
Wiimote1.LED4 = false;

// LED P2
Wiimote2.LED1 = false;
Wiimote2.LED2 = true;
Wiimote2.LED3 = false;
Wiimote2.LED4 = false;

// P1 Analog sticks
// The following script mapped the left analog stick to the same controls as the D-pad

Key.left = Wiimote1.Classic.Joy1X <= -25%
Key.right = Wiimote1.Classic.Joy1X >= 25%
Key.up = Wiimote1.Classic.Joy1Y <= -25%
Key.down = Wiimote1.Classic.Joy1Y >= 25%

// For Smash TV game I have mapped the Right Analog stick to X,Y,A,B
Key.A = Wiimote1.Classic.Joy2X <= -25%
Key.X = Wiimote1.Classic.Joy2X >= 25%
Key.S = Wiimote1.Classic.Joy2Y <= -25%
Key.Z = Wiimote1.Classic.Joy2Y >= 25%

//  P2 Analog sticks
// The following script mapped the left analog stick to the same controls as the D-pad

Key.NUMPAD4 = Wiimote2.Classic.Joy1X <= -25%
Key.NUMPAD6 = Wiimote2.Classic.Joy1X >= 25%
Key.NUMPAD8 = Wiimote2.Classic.Joy1Y <= -25%
Key.NUMPAD2 = Wiimote2.Classic.Joy1Y >= 25%

// For Smash TV game I have mapped the Right Analog stick to X,Y,A,B
Key.K = Wiimote2.Classic.Joy2X <= -25%
Key.P = Wiimote2.Classic.Joy2X >= 25%
Key.O = Wiimote2.Classic.Joy2Y <= -25%
Key.L = Wiimote2.Classic.Joy2Y >= 25%

[edit] Extra controls

The right stick is mapped on A,B,X,Y for SmashTV, the Home button is mapped on Fast Foward, The ZL Load state 0 and ZR Save state 0.

Personal tools
Online Casino - best online casino reviews.
Facebook Developers - facebook applications, facebook developers, facebook development, social network application development and viral widget social media strategy