mamedev / mame

MAME
https://www.mamedev.org/
Other
8.06k stars 2.01k forks source link

MAME XML: missing mouse buttons #11693

Closed ghost closed 11 months ago

ghost commented 11 months ago

MAME version

.260

System information

Ubuntu 23.10 AMD Ryzen Threadripper PRO 7995WX Corsair 128 GB DDR5 RAM 16 TB SSD (4 x 990 PRO PCIe 4.0 NVMe M.2 SSD 4 TB RAID-0)

INI configuration details

N/A

Emulated system/software

N/A

Incorrect behaviour

When looking at mame -listxml, I found many computers/game consoles that use a mouse, having no mouse buttons defined in the XML. A mouse without any buttons seems weird to me :)

An example with defined mouse buttons of ROM x68000. As you can see buttons="2" is present.

`

        <control type="keyboard" player="1" buttons="112" />
        <control type="joy" player="2" buttons="2" ways="8" />
        <control type="joy" player="3" buttons="2" ways="8" />
    </input>`

Following ROMs don't have the buttons present but all of the mice used for these computers have buttons. So they are all missing in the XML

Here are the ROMs missing mouse buttons (machine name and ROM between brackets):

Amstrad computers:

Example mouse: https://www.cpcwiki.eu/index.php/AMX_Mouse

Aleste 520EX (al520ex) Amstrad CPC464 (cpc464) Amstrad CPC464+ (cpc464p) Amstrad CPC6128 (cpc6128) Amstrad CPC6128 (France, AZERTY Keyboard) (cpc6128f) Amstrad CPC6128 (Spain) (cpc6128sp) Amstrad CPC6128 (Sweden/Finland) (cpc6128s) Amstrad CPC6128+ (cpc6128p) Amstrad CPC664 (cpc664) KC Compact (kccomp)

Mostly Amiga computers:

Example mouse: https://www.amiga-shop.net/en/Amiga-Hardware/Amiga-classic-hardware/TheMOUSE-Amiga-tank-mouse::1124.html

Amiga 1000 (NTSC) (a1000n) Amiga 1000 (PAL) (a1000) Amiga 1200 (NTSC) (a1200n) Amiga 1200 (PAL) (a1200) Amiga 2000 (NTSC) (a2000n) Amiga 2000 (PAL) (a2000) Amiga 3000 (NTSC) (a3000n) Amiga 3000 (PAL) (a3000) Amiga 4000/030 (NTSC) (a400030n) Amiga 4000/030 (PAL) (a400030) Amiga 4000/040 (NTSC) (a4000n) Amiga 4000/040 (PAL) (a4000) Amiga 4000T (NTSC) (a4000tn) Amiga 4000T (PAL) (a4000t) Amiga 500 (NTSC) (a500n) Amiga 500 (PAL) (a500) Amiga 500 Plus (NTSC) (a500pn) Amiga 500 Plus (PAL) (a500p) Amiga 600 (NTSC) (a600n) Amiga 600 (PAL) (a600) Amiga CD32 (NTSC) (cd32n) Amiga CD32 (PAL) (cd32) Amstrad PC1512 mouse (pc1512_mouse) Atari ST Keyboard/Mouse/Joystick (st_kbd) CDTV (NTSC) (cdtvn) CDTV (PAL) (cdtv) Falcon030 (falcon30) Falcon040 (prototype) (falcon40) MEGA ST (France) (megast_fr) MEGA ST (Germany) (megast_de) MEGA ST (Sweden) (megast_se) MEGA ST (Switzerland) (megast_sg) MEGA ST (UK) (megast_uk) MEGA ST (USA) (megast) MEGA STe (France) (megaste_fr) MEGA STe (Germany) (megaste_de) MEGA STe (Italy) (megaste_it) MEGA STe (Spain) (megaste_es) MEGA STe (Sweden) (megaste_se) MEGA STe (UK) (megaste_uk) MEGA STe (USA) (megaste) PC1512 DD (pc1512dd) PC1512 HD10 (pc1512hd10) PC1512 HD20 (pc1512hd20) PC1512 SD (pc1512) PC1640 DD (pc1640dd) PC1640 HD20 (pc1640hd20) PC1640 HD30 (pc1640hd30) PC1640 SD (pc1640) ST (France) (st_fr) ST (Germany) (st_de) ST (Netherlands) (st_nl) ST (Spain) (st_es) ST (Sweden) (st_se) ST (Switzerland) (st_sg) ST (UK) (st_uk) ST (USA) (st) STe (France) (ste_fr) STe (Germany) (ste_de) STe (Italy) (ste_it) STe (Spain) (ste_es) STe (Sweden) (ste_se) STe (Switzerland) (ste_sg) STe (UK) (ste_uk) STe (USA) (ste) TT030 (France) (tt030_fr) TT030 (Germany) (tt030_de) TT030 (Poland) (tt030_pl) TT030 (UK) (tt030_uk) TT030 (USA) (tt030)

