Commit graph

407 commits

Author SHA1 Message Date
cracyc
f16565a556 plugin/data: handle multiple blocks in dat 2021-10-25 16:55:40 +11:00
Vas Crabb
4601e60391 plugins: Use SPDX short identifiers for licenses in exports (more precise and easier to localise), use CC0 for hiscore plugin rather than CC0. 2021-10-25 01:57:07 +11:00
Vas Crabb
5ab93130eb Plugin updates:
Changed the hiscore plugin to save inside the "hiscore" folder in the
plugin data directory.  The old hiscore path setting has already been
removed from MAME for some time.  This means the plugin was always
saving in the "hi" folder in the working directory with no way to change
it, which is problematic on Linux and macOS, particularly for distro
packagers.  There are lots of plugin and UI changes in this release, so
we may as well get this out of the way now.  Also made it possible to
change the "timed save" option from the Plugin Options menu, and save
that in the data folder, too.

Documented the input macro plugin.  The only undocumented plugins now
are the cheat plugin, the cheat finder plugin, and the port name plugin.
2021-10-24 09:38: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
aa3643d5b7 plugins/timer: Fixed ticking when menu is left on the screen. 2021-10-22 03:46:00 +11:00
Vas Crabb
33f5ab983d -Cleaned up CI targets:
* Restricted Linux CI build to only run on changes to code,
  translations, software lists, and build scripts.
* Restricted Windows/macOS CO to only run on changes to code and build
  scripts.  They provide nothing over Linux for the other stuff.
* Added plugin properties and controller file validation to the "hash"
  workflow.
* Added a workflow for building documentation, so pull requests that
  affect documentation will at least get a basic check in advance.

-plugins/autofire: Bumped version as configuration format has changed.
2021-10-22 02:46:52 +11:00
Vas Crabb
f459eb6e13 Plugin usability improvements:
* autofire, inputmacro: Made left/right repeat when held (makes setting
  long delays/durations easier).
* autofire, inputmacro: Added headings for devices in input selection
  menus (helps when controller buttons have identical names, e.g. AES)
* autofire: Made intial selection when moving between menus intuitive,
  log some errors on saving/loading configuration.
* autofire: Fixed two errors in Chinese localisations.
2021-10-22 01:14:05 +11:00
Vas Crabb
3891d42471 frontend: Beter provision for plugins with multiple menu levels.
Make it possible for a plugin to specify which item should be selected
on repopulate.  Also allowed plugins to specify the UI heading flag for
menu items.

Updated input macro plugin to select sane items when changing menus.
Other plugins not updated yet, but may be at some point in the future.
2021-10-21 07:44:34 +11:00
Vas Crabb
b1c7644159 -plugins: Added an input macro plugin.
-plugins: Sort input selection menus for autofire plugin.

-frontend: Fixed another case where the menus may not automatically
scroll the first item into view.
2021-10-21 04:11:43 +11:00
Vas Crabb
4e74debb69 frontend: Don't show plugin options menu in main menu before start - it doesn't work anyway. 2021-10-20 05:27:31 +11:00
Vas Crabb
0a9ea09a9a Tie up a few loose ends:
debugger: Octal cheats for octal address spaces.

frontend: Pass events for automatically generated menu items to the
plugin - they will have index zero.

frontend: Don't try calling the data plugin from the main menu if the
system isn't starting yet - doing so will prevent the data plugin from
loading at all.
2021-10-20 02:03:43 +11:00
Vas Crabb
22bc3486c3 More user experience improvements:
frontend: Made it possible to cancel a media audit while it's in
progress.  Also made the media audit multi-threaded so it's faster.

frontend: Made the DIP switches in the DIP switch preview clickable.

frontend: Made the system and software selection menus leave focus on
the same system when clearing the search rather than jumping to the
first item.  Also fixed a couple of bugs in the logic for keeping the
selected item visible.

frontend: Fixed a few places that weren't showing localised system
names.

frontend: Made UI Cancel clear a search in the file manager the same way
it does on the system and sofware selection menus.

