Commit graph

411 commits

Author SHA1 Message Date
Vas Crabb 34a31ac42d Fixed various issues in internal layouts:
* plugins/layout: Log script errors at warning level rather than verbose
  level.
* microtouch.lay, pntnpuzl.lay: Improved pointer mapping code.
* Reordered all layouts to place views after element and group
  definitions and scripts last.  This matches how layout files are
  interpreted by MAME.
* Fixed various errors identified by validating layout files against an
  XSD schema.
2024-05-14 05:11:16 +10:00
Vas Crabb e22aae63a1 -merit/mtouchxl.cpp: Added touch-enabled layout.
-ui/tapectrl.cpp: Ensure device monitored for media change is up-to-date.

-osd/windows: Changed a pointer to a const reference in an API.
2024-05-09 04:43:56 +10:00
eientei95 662bc48d9a
cheat: Make string.char and string.format available to cheats (#12183) 2024-03-27 15:35:30 -05:00
cracyc c2c61bf29c hiscore.dat: fix renamed sets 2024-03-18 09:03:13 -05:00
Vas Crabb 59cbd883f8 sega/sega_beena.cpp: Hooked up barcode cards.
Systems promoted to working
---------------------------
Sega TV Ocha-Ken [QUFB]

Software list items promoted to working (tvochken.xml)
------------------------------------------------------
TV to Ocha-Card: Ocha-Ken 'Ho' to Seikatsu [Vas Crabb]
2023-12-14 13:14:26 +11:00
Vas Crabb 6e60af32c1 sega/sega_beena.cpp: Added basic book page display.
sega_beena_cart.xml: Put page scans in individual data areas.

frontend/mame/luaengine_mem.cpp: Added a raw read function for memory
regions.

plugins/layout: Added bitmap classes to layout sandbox.
2023-11-04 00:37:48 +11:00
cracyc 94bf1367ad hiscore.dat: fix renamed sets 2023-09-21 18:01:59 -05:00
hap c13ec72934 plugins: enable layout plugin by default 2023-07-31 11:04:49 +02:00
GregWeil 93771fee59
plugins/hiscore: Fixed detection of software item lines, and added high score support for Mega Drive Sonic Spinball. (#11282) 2023-07-07 05:49:56 +10:00
cracyc 76e5e89fed hiscore.dat: update changed sets 2023-06-23 19:10:39 -05:00
Vas Crabb b67b969bf0 -Improved some Lua APIs:
* Moved several machine lifecycle callbacks to the notifier/subscriber
  model.  The old callback registration model is still available for
  them for now, but prints a deprecation warning.
* Added pre-save/post-load notifications.
* Use a single allocated timer rather than one anonymous timer per
  waiter.  Waiters no longer prevent saved states from being loaded.
* Clean up outstanding waiters on stop or state load rather than just
  leaking them.
* Started documenting parts of the emulator interface object that should
  be relatively stable.

-imagedev/avivideo.cpp: Fixed an object leak on unload.  Also changed
 some other media image devices to use smart pointers.
2023-04-07 06:20:40 +10:00
Vas Crabb 5f97af903c
-Lua engine: run everything in coroutines. (#11019)
* This lets you use emu.wait(...) directly without mucking around creating coroutines.
* Allow emu.wait to accept an attotime argument.
* Added a couple more wait helper functions.

-emu/profiler.h: Actually use scope-based profiling helpers.
* This makes the comment at the top of emu/profile.h less dishonest, and makes it easier to write exception-safe code.
* Got rid of some do { ... } while (0) loops that only existed so break could be used like a goto.
2023-03-25 05:53:58 +11:00
Vas Crabb 00f317b3d3 -ui/menu.cpp: Don't pass IPT_UI_BACK event to the implementation when dismissing the menu.
-plugins/autofire, plugins/inputmacro: Don't be so eager to create empty settings folders.
2023-03-23 03:39:54 +11:00
Vas Crabb ab6a4f1b94 plugins/data: Use local sqlite3 library variable. 2023-03-13 05:51:22 +11:00
Vas Crabb f2a5f52526 Lua: Be more strict with concurrency and multiple contexts. 2023-03-08 04:09:22 +11:00
Vas Crabb 6dea565343 plugins/console: Fixed tab completion after linenoise update.
* Can now cycle through candidates by repeatedly pushing Tab.
* Also cleaned up Lua thread context object a little, and made it
  possible to pass any Lua object as a status value.
2023-03-08 03:18:21 +11:00
Vas Crabb 27fc200678 Tie up a few loose ends:
* msx2_flop.xml: Fixed a couple of Japanese titles.
* plugins/layout: Added a couple of things to the layout script sandbox.
* Tidied up Hyper Neo Geo 64 code (srcclean etc.).
2023-03-08 00:16:47 +11:00
Vas Crabb 8384223ac8 Updated forked linenoise to latest upstream.
This removes the need to force it to build as C++, and adds proper UTF-8
support for Windows.

Since this is a fork of linenoise, there's no hope for getting
lua-linenoise to sync with it upstream.  I made the bare minimum changes
to keep it working, but didn't add bindings for new functionality (e.g.
multi-line editing).
2023-03-07 05:33:37 +11:00
Vas Crabb d4589e0b29 Input refactoring:
osd/modules/input, emu/inpttype.cpp: Made most default joystick
assignments supplied by input modules.  Input modules take available
controls into consideration when generating default assignments.

emu/inpttype.ipp: Added a separate "Back" UI input separate from Cancel.
You may want an easier to hit combination for moving to the previous
menu than for exiting or cancelling input.  They both default to Escape.

emu/inpttype.ipp: Added a UI Help control.  Currently only used by
analog inputs menu

emu/inpttype.h: Moved I/O port field type enum to its own header and
sorted UI controls so they appear in a more logical order.

ui: Don't use UI Select to restore defaults - people should be getting
used to the UI Clear input by now.  UI Select cycles multi-value items
instead.

ui/inputmap.cpp: Don't use immediate cancel to cycle between clearing
and restoring default assignment (use UI Clear instead).

osd: Reduced the number of files needing to include the dreaded emu.h.
Got some implementation out of headers.
2023-02-18 06:18:45 +11:00
npwoods 13910382a5
osd/modules/file: Don't magically substitute environment variables when opening files. (#9859)
* util/options.cpp: Added option types for single and multiple paths.
* util/options.cpp: Substitute environment variables in values from defaults and INI files.
* ui/dirmenu.cpp: Removed hard-coded list of multi-path options.
* plugins: Don't substitute environment variables in path options.
2022-12-17 06:03:59 +11:00
cracyc a0429f8bac hiscore.dat: Updates [Leezer] 2022-11-20 10:28:03 -06:00
Vas Crabb 16e709ad82 plugins/autofire, plugins/inputmacro: Use clear_value to release I/O port fields. 2022-11-06 02:46:39 +11:00
Vas Crabb bdfdbd8796 plugins/cheat: Overwrite existing hotkeys if all hotkeys are cleared (fixes GitHub #10387). 2022-10-04 14:19:38 +11:00
cracyc 867167bb97 hiscore.dat: resort and set changes 2022-09-20 08:48:59 -05:00
mdeslaur f3b42285fc
pacman.cpp: Added Miss Packman Plus. (#10201)
New working clones
---------------------
Miss Packman Plus [Marc Deslauriers]
2022-08-13 01:09:13 +10:00
hap c860119abb hegenerglaser/*: add clickable element to internal artwork that presses 2 buttons at the same time where applicable 2022-07-26 15:55:17 +02:00
Vas Crabb df65b00ed4 plugins/data: Fixed story.dat errors; virtual.flt: Use glob pattern. 2022-07-02 03:11:23 +10:00
Vas Crabb 923ef2c25d -plugins.data: Reworked the code substantialy.
* Use the plugin data folder for storing the cache.  The history folder
  may be read-only or shared with different configurations.
* Don't create the cache database or surrounding folder if there's
  nothing to store in it.
* Actually use prepared queries multiple times rather than always
  destroying them after a single use.
* Added proper error checking for most database operations.
* Improved query performance by avoiding outer joins and table scans.

-bus/nubus: Made the Macintosh Display Cards map the blue channel to
 white with monochrome monitors.  Also added logging for PLL
 configuration to help debug how CRTC and RAMDAC clocks work in the
 future.
2022-06-25 04:57:24 +10:00
Vas Crabb 742de90a65 Mac-related emulation fixes:
* bus/nubus: Started emulating SuperMac Spectrum/8 CRTC.
* bus/nubus: Respect Apple 4•8 screen base register.
* cpu/m68000: Fixed disassembly of bit field extract instructions.
* Also cleaned up data plugin a little.
2022-06-20 07:52:24 +10:00
Vas Crabb f47f9c3db3
ui, docs: Added menus to fill a couple of gaps, improved consistency. (#9915)
Added menus for controlling toggle inputs, and showing recognised input
devices and control state.  Moved input menu options off main menu to a
submenu, as there are a lot of them now.

Moved menu heading drawing into base class, added headings to more
menus, and made headings more consistent with the menu items used to
reach them.  Also made terminology more consistent.

Changed the default names for buttons and hat switches/D-pads to use
1-based numbering.  DirectInput still returns 0-based button numbers for
some devices.

Removed local copy of MinGW xaudio2.h as it’s now included in the MSYS2
package.  Also fixed building the DirectSound sound output module with
the SDL OSD on Windows - the Windows headers are sensitive to include
order.

Started adding documentation for menus, to hopefully help people find
menus they remember seeing but can't recall how to access.

For translators, this makes terminology more consistent.  In particular:
* "Settings" is preferred over "configuration" in a number of places, as
  the latter can be construed as referring specifically to settings
  stored in .cfg files in the cfg_directory folder.  Also, references to
  saving machine configuration could be interpreted as relating to the
  settings on the "Machine Configuration" menu.
* The controls on host input devices (e.g. keys, buttons, joystick axes)
  are referred to as "controls", while emulated inputs are referred to
  as "inputs".
* The menus for assigning host controls to emulated inputs are called
  "input assignments" menus to distinguish them from other input
  settings menus.
* Combinations of controls that can be assigned to emulated inputs are
  referred to as "combinations" rather than "sequences".
* The potentially confusing term "ROM set" has been removed altogether.
  Use "short name" to refer to a device or system's identifier.
* "System" is used in almost places to refer to a complete, runnable
  system rather than "Machine".
* "Driver" is now only used to refer to source files where systems or
  devices are defined - it is no longer used to refer to individual
  systems.
* A few more menus have message context for the messages.  This makes it
  a bit easier to guess where the messages are used.  It also means you
  can use different translations in different places if necessary (e.g.
  if the same English text should be translated differently as an item
  in one menu and as a heading in another).
2022-06-11 21:47:19 +10:00
cracyc af1ee7db53 hiscore.dat: updates [Leezer] 2022-03-23 21:25:06 -05:00
Vas Crabb e6588480c4
Lua engine improvements (#9453)
Made auto-boot script errors and plugin bootstrap errors fatal.

Run auto-boot scripts in a sandbox.  Globals can be accessed, but not
set.  The sandbox is cleared on hard reset, but not on soft reset.

Added (hopefully) useful to string metafunctions to device_t and
address space that show short names and tags.

Fixed issues in plugins that surface when strict type checking is
enabled, as this means numbers and nil are not automatically converted
to strings.  Plugins should be tested with debug builds to check for
this.

Made save item read_block raise an error on invalid arguments rather
than returning an empty string, and made it use luaL_buffer directly
rather than using the helper wrapper.

Changed some more function bindings to use set_function to avoid issues
related to ThePhD/sol2#608, and got rid of some unnecessary lambda
captures.
2022-03-23 20:27:30 +11:00
cracyc ea0cdde148 plugins/cheatfind: don't try to call a handler for the previous menu option 2022-03-05 09:35:54 -06:00
cracyc be4008cbb2 hiscore.dat: fix renamed sets
hiscore.dat: Add "Mega Man 2: The Power Fighters (Hispanic 960712)" (megaman2h), fix "1000 Miglia: Great 1000 Miles Rally" (gtmr/gtmra/gtmro/gtmrusa) and add clones (gtmrb/gtmro) (#9285)
2022-02-13 13:53:28 -06:00
Vas Crabb 7d8c657fad Moved localised I/O port name lookup into I/O port manager.
Added pseudo format specifiers to controller port names: %p for player
and %% for literal percent symbol.  This lets you get the localised
player identifier in overridden input names (see NES and Neo-Geo for
examples), and reduces the number of messages to translate.

For translators, the new messages are mostly previously existing
messages with wording adjusted for clarity (e.g. referring to "media"
rather than "ROMs" in several places, as things like disk and tape
images are included).  It's also possible to localise the "???"
dipslayed for an input without a valid name, but that should never
actually appear in practice.
2021-12-09 07:42:12 +11:00
Vas Crabb 637eaca7a4 srcclean in preparation for release of MAME 0.238.
Patched up positron.cpp input ports - you shouldn’t use PORT_NAME when
the key cap label is just the characters it produces anyway, and you’re
supposed to use the actual character a key produces for PORT_CHAR or
"natural" keyboard mode/paste will be unnatural.
2021-11-21 14:14:44 +11:00
Vas Crabb 7cc9836017 plugins: Work around menu not remembering selection when ref is nullptr. 2021-11-08 11:51:29 +11:00
Vas Crabb 07e55935cf plugins: Rewrote timer plugin fixing multiple issues.
Added emulated time recording as well as wall clock time.

Fixed recording time for multiple software items per system.  An
incorrect constraint on the database table meant that time was only
being recorded for a single software item per system.

Detect the "empty" driver so the time spent at the selection menu isn't
recorded (you'd get multiple entries for this due to the way options
leak when returning to the system selection menu).

Included schema migration code to update existing timer plugin
databases.  Also replaced some unnecessary floating point code with
integer maths, added log messages, and made the plugin unload unload its
database access code during emulation.

Changed other plugins' use of paths with trailing slashes as this causes
stat to fail on Windows.
2021-11-06 05:20:59 +11:00
Vas Crabb de9ed12186 plugins: Reduced amnesia for autofire and inputmacro plugins.
Made autofire and inputmacro plugins capable of remembering settings if
the host input device for the binding is missing or if an input for a
slot device that isn't present is referenced.
2021-11-05 02:46:04 +11:00
cracyc 0a27fdf359 plugins/cheat: one more flag 2021-11-03 20:09:37 -05:00
cracyc fe0fbb87c2 plugins: fix cheatfind menu flags and write xml cheat text to ui container so it's not sideways on rotated screens 2021-11-03 20:01:07 -05:00
Vas Crabb 18a6113655 Two small fixes (bad menu flags in cheat plugin, copy/paste in docs). 2021-11-04 11:41:46 +11:00
Vas Crabb 6e355f86c8 frontend: Don't let the non-menus get as far as trying to draw. 2021-11-04 10:32:24 +11:00
Vas Crabb dc33e01896 plugins: Ensure state is destroyed on stop. 2021-11-04 10:12:19 +11:00
Vas Crabb 8c6cb643e3 plugins: Simplify logic in autofire and inputmacro plugins to try and avoid leaking state across sessions. 2021-11-04 09:55:26 +11:00
Vas Crabb dd43f801a1 -emu/ioport.cpp: Fixed "MAME lost my joystick settings!!!1!11!
-plugins: Gave the timecode plugin an option to count emulated frames.
2021-11-03 05:18:06 +11:00
Vas Crabb 2d220c7ba8 Fixed Windows build as well - default input overrides in OSD modules are annoying. 2021-11-02 16:08:24 +11:00
Vas Crabb 6cbfe66e52 plugins: Fixed obligatory copy/paste error in new timecode plugin. 2021-11-02 15:33:53 +11:00
Vas Crabb d775a2731d plugins: Moved the timecode recording functionality to a plugin. 2021-11-02 15:31:03 +11:00
Vas Crabb 8ab63e2072 Fix various usability issues:
frontend: Made it so you can press UI On Screen Display to hide the
Analog Controls menu and see the response to your inputs without the
risk of changing settings, and see more axes at once and scroll them for
systems with very large number of axes.  Also ensure the axis being
configured is visible when the menu is visible, and made the menu behave
a bit more like the system input assignments menu (including
previous/next group navigation).

frontend: Allow Lua to draw to the UI container - this addresses the
main complaint in #7475.  Note that drawing to the UI container will
draw over any UI elements, including menus.  Plugins can check
menu_active to avoid drawing over menus.  Also removed some unnecessary
use of sol::overload.

frontend: Improved info/image box navigation on the system/softwre
selection menus, and cleaned up some leftover code that came from the
copy/pasted event handling functions.

frontend: Fixed sliders menu not handling Alt+Shift as intended (thanks
Coverity).  Fixed a couple of harmless Coverity errors, too.

emu/inpttype.ipp: Made the default assignment for Save State recognise
right shift.

plugins: Added next/previous group navigation to input macro edit menu.

docs: Added basic description of the system and software selection
menus, and corrected a couple of errors in the Lua reference.
2021-11-02 07:53:18 +11:00