Commit Graph

69 Commits

Author SHA1 Message Date
Vas Crabb
77d4cc3475 Cleaned up the mess from #12610:
* Command line options need to be documented.
* Don't assume C strings returned as option values remain valid
  indefinitely.
* Fixed wording for option description.
2024-08-27 04:17:23 +10:00
Vas Crabb
64834145ae -osd: Update slider list on demand rather than on frame updated (fixes MT08857).
-konami/konamigq.cpp: No need to cancel a newly allocated timer.
2024-04-27 04:42:12 +10:00
Vas Crabb
f91b896cda input/input_sdl.cpp: Added an SDL lightgun provider.
This does essentially the same thing as the Win32 lightgun provider,
mapping the absolute pointer position over the window to gun axes.

Also added a bunch of const in the windows input handling code.

docs: Bumped version, as features that are not in a releaesd version of
MAME are now documented.
2024-04-26 06:26:22 +10:00
Vas Crabb
4ddd26fe21 Initial touch input support:
* Feed mouse/pen/touch pointer events through UI input manager with Win32 and SDL.
* Started migrating UI code to use new API and reworking mouse/touch interaction.
* emu/render.cpp: Support pressing multiple clickable layout items simultaneously.
* emu/render.cpp: Allow UI elements to be drawn in any window.
* emu/rendlay.cpp, luaengine_render.cpp: Added layout view events for pointer input.
* ui/ui.cpp: Allow the UI handler to control pointer display.
* ui/analogipt.cpp: Added mouse/touch and more keys for navigating field state list.
* ui/menu.cpp: Use vertical swipe to scroll and horizontal swipe to adjust.
* ui/menu.cpp: Draw after processing input - greatly improves responsiveness.
* ui/menu.cpp: Ignore keyboard/gamepad input during pointer actions.
* ui/selmenu.cpp: Made left/right info pane arrows repeat when held.
* ui/selmenu.cpp: Use middle click to move keyboard focus.
* ui/selmenu.cpp: Let filter list scroll if it's too tall, and use a bit of horizontal padding.
* ui/selmenu.cpp: Improved divider sizing.
* ui/state.cpp: Don't allow clicks to pass through the confirm deletion prompt to the menu.
* ui/simpleselgame.cpp: Fixed error message display and graphics/sound status not showing.
* ui/simpleselgame.cpp: Allow tap/click to dismiss error message.
* ui/utils.cpp: Show UI for choice filters when there are no choices - it's less confusing.
* modules/input/input_sdl.cpp: Made scaling for mouse scroll better match RawInput and DirectInput.
* modules/input/input_rawinput.cpp: Added support for horizontal scroll axis.
* modules/input/input_win32.cpp: Added support for scroll axes and more buttons to mouse/lightgun.
* modules/debugger/debugimgui.cpp: Don't fight over events with the UI manager - it breaks menus.
* osd/windows/window.cpp: Translate mouse position to window cooridinates for scroll wheel events.
* osd/sdl/window.cpp: Supply last mouse position for scroll wheel events if possible.
* scripts/build/complay.py: Made zero input mask an error - it was only being used to block clicks.
2024-04-12 02:49:15 +10:00
Vas Crabb
9626b93a41 Fixes and cleanup:
roland/roland_d70.cpp: Use object finders, use memory shares rather than
ram_device, fixed Endianness bugs, fixed bad indentation, fixed
double-qualified member functions, use m_ prefix consistently for
members, use lowercase hex digits, don't allow writes to ROM, fixed
header #include order.

docs: Corrected docmented default for ui_mouse option.

tektronix/tek440x.cpp: #include local headers first, etc.

bus/a2bus/snesmax.h: Fixed copy/pasted comment.