frontend: Made it possible for plugin menus to handle UI Cancel more
naturally, backing up to the previous plugin menu rather than dropping
straight back to the list of plugins.  Updated the autofire, cheat and
cheatfind plugins, and fixed a few other issues in the cheatfind plugin.

debugger: Made the mount and unmount commands accept instance names as
well as brief instance names.  Also updated another page of debugger
documentation.
2021-10-15 10:12:56 +11:00
Vas Crabb
751c2806bf Re-generated translations for I/O port names.
Trying to collect messages from everything at once hits some limit in
xgettext and causes messages to be lost no, so I've split it up by the
second-level source directories.

For some reason xgettext thinks overloaded Lua functions are blasphemy,
so that has to be worked around, too.
2021-10-11 15:02:55 +11:00
Vas Crabb
fd6309ee91 frontend: Keep cleaning up.
Got rid of one of the UI audit inputs.  There only needs to be one, and
the options can be presented in the confirmation menu.  Two secret
keystrokes is too confusing.  Also got rid of the long-obsolete UI
Toggle Debugger input.

Added audit media button to the toolbar so it's a bit less opaque, and
it can be accessed with a mouse/trackball (not just by knowing the key
mapping).

Made default I/O port names localisable.

Made autofire plugin save port fields using the { port, mask, type }
tuple, the same way MAME does.  Unfortunately this will break existing
autofire configuration, but it should be more stable going forward.

