mirror of
https://github.com/holub/mame
synced 2025-04-19 07:00:31 +03:00
Retired the over-stretched "system type" flags.
Functionally, the only difference between the system definitions is that GAMEL lets you specify an additional internal layout and SYST lets you specify a compatible system. COMP and CONS are just aliases for SYST - the aliases can be phased out. Removed arcade.flt and mess.flt altogether - opinion seems to be split between misinterpreting them as fully supported and considering them unnecessary. They were marginally useful as a performance test for makedep.py, but that isn't important. We still have nl.flt as an example .flt file (although it doesn't use "-" exclude directives). Moved the UI active flag from the machine to the UI manager. Nothing else uses it anyway (it's still accessible to scripts).
This commit is contained in:
parent
160a221990
commit
0562745629
@ -27,12 +27,7 @@ Order of Config Loading
|
||||
Systems with no monitors, multiple monitors with different orientations, or
|
||||
monitors connected to slot devices will usually load ``horizont.ini``.
|
||||
|
||||
5. System type INI file (``arcade.ini``, ``console.ini``, ``computer.ini``, or
|
||||
``othersys.ini``). Both Pac-Man and Street Fighter Alpha are arcade games,
|
||||
so ``arcade.ini`` will be loaded here, while Atari 2600 will load
|
||||
``console.ini`` as it is a home game console.
|
||||
|
||||
6. Monitor type INI file (``vector.ini`` for vector monitors, ``raster.ini`` for
|
||||
5. Monitor type INI file (``vector.ini`` for vector monitors, ``raster.ini`` for
|
||||
CRT raster monitors, or ``lcd.ini`` for LCD/EL/plasma matrix monitors).
|
||||
Pac-Man and Street Fighter Alpha use raster CRTs, so ``raster.ini`` is loaded
|
||||
here, while Tempest uses a vector monitor, so ``vector.ini`` is loaded here.
|
||||
@ -43,7 +38,7 @@ Order of Config Loading
|
||||
monitors or with other kinds of monitors will not load an INI file for this
|
||||
step.
|
||||
|
||||
7. Driver source file INI file. MAME will attempt to load
|
||||
6. Driver source file INI file. MAME will attempt to load
|
||||
``source/``\ *<sourcefile>*\ ``.ini`` where *<sourcefile>* is the base name
|
||||
of the source code file where the system driver is defined. A system's
|
||||
source file can be found using **mame -listsource <pattern>** at the command
|
||||
@ -54,16 +49,16 @@ Order of Config Loading
|
||||
``cave.cpp`` source file, so they will all load ``source/cave.ini`` at this
|
||||
step.
|
||||
|
||||
8. BIOS set INI file (if applicable). For example The Last Soldier uses the
|
||||
7. BIOS set INI file (if applicable). For example The Last Soldier uses the
|
||||
Neo-Geo MVS BIOS, so it will load ``neogeo.ini``. Systems that don't use a
|
||||
BIOS set won't load an INI file for this step.
|
||||
|
||||
9. Parent system INI file. For example The Last Soldier is a clone of The Last
|
||||
8. Parent system INI file. For example The Last Soldier is a clone of The Last
|
||||
Blade / Bakumatsu Roman - Gekka no Kenshi, so it will load ``lastblad.ini``.
|
||||
Parent systems will not load an INI file for this step.
|
||||
|
||||
10. System INI file. Using the previous example, The Last Soldier will load
|
||||
``lastsold.ini``.
|
||||
9. System INI file. Using the previous example, The Last Soldier will load
|
||||
``lastsold.ini``.
|
||||
|
||||
|
||||
Examples of Config Loading Order
|
||||
@ -75,12 +70,11 @@ Examples of Config Loading Order
|
||||
2. ``mame.ini`` (global)
|
||||
3. (debugger not enabled, no extra INI file loaded)
|
||||
4. ``vertical.ini`` (screen orientation)
|
||||
5. ``arcade.ini`` (system type)
|
||||
6. ``raster.ini`` (monitor type)
|
||||
7. ``source/jack.ini`` (driver source file)
|
||||
8. (no BIOS set)
|
||||
9. ``zzyzzyxx.ini`` (parent system)
|
||||
10. ``brix.ini`` (system)
|
||||
5. ``raster.ini`` (monitor type)
|
||||
6. ``source/jack.ini`` (driver source file)
|
||||
7. (no BIOS set)
|
||||
8. ``zzyzzyxx.ini`` (parent system)
|
||||
9. ``brix.ini`` (system)
|
||||
|
||||
* Super Street Fighter 2 Turbo (**mame ssf2t**)
|
||||
|
||||
@ -88,12 +82,11 @@ Examples of Config Loading Order
|
||||
2. ``mame.ini`` (global)
|
||||
3. (debugger not enabled, no extra INI file loaded)
|
||||
4. ``horizont.ini`` (screen orientation)
|
||||
5. ``arcade.ini`` (system type)
|
||||
6. ``raster.ini`` (monitor type)
|
||||
7. ``source/cps2.ini`` (driver source file)
|
||||
8. (no BIOS set)
|
||||
9. (no parent system)
|
||||
10. ``ssf2t.ini`` (system)
|
||||
5. ``raster.ini`` (monitor type)
|
||||
6. ``source/cps2.ini`` (driver source file)
|
||||
7. (no BIOS set)
|
||||
8. (no parent system)
|
||||
9. ``ssf2t.ini`` (system)
|
||||
|
||||
* Final Arch (**mame finlarch**)
|
||||
|
||||
@ -101,12 +94,11 @@ Examples of Config Loading Order
|
||||
2. ``mame.ini`` (global)
|
||||
3. (debugger not enabled, no extra INI file loaded)
|
||||
4. ``horizont.ini`` (screen orientation)
|
||||
5. ``arcade.ini`` (system type)
|
||||
6. ``raster.ini`` (monitor type)
|
||||
7. ``source/stv.ini`` (driver source file)
|
||||
8. ``stvbios.ini`` (BIOS set)
|
||||
9. ``smleague.ini`` (parent system)
|
||||
10. ``finlarch.ini`` (system)
|
||||
5. ``raster.ini`` (monitor type)
|
||||
6. ``source/stv.ini`` (driver source file)
|
||||
7. ``stvbios.ini`` (BIOS set)
|
||||
8. ``smleague.ini`` (parent system)
|
||||
9. ``finlarch.ini`` (system)
|
||||
|
||||
*Remember command line parameters take precedence over all else!*
|
||||
|
||||
@ -118,5 +110,3 @@ Some users may have a wall-mounted or otherwise rotatable monitor, and may wish
|
||||
to actually play vertical games with the rotated display. The easiest way to
|
||||
accomplish this is to put your rotation modifiers into ``vertical.ini``, where
|
||||
they will only affect vertical games.
|
||||
|
||||
[todo: more practical examples]
|
||||
|
@ -63,9 +63,9 @@ copyright = u'1997-2023, MAMEdev and contributors'
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = '0.252'
|
||||
version = '0.253'
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = '0.252'
|
||||
release = '0.253'
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
@ -250,8 +250,6 @@ machine:logerror(msg)
|
||||
Properties
|
||||
^^^^^^^^^^
|
||||
|
||||
machine.ui_active (read/write)
|
||||
A Boolean indicating whether UI control inputs are currently enabled.
|
||||
machine.time (read-only)
|
||||
The elapsed emulated time for the current session as an
|
||||
:ref:`attotime <luareference-core-attotime>`.
|
||||
@ -565,6 +563,8 @@ ui.line_height (read-only)
|
||||
ui.menu_active (read-only)
|
||||
A Boolean indicating whether an interactive UI element is currently active.
|
||||
Examples include menus and slider controls.
|
||||
ui.ui_active (read/write)
|
||||
A Boolean indicating whether UI control inputs are currently enabled.
|
||||
ui.single_step (read/write)
|
||||
A Boolean controlling whether the emulated system should be automatically
|
||||
paused when the next frame is drawn. This property is automatically reset
|
||||
|
@ -30,44 +30,32 @@ struct machine_flags
|
||||
{
|
||||
enum type : u32
|
||||
{
|
||||
MASK_ORIENTATION = 0x00000007,
|
||||
MASK_TYPE = 0x00000038,
|
||||
MASK_ORIENTATION = 0x0000'0007,
|
||||
|
||||
FLIP_X = 0x00000001,
|
||||
FLIP_Y = 0x00000002,
|
||||
SWAP_XY = 0x00000004,
|
||||
ROT0 = 0x00000000,
|
||||
FLIP_X = 0x0000'0001,
|
||||
FLIP_Y = 0x0000'0002,
|
||||
SWAP_XY = 0x0000'0004,
|
||||
ROT0 = 0x0000'0000,
|
||||
ROT90 = FLIP_X | SWAP_XY,
|
||||
ROT180 = FLIP_X | FLIP_Y,
|
||||
ROT270 = FLIP_Y | SWAP_XY,
|
||||
|
||||
TYPE_ARCADE = 0x00000008, // coin-operated machine for public use
|
||||
TYPE_CONSOLE = 0x00000010, // console system
|
||||
TYPE_COMPUTER = 0x00000018, // any kind of computer including home computers, minis, calculators, ...
|
||||
TYPE_OTHER = 0x00000038, // any other emulated system (e.g. clock, satellite receiver, ...)
|
||||
|
||||
NOT_WORKING = 0x00000040,
|
||||
SUPPORTS_SAVE = 0x00000080, // system supports save states
|
||||
NO_COCKTAIL = 0x00000100, // screen flip support is missing
|
||||
IS_BIOS_ROOT = 0x00000200, // this driver entry is a BIOS root
|
||||
REQUIRES_ARTWORK = 0x00000400, // requires external artwork for key game elements
|
||||
CLICKABLE_ARTWORK = 0x00000800, // artwork is clickable and requires mouse cursor
|
||||
UNOFFICIAL = 0x00001000, // unofficial hardware modification
|
||||
NO_SOUND_HW = 0x00002000, // system has no sound output
|
||||
MECHANICAL = 0x00004000, // contains mechanical parts (pinball, redemption games, ...)
|
||||
IS_INCOMPLETE = 0x00008000 // official system with blatantly incomplete hardware/software
|
||||
NOT_WORKING = 0x0000'0040,
|
||||
SUPPORTS_SAVE = 0x0000'0080, // system supports save states
|
||||
NO_COCKTAIL = 0x0000'0100, // screen flip support is missing
|
||||
IS_BIOS_ROOT = 0x0000'0200, // this driver entry is a BIOS root
|
||||
REQUIRES_ARTWORK = 0x0000'0400, // requires external artwork for key game elements
|
||||
CLICKABLE_ARTWORK = 0x0000'0800, // artwork is clickable and requires mouse cursor
|
||||
UNOFFICIAL = 0x0000'1000, // unofficial hardware modification
|
||||
NO_SOUND_HW = 0x0000'2000, // system has no sound output
|
||||
MECHANICAL = 0x0000'4000, // contains mechanical parts (pinball, redemption games, ...)
|
||||
IS_INCOMPLETE = 0x0000'8000 // official system with blatantly incomplete hardware/software
|
||||
};
|
||||
};
|
||||
|
||||
DECLARE_ENUM_BITWISE_OPERATORS(machine_flags::type);
|
||||
|
||||
|
||||
constexpr u64 MACHINE_TYPE_ARCADE = machine_flags::TYPE_ARCADE;
|
||||
constexpr u64 MACHINE_TYPE_CONSOLE = machine_flags::TYPE_CONSOLE;
|
||||
constexpr u64 MACHINE_TYPE_COMPUTER = machine_flags::TYPE_COMPUTER;
|
||||
constexpr u64 MACHINE_TYPE_OTHER = machine_flags::TYPE_OTHER;
|
||||
|
||||
|
||||
/// \addtogroup machinedef
|
||||
/// \{
|
||||
/// \name System emulation status constants
|
||||
@ -204,11 +192,9 @@ driver_device_creator< \
|
||||
/// \addtogroup machinedef
|
||||
/// \{
|
||||
|
||||
/// \brief Define a "game" system
|
||||
/// \brief Define a system
|
||||
///
|
||||
/// Use this macro to define most systems intended for public use,
|
||||
/// including arcade games, gambling machines, vending machines, and
|
||||
/// information kiosks. Must be used in the global namespace.
|
||||
/// Must be used in the global namespace.
|
||||
///
|
||||
/// Creates an appropriately named and populated #game_driver structure
|
||||
/// describing the system.
|
||||
@ -252,7 +238,7 @@ driver_device_creator< \
|
||||
/// unemulated and imperfectly emulated feature flags that apply to
|
||||
/// all systems implemented using the class in the class itself to
|
||||
/// avoid repetition.
|
||||
/// \sa GAMEL CONS COMP SYST
|
||||
/// \sa GAMEL SYST
|
||||
#define GAME(YEAR, NAME, PARENT, MACHINE, INPUT, CLASS, INIT, MONITOR, COMPANY, FULLNAME, FLAGS) \
|
||||
GAME_DRIVER_TRAITS(NAME, FULLNAME) \
|
||||
extern game_driver const GAME_NAME(NAME) \
|
||||
@ -267,18 +253,18 @@ extern game_driver const GAME_NAME(NAME) \
|
||||
ROM_NAME(NAME), \
|
||||
nullptr, \
|
||||
nullptr, \
|
||||
machine_flags::type(u32((MONITOR) | (FLAGS) | MACHINE_TYPE_ARCADE)),\
|
||||
machine_flags::type(u32((MONITOR) | (FLAGS))), \
|
||||
#NAME \
|
||||
};
|
||||
|
||||
|
||||
/// \brief Define a "game" system with an additional internal layout
|
||||
/// \brief Define a system with an additional internal layout
|
||||
///
|
||||
/// Equivalent to the #GAME macro, but with the additional ability to
|
||||
/// supply system-specific internal artwork layout data. Views from the
|
||||
/// supply a system-specific internal artwork layout. Views from the
|
||||
/// system-specific layout are available in addition to any views from
|
||||
/// layout data specified in the machine configuration. Must be used in
|
||||
/// the global namespace.
|
||||
/// layouts specified in the machine configuration. Must be used in the
|
||||
/// global namespace.
|
||||
///
|
||||
/// Creates an appropriately named and populated #game_driver structure
|
||||
/// describing the system.
|
||||
@ -324,7 +310,7 @@ extern game_driver const GAME_NAME(NAME) \
|
||||
/// avoid repetition.
|
||||
/// \param LAYOUT An #internal_layout structure providing additional
|
||||
/// internal artwork for the system.
|
||||
/// \sa GAME CONS COMP SYST
|
||||
/// \sa GAME SYST
|
||||
#define GAMEL(YEAR, NAME, PARENT, MACHINE, INPUT, CLASS, INIT, MONITOR, COMPANY, FULLNAME, FLAGS, LAYOUT) \
|
||||
GAME_DRIVER_TRAITS(NAME, FULLNAME) \
|
||||
extern game_driver const GAME_NAME(NAME) \
|
||||
@ -339,15 +325,15 @@ extern game_driver const GAME_NAME(NAME) \
|
||||
ROM_NAME(NAME), \
|
||||
nullptr, \
|
||||
&LAYOUT, \
|
||||
machine_flags::type(u32((MONITOR) | (FLAGS) | MACHINE_TYPE_ARCADE)),\
|
||||
machine_flags::type(u32((MONITOR) | (FLAGS))), \
|
||||
#NAME \
|
||||
};
|
||||
|
||||
|
||||
/// \brief Define a "console" system
|
||||
/// \brief Define a system with software compatibility grouping
|
||||
///
|
||||
/// Use this macro to define appliance-like entertainment systems
|
||||
/// designed for domestic use. Must be used in the global namespace.
|
||||
/// Equivalent to the #GAME macro, but allows software-compatible
|
||||
/// systems to be grouped.
|
||||
///
|
||||
/// Creates an appropriately named and populated #game_driver structure
|
||||
/// describing the system.
|
||||
@ -390,156 +376,31 @@ extern game_driver const GAME_NAME(NAME) \
|
||||
/// unemulated and imperfectly emulated feature flags that apply to
|
||||
/// all systems implemented using the class in the class itself to
|
||||
/// avoid repetition. Screen orientation flags may be included here.
|
||||
/// \sa GAME GAMEL COMP SYST
|
||||
#define CONS(YEAR, NAME, PARENT, COMPAT, MACHINE, INPUT, CLASS, INIT, COMPANY, FULLNAME, FLAGS) \
|
||||
GAME_DRIVER_TRAITS(NAME, FULLNAME) \
|
||||
extern game_driver const GAME_NAME(NAME) \
|
||||
{ \
|
||||
GAME_DRIVER_TYPE(NAME, CLASS, FLAGS), \
|
||||
#PARENT, \
|
||||
#YEAR, \
|
||||
COMPANY, \
|
||||
[] (machine_config &config, device_t &owner) { downcast<CLASS &>(owner).MACHINE(config); }, \
|
||||
INPUT_PORTS_NAME(INPUT), \
|
||||
[] (device_t &owner) { downcast<CLASS &>(owner).INIT(); }, \
|
||||
ROM_NAME(NAME), \
|
||||
#COMPAT, \
|
||||
nullptr, \
|
||||
machine_flags::type(u32(ROT0 | (FLAGS) | MACHINE_TYPE_CONSOLE)), \
|
||||
#NAME \
|
||||
};
|
||||
|
||||
|
||||
/// \brief Define a "computer" system
|
||||
///
|
||||
/// Use this macro to define computer-like systems. Must be used in the
|
||||
/// global namespace.
|
||||
///
|
||||
/// Creates an appropriately named and populated #game_driver structure
|
||||
/// describing the system.
|
||||
/// \param YEAR The year that the system was first made available. Must
|
||||
/// be a token containing only the digits zero to nine, question mark
|
||||
/// and plus sign.
|
||||
/// \param NAME The short name of the system, used for identification,
|
||||
/// and in filesystem paths for assets and data. Must be a token no
|
||||
/// longer than sixteen characters, containing only ASCII lowercase
|
||||
/// letters, digits and underscores. Must be globally unique across
|
||||
/// systems and devices.
|
||||
/// \param PARENT Short name of the parent or BIOS system if applicable,
|
||||
/// or a single digit zero otherwise.
|
||||
/// \param COMPAT Short name of a system that this system is compatible
|
||||
/// with if applicable, or a single digit zero otherwise.
|
||||
/// \param MACHINE Function used to buid machine configuration for the
|
||||
/// system. Must be a public member function of the system device
|
||||
/// class (\p CLASS argument), returning void and taking a reference
|
||||
/// to a #machine_config object as a parameter.
|
||||
/// \param INPUT Input port definitions for the root device of the
|
||||
/// system, usually defined using #INPUT_PORTS_START and associated
|
||||
/// macros.
|
||||
/// \param CLASS Class to instantiate as the root device of the system.
|
||||
/// Must be an implementation of #driver_device.
|
||||
/// \param INIT Initialisation function called after all child devices
|
||||
/// have started, but before the driver start functions are called.
|
||||
/// Often used for tasks like decrypting ROMs. Must be a public
|
||||
/// member function of the system device class (\p CLASS argument),
|
||||
/// returning void and accepting no parameters. The function
|
||||
/// #driver_device::empty_init is supplied for systems that don't need
|
||||
/// to perform additional tasks.
|
||||
/// \param COMPANY Name of the developer or distributor of the system.
|
||||
/// Must be a string.
|
||||
/// \param FULLNAME Display name for the system. Must be a string, and
|
||||
/// must be globally unique across systems and devices.
|
||||
/// \param FLAGS Bitwise combination of emulation status flags for the
|
||||
/// system, in addition to flags supplied by the system device class
|
||||
/// (see #device_t::unemulated_features and
|
||||
/// #device_t::imperfect_features). It is advisable to supply
|
||||
/// unemulated and imperfectly emulated feature flags that apply to
|
||||
/// all systems implemented using the class in the class itself to
|
||||
/// avoid repetition. Screen orientation flags may be included here.
|
||||
/// \sa GAME GAMEL CONS SYST
|
||||
#define COMP(YEAR, NAME, PARENT, COMPAT, MACHINE, INPUT, CLASS, INIT, COMPANY, FULLNAME, FLAGS) \
|
||||
GAME_DRIVER_TRAITS(NAME, FULLNAME) \
|
||||
extern game_driver const GAME_NAME(NAME) \
|
||||
{ \
|
||||
GAME_DRIVER_TYPE(NAME, CLASS, FLAGS), \
|
||||
#PARENT, \
|
||||
#YEAR, \
|
||||
COMPANY, \
|
||||
[] (machine_config &config, device_t &owner) { downcast<CLASS &>(owner).MACHINE(config); }, \
|
||||
INPUT_PORTS_NAME(INPUT), \
|
||||
[] (device_t &owner) { downcast<CLASS &>(owner).INIT(); }, \
|
||||
ROM_NAME(NAME), \
|
||||
#COMPAT, \
|
||||
nullptr, \
|
||||
machine_flags::type(u32(ROT0 | (FLAGS) | MACHINE_TYPE_COMPUTER)), \
|
||||
#NAME \
|
||||
};
|
||||
|
||||
|
||||
/// \brief Define a generic system
|
||||
///
|
||||
/// Use this macro to define miscellaneous systems that don't fall into
|
||||
/// one of the other categories. Must be used in the global namespace.
|
||||
///
|
||||
/// Creates an appropriately named and populated #game_driver structure
|
||||
/// describing the system.
|
||||
/// \param YEAR The year that the system was first made available. Must
|
||||
/// be a token containing only the digits zero to nine, question mark
|
||||
/// and plus sign.
|
||||
/// \param NAME The short name of the system, used for identification,
|
||||
/// and in filesystem paths for assets and data. Must be a token no
|
||||
/// longer than sixteen characters, containing only ASCII lowercase
|
||||
/// letters, digits and underscores. Must be globally unique across
|
||||
/// systems and devices.
|
||||
/// \param PARENT Short name of the parent or BIOS system if applicable,
|
||||
/// or a single digit zero otherwise.
|
||||
/// \param COMPAT Short name of a system that this system is compatible
|
||||
/// with if applicable, or a single digit zero otherwise.
|
||||
/// \param MACHINE Function used to buid machine configuration for the
|
||||
/// system. Must be a public member function of the system device
|
||||
/// class (\p CLASS argument), returning void and taking a reference
|
||||
/// to a #machine_config object as a parameter.
|
||||
/// \param INPUT Input port definitions for the root device of the
|
||||
/// system, usually defined using #INPUT_PORTS_START and associated
|
||||
/// macros.
|
||||
/// \param CLASS Class to instantiate as the root device of the system.
|
||||
/// Must be an implementation of #driver_device.
|
||||
/// \param INIT Initialisation function called after all child devices
|
||||
/// have started, but before the driver start functions are called.
|
||||
/// Often used for tasks like decrypting ROMs. Must be a public
|
||||
/// member function of the system device class (\p CLASS argument),
|
||||
/// returning void and accepting no parameters. The function
|
||||
/// #driver_device::empty_init is supplied for systems that don't need
|
||||
/// to perform additional tasks.
|
||||
/// \param COMPANY Name of the developer or distributor of the system.
|
||||
/// Must be a string.
|
||||
/// \param FULLNAME Display name for the system. Must be a string, and
|
||||
/// must be globally unique across systems and devices.
|
||||
/// \param FLAGS Bitwise combination of emulation status flags for the
|
||||
/// system, in addition to flags supplied by the system device class
|
||||
/// (see #device_t::unemulated_features and
|
||||
/// #device_t::imperfect_features). It is advisable to supply
|
||||
/// unemulated and imperfectly emulated feature flags that apply to
|
||||
/// all systems implemented using the class in the class itself to
|
||||
/// avoid repetition. Screen orientation flags may be included here.
|
||||
/// \sa GAME GAMEL CONS COMP
|
||||
/// \sa GAME GAMEL
|
||||
#define SYST(YEAR, NAME, PARENT, COMPAT, MACHINE, INPUT, CLASS, INIT, COMPANY, FULLNAME, FLAGS) \
|
||||
GAME_DRIVER_TRAITS(NAME, FULLNAME) \
|
||||
extern game_driver const GAME_NAME(NAME) \
|
||||
{ \
|
||||
GAME_DRIVER_TYPE(NAME, CLASS, FLAGS), \
|
||||
#PARENT, \
|
||||
#YEAR, \
|
||||
COMPANY, \
|
||||
[] (machine_config &config, device_t &owner) { downcast<CLASS &>(owner).MACHINE(config); }, \
|
||||
INPUT_PORTS_NAME(INPUT), \
|
||||
[] (device_t &owner) { downcast<CLASS &>(owner).INIT(); }, \
|
||||
ROM_NAME(NAME), \
|
||||
#COMPAT, \
|
||||
nullptr, \
|
||||
machine_flags::type(u32(ROT0 | (FLAGS) | MACHINE_TYPE_OTHER)), \
|
||||
#NAME \
|
||||
};
|
||||
GAME_DRIVER_TRAITS(NAME, FULLNAME) \
|
||||
extern game_driver const GAME_NAME(NAME) \
|
||||
{ \
|
||||
GAME_DRIVER_TYPE(NAME, CLASS, FLAGS), \
|
||||
#PARENT, \
|
||||
#YEAR, \
|
||||
COMPANY, \
|
||||
[] (machine_config &config, device_t &owner) { downcast<CLASS &>(owner).MACHINE(config); }, \
|
||||
INPUT_PORTS_NAME(INPUT), \
|
||||
[] (device_t &owner) { downcast<CLASS &>(owner).INIT(); }, \
|
||||
ROM_NAME(NAME), \
|
||||
#COMPAT, \
|
||||
nullptr, \
|
||||
machine_flags::type(u32(ROT0 | (FLAGS))), \
|
||||
#NAME \
|
||||
};
|
||||
|
||||
|
||||
#define CONS(YEAR, NAME, PARENT, COMPAT, MACHINE, INPUT, CLASS, INIT, COMPANY, FULLNAME, FLAGS) \
|
||||
SYST(YEAR, NAME, PARENT, COMPAT, MACHINE, INPUT, CLASS, INIT, COMPANY, FULLNAME, FLAGS)
|
||||
|
||||
#define COMP(YEAR, NAME, PARENT, COMPAT, MACHINE, INPUT, CLASS, INIT, COMPANY, FULLNAME, FLAGS) \
|
||||
SYST(YEAR, NAME, PARENT, COMPAT, MACHINE, INPUT, CLASS, INIT, COMPANY, FULLNAME, FLAGS)
|
||||
|
||||
/// \}
|
||||
|
||||
|
@ -60,29 +60,28 @@ osd_interface &running_machine::osd() const
|
||||
//-------------------------------------------------
|
||||
|
||||
running_machine::running_machine(const machine_config &_config, machine_manager &manager)
|
||||
: m_side_effects_disabled(0),
|
||||
debug_flags(0),
|
||||
m_config(_config),
|
||||
m_system(_config.gamedrv()),
|
||||
m_manager(manager),
|
||||
m_current_phase(machine_phase::PREINIT),
|
||||
m_paused(false),
|
||||
m_hard_reset_pending(false),
|
||||
m_exit_pending(false),
|
||||
m_soft_reset_timer(nullptr),
|
||||
m_rand_seed(0x9d14abd7),
|
||||
m_ui_active(true),
|
||||
m_basename(_config.gamedrv().name),
|
||||
m_sample_rate(_config.options().sample_rate()),
|
||||
m_saveload_schedule(saveload_schedule::NONE),
|
||||
m_saveload_schedule_time(attotime::zero),
|
||||
m_saveload_searchpath(nullptr),
|
||||
: m_side_effects_disabled(0)
|
||||
, debug_flags(0)
|
||||
, m_config(_config)
|
||||
, m_system(_config.gamedrv())
|
||||
, m_manager(manager)
|
||||
, m_current_phase(machine_phase::PREINIT)
|
||||
, m_paused(false)
|
||||
, m_hard_reset_pending(false)
|
||||
, m_exit_pending(false)
|
||||
, m_soft_reset_timer(nullptr)
|
||||
, m_rand_seed(0x9d14abd7)
|
||||
, m_basename(_config.gamedrv().name)
|
||||
, m_sample_rate(_config.options().sample_rate())
|
||||
, m_saveload_schedule(saveload_schedule::NONE)
|
||||
, m_saveload_schedule_time(attotime::zero)
|
||||
, m_saveload_searchpath(nullptr)
|
||||
|
||||
m_save(*this),
|
||||
m_memory(*this),
|
||||
m_ioport(*this),
|
||||
m_parameters(*this),
|
||||
m_scheduler(*this)
|
||||
, m_save(*this)
|
||||
, m_memory(*this)
|
||||
, m_ioport(*this)
|
||||
, m_parameters(*this)
|
||||
, m_scheduler(*this)
|
||||
{
|
||||
memset(&m_base_time, 0, sizeof(m_base_time));
|
||||
|
||||
|
@ -145,7 +145,6 @@ public:
|
||||
bool paused() const { return m_paused || (m_current_phase != machine_phase::RUNNING); }
|
||||
bool exit_pending() const { return m_exit_pending; }
|
||||
bool hard_reset_pending() const { return m_hard_reset_pending; }
|
||||
bool ui_active() const { return m_ui_active; }
|
||||
const std::string &basename() const { return m_basename; }
|
||||
int sample_rate() const { return m_sample_rate; }
|
||||
bool save_or_load_pending() const { return !m_saveload_pending_file.empty(); }
|
||||
@ -172,7 +171,6 @@ public:
|
||||
void add_notifier(machine_notification event, machine_notify_delegate callback, bool first = false);
|
||||
void call_notifiers(machine_notification which);
|
||||
void add_logerror_callback(logerror_callback callback);
|
||||
void set_ui_active(bool active) { m_ui_active = active; }
|
||||
void debug_break();
|
||||
void export_http_api();
|
||||
|
||||
@ -297,7 +295,6 @@ private:
|
||||
|
||||
// misc state
|
||||
u32 m_rand_seed; // current random number seed
|
||||
bool m_ui_active; // ui active or not (useful for games / systems with keyboard inputs)
|
||||
time_t m_base_time; // real time at initial emulation time
|
||||
std::string m_basename; // basename used for game-related paths
|
||||
int m_sample_rate; // the digital audio sample rate
|
||||
|
@ -63,73 +63,76 @@ namespace {
|
||||
struct thread_context
|
||||
{
|
||||
private:
|
||||
struct environment
|
||||
{
|
||||
sol::state state;
|
||||
bool busy = false;
|
||||
};
|
||||
|
||||
std::optional<environment> m_environment;
|
||||
std::string m_result;
|
||||
std::mutex m_guard;
|
||||
std::condition_variable m_sync;
|
||||
|
||||
public:
|
||||
bool m_busy = false;
|
||||
bool m_yield = false;
|
||||
|
||||
bool start(char const *scr)
|
||||
bool start(sol::this_state s, char const *scr)
|
||||
{
|
||||
std::unique_lock<std::mutex> caller_lock(m_guard);
|
||||
if (m_busy)
|
||||
if (m_environment && m_environment->busy)
|
||||
return false;
|
||||
|
||||
std::string script(scr);
|
||||
std::thread th(
|
||||
[this, script = std::string(scr)] ()
|
||||
{
|
||||
sol::state thstate;
|
||||
thstate.open_libraries();
|
||||
thstate["package"]["preload"]["zlib"] = &luaopen_zlib;
|
||||
thstate["package"]["preload"]["lfs"] = &luaopen_lfs;
|
||||
thstate["package"]["preload"]["linenoise"] = &luaopen_linenoise;
|
||||
sol::load_result res = thstate.load(script);
|
||||
std::unique_lock<std::mutex> result_lock(m_guard, std::defer_lock);
|
||||
if (res.valid())
|
||||
if (!m_environment)
|
||||
{
|
||||
m_environment.emplace();
|
||||
m_environment->state.open_libraries();
|
||||
m_environment->state["package"]["preload"]["zlib"] = &luaopen_zlib;
|
||||
m_environment->state["package"]["preload"]["lfs"] = &luaopen_lfs;
|
||||
m_environment->state["package"]["preload"]["linenoise"] = &luaopen_linenoise;
|
||||
m_environment->state.set_function(
|
||||
"yield",
|
||||
[this] ()
|
||||
{
|
||||
sol::protected_function func = res.get<sol::protected_function>();
|
||||
thstate.set_function(
|
||||
"yield",
|
||||
[this, &thstate]()
|
||||
{
|
||||
std::unique_lock<std::mutex> yield_lock(m_guard);
|
||||
m_result = thstate["status"];
|
||||
m_yield = true;
|
||||
m_sync.wait(yield_lock);
|
||||
m_yield = false;
|
||||
thstate["status"] = m_result;
|
||||
});
|
||||
auto ret = func();
|
||||
result_lock.lock();
|
||||
if (ret.valid())
|
||||
{
|
||||
auto result = ret.get<std::optional<char const *> >();
|
||||
if (!result)
|
||||
osd_printf_error("[LUA ERROR] in thread: return value must be string\n");
|
||||
else if (!*result)
|
||||
m_result.clear();
|
||||
else
|
||||
m_result = *result;
|
||||
}
|
||||
std::unique_lock<std::mutex> yield_lock(m_guard);
|
||||
m_result = m_environment->state["status"];
|
||||
m_yield = true;
|
||||
m_sync.wait(yield_lock);
|
||||
m_yield = false;
|
||||
});
|
||||
}
|
||||
|
||||
sol::load_result res = m_environment->state.load(scr);
|
||||
if (!res.valid())
|
||||
{
|
||||
sol::error err = res;
|
||||
luaL_error(s, err.what());
|
||||
return false; // unreachable - luaL_error throws
|
||||
}
|
||||
|
||||
std::thread th(
|
||||
[this, func = res.get<sol::protected_function>()] ()
|
||||
{
|
||||
auto ret = func();
|
||||
std::unique_lock<std::mutex> result_lock(m_guard);
|
||||
if (ret.valid())
|
||||
{
|
||||
auto result = ret.get<std::optional<char const *> >();
|
||||
if (!result)
|
||||
osd_printf_error("[LUA ERROR] in thread: return value must be string\n");
|
||||
else if (!*result)
|
||||
m_result.clear();
|
||||
else
|
||||
{
|
||||
sol::error err = ret;
|
||||
osd_printf_error("[LUA ERROR] in thread: %s\n", err.what());
|
||||
}
|
||||
m_result = *result;
|
||||
}
|
||||
else
|
||||
{
|
||||
result_lock.lock();
|
||||
sol::error err = res;
|
||||
osd_printf_error("[LUA ERROR] when loading script for thread: %s\n", err.what());
|
||||
sol::error err = ret;
|
||||
osd_printf_error("[LUA ERROR] in thread: %s\n", err.what());
|
||||
}
|
||||
assert(result_lock);
|
||||
m_busy = false;
|
||||
});
|
||||
m_busy = true;
|
||||
m_environment->busy = false;
|
||||
});
|
||||
m_environment->busy = true;
|
||||
m_yield = false;
|
||||
th.detach(); // FIXME: this is unsafe as the thread function modifies members of the object
|
||||
return true;
|
||||
@ -141,9 +144,9 @@ public:
|
||||
if (m_yield)
|
||||
{
|
||||
if (val)
|
||||
m_result = val;
|
||||
m_environment->state["status"] = val;
|
||||
else
|
||||
m_result.clear();
|
||||
m_environment->state["status"] = sol::lua_nil;
|
||||
m_sync.notify_all();
|
||||
}
|
||||
}
|
||||
@ -151,11 +154,16 @@ public:
|
||||
char const *result()
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(m_guard);
|
||||
if (m_busy && !m_yield)
|
||||
if (m_environment && m_environment->busy && !m_yield)
|
||||
return "";
|
||||
else
|
||||
return m_result.c_str();
|
||||
}
|
||||
|
||||
bool busy() const
|
||||
{
|
||||
return m_environment && m_environment->busy;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -1019,16 +1027,16 @@ void lua_engine::initialize()
|
||||
* thread runs until yield() and/or terminates on return.
|
||||
* thread:continue(val) - resume thread that has yielded and pass val to it
|
||||
*
|
||||
* thread.result - get result of a terminated thread as string
|
||||
* thread.busy - check if thread is running
|
||||
* thread.yield - check if thread is yielded
|
||||
* thread.result - get result of a terminated or yielding thread as string
|
||||
* thread.busy - check if thread is running or yielding
|
||||
* thread.yield - check if thread is yielding
|
||||
*/
|
||||
|
||||
auto thread_type = emu.new_usertype<thread_context>("thread", sol::call_constructor, sol::constructors<sol::types<>>());
|
||||
thread_type.set_function("start", &thread_context::start);
|
||||
thread_type.set_function("continue", &thread_context::resume);
|
||||
thread_type["result"] = sol::property(&thread_context::result);
|
||||
thread_type["busy"] = sol::readonly(&thread_context::m_busy);
|
||||
thread_type["busy"] = sol::property(&thread_context::busy);
|
||||
thread_type["yield"] = sol::readonly(&thread_context::m_yield);
|
||||
|
||||
|
||||
@ -1329,7 +1337,6 @@ void lua_engine::initialize()
|
||||
m.popmessage();
|
||||
});
|
||||
machine_type.set_function("logerror", [] (running_machine &m, char const *str) { m.logerror("[luaengine] %s\n", str); });
|
||||
machine_type["ui_active"] = sol::property(&running_machine::ui_active, &running_machine::set_ui_active);
|
||||
machine_type["time"] = sol::property(&running_machine::time);
|
||||
machine_type["system"] = sol::property(&running_machine::system);
|
||||
machine_type["parameters"] = sol::property(&running_machine::parameters);
|
||||
@ -1939,6 +1946,7 @@ void lua_engine::initialize()
|
||||
ui_type["options"] = sol::property([] (mame_ui_manager &m) { return static_cast<core_options *>(&m.options()); });
|
||||
ui_type["line_height"] = sol::property([] (mame_ui_manager &m) { return m.get_line_height(); });
|
||||
ui_type["menu_active"] = sol::property(&mame_ui_manager::is_menu_active);
|
||||
ui_type["ui_active"] = sol::property(&mame_ui_manager::ui_active, &mame_ui_manager::set_ui_active);
|
||||
ui_type["single_step"] = sol::property(&mame_ui_manager::single_step, &mame_ui_manager::set_single_step);
|
||||
ui_type["show_fps"] = sol::property(&mame_ui_manager::show_fps, &mame_ui_manager::set_show_fps);
|
||||
ui_type["show_profiler"] = sol::property(&mame_ui_manager::show_profiler, &mame_ui_manager::set_show_profiler);
|
||||
|
@ -58,24 +58,6 @@ void mame_options::parse_standard_inis(emu_options &options, std::ostream &error
|
||||
else
|
||||
parse_one_ini(options, "horizont", OPTION_PRIORITY_ORIENTATION_INI, &error_stream);
|
||||
|
||||
switch (cursystem->flags & machine_flags::MASK_TYPE)
|
||||
{
|
||||
case machine_flags::TYPE_ARCADE:
|
||||
parse_one_ini(options, "arcade", OPTION_PRIORITY_SYSTYPE_INI, &error_stream);
|
||||
break;
|
||||
case machine_flags::TYPE_CONSOLE:
|
||||
parse_one_ini(options ,"console", OPTION_PRIORITY_SYSTYPE_INI, &error_stream);
|
||||
break;
|
||||
case machine_flags::TYPE_COMPUTER:
|
||||
parse_one_ini(options, "computer", OPTION_PRIORITY_SYSTYPE_INI, &error_stream);
|
||||
break;
|
||||
case machine_flags::TYPE_OTHER:
|
||||
parse_one_ini(options, "othersys", OPTION_PRIORITY_SYSTYPE_INI, &error_stream);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
machine_config config(*cursystem, options);
|
||||
for (const screen_device &device : screen_device_enumerator(config.root_device()))
|
||||
{
|
||||
|
@ -31,7 +31,6 @@ enum
|
||||
OPTION_PRIORITY_MAME_INI = OPTION_PRIORITY_NORMAL + 1,
|
||||
OPTION_PRIORITY_DEBUG_INI,
|
||||
OPTION_PRIORITY_ORIENTATION_INI,
|
||||
OPTION_PRIORITY_SYSTYPE_INI,
|
||||
OPTION_PRIORITY_SCREEN_INI,
|
||||
OPTION_PRIORITY_SOURCE_INI,
|
||||
OPTION_PRIORITY_GPARENT_INI,
|
||||
|
@ -163,6 +163,7 @@ mame_ui_manager::mame_ui_manager(running_machine &machine)
|
||||
, m_font()
|
||||
, m_handler_callback()
|
||||
, m_handler_callback_type(ui_callback_type::GENERAL)
|
||||
, m_ui_active(true)
|
||||
, m_single_step(false)
|
||||
, m_showfps(false)
|
||||
, m_showfps_end(0)
|
||||
@ -335,7 +336,7 @@ void mame_ui_manager::config_save(config_type cfg_type, util::xml::data_node *pa
|
||||
void mame_ui_manager::initialize(running_machine &machine)
|
||||
{
|
||||
m_machine_info = std::make_unique<ui::machine_info>(machine);
|
||||
machine.set_ui_active(!machine_info().has_keyboard() || machine.options().ui_active());
|
||||
set_ui_active(!machine_info().has_keyboard() || machine.options().ui_active());
|
||||
|
||||
// initialize the on-screen display system
|
||||
slider_list = slider_init(machine);
|
||||
@ -1243,7 +1244,7 @@ uint32_t mame_ui_manager::handler_ingame(render_container &container)
|
||||
|
||||
// determine if we should disable the rest of the UI
|
||||
bool const has_keyboard = machine_info().has_keyboard();
|
||||
bool const ui_disabled = !machine().ui_active();
|
||||
bool const ui_disabled = !ui_active();
|
||||
|
||||
// is ScrLk UI toggling applicable here?
|
||||
if (has_keyboard)
|
||||
@ -1252,11 +1253,11 @@ uint32_t mame_ui_manager::handler_ingame(render_container &container)
|
||||
if (machine().ui_input().pressed(IPT_UI_TOGGLE_UI))
|
||||
{
|
||||
// toggle the UI
|
||||
machine().set_ui_active(!machine().ui_active());
|
||||
set_ui_active(!ui_active());
|
||||
|
||||
// display a popup indicating the new status
|
||||
std::string const name = get_general_input_setting(IPT_UI_TOGGLE_UI);
|
||||
if (machine().ui_active())
|
||||
if (ui_active())
|
||||
popup_time(2, _("UI controls enabled\nUse %1$s to toggle"), name);
|
||||
else
|
||||
popup_time(2, _("UI controls disabled\nUse %1$s to toggle"), name);
|
||||
|
@ -175,6 +175,8 @@ public:
|
||||
void save_main_option();
|
||||
|
||||
template <typename Format, typename... Params> void popup_time(int seconds, Format &&fmt, Params &&... args);
|
||||
void set_ui_active(bool active) { m_ui_active = active; }
|
||||
bool ui_active() const { return m_ui_active; }
|
||||
void show_fps_temp(double seconds);
|
||||
void set_show_fps(bool show);
|
||||
bool show_fps() const;
|
||||
@ -238,6 +240,7 @@ private:
|
||||
std::unique_ptr<render_font> m_font;
|
||||
handler_callback_func m_handler_callback;
|
||||
ui_callback_type m_handler_callback_type;
|
||||
bool m_ui_active;
|
||||
bool m_single_step;
|
||||
bool m_showfps;
|
||||
osd_ticks_t m_showfps_end;
|
||||
|
1605
src/mame/arcade.flt
1605
src/mame/arcade.flt
File diff suppressed because it is too large
Load Diff
1353
src/mame/mess.flt
1353
src/mame/mess.flt
File diff suppressed because it is too large
Load Diff
@ -731,7 +731,7 @@ void chain_manager::load_config(util::xml::data_node const &windownode)
|
||||
// treat source INI files or more specific as higher priority than CFG
|
||||
// FIXME: leaky abstraction - this depends on a front-end implementation detail
|
||||
bool const persist = windownode.get_attribute_int("persist", 1) != 0;
|
||||
bool const default_chains = (OPTION_PRIORITY_NORMAL + 6) > m_options.get_entry(OSDOPTION_BGFX_SCREEN_CHAINS)->priority();
|
||||
bool const default_chains = (OPTION_PRIORITY_NORMAL + 5) > m_options.get_entry(OSDOPTION_BGFX_SCREEN_CHAINS)->priority();
|
||||
bool const explicit_chains = !persist && !default_chains && *m_options.bgfx_screen_chains();
|
||||
|
||||
// if chains weren't explicitly specified, restore the chains from the config file
|
||||
|
Loading…
Reference in New Issue
Block a user