yamaha/ympsr2000.cpp: Put code in an anonymous namespace.
2024-03-12 04:47:09 +11:00
Angelo Salese
7c67c1b2da
docs: Fixed typo in -wavwrite option example. (#11919) 2024-01-09 05:22:38 +11:00
Firehawke
09be4295de
docs: Fixed documentation compilation warning. (#11586)
Fixes a title underline too short warning.
2023-10-01 13:10:30 +11:00
Tom Cariello
30d92e397d
docs: Fixed many editing errors and spelling errors. (#11575)
Also fixed outdated link to contributing guidelines.
2023-09-29 00:41:31 +10:00
Vas Crabb
82394e8569 Adjustments to option priority interactions:
emu/sound.cpp: Made -volume in source file INI or higher priority
context take precedence over volume read from CFG file.  This matches
behaviour of -bgfx_screen_chains.

emu/input.cpp: Made explicit -no{mouse|joystick|lightgun} take
precedence over -{mouse|trackball|adstick|paddle}_device etc. from lower
priority levels.

Alos got rid of a bunch of unnecessary simple_list.
2023-05-09 01:49:41 +10:00
Vas Crabb
b06dae9201 clifront.cpp: Changed -listbios to work more like -listslots, showing all BIOS options in a system. 2023-04-10 06:34:35 +10:00
Vas Crabb
f3850d1e3c Cleaned up some recent changes. 2023-02-04 03:25:01 +11:00
Vas Crabb
43e30203bd docs: Clarified documentation of input options.
Made explanation of interaction between device class enable options
(-[no]mouse, -[no]joystick, -[no]lightgun) and automatic device class
enable options (-*_device) more explicit.  Also documented that
-mouse_device mouse is set by default in both relevant places.

Provided a better explanation of the purpose of -dual_lightgun.
2023-02-03 04:27:40 +11:00
Vas Crabb
68472d3d72 Various input and OSD refactoring:
osd: Supply OSD object to modules on initialisation.  Encapsulated some
event handling in the OSD objects rather than leaving it in free
functions.  Put various stuff in namespaces.

osd/modules/input: Enabled dinput, xinput and winhybrid modules for
Windows SDL builds, and enabled background input for dinput and xinput
(and by extension winhybrid) modules.  Also fixed some COM and X11
resource leaks.

osd/modules/input/input_sdl.cpp: Flipped SDL mouse button order to match
Windows, and exposed vertical and horizontal scroll as Z and rZ axes.
Moved SDL UI event handling out of input devices into OSD object.

osd/modules/input_rawinput.cpp: Changed lightgun Z axis token so it's
correctly identified as a relative axis (it maps to the scroll wheel
equivalent).

osd: Added an option to choose the network provider module.  Mostly
useful if you build with both TUN/TAP and pcap support included, or if
you want to disable emulated networking completely.

emu/input.cpp: Use a better strategy for assembling input code names
that uses fewer temporary strings and doesn't require use of the
non-Unicode-aware space trimming function (fixes MT08552).

osd/modules/input_dinput.cpp: Improved polling logic.

osd: Made various parts of the input code less dependent on concrete emu
objects, and reduced inappropriately passing around the machine object.
Made input modules less dependent on OSD implementation.  Encapsulated
some stuff and got rid of some vestigial newui and SDL1 support code.
Cleaned up some interfaces.  Moved OSD options classes to their own
files.

Prepare to remove main.h from emu.h - it's mostly used to get the
application name, which the vast majority of emulated devices don't need
to do.
2023-01-29 03:16:14 +11:00
Vas Crabb
2498f2b7cf Miscellaneous fixes and refactoring:
ui/analogipt.cpp: Fixed bar graph display for fields with ranges
that wrap through zero.

emu/inputdev.cpp: Separateed analog axis deadzone and switch threshold
settings, reduced default deadzone, and fixed a potential division by
zero if the deadzone and saturation settings are equal.

emu/ioport.cpp: Fixed behaviour of absolute analog fields where range
passes through zero - it previously only worked for specific
combinations of mask, minimum and default.  Removed a workaround from
universal/getaway.cpp that is no longer necessary.

emu/input.cpp: Fixed unintuitive behaviour when an absolute field is
assigned an OR combination of a relative control folled by an absolute
control (e.g. Mouse X or Joy 1 LSX).  Also fixed reading axis input
sequences where an axis code is followed by a switch code (these can
only be produced by manually editing configuration files, not through
MAME's UI), and fixed the returned type when multiple relative axes sum
to zero.

osd/modules/input_dinput.cpp: Fixed hat switches being stuck in up
position when input is suspended in the background

taito/taitoio_yoke.cpp: Give throttle control a distinct type, and don't
auto-centre.

osd: Added option to select MIDI provider module (currently only
PortMidi and the dummy module are available).  Also put various things
in namespaces, and fixed builds including SDL sound module with native
Windows OSD.

emu/validity.cpp: Added check to catch I/O port fields using UI input
types.

emu/inpttype.ipp: Renamed inputs that were causing confusion.  "Bill"
and "Track" were causing confusion for translators and hence likely
causing confusion for many users, especially those who are not native
English speakers.  "Track" as an abbreviation for "Trackball" was
frequently being mistranslated, e.g. in the sense of a CD track
selection button or even in the sense of a railway track.  There's no
reason to abbreviate it.  "Bill" in the US English sense as a banknote
is too ambiguous and was causing confusion for translators.  It's better
to use the less ambiguous "Banknote".  Corrected Greek translations of
"Trackball".

Don't run GitHub Actions on issue template changes.
2023-01-28 08:16:53 +11:00
AJR
5087e6c2f9 Add -listbios command to list alternate BIOSes for drivers and devices 2023-01-24 21:00:08 -05:00
Vas Crabb
2592ac32c1 osd: Added option to accept SDL game controller/joystick input when losing UI focus. 2023-01-14 15:57:22 +11:00
Vas Crabb
5c4dcb3016 docs: Updated default joystick providers. 2023-01-14 07:10:21 +11:00
Vas Crabb
bf2707f4c7 osd: Added support for mapping files to sdlgame joystick provider and made it default with SDL.
This changes behaviour, however I think it's a net positive:
* Most games using Steam Input or SDL2 to read game controllers have
  this behaviour, so users have come to expect it.
* This module is better at giving meaningful names to buttons on
  common controller, and assigning axes consistently.
* Button/axis mapping files using a widely-used format are supported.
* The old behaviour is still available with `-joystickprovider sdljoy`
  if anyone wants it.

The new option for controller mapping files is in the general OSD
options rather than SDL options as it can be extended to DirectInput in
the future.
2023-01-14 03:13:59 +11:00
Vas Crabb
fee7047c16 -osd: Better XInput and SDL game controller input enhancements:
* Added initial support for XInput controller subtypes, starting with
  driving, arcade and flight controllers.
* Check XInput capabilities to ignore buttons and hats that aren't
  present.
* Added preliminary SDL Game Controller joystick provider.  Reconnection
  and mixed Game Controller/Joystick devices are unsupported.
* Show the input token for the highlighted control on input device
  menus.

-ui: Allow menus to set required space above and below menu when metrics
change.  Fixes the initial bad layout on the system selecton menu, or
bad layout after resizing windows.
2023-01-12 18:14:13 +11:00
Vas Crabb
b80b4066bf osd/sdl: Removed keyboard/mouse/joystick device mapping options.
The keyboard and mouse device mapping options did nothing at all, mostly
because of lack of support for separating inputs from multiple devices.

The joystick options were useless when you have two of the same kind of
controller, and you can achieve the same thing with controller
configuration files.
2022-07-15 15:16:33 +10:00
Vas Crabb
422185fe55 docs: Added page describing how MAME searches for media.
Also made error messages for missing CHDs and missing files for software
parts using the image file loader show search paths, and changed the
(poorly named) bitbanger device to use the image file loader rather than
the ROM loader for software items.
2022-03-10 02:55:40 +11:00
Vas Crabb
cb16512392 Clean up various loose ends:
frontend: Exposed debug symbol tables and parsed expressions to Lua
(these can be used when the debugger is not active).  Also made it
simpler to walk input types.

imagedev/bitbngr.cpp: Added software list loader support (used by
sitcom).

sitcom.cpp: Replaced bankdev with a memory view.  Also added a bar graph
for the timer DAC output, and made the DL1414 displays squarer in the
layout like they are in real life.  They still don't look right because
the internal segment drawing code doen't draw the segments the right
width.

docs: Fixed broken links and added missing links in command line options
index.  Also removed documentation for an option that no longer exists
and fixed some inconsistent terminology.

Separated includes by module in various drivers.
2022-02-03 09:00:23 +11:00
Vas Crabb
d29287e092 -emu/ioport.cpp: Made default behaviour better.
* If an input is configured to some combination of controls that are not
  present at all, ignore the setting altogether for the session.
* Fixed relative axes with PORT_RESET not responding to absolute
  controls (MT07685).
* Fixed relative axes not responding to an absolute control if the value
  doesn’t change every frame (eg. holding a stick against the stop).
* Changed the scaling for absolute controls assigned to relative axes to
  make defaults more sane (e.g. arkanoid or spdheat with a joystick).

-frontend: Fixed some localisation issues in Analog Controls menu.

-docs: Added documentation on assigning inputs.
2021-11-03 19:41:40 +11:00
Vas Crabb
d775a2731d plugins: Moved the timecode recording functionality to a plugin. 2021-11-02 15:31:03 +11:00
Vas Crabb
669b1f6ade -docs: Started documenting plugins.
* Also added a couple of missing command-line options, and added a local
  table of contents to the (rather long) command line options page.

-Added a separate CI target for localisation updates that produces an
 artefact, and removed the message catalogs from the trigger paths for
 the Linux CI build.
2021-10-24 05:48:05 +11:00
Vas Crabb
ca338f7372 Various improvements to the user experience:
Extended the memory access prefixes in debugger expressions to support
address space names.

Made the debugger history command aware of how much history it has
collected, and added a help topic for it to the built-in debugger help.

Started updating the documentation for the web site, and corrected some
of the more misleading built-in debugger help.

Made some corrections to Chinese localisation after discussion with
YuiFAN.

Darkened the UI red colour a little.

cpu/m6502/st2205u.h: Marked sound imperfect.
2021-10-13 10:59:38 +11:00
0kmg
4395d59216
emu/video.cpp: Set file names via -snapname when exiting in -seconds_… (#8633) 2021-09-30 16:22:43 -04:00
hap
9db8443a30 docs: explain compressor a bit again 2021-09-24 21:39:40 +02:00
hap
95bcb4551d docs: explain compressor a bit 2021-09-24 20:00:07 +02:00
hap
c9c3cac6c2 sound: make the compressor optional (clamp overdrive to -1.0-1.0 when off) 2021-09-24 19:40:10 +02:00
Vas Crabb
3715746131 API cleanups and miscellaneous fixes.
emu/ioport.cpp: Allow controller files to override input sequences for
inputs that don't use defaults, and to override the toggle setting for
digital inputs.

emu/config.cpp: Expose configuration level (mostly matters for
controller files), improved verbose diagnostic messages, and moved a few
things out of the global and preprocessor namespaces.

docs: Added documentation for some controller configuration file
features.  The device mapping feature documentation will be merged in at
some point.

util/unicode.cpp, emu/input.cpp: API cleanups.
2021-07-15 13:54:40 +10:00
Firehawke
7f84a651d7
Change "mame64" to "mame" in docs (#7709) 2021-01-29 00:59:06 +11:00
Vas Crabb
6ba369b3fc -docs update:
* Added note explaining that view options saved in machine CFG take
  precedence over INI/command line.
* Added prerequisites for building HTML documentation under MSYS2 and
  Fedora Linux.
* Explicitly mentioned that Ubuntu modifies GCC to enable "fortify
  source" by default in the relevant section.
* Removed obsolete reference to glibstdc++6.
* Re-formated compiling guide source (hard wrap at 80 columns,
  typographical quotes, code blocks for sample command lines).

-genie.lua: Show GCC ignored attribute warnings, but don't fail for
them.
2021-01-23 16:34:25 +11:00
Vas Crabb
ed872d1bd2 Fix some oversights and emergent behaviour with view selection.
Exposed the "native snapview" option on the video manager.  Trying to
use presence of a single view is a poor proxy that breaks with
multi-screen systems.

Allow rotation to be changed for native snapshot views, and disable the
zoom to screen area control when it has no effect on the selected view.

Treat an empty string identically to "auto" for view selectction.
Previously this was being used for prefix matching so it would force the
first view.  (This caused the bad snapshot view selection.  It had been
relying on "internal" not being a common view name prefix so it fell
through to automatic selection, but when changed to an empty string it
forced the first view.)

Documented "auto" as well as "native" for the -snapview option and
changed the default to auto rather than an empty string for consistency
with the -viewN options.

Added [w]string_view handlers to the stuff that's instantiated in
strformat.cpp since we'll be increasingly using them.

Cleaned up and updated some documentation.
2020-12-20 15:28:27 +11:00
Firehawke
d6a71a9db9
Remove VRR statement until it can be retested. 2020-09-17 19:06:43 -07:00
Firehawke
41f49b9afe
Fixed compilation of docs for HTML and manfiles. 2020-08-10 19:23:46 -07:00
Aaron Giles
01d5d49518 Documentation update for vector options. 2020-08-05 16:41:08 -07:00
Firehawke
584c471ff3
Documentation updates (#6825)
Documentation updates [Firehawke]
* Preliminary work on -joystick_map redesign
* Adjustments to phrasing for analog mapping
* Health warning text
2020-07-18 08:15:13 -04:00
Firehawke
7b6dbd7a14
First completed pass of commandline parameters. (nw) (#6711)
* First completed pass of commandline parameters. (nw)

* Further refinements on commandline (nw)

* Get the audio latency numbers right and add PortAudio info.

* FreeSync/GSync information cleanup.

* Minor additions to G-Sync/FreeSync.

* Add tip for keyboardprovider, remove biospath, correct anchor positioning (nw)

* A few corrections per Vas (nw)
2020-06-12 14:26:28 +10:00
Angelo Salese
a41616e6f7
dialong -> dialog (nw) 2020-01-30 15:58:51 +01:00
Firehawke
a10af356cc Update documentation (nw)
* Update MAME docs revision to 0.216
* Add FAQ question about autofire with walkthrough of setup process.
* Add VSCode .gitignore for RST compilation temporary folder (/docs/source/_build)
* Add a caveat about autofire+normal fire mapping
* Add -lowlatency to the docs.
2019-11-25 18:51:44 +11:00
Vas Crabb
c38a3395e9 Make layout format more flexible:
* There is no longer a concept of "layers" - there are only screens and elements.
* Elements are now instantiated with <element ref="...">
* Screens and elements can have explicit blending mode specified with blend="..."
* Default blending mode for screens is "add" and default for other elements is "alpha"
* Other supported modes are "none" and "multiply"
* This removes the options to enable/disable layers individually - use views instead
* Legacy layouts can still be loaded, and support won't be removed for at least a year

The current artwork model is over-stretched.  It's based on a Space
Invaders cabinet model, and isn't applicable to a lot of the systems
MAME emulates now.  The fact that MAME has to switch to an "alternate"
mode to deal with games like Golly! Ghost! without requiring pre-matted
bitmaps shows that the Space Invaders model wasn't even adequate for
general arcade use.  It shows in that for a lot of the systems that
heavily depend on artwork, people just seem to randomly choose layers
for elements until they get something that works.  Also, the fact that
MAME will switch to an alternate (Golly! Ghost!) mode depending on the
combination of elements is a trap for people learning to make artwork.

There are cases that the current approach of implying the blending mode
from the layer doesn't work with.  Examples include LEDs behind
diffusers (requires additive blending for layout elements), and mutliple
stacked LCD panels (requires RGB multiplication for screens).

For configurability, it's now a lot easier to make multiple views using
groups.  For example, if you want to make it possible to hide the
control panel section of your layout, you can put the control panel
elements in a group and create views with and without it.

I will gradually migrate the internal artwork to use the new approach.
I have an XSLT stylesheet that helps with this, but I'm not comfortable
adding it because it isn't a complete solution and it still requires
manul steps.

I wanted to get the re-worked pointer handling done sooner so I could
push them both at the same time, but unfortunately various things have
prevented me from progressing as quickly as I wanted to.  Sorry guys,
that stuff's going to have to wait.
2019-07-06 00:23:20 +10:00
Vas Crabb
97b6717027 (nw) Clean up the mess on master
This effectively reverts b380514764 and
c24473ddff, restoring the state at
598cd52272.

Before pushing, please check that what you're about to push is sane.
Check your local commit log and ensure there isn't anything out-of-place
before pushing to mainline.  When things like this happen, it wastes
everyone's time.  I really don't need this in a week when real work™ is
busting my balls and I'm behind where I want to be with preparing for
MAME release.
2019-03-26 11:13:37 +11:00
andreasnaive
b380514764 Revert "conflict resolution (nw)"
This reverts commit c24473ddff, reversing
changes made to 009cba4fb8.
2019-03-25 23:13:40 +01:00
AJR
b84397f786 Make -nonvram_save also inhibit saving of "battery" NVRAM for image devices 2019-02-19 20:47:39 -05:00
Vas Crabb
995ba92e83 update docs (nw) 2019-01-28 03:59:45 +11:00
Firehawke
ff8cda02cb Correct compilation packages (for #4507) and finish cleanup on previous docs updates. (nw) (#4509)
* Correct the compilation packages [partial for #4507] (nw)

* Minor corrections, joymap adjustments (nw)
2019-01-13 11:18:09 -05:00
Vas Crabb
4c444b2a00 more command line doc cleanup (nw) 2019-01-11 01:37:17 +11:00
Firehawke
9e3e966dea Major formatting update for command line options, copyright/version update (#4470)
* Update copyrights and docs revision (nw)

Updates copyright on existing 2018 entries to 2019 (and one 2016)
Updates the docs compilation script to MAME 0.205 and 2019 copyright.

* Further formatting overhauling (nw)

Clamp to 80 column where possible; it makes it easier to track errant
line breaks, etc.
Also begin standardizing tab formatting and two spaces after period.

* Further corrections to command line materials (nw)

* More adjustments for Cuavas (nw)

Getting closer to acceptable.
2019-01-11 01:06:52 +11:00
Vas Crabb
cba80b7182 Make informational verbs a bit more consistent, reduce copy/pasted code, a slight performance improvement for reading localisation files, and more documentation clean-up/correction/clarification 2019-01-04 01:12:02 +11:00