Main > Main Forum

Official Mame and remapping Mice

<< < (2/3) > >>

u_rebelscum:

--- Quote from: Howard_Casto on August 18, 2004, 08:06:51 am ---My Findings:

ctrlr sequence is as follows

MOUSECODE_#_ANALOG_##

Where #= the mouse number and ## = the axis
--- End quote ---

Yup.  The complete list of standard names is in src/input.h, lines 37-433 (397-420 the mouse axis codes).

Note that the axis can only be X or Y, ATM.  Aaron has hints in the source code that the mouse's Z axis (scroll wheel) will be added later.


--- Quote ---It works great for analog axis as mame knows to split the axis into two seperate directions.  On digital inputs, however it gets really confused and can't use them.  I tried it on pacman just for fun.  It appears that the  codes crash the input macro as when i went into the input settings in mame p1_joystick_left was shown to be mapped to "mouse 1 X" but the other 3 directions came up as "NONE".  

I believe there must be similar codes to the old-school "P1_JOYCODE_1_UP" flags used in mame to split an axis into two directions,  I just haven't found them yet.  


Rebel if you can help me figure out this mess it would be appreciated.  This is useful info for the controls.dat project.  :)
--- End quote ---

Okay.  Lots of info at the top of src/inptport.c source file, but here's some basics:

Three OSD inputs (aka physical devices):
digital, absolute analog, & relative analog

Three game inputs (aka emulated inputs, aka mame input types):
digital, absolute analog, & relative analog

So nine OS --> game input combos:
OSD inputGame Inputdigital -->digital :)digital -->Absolute Analogsimulated, coredigital -->Relative Analogsimulated, coreAbsolute Analog -->digitalsimulated (well in official mame), OS Dendent*Absolute Analog -->Absolute Analog :)Absolute Analog -->Relative Analognot directly supported**Relative Analog -->digitalnot directly supported***Relative Analog -->Absolute Analogsimulted well, coreRelative Analog -->Relative Analog :)
* Mame windows OS code sees a joystick's axis as three inputs: Analog, simulated digital (positive direction), simulated digital (negative direction).

**Official mame indirectly supports this, through Digital --> Relative analog.  The absolute analog input needs to be "converted" to digital in the OS code.

***This is what you're having problems with.  Mame isn't designed to do the conversion.  It might be possible to add this in couple different ways.


Note 1: From table above, Mame might be able to use OSD lightgun to Game digital input.  Looks like it's probably only in pulses, though, since that's how the lightgun works.

Note 2: Mame doesn't split a relative analog axis into two directions.  Absolute analog axes aren't split in two directions unless it's converted to digital inputs, which is done on the OS level.

Note 3: An analog axis doesn't have two directions when it's seen as analog.  It just has one value for the axis.  

Howard_Casto:
Inteesting.....

by chance you haven't played with the guncodes and newer analog joystick codes have you?

I'm sure they work, but I'm more interested in how they work.  For example, there are now 3 pedal joycodes.  Afaik directx doesn't label axis this way, or do they?  I don't use a lot of crazy directx controllers so i'm just asking.  

Also the guncodes, is there a way to tell an actlabs gun from a regular mouse?  If not then wouldn't the guncodes also effect mouse mappings? (Of course only if the lightgun is turned on, so maybe I answered my own question).  

jerryjanis:

--- Quote from: Howard_Casto on August 19, 2004, 08:37:52 pm ---Is there a way to tell an actlabs gun from a regular mouse?
--- End quote ---

I don't know about DirectX, but when a rawmouse message is received, it reports whether the device uses relative (mouse) mode or absolute (lightgun/touchscreen) mode, so it was possible to tell an act labs gun from a regular mouse in that way.  The weird thing was that I had no way of knowing what kind of device it was until after it gave me some kind of feedback (either a mousebutton or mousemove).

u_rebelscum:

--- Quote from: Howard_Casto on August 19, 2004, 08:37:52 pm ---Inteesting.....

by chance you haven't played with the guncodes and newer analog joystick codes have you?

I'm sure they work, but I'm more interested in how they work.  For example, there are now 3 pedal joycodes.  Afaik directx doesn't label axis this way, or do they?  I don't use a lot of crazy directx controllers so i'm just asking.  
--- End quote ---

You're mixing mame's internal names with directX directInput names.  

Mame has a internal generic names for button1, joyup, analog_Y, pedal1, lightgunY, ect  (JOYCODE_1_BUTTON1, JOYCODE_1_UP, JOYCODE_1_ANALOG_Y, JOYCODE_1_ANALOG_PEDAL1, GUNCODE_1_ANALOG_Y).  These are the "STANDARD_CODE_STRING" name.

It's the OSD code's job to assign input devices to these names.  AFAICT mame 0.85u2 does not assign anything to the generic JOYCODE_#_ANALOG_PEDAL# pedal names, but I can't test here at work.


DirectInput can name any input whatever it wants.  You see this mostly on "start" and "select" buttons.  They still have a number, but also have a function name.

Mame also can read OS specific names.  When you have a 14 button gamepad, the buttons 11-14 must be called by the OS specific name, much like before.

Stuff that are assigned to a generic name can be called by either that or the OS specific name.  So in cfg and crlr files, mouse 1 Y axis can be "MOUSECODE_#_ANALOG_##" or (with my system) "Mouse_#_##".


--- Quote ---Also the guncodes, is there a way to tell an actlabs gun from a regular mouse?  If not then wouldn't the guncodes also effect mouse mappings? (Of course only if the lightgun is turned on, so maybe I answered my own question).  
--- End quote ---

In Dinput 8.0 and later, yes, but depends on the driver.  I'll need to check dInput 7.0 (the one mame uses) when I get home.  AFAICT, mame doesn't figure out mouse vs gun inputs, but I don't think that's right. ???

Howard_Casto:
No i'm not confused believe it or not.  I am aware that mame uses both directx "labels" as well as it's own labels that it gives to certain indentifiable axis and buttons.  

What I was getting at is I'm almost positive that directx controllers don't use said labels.  So then how is mame choosing which analog axis is a "pedal"  these constants are listed in the source so either they are useless (which means somebody needs to comment them out) or they are magical in that I don't have  aclue how they are working.  

I am concluding basically what you are with the mouse vs lightgun inputs.  My guess is analog Z and pedal 1 are one in the same, in which case we have some redundant constants which might be confusing in the future.  

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version