Recently added Casio Loopy:

Example mouse: https://en.wikipedia.org/wiki/Casio_Loopy#/media/File:Casio_Loopy_With_Magical_Shop_And_Mouse.jpg

Loopy (casloopy)

Acorn computers and N64:

Example mouse: https://chrisacorns.computinghistory.org.uk/32bit_UpgradesA2G/Acorn_MouseType2.html N64 mouse: https://nintendo.fandom.com/wiki/Nintendo_64_Mouse?file=N64_mse.jpg

Acorn A3010 (aa3010) Acorn A3020 (aa3020) Acorn A4 (aa4) Acorn A4000 (aa4000) Acorn A500 2nd Processor (bbc_tube_a500) Acorn A500 Development System (aa500) Acorn A500 Domesday Development System (aa500d) Acorn A5000 (aa5000) Acorn A5000 Alpha (aa5000a) Acorn A680 UNIX Evaluation System (aa680) Acorn Archimedes Keyboard (archimedes_keyboard) Acorn M4 (am4) Acorn R140 (ar140) Acorn R225 (ar225) Acorn R260 (ar260) Archimedes 305 (aa305) Archimedes 310 (aa310) Archimedes 410/1 (aa4101) Archimedes 420/1 (aa4201) Archimedes 440 (aa440) Archimedes 440/1 (aa4401) Archimedes 540 (aa540) BBC A3000 (aa3000) Nintendo 64 (NTSC) (n64) Nintendo 64 (PAL) (n64pal) Nintendo 64DD (n64dd)

I thought I report it here so you can have a look. Are they forgotten or what happened? All drivers work, it's just the missing information in the XML.

Expected behaviour

I would expect mice that have buttons should have their buttons defined in the correct XML attribute of the control tag with type mouse. But unfortunately many computers are missing this attribute.

Steps to reproduce

No response

Additional details

No response

galibert commented 11 months ago

We do not have the concept of mouse buttons, only mouse axis. In fact our buttons are not associated to anything, we just put "joy" there because we need to put something. Some of what you see as joystick buttons are in fact the mouse buttons.

ghost commented 11 months ago

Why is in the mouse XML of ROM x68000 then written buttons="2" , as like in many other mice of many many machines? So why is it not used in the machines above, but in a lot of others? (so there are much more machines having the buttons present then machines that DON'T have it present)

<control type="mouse" player="1" buttons="2" minimum="0" maximum="255" sensitivity="100" />

Sorry, I don't understand your explanation because I find many buttons for mouse XML tags, but not for those specific machines I listed.

Why are they used then if they are not associated with anything and why are they used in most of the machines but not in the ones I listed? I would expect to find no buttons for mouse XML tags when I read your explanation, but that's not the case.

galibert commented 11 months ago

That's because there's a heuristic that tries to attach them to something. For instance the ST has both joystick and mouse for player 1, and the definition of the joystick directions happen to be before the one for the mouse axis, so the joystick gets the buttons. The x68000 does not have joystick axis in the first place, so the mouse wins on that one. Where it comes to buttons only the player number is significant.

ghost commented 11 months ago

But in case frontends will ever read this information (to make input control filters based on number of buttons, ... of each control) then it can be wrong since the buttons can be attached/not attached to a device that does/does not have them in real life (see my examples above: many mice without buttons that actually don't exist). So then my final question: why is this by heuristics generated information exported in the XML, while the XML serves as a information file for frontends, who assume the information is close to the real hardware?

Is it maybe better to assign buttons to a device manually so it matches the real world device? (for joystick and mice)

cuavas commented 11 months ago

The information on I/O ports in the XML has always just been “informative” in the sense that it gives a general idea of the types of inputs a device/system has. It’s useful for queries like “show me all the systems with trackball controls”, but not much more than that. Trying to use it to automatically set input assignments or something will never work well because it simply doesn’t give you all the information you need for that.

galibert commented 11 months ago

And the extra point is that the information is currently not in Mame, and infrastructure is missing if we ever wanted to add it.

MooglyGuy commented 11 months ago

JJ.

ghost commented 11 months ago

It’s useful for queries like “show me all the systems with trackball controls”, but not much more than that. Trying to use it to automatically set input assignments or something will never work well because it simply doesn’t give you all the information you need for that.

IMHO it's better not to provide wrong information. So better not use "buttons" in a device that maybe doesn't have them or the other way that's missing those buttons (but not in real life). But I understand now what the reason is and how we must look at the information! Closed.