Added some more UI keys to the default key mappings documentation.
2021-10-11 13:14:31 +11:00
Vas Crabb
38082ccbee
Overdue internal UI enhancements (#8674)
* frontend: Added support for message context to localisations.
* frontend: Added string_view versions of the message lookup functions.
* frontend: Added a few more folder options to the internal UI.
* emu/softlist.cpp: Use more appropriate containers.
* Switched to Python 3 by default - this will become a requirement.
* Updated msgfmt.py for message context support.
* frontend: Show all software item info in the internal UI.
* frontend: Search alternate titles in software selection menu.
* 3rdparty/utf8proc: Updated to v2.6.1 (has several fixes).
* frontend: Added software filters for common info fields.
* frontend: Allow UI manager to hold onto persistent session data.
* frontend: Cache software lists for eight machines.
* frontend: Added support for loading localised system names.
* frontend: Add UI for selecting localised system names.
2021-10-09 12:16:17 +11:00
cracyc
5bb6a786a8 hiscore.dat: Updates [Leezer] 2021-07-20 09:16:41 -05:00
Julian Sikorski
97bd2d20df
Strip CRs from history.xml (#8115) 2021-05-30 13:25:37 -05:00
Vas Crabb
5fe20586ee srcclean for release 2021-05-23 17:33:52 +10:00
Vas Crabb
fab84e8d2b Mostly revert "Create console history file in homepath (#8026)"
The change to make the console plugin work is preserved.

This reverts commit 25137717c9.
2021-05-07 02:14:05 +10:00
Szunti
25137717c9
Create console history file in homepath (#8026)
* Fix console history path, homepath is a core option

* Create missing directories recursively in lua plugins.

* Add lfs to global environment in a less magical way.

require normally doesn't bind the name globally just returns the
module, mame sets a preloader that does bind lfs globally, but
maybe it's less surprising to do it explicitly
2021-05-03 20:40:10 -04:00
AJR
26defea154 init.lua: Change "historypath" (only supposed to be used for DATs) to "homepath" (where plugin data should reside) 2021-05-02 12:27:54 -04:00
Szunti
b8cb370b74 Save line history for the console and other minor fixes
Changed a loadstring to load, since lua 5.3 loadstring is not
available.
Made sure the linenoise thread returns a string.
After Ctrl+D stop reading lines.
2021-04-25 20:43:10 +02:00
cracyc
85b9bcd670 plugins/cheat: fix regions in xml cheats too 2021-04-23 16:58:47 -05:00
Szunti
bf21508faa
Fix XML cheats which use multiple spaces. (#7998) 2021-04-23 16:56:21 -05:00
cracyc
6ac210c6be plugins/cheat: fix getting arbitrary screen 2021-04-04 09:58:51 -05:00
cracyc
9c14a66139 plugins/data: properly clear history data when loading new file 2021-04-03 20:13:56 -05:00
etabeta
8e72b65075 plugins/cheat: removed spurious print 2021-04-01 15:56:38 +02:00
Priuli
bcfd7c64b0 plugins/cheat: fix XML cheat loading when emulation is launched with an image option specified (e.g. mame nes -cart smb) or by loading directly one part of the software (e.g. mame a600 amigaocs_flop:lslarry2:flop1) 2021-04-01 15:33:39 +02:00
cracyc
a405de0435 hiscore.dat: Updates [Leezer] 2021-03-23 10:19:50 -05:00
cracyc
a928d3c40c plugins/cheat: fix selection 2021-03-17 14:10:05 -05:00
cracyc
61caa1450b plugins: another leftover 2021-03-07 10:33:07 -06:00
cracyc
5b489ca475 plugins: fix missed lua api changes 2021-03-06 18:55:44 -06:00
cracyc
6bf76d0453 plugins/cheatfind: fix watch and write 2021-02-19 12:32:25 -06:00
cracyc
b97c1dbc94 hiscore.dat: rename changed sets 2021-02-14 19:31:19 -06:00
cracyc
5faba2b813 plugins/discord: fix softlist longname 2021-02-13 09:39:39 -06:00
Vas Crabb
78f6ff34a5 srcclean in preparation for branching release 2021-01-24 13:33:07 +11:00
cracyc
ae2e3443f5 plugins/data: more hiscore improvements 2021-01-02 22:39:40 -06:00
cracyc
aea4460250 plugins/data: better hiscore parsing 2021-01-01 22:06:33 -06:00
cracyc
d961efa925 plugins/data: remove logging and fix query 2020-12-31 21:47:50 -06:00
cracyc
886bf9ac67 plugins/data: use history.xml and add xml parser for it 2020-12-31 15:06:57 -06:00
Vas Crabb
525f744b38 plugins/cheat: Migrate remaining XML cheat code for Lua API changes. 2021-01-01 01:31:12 +11:00
Vas Crabb
a5e6f4ea8d Expose a couple more things to Lua so the plugins can show the actual key mapped to UI clear. 2020-12-27 04:27:42 +11:00
Vas Crabb
9e36b6a6d9 More Lua interface cleanup - it's simpler with cleaner underlyng APIs.
Made the sound manager mute controls readable, and got rid of system
enable since it just controls system mute anyway.  This was causing
confusion: phantom2 was trying to use both independentlyt casuing the
mute bit to be ignored.

THe Lua interface changes are mostly changing methods to properties,
some renames to make things clearer, and some additional properties for
better control over snapshots.
2020-12-27 01:32:37 +11:00
Vas Crabb
1df245cb99 More Lua engine clean-up and documentation, resulting in core cleanup.
More Lua interface cleanup, additional properties and methods, and
documentation migration/expansion.

Emulated switch inputs can have "not" codes applied to host input axis
directions.  It works the same way as host switch inputs - push twice
for a "not" prefix.

Input polling helpers no longer need to store state in the input device
items.  There’s less leakage, and less chance of things interfering with
each other.

Allow snapshot view options to be configured through the internal UI via
the video options menu.  Made video options menus place initial focus on
the currently selected view item.  Removed some crud from the menu base
class.

Fixed the description of the "snapview" option.  The value to get raw
screen pixels was changed to "native" a long time ago but the
description was never updated.

Re-arranged the Golden Poker button lamps so that the 6-button layouts
for Jolli Witch and Wild Witch make sense.  In 6-button mode, the hold
buttons double as bonus game and bet buttons, but the lamp outputs don't
change.  The simplest way to deal with this without requiring the user
to switch views or using layout scripting is to place the dedicated
buttons directly below the hold buttons that correspond to them.

Removed some software list data that was redundantly copied into
device_image_interface (m_supported was never even set, so it didn't
even work), and made crc() work better (previously it wasn't
recalculuated after unloading and loading another image).

Made strformat.h and devcb.h play nicer with C++17 and pre-standard
C++20.  Format precision now correctly limits the length of string
views.  Confirmed that strformat.{h,cpp} works with pre-standard C++20
support in GCC 9.

Removed an auto_alloc from cpu/arm7.
2020-12-18 15:54:52 +11:00
Vas Crabb
503332a986 -Lua cleanup and documentation migration checkpoint.
* Cleaned up some more of the Lua inteface.  Mostly replacing methods
  with properties, some consistency fixes, a few renames, some more
  exposed functionality, and a couple of properties that have no
  business being set from scripts made read-only.
* Moved a lot more Lua documentation out of source comments into the
  documentation, and expanded on it in the process.
* Got more UI code out of the input manager.
* Changed input sequence poller to a polymorphic class where you
  specify your intention upfront.
* Changed the cheat plugin to use UI Clear to clear hotkey assignments
  and leave them unchanged if the user starts assignment but doesn't
  press any switches.
* Ported AJR's fix for over-eager double-click recognition from SDL to
  Windows OSD.

-goldnpkr.cpp: Cleaned up inputs, using standard keyout and payout types
 and key assignments.
2020-12-16 02:18:52 +11:00
AJR
a7921a601b plugins/portname: Use emu.subst_env 2020-12-08 15:57:41 -05:00
AJR
e70d4ebb34 plugins: Replace environment variable substitution function with core version 2020-12-08 09:44:32 -05:00
Vas Crabb
e008c7b1b1 -Lua engine cleanup, input edition:
* Modernised and cleaned up Lua bindings for input classes.
* Exposed the input_sequence_poller class to Lua and updated the
  autofire and cheat plugins to use it, rather than continuing to
  pretend it's part of the input manager.
* Exposed more of the natural keyboard manager, including the ability
  to enable/disable individual keyboard and keypad devices like you
  can from the keyboard mode menu.
* Exposed a few more things on ioport_port and input_device.

-plugins/cheat: Fixed menu item not updating visually when disabling a
 cheat with UI Left.

-plugins/cheatfind: Fixed not finding the first screen after screen
 enumerator was exposed as an object rather than using a table.

-bwidow.cpp, pacman.cpp: Minor cleanup to recent changes.
2020-12-09 01:10:26 +11:00
Vas Crabb
cac83ba5b1 Expose enough of the layout system to Lua to allow position and colour to be animated. 2020-12-05 21:04:22 +11:00
Vas Crabb
1bdf8d272a frontend: Lua engine improvements.
Added methods for enabling and disabling breakpoints and watchpoints,
and made debugger views update when breakpoints/watchpoints are
manipulated from Lua.  Made breakpoints and watchpoints objects rather
than tables.  (It’s not possible to enable/disable a breakpoint or
watchpoint from the object itself, you have to go through its owners'
debug interface.)

Exposed more device_t members for dealing with child/sibling tags and
devices.  Also provided a way to get regions/shares/banks from a device
using relative tags rather than going through the memory manager with
absolute tags.
2020-11-30 12:01:14 +11:00
Vas Crabb
ec80428647 Fairly significant overhaul of Lua engine and some cleanup.
The things that were previously called device iterators are not
iterators in the C++ sense of the word.  This is confusing for
newcomers.  These have been renamed to be device enumerators.

Several Lua methods and properties that previously returned tables now
return lightweight wrappers for the underlying objects.  This means
creating them is a lot faster, but you can't modify them, and the
performance characteristics of different operations varies.

The render manager's target list uses 1-based indexing to be more like
idiomatic Lua.

It's now possible to create a device enumerator on any device, and then
get subdevices (or sibling devices) using a relative tag.

Much more render/layout functionality has been exposed to Lua.  Layout
scripts now have access to the layout file and can directly set the
state of an item with no bindings, or register callbacks to obtain
state.  Some things that were previously methods are now read-only
properties.

Layout files are no longer required to supply a "name".  This was
problematic because the same layout file could be loaded for multiple
instances of the same device, and each instance of the layout file
should use the correct inputs (and in the future outputs) for the device
instance it's associated with.

This should also fix video output with MSVC builds by avoiding delegates
that return things that don't fit in a register.
2020-11-25 19:18:26 +11:00
cracyc
1a4803c9ec hiscore.dat: fix stdragon 2020-11-23 20:24:34 -06:00
cracyc
9838b52f97 hiscore.dat: updates [Leezer] 2020-11-22 15:16:27 -06:00
cracyc
dc2e44c7be hiscore.dat: update with changed sets 2020-10-22 19:09:47 -05:00
Vas Crabb
6e807013c5 Disable SOUND_DEBUG for non-debug builds, and srcclean 2020-09-27 11:00:56 +10:00
cracyc
7f281a9d95 hiscore.dat: fix set names 2020-09-22 20:44:46 -05:00
npwoods
b8d6be3320
Fixing a cheat plugin bug 2020-09-19 11:02:29 -05:00
cracyc
cfd3c1fac6 plugins/cheat: small simplification 2020-09-15 20:38:39 -05:00
cracyc
90fd79601b
plugins/cheat: copy the cheat table to not expose internal state (#7238) 2020-09-15 09:37:47 -05:00
cracyc
692ff2c06f plugin/cheat: subtract min before dividing 2020-09-13 19:13:38 -05:00
cracyc
35bfe62b59 plugin/cheat: check value is a mulitple of step 2020-09-13 19:03:22 -05:00
cracyc
c70bc6be75 plugin/cheat: flesh out the exported interface a bit more 2020-09-13 16:37:53 -05:00
cracyc
9c4d1457da plugins: add emu.plugin table to contain plugin exported interfaces 2020-09-13 10:00:54 -05:00
cracyc
a03b22c555 cheat_simple: with game genie codes try 32k nes banks then fall back to 8k and warn with 6 char codes and banked prg 2020-09-08 18:51:03 -05:00
cracyc
1e61ba02fe hiscore.dat: gauntlet high scores are in the nvram, these cause more problems then they are worth 2020-09-03 16:31:44 -05:00
cracyc
44af4d00ed hiscore.dat: updates [Leezer] 2020-08-17 10:17:04 -05:00
cracyc
bdd7e205a9 hiscore.dat: update changed set names 2020-07-21 16:33:10 -05:00
Vas Crabb
718da3388c
plugins/autofire: remove leftover code from first attempt at removing empty configuration files 2020-07-19 23:07:39 +10:00
kunikuni
070eeeec3a
plugins/autofire: don't save 2bytes cfg file (nw) (#6969)
* plugins/autofire: don't save 2bytes cfg file (nw)

* Update autofire_save.lua
2020-07-19 23:05:00 +10:00
kunikuni
33fbb85d59
plugins/autofire: don't save 2bytes cfg file (#6960) 2020-07-17 15:05:23 -04:00
cracyc
cc093aaf50 hiscore.dat: updates [Leezer] 2020-04-22 09:51:57 -05:00
cracyc
f42d9f7d43 hiscore.dat: fix viewpoin (nw) 2020-03-10 12:24:54 -05:00
Vas Crabb
c39f46d6d2 Revert "added support for reading/writing hiscore files from cart images (#6130)"
This reverts commit a77313a987.

This seems to break high score support on things without cartridges.  I think it needs re-thinking.
2020-02-28 02:21:06 +11:00
eadmaster
a77313a987
added support for reading/writing hiscore files from cart images (#6130)
* added support for reading/writing hiscore files from cart images

example hiscore.dat entry:
````
nes,smb:
Super Mario Bros. (World).nes:
Super Mario Bros. (W) [!].nes:
@:maincpu,program,7df,4,0,0,ff
````

* store console hiscores in subdirs, added cart hashes support

* added back my prev changes

* added missing end

* using simpler regexpr for hiscore.ini parsing, fixed typo

* minor cleanups
2020-02-13 10:25:28 -05:00
cracyc
a0a658a111 fix various things. checkpointed the alphatpc16, will credit before next release (nw) 2020-02-11 17:04:36 -06:00
Vas Crabb
a7fec751ed srcclean, manual adjustments (nw) 2020-01-26 12:39:27 +11:00
R. Belmont
9730b87bbc
Merge pull request #6129 from eadmaster/patch-1
made read_config in hiscore lua plugin more robust
2020-01-04 16:09:27 -05:00
MooglyGuy
7486fe3ce0 -cheat_xml: Attempt at fixing Github issue #6114. Strip the leading colon from device names as necessary in order to avoid doubling of the root colon. [Ryan Holtz, DjDiabolik] 2020-01-04 14:06:13 +01:00
Andrea
9764233875
made read_config in hiscore lua plugin more robust 2020-01-04 10:10:19 +01:00
cracyc
5c226e1f99 hiscore.dat: fix old parsing errors (nw) 2019-12-08 14:54:47 -06:00
cracyc
c6dcf7e6be hiscore.dat: Updates [Leezer]
plugins/data: various fixes (nw)
2019-12-02 21:17:42 -06:00
cracyc
b32f90e5a9 plugins/data: small cleanups (nw) 2019-11-29 10:18:50 -06:00
cracyc
b5f648cca7 plugins/data: that shouldn't be there (nw) 2019-11-29 08:36:30 -06:00
cracyc
8dbea98e20 plugins/data: loading fixes (nw) 2019-11-28 22:35:36 -06:00
cracyc
5528afb489 plugins/cheatfind: permit entry of cheat names 2019-11-27 14:12:02 -06:00
Vas Crabb
c38f63c10a plugins/cheat, plugins/autofire: only time out input sequence entry if nothing is entered (nw) 2019-11-22 02:32:29 +11:00
cracyc
0ec88f2ff7 plugins/autofire: permit input sequences (nw) 2019-11-20 22:35:13 -06:00
cracyc
52bc1df46e plugins/cheat: don't clear error message (nw) 2019-11-20 21:56:36 -06:00
cracyc
0606a77760 plugins/cheat: show pressed buttons when setting hotkeys (nw) 2019-11-20 21:35:35 -06:00
cracyc
99a628eb7c plugins/cheatfind: pull https://github.com/mamedev/mame/pull/4618 with some simplifications and bugfixes (nw) 2019-11-17 21:12:41 -06:00
cracyc
7fc2f68051 hiscore.dat: fix renamed set (nw) 2019-11-16 15:05:20 -06:00
cracyc
b0ef759b80 winptty: don't create pipe unless requested (nw)
plugins/discord: disconnect if timed out (nw)
2019-11-16 14:59:02 -06:00
cracyc
f0c5429b95 hiscore.dat: fix MT07454 (nw) 2019-10-16 17:20:11 -05:00
cracyc
55ef735fb7 hiscore.dat: fix set renames (nw) 2019-09-20 14:01:47 -05:00
cracyc
2c485b158c plugins/cheat: add time functions to cheat sandbox 2019-09-09 20:56:39 -05:00
cracyc
70f176f74f hiscore.dat: fix makai high scores (nw) 2019-08-23 15:43:27 -05:00
npwoods
d4cb1ba742 LUA boot.lua file now handles multiple paths (delimited by semicolons)
on -pluginspath
2019-07-25 13:19:43 -04:00
npwoods
aac4e79d4b Refactored MAME's plugin system 2019-07-24 07:21:06 -04:00
cracyc
8893bfcd7e hiscore.dat: updates [Leezer] 2019-07-20 13:46:11 -05:00
Jack Li
2da86cda04 Change autofire config directory to homepath (#5129)
* Revert "Used set_folder to avoid hardcoding plugin name in settings path"

This reverts commit 76884986fd8630f81cfc838aa42f264fdcec2ea9.

* Changed autofire config directory to homepath

* Bumped autofire plugin version
2019-05-30 14:31:57 -04:00