Main > Main Forum
New Product: TurboTwist 2 - The Ultimate Spinner / Paddle control ! From GGG!
u_rebelscum:
--- Quote from: Tiger-Heli on April 26, 2007, 08:01:10 am ---Last question - What I would prefer is for either the Buttons or the Mouse to do Rotation, but I didn't see any way to assign this.
Do you think it's possible?
--- End quote ---
You just like left arrow OR mouse X axis Pos? This will be a head slapper for you Tiger-Heli ;):
It's just like entering multiple OR inputs in mame: enter, press key/button, wait until mame accepts it, enter, spin spinner, wait until mame accepts it, (repeat as needed).
Tiger-Heli:
--- Quote from: u_rebelscum on April 26, 2007, 03:50:46 pm ---You just like left arrow OR mouse X axis Pos? This will be a head slapper for you Tiger-Heli ;):
It's just like entering multiple OR inputs in mame: enter, press key/button, wait until mame accepts it, enter, spin spinner, wait until mame accepts it, (repeat as needed).
--- End quote ---
Thanks Robin, I tried that earlier. My work, errmmmn test system does not like reading the mouse inputs at all.
I simplified my earlier response, but when I spun the mouse, my unmodified .cfg file looked like this:
--- Code: ---<?xml version="1.0"?>
<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
<system name="asteroid">
<input>
<port type="P1_JOYSTICK_RIGHT" mask="64" index="18" defvalue="0">
<newseq type="standard">
NOT MOUSECODE_1_X_POS MOUSECODE_1_Y_POS MOUSECODE_1_Y_NEG MOUSECODE_1_X_NEG MOUSECODE_1_X_POS MOUSECODE_1_Y_POS MOUSECODE_1_Y_NEG MOUSECODE_1_X_POS MOUSECODE_1_Y_NEG MOUSECODE_1_Y_POS MOUSECODE_1_X_NEG MOUSECODE_1_Y_NEG MOUSECODE_1_X_POS MOUSECODE_1_X_NEG
</newseq>
</port>
<port type="P1_JOYSTICK_LEFT" mask="128" index="19" defvalue="0">
<newseq type="standard">
MOUSECODE_1_X_POS MOUSECODE_1_Y_POS NOT MOUSECODE_1_X_POS MOUSECODE_1_Y_POS MOUSECODE_1_X_POS MOUSECODE_1_Y_POS MOUSECODE_1_Y_NEG MOUSECODE_1_X_NEG MOUSECODE_1_Y_NEG MOUSECODE_1_X_POS MOUSECODE_1_X_NEG MOUSECODE_1_Y_POS NOT MOUSECODE_1_X_POS
</newseq>
</port>
</input>
</system>
</mameconfig>
--- End code ---
When I tried to map an OR combination, it changed ROTATE LEFT from "mouse gobbledygook" to "Enter", so I asked here, but now that I know it's possible, I'll see if I have any better luck with my home (real) PC.
u_rebelscum:
--- Quote from: Tiger-Heli on April 26, 2007, 04:03:44 pm ---My work, errmmmn test system does not like reading the mouse inputs at all.
I simplified my earlier response, but when I spun the mouse, my unmodified .cfg file looked like this:[snip]
When I tried to map an OR combination, it changed ROTATE LEFT from "mouse gobbledygook" to "Enter", so I asked here, but now that I know it's possible, I'll see if I have any better luck with my home (real) PC.
--- End quote ---
--- Quote from: u_rebelscum on April 26, 2007, 01:34:38 am ---Works fine on my laptop, except if I try to map a normal mouse or touchpad X axis for example, the Y axis is included with lots of NOT or ORs or ANDs. Hand editing the cfg file gets rid of the extra Y axis junk.
--- End quote ---
Your example has 15 words per input: the max is 16, and to add a button, you need "OR" & the button. If the number words goes above 16, mame drops the old settings and just goes with the new. And 15+2 = 17 > 16, so that's why you lose the mouse inputs. Did you try it in the order in my reply (key first then mouse)? Does it make a difference? (I ask because I usually only get between half to one dozen words when remapping a mouse axis to a digital input, so either order usually works for me.)
Tiger-Heli:
Thanks Robin - it was much easier to configure on my home system.
The game that I wanted this for was Pirates. It is supposed to be a joystick game, but the code is a pretty obvious rip of CABAL (the bootleg of CABAL is joystick-based) so I wanted it to play like a trackball game. It works much better that way, but it makes it a bit too easy.
The code I used allows me to work with my home desktop computer. The arrow keys or my joystick control panel can also be used. Or for a quick one player game, I can use the PC mouse (Mouse 1) or for a more serious game my PC USB trackball (Mouse 2) or for a serious 2-player game, Player 1 on the first PC trackball and Player 2 on the second PC trackball (Mouse 3).
Also, I swapped buttons 2 and 3 b/c MAME has 2 as "duck and roll" and 3 as "Grenade" and I thought that was backwards, at least compared to CABAL.
Here's the .cfg file:
--- Code: ---<?xml version="1.0"?>
<!-- This file is autogenerated; comments and unknown tags will be stripped -->
<mameconfig version="10">
<system name="pirates">
<input>
<port type="P1_JOYSTICK_UP" mask="1" index="1" defvalue="1">
<newseq type="standard">
KEYCODE_UP OR MOUSECODE_1_Y_NEG OR MOUSECODE_2_Y_NEG
</newseq>
</port>
<port type="P1_JOYSTICK_DOWN" mask="2" index="2" defvalue="2">
<newseq type="standard">
KEYCODE_DOWN OR MOUSECODE_1_Y_POS OR MOUSECODE_2_Y_POS
</newseq>
</port>
<port type="P1_JOYSTICK_LEFT" mask="4" index="3" defvalue="4">
<newseq type="standard">
KEYCODE_LEFT OR MOUSECODE_1_X_NEG OR MOUSECODE_2_X_NEG
</newseq>
</port>
<port type="P1_JOYSTICK_RIGHT" mask="8" index="4" defvalue="8">
<newseq type="standard">
KEYCODE_RIGHT OR MOUSECODE_1_X_POS OR MOUSECODE_2_X_POS
</newseq>
</port>
<port type="P1_BUTTON1" mask="16" index="5" defvalue="16">
<newseq type="standard">
KEYCODE_LCONTROL OR MOUSECODE_1_BUTTON1
</newseq>
</port>
<port type="P1_BUTTON2" mask="32" index="6" defvalue="32">
<newseq type="standard">
KEYCODE_SPACE OR MOUSECODE_1_BUTTON3
</newseq>
</port>
<port type="P1_BUTTON3" mask="64" index="7" defvalue="64">
<newseq type="standard">
KEYCODE_LALT OR MOUSECODE_1_BUTTON2
</newseq>
</port>
<port type="P2_JOYSTICK_UP" mask="256" index="9" defvalue="256">
<newseq type="standard">
KEYCODE_R OR MOUSECODE_3_Y_NEG
</newseq>
</port>
<port type="P2_JOYSTICK_DOWN" mask="512" index="10" defvalue="512">
<newseq type="standard">
KEYCODE_F OR MOUSECODE_3_Y_POS
</newseq>
</port>
<port type="P2_JOYSTICK_LEFT" mask="1024" index="11" defvalue="1024">
<newseq type="standard">
KEYCODE_D OR MOUSECODE_3_X_NEG
</newseq>
</port>
<port type="P2_JOYSTICK_RIGHT" mask="2048" index="12" defvalue="2048">
<newseq type="standard">
KEYCODE_G OR MOUSECODE_3_X_POS
</newseq>
</port>
<port type="P2_BUTTON2" mask="8192" index="14" defvalue="8192">
<newseq type="standard">
KEYCODE_Q
</newseq>
</port>
<port type="P2_BUTTON3" mask="16384" index="15" defvalue="16384">
<newseq type="standard">
KEYCODE_S
</newseq>
</port>
</input>
</system>
</mameconfig>
--- End code ---
--- Quote from: u_rebelscum on April 26, 2007, 06:59:25 pm ---Your example has 15 words per input: the max is 16, and to add a button, you need "OR" & the button. If the number words goes above 16, mame drops the old settings and just goes with the new. And 15+2 = 17 > 16, so that's why you lose the mouse inputs.
--- End quote ---
Wow - I never would have realized that!!!
--- Quote --- Did you try it in the order in my reply (key first then mouse)?
--- End quote ---
Not on the work computer. I did try that on the home computer, although on the home computer - I basically ended up spinning ANY mouse to get the directionals assigned to something other than default (so they showed up in the pirates.cfg file) and then hand-editing the file to what I wanted (once I could see how the format was structured).
--- Quote --- Does it make a difference? (I ask because I usually only get between half to one dozen words when remapping a mouse axis to a digital input, so either order usually works for me.)
--- End quote ---
I'm not sure if it would have made a difference or not. Now that you explained the problem, I think I might have ended up with only the button input if I moved the mouse first, and only the mouse gobbledy-gook if I input the button first.
Although I think you hit it correctly with your initial reply:
--- Quote ---You have to spin it fast and far enough within the second or so you have to remap. (But not too fast so you get back spin. ) Very much like remapping any mouse axis to a normal analog axis (which seems to work easier on some systems than others).
--- End quote ---
At first, I was not spinning it fast enough to register, so nothing was added.
Spin it too FAR and you get MOUSECODE_1_X_POS MOUSECODE_1_X_POS MOUSECODE_1_X_POS ...
Spin it too fast or not quite in a straight line, and you get all the NEG inputs, NOT codes, and Y-Axis stuff.
With practice on the home computer, I actually got it to register correctly "MOUSECODE_3_Y_NEG" only ONCE, and I suspect experience explains why you only got about 6 words and I was getting 15.
Since we're looking at curiosity things, do you have any idea what the various
--- Code: ---mask="16384" index="15" defvalue="16384"
--- End code ---
etc. values mean?
u_rebelscum:
--- Quote from: Tiger-Heli on April 27, 2007, 07:52:08 am ---Thanks Robin - it was much easier to configure on my home system.
The game that I wanted this for was Pirates. It is supposed to be a joystick game, but the code is a pretty obvious rip of CABAL (the bootleg of CABAL is joystick-based) so I wanted it to play like a trackball game. It works much better that way, but it makes it a bit too easy.
--- End quote ---
I'll have to try that game. I tested on scrolling games (rastan) and control wasn't good.
--- Quote ---
--- Quote ---You have to spin it fast and far enough within the second or so you have to remap. (But not too fast so you get back spin. ) Very much like remapping any mouse axis to a normal analog axis (which seems to work easier on some systems than others).
--- End quote ---
At first, I was not spinning it fast enough to register, so nothing was added.
Spin it too FAR and you get MOUSECODE_1_X_POS MOUSECODE_1_X_POS MOUSECODE_1_X_POS ...
Spin it too fast or not quite in a straight line, and you get all the NEG inputs, NOT codes, and Y-Axis stuff.
With practice on the home computer, I actually got it to register correctly "MOUSECODE_3_Y_NEG" only ONCE, and I suspect experience explains why you only got about 6 words and I was getting 15.
--- End quote ---
That makes sense. But to be able to hit the speed perfectly? :notworthy:
--- Quote ---Since we're looking at curiosity things, do you have any idea what the various
--- Code: ---mask="16384" index="15" defvalue="16384"
--- End code ---
etc. values mean?
--- End quote ---
Index is which number of the input "port" in the driver's input port input list.
Mask is which bit (or bits which analog) is changed.
Defvalue is the default value if nothing is pushed. (for digital single bit inputs, it's either the same as mask ("active low") or zero ("active high"); spinner & trackball have no (zero) default; analog joystick & lightgun usually default in the center of the range; pedals are usually the mask or zero)
They are game specific, and ignored if copied into default.cfg or a ctrlr file.
Example from marble madness:
snip from cfg/marble.cfg:
--- Code: ---<port type="P1_TRACKBALL_X" mask="255" index="1" defvalue="0">
<port type="P1_TRACKBALL_Y" mask="255" index="3" defvalue="0">
<port type="P2_TRACKBALL_X" mask="255" index="5" defvalue="0">
<port type="P2_TRACKBALL_Y" mask="255" index="7" defvalue="0">
<port type="START1" mask="1" index="9" defvalue="1">
<port type="START2" mask="2" index="10" defvalue="2">
<port type="COIN1" mask="1" index="21" defvalue="1">
<port type="COIN2" mask="2" index="22" defvalue="2">
<port type="COIN3" mask="4" index="23" defvalue="4">
--- End code ---
snip from /src/mame/drivers/atarisy1.c:
--- Code: ---INPUT_PORTS_START( marble )
0 PORT_START /* F20000 */
1 PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) ... PORT_PLAYER(1)
2 PORT_START /* F20002 */
3 PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) ... PORT_PLAYER(1)
4 PORT_START /* F20004 */
5 PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) ... PORT_PLAYER(2)
6 PORT_START /* F20006 */
7 PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) ... PORT_PLAYER(2)
8 PORT_START /* F60000 */
9 PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_START1 )
10 PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_START2 )
11 PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_UNUSED )
12 PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNUSED )
13 PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_VBLANK )
14 PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED )
15 PORT_SERVICE( 0x0040, IP_ACTIVE_LOW )
16 PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_SPECIAL )
17 PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED )
...
--- End code ---
Notice the index # matches the number I added to the driver code, the mask = the hex number right after "PORT_BIT( ####" except in decimal.