Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 2nd, 2012  |  syntax: None  |  size: 5.11 KB  |  hits: 61  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. if (starting) {
  2.    var.wiimoteReady = (Wiimote.battery != 0)
  3.    //debugprint("Started. Wiimote Ready: " + var.wiimoteReady)
  4.    var.RestartScript = false
  5. }
  6.  
  7. if (var.RestartScript) {
  8.    //debugprint("Attempting to restart the script!")
  9.    chain("C:\Documents and Settings\Tom\My Documents\software\GLOVE PIE\autowiimote.PIE")       // <---- Change this to the path and filename of THIS script
  10. }
  11.  
  12. if (!var.wiimoteReady) {
  13.    //debug = "Wiimote not ready - Framerate: " + pie.frameRate
  14.    pie.Framerate = 2       //Makes GlovePie eat less CPU while waiting for wiimote to be Ready.
  15.    if (Wiimote.battery != 0) {   //Wiimote changed from not ready to ready, restart the script
  16.       var.RestartScript = true
  17.    }
  18.    
  19. } else { //Wiimote is ready :o)
  20.    //debug = "Wiimote ready! - Framerate: " + pie.frameRate
  21.    if (Wiimote.battery == 0) {  //Wiimote changed from ready to not ready, restart the script
  22.       var.RestartScript = true
  23.    }
  24.    
  25. ********************************************************************
  26. * This code must be use with Gens/Fusion emulators.
  27. * For 1 or 2 players, Wiimotes/Classic controllers
  28. *
  29. * GPL License
  30. * Writen by Marc-Andre Larouche
  31. * marclar83@gmail.com
  32. * Version 0.2
  33. * tested on GlovePIE 0.29, Gens 2.14, Fusion 3.5
  34. *
  35. * you can also use alternative mapping for Mortal Kombat,
  36. * set "1 player 2 controllers" on Smash TV
  37. * for Dual thumbstick control on the 1st controller.
  38. *
  39. * September 2007
  40. ********************************************************************/
  41.  
  42. /****************************
  43.            Player 1
  44. ****************************/
  45. // Wiimote (3 buttons)
  46. Key.Up = Wiimote1.Right
  47. Key.Down = Wiimote1.Left
  48. Key.Left = Wiimote1.Up
  49. Key.Right = Wiimote1.Down
  50.  
  51. Key.RightShift = Wiimote1.Minus
  52. Key.Enter = Wiimote1.Plus
  53.  
  54. // Classic controller (6 buttons)
  55. Key.Up = Wiimote1.Classic.Up
  56. Key.Down = Wiimote1.Classic.Down
  57. Key.Left = Wiimote1.Classic.Left
  58. Key.Right = Wiimote1.Classic.Right
  59.  
  60. Key.RightShift = Wiimote1.Classic.Minus
  61. Key.Enter = Wiimote1.Classic.Plus
  62.  
  63. // P1 (default) buttons mapping
  64. // A,B,C
  65. Key.D = Wiimote1.A
  66. Key.A = Wiimote1.one
  67. Key.S = Wiimote1.two
  68. Key.A = Wiimote1.Classic.y
  69. Key.S = Wiimote1.Classic.b
  70. Key.D = Wiimote1.Classic.a
  71. Key.D = Wiimote1.B
  72. // X,Y,Z
  73. Key.Z = Wiimote1.Classic.x
  74. Key.X = Wiimote1.Classic.L
  75. Key.C = Wiimote1.Classic.R
  76.  
  77. // P1 (Mortal Kombat) buttons mapping
  78. /* Remove comment to enable (put default controls in comment!)
  79. // A,B,C
  80. Key.S = Wiimote1.A
  81. Key.A = Wiimote1.one
  82. Key.D = Wiimote1.two
  83. Key.Z = Wiimote1.Classic.y
  84. Key.A = Wiimote1.Classic.b
  85. Key.D = Wiimote1.Classic.a
  86. // X,Y,Z
  87. Key.C = Wiimote1.Classic.x
  88. Key.X = Wiimote1.Classic.L
  89. Key.S = Wiimote1.Classic.R
  90. */
  91.  
  92. /****************************
  93.            Player 2
  94. ****************************/
  95. // Wiimote (3 buttons)
  96. Key.Y = Wiimote2.Right
  97. Key.H = Wiimote2.Left
  98. Key.G = Wiimote2.Up
  99. Key.J = Wiimote2.Down
  100.  
  101. Key.T = Wiimote2.Minus
  102. Key.U = Wiimote2.Plus
  103.  
  104. // Classic controller (6 buttons)
  105. Key.Y = Wiimote2.Classic.Up
  106. Key.H = Wiimote2.Classic.Down
  107. Key.G = Wiimote2.Classic.Left
  108. Key.J = Wiimote2.Classic.Right
  109.  
  110. Key.T = Wiimote2.Classic.Minus
  111. Key.U = Wiimote2.Classic.Plus
  112.  
  113. // P2 (default) button mapping
  114. // A,B,C
  115. Key.M = Wiimote2.A
  116. Key.K = Wiimote2.one
  117. Key.L = Wiimote2.two
  118. Key.K = Wiimote2.Classic.y
  119. Key.L = Wiimote2.Classic.b
  120. Key.M = Wiimote2.Classic.a
  121. // X,Y,Z
  122. Key.I = Wiimote2.Classic.x
  123. Key.O = Wiimote2.Classic.L
  124. Key.P = Wiimote2.Classic.R
  125.  
  126. // P2 (Mortal Kombat) buttons mapping
  127. /* Remove comment to enable (put default controls in comment!)
  128. // A,B,C
  129. Key.L = Wiimote2.A
  130. Key.K = Wiimote2.one
  131. Key.M = Wiimote2.two
  132. Key.I = Wiimote2.Classic.y
  133. Key.K  = Wiimote2.Classic.b
  134. Key.M = Wiimote2.Classic.a
  135. // X,Y,Z
  136. Key.P = Wiimote2.Classic.x
  137. Key.O = Wiimote2.Classic.L
  138. Key.L  = Wiimote2.Classic.R
  139. */
  140.  
  141. // Emulator Shared key
  142. //load state
  143. Key.F8 = Wiimote1.Classic.ZL
  144. Key.F8 = Wiimote2.Classic.ZL
  145. //save state
  146. Key.F5 = Wiimote1.Classic.ZR
  147. Key.F5 = Wiimote2.Classic.ZR
  148. //throttle
  149. Key.BackSpace = Wiimote1.Home
  150. Key.BackSpace = Wiimote2.Home
  151. Key.BackSpace = Wiimote1.Classic.Home
  152. Key.BackSpace = Wiimote2.Classic.Home
  153.  
  154. // LED P1
  155. Wiimote1.LED1 = true;
  156. Wiimote1.LED2 = false;
  157. Wiimote1.LED3 = false;
  158. Wiimote1.LED4 = false;
  159.  
  160. // LED P2
  161. Wiimote2.LED1 = false;
  162. Wiimote2.LED2 = true;
  163. Wiimote2.LED3 = false;
  164. Wiimote2.LED4 = false;
  165.  
  166. // P1 Analog sticks
  167. // The following script mapped the left analog stick to the same controls as the D-pad
  168. Key.left = Wiimote1.Classic.Joy1X <= -25%
  169. Key.right = Wiimote1.Classic.Joy1X >= 25%
  170. Key.up = Wiimote1.Classic.Joy1Y <= -25%
  171. Key.down = Wiimote1.Classic.Joy1Y >= 25%
  172.  
  173. // For Smash TV game I have mapped the Right Analog stick to P2 DPAD
  174. Key.G = Wiimote1.Classic.Joy2X <= -25%
  175. Key.J = Wiimote1.Classic.Joy2X >= 25%
  176. Key.Y = Wiimote1.Classic.Joy2Y <= -25%
  177. Key.H = Wiimote1.Classic.Joy2Y >= 25%
  178.  
  179. //  P2 Left Analog stick
  180. // The following script mapped the left analog stick to the same controls as the D-pad
  181. Key.G = Wiimote2.Classic.Joy1X <= -25%
  182. Key.J = Wiimote2.Classic.Joy1X >= 25%
  183. Key.Y = Wiimote2.Classic.Joy1Y <= -25%
  184. Key.H = Wiimote2.Classic.Joy1Y >= 25%
  185.    //********** Put your wiimote code here!!!*********
  186.    
  187. }