Code: Select all
if pressed(Wiimote.Minus) then
var.wakeup=1
WiimotePoke(1, 0x4A400F0, 0x55) // Decrypt
wait 100ms
WiimotePoke(1, 0x4A400FB, 0) // Unknown
//wait 100ms
//WiimoteDumpBytes(1, 0x4A400F0, 16) // view type
wait 100ms
WiimotePoke(1, 0x4A400F0, 0xAA) // Encrypt again
//wait 100ms
//WiimoteDumpBytes(1, 0x4A40020, 32) // view calibration
wait 100ms
WiimotePoke(1, 0x4A40040, 0)
wait 100ms
WiimoteSend(1, 0x17, 0x04, 0xA4, 0x00, 0xF0, 0, 16) // get type
var.wakeup=0
end if
debug = var.wakeup+";" +wiimote.ExpString
If I held down a fret button and then pressed minus on the wiimote, the exp string changed. I also went nuts on the whammy bar and pressed minus during it, and I could see the values changing for that brief moment
EDIT: If I remove this line it works fine:
Code: Select all
WiimotePoke(1, 0x4A400F0, 0xAA) // Encrypt again
EDIT: Also, the analog stick on the guitar does not work. The frets, strum up and down, whammy bar, both plus buttons and the Star Power Button (minus) all work on the guitar. It's just the joystick and the touch bar which don't.
Just played FoFiX perfectly using my old script with that stuff at the top.
EDIT: I know, so many edits... I was looking at the joystick on the wii guitars through the wiimote.ExpString... The first 64 bits are the ones that change for both, but the ranges are different.
On the GH4 guitar the first two chunks vary from approximately 00 - 3F, whereas on the GH3 guitars it was C0 - FF
Also, while I'm looking at it... The touch bar seems to be governed by the 3rd chunk. On my guitar, I get these values:
Code: Select all
Not touching it - 0F
1st (top) fret - 04
1st AND 2nd - 07
2nd - 0A
2nd AND 3rd - 0C/0D (keeps changing)
3rd - 12/13
3rd AND 4th - 14/15
4th - 17/18
4th and 5th - 1A
5th (bottom) - 1F
You can hold two frets at once, as long as those two frets are adjacent, otherwise it will take the value of the lowest fret held (Eg, if you hold the highest and lowest fret, it reads 1F)
Note that high/low means physically on the guitar neck (in musical terms I think it's the other way around, so I thought I'd better specify)
EDIT:
And now: Drums!
I haven't really figured these out fully... They're supposed to be velocity sensitive, but I'm only really reading one bit for each drum pad. They're all from the sixth chunk (wiimote.exp5) as follows:
Code: Select all
Orange - 7F - 01111111
Red - BF - 10111111
Yellow - DF - 11011111
Green - EF - 11101111
Blue - F7 - 11110111
bass - FB - 11111011
Here is a GlovePie script I whipped up quickly to allow me to play drums on FoFiX using my WT drums:
Code: Select all
if(!var.init)
//if pressed(Wiimote.Minus) then
WiimotePoke(1, 0x4A400F0, 0x55) // Decrypt
wait 100ms
WiimotePoke(1, 0x4A400FB, 0) // Unknown
//wait 100ms
//WiimoteDumpBytes(1, 0x4A400F0, 16) // view type
//wait 100ms
//WiimotePoke(1, 0x4A400F0, 0xAA) // Encrypt again
//wait 100ms
//WiimoteDumpBytes(1, 0x4A40020, 32) // view calibration
wait 100ms
WiimotePoke(1, 0x4A40040, 0)
wait 100ms
WiimoteSend(1, 0x17, 0x04, 0xA4, 0x00, 0xF0, 0, 16) // get type
var.init = true
end if
var.bass = |(1-((wiimote.Exp5 & 4) >> 2))|
var.blue = |(1-((wiimote.Exp5 & 8) >> 3))|
var.green = |(1-((wiimote.Exp5 & 16) >> 4))|
var.yellow = |(1-((wiimote.Exp5 & 32) >> 5))|
var.red = |(1-((wiimote.Exp5 & 64) >> 6))|
var.orange = |(1-((wiimote.Exp5 & 128) >> 7))|
//debug=wiimote.ExpString +";"+var.bass +";"+var.blue
var.d = " Pads:"
if(var.red) var.d+="Red;"
if(var.yellow) var.d+="Yellow;"
if(var.blue) var.d+="Blue;"
if(var.orange) var.d+="Orange;"
if(var.green) var.d+="Green;"
if(var.bass) var.d+="Bass;"
debug = wiimote.ExpString + var.d
key.q = var.red
key.w = var.yellow
key.o = var.blue
key.p = var.orange
key.space = var.bass
Also, the analog stick and plus and minus buttons are the same as the (GH4) guitar
Does this help you out, Carl?
...There's got to be something I'm missing though. How is the velocity sensitivity measured?