diff --git a/docs/source/commandline/commandline-all.rst b/docs/source/commandline/commandline-all.rst index 3f008300f04..c34618b428a 100644 --- a/docs/source/commandline/commandline-all.rst +++ b/docs/source/commandline/commandline-all.rst @@ -919,8 +919,8 @@ Example: supporting both XInput and DirectInput controllers. -OSD CLI Options ---------------- +OSD CLI Verbs +------------- .. _mame-commandline-listmidi: @@ -1862,7 +1862,7 @@ Core Performance Options .. _mame-commandline-lowlatency: -**-lowlatency** +**-[no]lowlatency** This tells MAME to draw a new frame before throttling to reduce input latency. This is particularly effective with VRR (Variable Refresh Rate) @@ -2698,11 +2698,11 @@ Core Video OpenGL GLSL Options .. _mame-commandline-glglsl: -**-gl_glsl** +**-[no]gl_glsl** Enable OpenGL GLSL, if available. - The default is OFF. + The default is OFF (**-nogl_glsl**). Example: .. code-block:: bash @@ -2765,20 +2765,6 @@ Core Video OpenGL GLSL Options mame suprmrio -gl_glsl -glsl_shader_screen0 gaussx -glsl_shader_screen1 gaussy -glsl_shader_screen2 CRT-geom-halation -.. _mame-commandline-glglslvidattr: - -**-gl_glsl_vid_attr** - - Enable OpenGL GLSL handling of brightness and contrast. - Better RGB system performance. - - Default is ``on``. - - Example: - .. code-block:: bash - - mame pacman -gl_glsl -gl_glsl_vid_attr off - Core Sound Options ------------------ @@ -2904,7 +2890,7 @@ Core Sound Options The default is ``1``. - | For PortAudio, see the section on :ref:`-pa_latency `. + | For PortAudio, see the section on :ref:`-pa_latency `. | XAudio2 calculates audio_latency as 10ms steps. | DSound calculates audio_latency as 10ms steps. | CoreAudio calculates audio_latency as 25ms steps. @@ -3256,7 +3242,7 @@ Core Input Options .. _mame-commandline-natural: -**\-natural** +**\-[no]natural** Allows user to specify whether or not to use a natural keyboard or not. This allows you to start your system in a 'native' mode, depending on your @@ -3290,7 +3276,7 @@ Core Input Options .. _mame-commandline-joystickcontradictory: -**-joystick_contradictory** +**-[no]joystick_contradictory** Enable contradictory direction digital joystick input at the same time such as **Left and Right** or **Up and Down** at the same time. @@ -3663,7 +3649,7 @@ Core Misc Options .. _mame-commandline-drcusec: -**\-drc_use_c** +**\-[no]drc_use_c** Force DRC to use the C code backend. @@ -3676,7 +3662,7 @@ Core Misc Options .. _mame-commandline-drcloguml: -**\-drc_log_uml** +**\-[no]drc_log_uml** Write DRC UML disassembly log. @@ -3689,7 +3675,7 @@ Core Misc Options .. _mame-commandline-drclognative: -**\-drc_log_native** +**\-[no]drc_log_native** Write DRC native disassembly log. @@ -3788,7 +3774,7 @@ Core Misc Options .. _mame-commandline-confirmquit: -**\-confirm_quit** +**\-[no]confirm_quit** Display a Confirm Quit dialog to screen on exit, requiring one extra step to exit MAME. @@ -3802,7 +3788,7 @@ Core Misc Options .. _mame-commandline-uimouse: -**\-ui_mouse** +**\-[no]ui_mouse** Displays a mouse cursor when using the built-in UI for MAME. @@ -3975,7 +3961,7 @@ HTTP Server Options PortAudio Options ----------------- -.. _mame-commandline-pa-api: +.. _mame-commandline-paapi: **-pa_api** *API* @@ -4031,7 +4017,7 @@ PortAudio Options mame suprmrio -sound portaudio -pa_api "Windows WASAPI" -.. _mame-commandline-pa-device: +.. _mame-commandline-padevice: **-pa_device** *device* @@ -4045,7 +4031,7 @@ PortAudio Options mame suprmrio -sound portaudio -pa_api "Windows WASAPI" -pa_device "NX-EDG27 (NVIDIA High Definition Audio)" -.. _mame-commandline-pa-latency: +.. _mame-commandline-palatency: **-pa_latency** *latency* diff --git a/docs/source/commandline/commandline-index.rst b/docs/source/commandline/commandline-index.rst index b0cd9a51170..8698dcf7dc5 100644 --- a/docs/source/commandline/commandline-index.rst +++ b/docs/source/commandline/commandline-index.rst @@ -11,23 +11,23 @@ Universal Commandline Options This section contains configuration options that are applicable to *all* MAME sub-builds (both SDL and Windows native). -Core Commands -~~~~~~~~~~~~~ +Core Verbs +~~~~~~~~~~ | :ref:`help ` | :ref:`validate ` -Configuration Commands -~~~~~~~~~~~~~~~~~~~~~~ +Configuration Verbs +~~~~~~~~~~~~~~~~~~~ | :ref:`createconfig ` | :ref:`showconfig ` | :ref:`showusage ` -Frontend Commands -~~~~~~~~~~~~~~~~~ +Frontend Verbs +~~~~~~~~~~~~~~ | :ref:`listxml ` | :ref:`listfull ` @@ -60,8 +60,8 @@ OSD-related Options | :ref:`joystickprovider ` -OSD CLI Options -~~~~~~~~~~~~~~~ +OSD CLI Verbs +~~~~~~~~~~~~~ | :ref:`listmidi ` | :ref:`listnetwork ` @@ -117,9 +117,8 @@ Core State/Playback Options | :ref:`state ` | :ref:`[no]autosave ` | :ref:`playback ` -| :ref:`exit_after_playback ` +| :ref:`[no]exit_after_playback ` | :ref:`record ` -| :ref:`record_timecode ` | :ref:`mngwrite ` | :ref:`aviwrite ` | :ref:`wavwrite ` @@ -143,7 +142,7 @@ Core Performance Options | :ref:`[no]refreshspeed ` | :ref:`numprocessors ` | :ref:`bench ` -| :ref:`lowlatency ` +| :ref:`[no]lowlatency ` Core Rotation Options @@ -212,6 +211,7 @@ Core Vector Options | :ref:`beam_width_min ` | :ref:`beam_width_max ` | :ref:`beam_intensity_weight ` +| :ref:`beam_dot_size ` | :ref:`flicker ` @@ -227,11 +227,10 @@ Core Video OpenGL Debugging Options Core Video OpenGL GLSL Options ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -| :ref:`gl_glsl ` +| :ref:`[no]gl_glsl ` | :ref:`gl_glsl_filter ` | :ref:`glsl_shader_mame[0-9] ` | :ref:`glsl_shader_screen[0-9] ` -| :ref:`gl_glsl_vid_attr ` Core Sound Options @@ -261,8 +260,8 @@ Core Input Options | :ref:`joystick_map ` | :ref:`joystick_deadzone ` | :ref:`joystick_saturation ` -| :ref:`natural ` -| :ref:`joystick_contradictory ` +| :ref:`[no]natural ` +| :ref:`[no]joystick_contradictory ` | :ref:`coin_impulse ` @@ -286,9 +285,11 @@ Core Debugging Options | :ref:`[no]oslog ` | :ref:`[no]log ` | :ref:`[no]debug ` +| :ref:`debugger ` | :ref:`debugscript ` | :ref:`[no]update_in_pause ` | :ref:`watchdog ` +| :ref:`debugger_port ` | :ref:`debugger_font ` | :ref:`debugger_font_size ` @@ -307,23 +308,23 @@ Core Misc Options ~~~~~~~~~~~~~~~~~ | :ref:`[no]drc ` -| :ref:`drc_use_c ` -| :ref:`drc_log_uml ` -| :ref:`drc_log_native ` +| :ref:`[no]drc_use_c ` +| :ref:`[no]drc_log_uml ` +| :ref:`[no]drc_log_native ` | :ref:`bios ` | :ref:`[no]cheat ` | :ref:`[no]skip_gameinfo ` | :ref:`uifont ` | :ref:`ui ` | :ref:`ramsize ` -| :ref:`confirm_quit ` -| :ref:`ui_mouse ` +| :ref:`[no]confirm_quit ` +| :ref:`[no]ui_mouse ` | :ref:`language ` | :ref:`[no]nvram_save ` Scripting Options ------------------ +~~~~~~~~~~~~~~~~~ | :ref:`autoboot_command ` | :ref:`autoboot_delay ` @@ -335,13 +336,21 @@ Scripting Options HTTP Server Options -------------------- +~~~~~~~~~~~~~~~~~~~ | :ref:`http ` | :ref:`http_port ` | :ref:`http_root ` +PortAudio Options +~~~~~~~~~~~~~~~~~ + +| :ref:`pa_api ` +| :ref:`pa_device ` +| :ref:`pa_latency ` + + Windows-Specific Commandline Options ------------------------------------ @@ -377,7 +386,7 @@ This section contains configuration options that are specific to any build suppo SDL Performance Options ~~~~~~~~~~~~~~~~~~~~~~~ -| :ref:`sdlvideofps ` +| :ref:`[no]sdlvideofps ` SDL Video Options diff --git a/docs/source/commandline/sdlconfig.rst b/docs/source/commandline/sdlconfig.rst index 0da5f4c526e..e67835c8c21 100644 --- a/docs/source/commandline/sdlconfig.rst +++ b/docs/source/commandline/sdlconfig.rst @@ -11,7 +11,7 @@ Performance Options .. _mame-scommandline-sdlvideofps: -**-sdlvideofps** +**-[no]sdlvideofps** Enable output of benchmark data on the SDL video subsystem, including your system's video driver, X server (if applicable), and OpenGL stack in **-video opengl** mode. diff --git a/docs/source/debugger/general.rst b/docs/source/debugger/general.rst index ffeb1379f3f..52146e369cd 100644 --- a/docs/source/debugger/general.rst +++ b/docs/source/debugger/general.rst @@ -78,8 +78,8 @@ do The **do** command simply evaluates the supplied expression. This is often used to set or modify device state variable (e.g. CPU registers), -or to write to memory. See :ref:`debugger-expressions` for details -about expression syntax. +or to write to memory. See :ref:`debugger-express` for details about +expression syntax. Examples: diff --git a/docs/source/debugger/index.rst b/docs/source/debugger/index.rst index 18785e734e7..9bf6f5f8301 100644 --- a/docs/source/debugger/index.rst +++ b/docs/source/debugger/index.rst @@ -163,7 +163,7 @@ debugger should take the most likely meaning for a device or address space specification. -.. _debugger-expressions: +.. _debugger-express: Debugger expression syntax -------------------------- @@ -218,6 +218,8 @@ Major differences from C expression semantics: always evaluated. +.. _debugger-express-num: + Numbers ~~~~~~~ @@ -240,6 +242,8 @@ Examples: * ``0b123`` is invalid +.. _debugger-express-bool: + Boolean values ~~~~~~~~~~~~~~ @@ -253,6 +257,8 @@ debugger commands to use the default value, even when subsequent parameters are specified. +.. _debugger-express-mem: + Memory accesses ~~~~~~~~~~~~~~~ @@ -390,6 +396,8 @@ Memory accesses can be used as both lvalues and rvalues, so you can write ``b@100 = ff`` to store a byte in memory. +.. _debugger-express-func: + Functions ~~~~~~~~~ diff --git a/docs/source/techspecs/luareference.rst b/docs/source/techspecs/luareference.rst index 85c7ea8cb8a..5c8297a2610 100644 --- a/docs/source/techspecs/luareference.rst +++ b/docs/source/techspecs/luareference.rst @@ -1648,9 +1648,12 @@ ioport:count_players() Returns the number of player controllers in the system. ioport:type_pressed(type, [player]) Returns a Boolean indicating whether the specified input is currently - pressed. The input port type is an enumerated value. The player number is - a zero-based index. If the player number is not supplied, it is assumed to - be zero. + pressed. The input type may be an enumerated value or an + :ref:`input type ` entry. If the input type + is an enumerated value, the player number may be supplied as a zero-based + index; if the player number is not supplied, it is assumed to be zero. If + the input type is an input type entry, the player number may not be supplied + separately. ioport:type_name(type, [player]) Returns the display name for the specified input type and player number. The input type is an enumerated value. The player number is a zero-based @@ -1665,22 +1668,31 @@ ioport:type_group(type, player) canonical grouping in an input configuration UI. ioport:type_seq(type, [player], [seqtype]) Get the configured :ref:`input sequence ` for the - specified input type, player number and sequence type. The input type is an - enumerated value. The player number is a zero-based index. If the player - number is not supplied, it is assumed to be zero. If the sequence type is - supplied, it must be ``"standard"``, ``"increment"`` or ``"decrement"``; if - it is not supplied, it is assumed to be ``"standard"``. + specified input type, player number and sequence type. The input type may + be an enumerated value or an + :ref:`input type ` entry. If the input type + is an enumerated value, the player number may be supplied as a zero-based + index; if the player number is not supplied, it is assumed to be zero. If + the input type is an input type entry, the player number may not be supplied + separately. If the sequence type is supplied, it must be ``"standard"``, + ``"increment"`` or ``"decrement"``; if it is not supplied, it is assumed to + be ``"standard"``. This provides access to general input configuration. -ioport:set_type_seq(type, player, seqtype, seq) +ioport:set_type_seq(type, [player], seqtype, seq) Set the configured :ref:`input sequence ` for the - specified input type, player number and sequence type. The input type is an - enumerated value. The player number is a zero-based index. The sequence - type must be ``"standard"``, ``"increment"`` or ``"decrement"``. + specified input type, player number and sequence type. The input type may + be an enumerated value or an + :ref:`input type ` entry. If the input type + is an enumerated value, the player number must be supplied as a zero-based + index. If the input type is an input type entry, the player number may not + be supplied separately. The sequence type must be ``"standard"``, + ``"increment"`` or ``"decrement"``. This allows general input configuration to be set. ioport:token_to_input_type(string) - Returns the input type and player number for the specified input type token. + Returns the input type and player number for the specified input type token + string. ioport:input_type_to_token(type, [player]) Returns the token string for the specified input type and player number. If the player number is not supplied, it assumed to be zero. @@ -1688,6 +1700,9 @@ ioport:input_type_to_token(type, [player]) Properties ^^^^^^^^^^ +ioport.types[] (read-only) + Gets the supported :ref:`input types `. Keys + are arbitrary indices. All supported operations have O(1) complexity. ioport.ports[] Gets the emulated :ref:`I/O ports ` in the system. Keys are absolute tags. The ``at`` and ``index_of`` methods have @@ -1985,6 +2000,41 @@ Properties live.name Display name for the field. +.. _luareference-input-inputtype: + +Input type +~~~~~~~~~~ + +Wraps MAME’s ``input_type_entry`` class, representing an emulated input type or +emulator UI input type. Input types are uniquely identified by the combination +of their enumerated type value and player index. + +Instantiation +^^^^^^^^^^^^^ + +manager.machine.ioport.types[index] + Gets a supported input type. + +Properties +^^^^^^^^^^ + +type.type (read-only) + An enumerated value representing the type of input. +type.group (read-only) + An integer giving the grouping for the input type. Should be used to + provide canonical grouping in an input configuration UI. +type.player (read-only) + The zero-based player number, or zero for non-player controls. +type.token (read-only) + The token string for the input type, used in configuration files. +type.name (read-only) + The display name for the input type. +type.is_analog (read-only) + A Boolean indicating whether the input type is analog or digital. Inputs + that only have on and off states are considered digital, while all other + inputs are considered analog, even if they can only represent discrete + values or positions. + .. _luareference-input-inputman: Input manager @@ -2745,10 +2795,12 @@ screens in the emulated system. Instantiation ^^^^^^^^^^^^^ -Layout scripts generally - manager.machine.render.targets[index].current_view Gets the currently selected view for a given render target. +file.views[name] + Gets the view with the specified name from a + :ref:`layout file `. This is how layout + scripts generally obtain views. Methods ^^^^^^^ @@ -2982,9 +3034,193 @@ Debugger -------- Some of MAME’s core debugging features can be controlled from Lua script. The -debugger must be enabled to use the debugging features (usually by passing +debugger must be enabled to use the debugger features (usually by passing ``-debug`` on the command line). +.. _luareference-debug-symtable: + +Symbol table +~~~~~~~~~~~~ + +Wrap’s MAME’s ``symbol_table`` class, providing named symbols that can be used +in expressions. Note that symbol tables can be created and used even when the +debugger is not enabled. + +Instantiation +^^^^^^^^^^^^^ + +emu.symbol_table(machine, [parent], [device]) + Creates a new symbol table in the context of the specified machine, + optionally supplying a parent symbol table. If a parent symbol table is + supplied, it must not be destroyed before the new symbol table. If a device + is specified and it implements ``device_memory_interface``, it is used as + the base for looking up address spaces and memory regions. Note that if a + device that does not implement ``device_memory_interface`` is supplied, it + will not be used (address spaces and memory regions will be looked up + relative to the root device). + +Methods +^^^^^^^ + +symbols:set_memory_modified_func(cb) + Set a function to call when memory is modified via the symbol table. No + arguments are passed to the function and any return values are ignored. + Call with ``nil`` to remove the callback. +symbols:add(name, [value]) + Adds a named integer symbol. The name must be a string. If a value is + supplied, it must be an integer. If a value is supplied, a read-only symbol + is added with the supplied value. If no value is supplied, a read/write + symbol is created with and initial value of zero. If a symbol entry with + the specified name already exists in the symbol table, it will be replaced. +symbols:add(name, getter, [setter], [format]) + Adds a named integer symbol using getter and optional setter callbacks. The + name must be a string. The getter must be a function returning an integer + for the symbol value. If supplied, the setter must be a function that + accepts a single integer argument for the new value of the symbol. A format + string for displaying the symbol value may optionally be supplied. If a + symbol entry with the specified name already exists in the symbol table, it + will be replaced. +symbols:add(name, minparams, maxparams, execute) + Adds a named function symbol. The name must be a string. The minimum and + maximum numbers of parameters must be integers. If a symbol entry with the + specified name already exists in the symbol table, it will be replaced. +symbols:find(name) + Returns the :ref:`symbol entry ` with the + specified name, or ``nil`` if there is no symbol with the specified name in + the symbol table. +symbols:find_deep(name) + Returns the :ref:`symbol entry ` with the + specified name, or ``nil`` if there is no symbol with the specified name in + the symbol table or any of its parent symbol tables. +symbols:value(name) + Returns the integer value of the symbol with the specified name, or zero if + there is no symbol with the specified name in the symbol table or any of its + parent symbol tables. Raises an error if the symbol with specified name is + a function symbol. +symbols:set_value(name, value) + Sets the value of the symbol with the specified name. Raises an error if + the symbol with the specified name is a read-only integer symbol or if it is + a function symbol. Has no effect if there is no symbol with the specified + name in the symbol table or any of its parent symbol tables. +symbols:memory_value(name, space, offset, size, disable_se) + Read a value from memory. Supply the name or tag of the address space or + memory region to read from, or ``nil`` to use the address space or memory + region implied by the ``space`` argument. See + :ref:`memory accesses in debugger expressions ` for + access type specifications that can be used for the ``space`` argument. + The access size is specified in bytes, and must be 1, 2, 4 or 8. The + ``disable_se`` argument specifies whether memory access side effects should + be disabled. +symbols:set_memory_value(name, space, offset, value, size, disable_se) + Write a value to memory. Supply the name or tag of the address space or + memory region to write to, or ``nil`` to use the address space or memory + region implied by the ``space`` argument. See + :ref:`memory accesses in debugger expressions ` for + access type specifications that can be used for the ``space`` argument. + The access size is specified in bytes, and must be 1, 2, 4 or 8. The + ``disable_se`` argument specifies whether memory access side effects should + be disabled. + +Properties +^^^^^^^^^^ + +symbols.entries[] + The :ref:`symbol entries ` in the symbol table, + indexed by name. The ``at`` and ``index_of`` methods have O(n) complexity; + all other supported operations have O(1) complexity. +symbols.parent (read-only) + The parent symbol table, or ``nil`` if the symbol table has no parent. + +.. _luareference-debug-expression: + +Parsed expression +~~~~~~~~~~~~~~~~~ + +Wraps MAME’s ``parsed_expression`` class, which represents a tokenised debugger +expression. Note that parsed expressions can be created and used even when the +debugger is not enabled. + +Intantiation +^^^^^^^^^^^^ + +emu.parsed_expression(symbols) + Creates an empty expression that will use the supplied + :ref:`symbol table ` to look up symbols. +emu.parsed_expression(symbols, string, [default_base]) + Creates an expression by parsing the supplied string, looking up symbols in + the supplied :ref:`symbol table `. If the + default base for interpreting integer literals is not supplied, 16 is used + (hexadecimal). Raises an error if the string contains syntax errors or uses + undefined symbols. +emu.parsed_expression(expression) + Creates a copy of an existing parsed expression. + +Methods +^^^^^^^ + +expression:set_default_base(base) + Set the default base for interpreting numeric literals. The base must be a + positive integer. +expression:parse(string) + Parse a debugger expression string. Replaces the current contents of the + expression if it is not empty. Raises an error if the string contains + syntax errors or uses undefined symbols. The previous content of the + expression is not preserved when attempting to parse an invalid expression + string. +expression:execute() + Evaluates the expression, returning an unsigned integer result. Raises an + error if the expression cannot be evaluated (e.g. calling a function with an + invalid number of arguments). + +Properties +^^^^^^^^^^ + +expression.is_empty (read-only) + A Boolean indicating whether the expression contains no tokens. +expression.original_string (read-only) + The original string that was parsed to create the expression. +expression.symbols (read/write) + The :ref:`symbol table ` used for to look up + symbols in the expression. + +.. _luareference-debug-symentry: + +Symbol entry +~~~~~~~~~~~~ + +Wraps MAME’s ``symbol_entry`` class, which represents an entry in a +:ref:`symbol table `. + +Instantiation +^^^^^^^^^^^^^ + +symbols:find(name) + Obtains the symbol entry with the specified name from a + :ref:`symbol table `, but does not search + parent symbol tables. +symbols:deep_find(name) + Obtains the symbol entry with the specified name from a + :ref:`symbol table `, recursively searching + parent symbol tables. + +Properties +^^^^^^^^^^ + +entry.name (read-only) + The name of the symbol entry. +entry.format (read-only) + The format string used to convert the symbol entry to text for display. +entry.is_function (read-only) + A Boolean indicating whether the symbol entry is a callable function. +entry.is_lval (read-only) + A Boolean indicating whether the symbol entry is an integer symbol that can + be set (i.e. whether it can be used on the left-hand side of assignment + expressions). +entry.value (read/write) + The integer value of the symbol entry. Attempting to set the value raises + an error if the symbol entry is read-only. Attempting to get or set the + value of a function symbol raises an error. + .. _luareference-debug-manager: Debugger manager diff --git a/hash/sitcom.xml b/hash/sitcom.xml index 03ba55756a8..811436777c7 100644 --- a/hash/sitcom.xml +++ b/hash/sitcom.xml @@ -11,7 +11,7 @@ license:CC0 2002 San Bergmans - + @@ -22,7 +22,7 @@ license:CC0 2002 Izabella Malcolm - + @@ -33,7 +33,7 @@ license:CC0 2002 Izabella Malcolm - + @@ -44,17 +44,17 @@ license:CC0 2002 Izabella Malcolm - + - + - + @@ -65,22 +65,22 @@ license:CC0 2002 Izabella Malcolm - + - + - + - + @@ -91,22 +91,22 @@ license:CC0 2002 Izabella Malcolm - + - + - + - + @@ -117,22 +117,22 @@ license:CC0 2002 Izabella Malcolm - + - + - + - + @@ -143,27 +143,27 @@ license:CC0 2002 Izabella Malcolm - + - + - + - + - + diff --git a/src/devices/imagedev/bitbngr.cpp b/src/devices/imagedev/bitbngr.cpp index 2a18395ad75..86c92c88ceb 100644 --- a/src/devices/imagedev/bitbngr.cpp +++ b/src/devices/imagedev/bitbngr.cpp @@ -9,6 +9,10 @@ #include "emu.h" #include "bitbngr.h" +#include "softlist_dev.h" + +#include + /*************************************************************************** @@ -24,6 +28,8 @@ DEFINE_DEVICE_TYPE(BITBANGER, bitbanger_device, "bitbanger", "Bitbanger") bitbanger_device::bitbanger_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, BITBANGER, tag, owner, clock), device_image_interface(mconfig, *this), + m_next(nullptr), + m_end(nullptr), m_interface(nullptr), m_is_readonly(false) { @@ -37,10 +43,8 @@ bitbanger_device::bitbanger_device(const machine_config &mconfig, const char *ta void bitbanger_device::output(uint8_t data) { - if (exists()) - { + if (!loaded_through_softlist() && exists()) fwrite(&data, 1); - } } @@ -50,11 +54,21 @@ void bitbanger_device::output(uint8_t data) uint32_t bitbanger_device::input(void *buffer, uint32_t length) { - if (exists()) + if (loaded_through_softlist()) + { + size_t const result = std::min(length, m_end - m_next); + memcpy(buffer, m_next, result); + m_next += result; + return uint32_t(result); + } + else if (exists()) { return fread(buffer, length); } - return 0; + else + { + return 0; + } } @@ -63,25 +77,45 @@ uint32_t bitbanger_device::input(void *buffer, uint32_t length) device_start -------------------------------------------------*/ -void bitbanger_device::device_start(void) +void bitbanger_device::device_start() { } +/*------------------------------------------------- + get_software_list_loader +-------------------------------------------------*/ + +const software_list_loader &bitbanger_device::get_software_list_loader() const +{ + return rom_software_list_loader::instance(); +} + + + /*------------------------------------------------- call_load -------------------------------------------------*/ -image_init_result bitbanger_device::call_load(void) +image_init_result bitbanger_device::call_load() { - /* we don't need to do anything special */ + if (loaded_through_softlist()) + { + auto const length = get_software_region_length("input"); + m_next = get_software_region("input"); + m_end = m_next + length; + } + else + { + m_next = m_end = nullptr; + } return image_init_result::PASS; } image_init_result bitbanger_device::call_create(int format_type, util::option_resolution *format_options) { - /* we don't need to do anything special */ + // we don't need to do anything special return image_init_result::PASS; } @@ -89,6 +123,7 @@ image_init_result bitbanger_device::call_create(int format_type, util::option_re call_unload -------------------------------------------------*/ -void bitbanger_device::call_unload(void) +void bitbanger_device::call_unload() { + m_next = m_end = nullptr; } diff --git a/src/devices/imagedev/bitbngr.h b/src/devices/imagedev/bitbngr.h index 19cbea3bc09..7ffcfd45a2b 100644 --- a/src/devices/imagedev/bitbngr.h +++ b/src/devices/imagedev/bitbngr.h @@ -39,10 +39,15 @@ public: uint32_t input(void *buffer, uint32_t length); protected: - // device-level overrides + // device_t implementation virtual void device_start() override; + // device_image_interface implementation + virtual software_list_loader const &get_software_list_loader() const override; + private: + uint8_t const *m_next; + uint8_t const *m_end; char const *m_interface; bool m_is_readonly; }; diff --git a/src/frontend/mame/cheat.cpp b/src/frontend/mame/cheat.cpp index 1e6d7aaffbd..c16316e8d02 100644 --- a/src/frontend/mame/cheat.cpp +++ b/src/frontend/mame/cheat.cpp @@ -1400,7 +1400,7 @@ void cheat_manager::load_cheats(std::string const &filename) emu_file cheatfile(std::move(searchstr), OPEN_FLAG_READ); try { - // loop over all instrances of the files found in our search paths + // loop over all instances of the files found in our search paths for (std::error_condition filerr = cheatfile.open(filename + ".xml"); !filerr; filerr = cheatfile.open_next()) { osd_printf_verbose("Loading cheats file from %s\n", cheatfile.fullpath()); diff --git a/src/frontend/mame/luaengine_debug.cpp b/src/frontend/mame/luaengine_debug.cpp index 8349cbd88fc..699c303f44f 100644 --- a/src/frontend/mame/luaengine_debug.cpp +++ b/src/frontend/mame/luaengine_debug.cpp @@ -14,6 +14,7 @@ #include "debug/debugcon.h" #include "debug/debugcpu.h" #include "debug/debugvw.h" +#include "debug/express.h" #include "debug/points.h" #include "debug/textbuf.h" #include "debugger.h" @@ -94,6 +95,140 @@ void lua_engine::initialize_debug(sol::table &emu) { "wr", read_or_write::READWRITE } }; + static const enum_parser s_expression_space_parser = + { + { "p", EXPSPACE_PROGRAM_LOGICAL }, { "lp", EXPSPACE_PROGRAM_LOGICAL }, { "pp", EXPSPACE_PROGRAM_PHYSICAL }, + { "d", EXPSPACE_DATA_LOGICAL }, { "ld", EXPSPACE_DATA_LOGICAL }, { "pd", EXPSPACE_DATA_PHYSICAL }, + { "i", EXPSPACE_IO_LOGICAL }, { "li", EXPSPACE_IO_LOGICAL }, { "pi", EXPSPACE_IO_PHYSICAL }, + { "3", EXPSPACE_OPCODE_LOGICAL }, { "l3", EXPSPACE_OPCODE_LOGICAL }, { "p3", EXPSPACE_OPCODE_PHYSICAL }, + { "r", EXPSPACE_PRGDIRECT }, + { "o", EXPSPACE_OPDIRECT }, + { "m", EXPSPACE_REGION } + }; + + auto const do_add_symbol = [this] (symbol_table &st, char const *name, sol::protected_function getter, std::optional setter, std::optional format) + { + symbol_table::setter_func setfun; + if (setter) + setfun = [this, cbfunc = std::move(*setter)] (u64 value) { invoke(cbfunc, value); }; + st.add( + name, + [this, cbfunc = std::move(getter)] () -> u64 + { + auto result = invoke(cbfunc).get >(); + if (result) + { + return *result; + } + else + { + osd_printf_error("[LUA EROR] invalid return from symbol value getter callback\n"); + return 0; + } + }, + std::move(setfun), + (format && *format) ? *format : ""); + }; + + auto symbol_table_type = emu.new_usertype( + "symbol_table", + sol::call_constructor, sol::factories( + [] (running_machine &machine, symbol_table *parent, device_t *device) { return std::make_unique(machine, parent, device); }, + [] (running_machine &machine, symbol_table *parent) { return std::make_unique(machine, parent); }, + [] (running_machine &machine, device_t &device) { return std::make_unique(machine, nullptr, &device); }, + [] (running_machine &machine) { return std::make_unique(machine); })); + symbol_table_type["set_memory_modified_func"] = + [this] (symbol_table &st, sol::object cb) + { + if (cb == sol::lua_nil) + st.set_memory_modified_func(nullptr); + else if (cb.is()) + st.set_memory_modified_func([this, cbfunc = cb.as()] () { invoke(cbfunc); }); + else + osd_printf_error("[LUA ERROR] must call set_memory_modified_func with function or nil\n"); + }; + symbol_table_type["add"] = sol::overload( + [] (symbol_table &st, char const *name) { st.add(name, symbol_table::READ_WRITE); }, + static_cast(&symbol_table::add), + do_add_symbol, + [do_add_symbol] (symbol_table &st, char const *name, sol::protected_function getter, sol::lua_nil_t, char const *format) + { + do_add_symbol(st, name, getter, std::nullopt, format); + }, + [do_add_symbol] (symbol_table &st, char const *name, sol::protected_function getter, std::optional setter) + { + do_add_symbol(st, name, getter, setter, nullptr); + }, + [do_add_symbol] (symbol_table &st, char const *name, sol::protected_function getter, char const *format) + { + do_add_symbol(st, name, getter, std::nullopt, format); + }, + [do_add_symbol] (symbol_table &st, char const *name, sol::protected_function getter) + { + do_add_symbol(st, name, getter, std::nullopt, nullptr); + }, + [this] (symbol_table &st, char const *name, int minparams, int maxparams, sol::protected_function execute) + { + st.add( + name, + minparams, + maxparams, + [this, cbref = sol::reference(execute)] (int numparams, u64 const *paramlist) -> u64 + { + sol::stack_reference traceback(m_lua_state, -sol::stack::push(m_lua_state, sol::default_traceback_error_handler)); + cbref.push(); + sol::stack_aligned_stack_handler_function func(m_lua_state, -1, traceback); + for (int i = 0; numparams > i; ++i) + lua_pushinteger(m_lua_state, paramlist[i]); + auto result = func(sol::stack_count(numparams)).get >(); + traceback.pop(); + return result ? *result : 0; + }); + }); + symbol_table_type["find"] = &symbol_table::find; + symbol_table_type["find_deep"] = &symbol_table::find_deep; + symbol_table_type["value"] = &symbol_table::value; + symbol_table_type["set_value"] = &symbol_table::set_value; + symbol_table_type["memory_value"] = + [] (symbol_table &st, char const *name, char const *space, u32 offset, int size, bool disable_se) + { + expression_space const es = s_expression_space_parser(space); + return st.memory_value(name, es, offset, size, disable_se); + }; + symbol_table_type["set_memory_value"] = + [] (symbol_table &st, char const *name, char const *space, u32 offset, int size, u64 value, bool disable_se) + { + expression_space const es = s_expression_space_parser(space); + st.set_memory_value(name, es, offset, size, value, disable_se); + }; + //symbol_table_type["read_memory"] = &symbol_table::read_memory; crashes if you try to use it, need to work out why + //symbol_table_type["write_memory"] = &symbol_table::write_memory; crashes if you try to use it, need to work out why + symbol_table_type["entries"] = sol::property([] (symbol_table const &st) { return standard_tag_object_ptr_map(st.entries()); }); + symbol_table_type["parent"] = sol::property(&symbol_table::parent); + + + auto parsed_expression_type = emu.new_usertype( + "parsed_expression", + sol::call_constructor, sol::factories( + [] (symbol_table &symtable) { return std::make_unique(symtable); }, + [] (symbol_table &symtable, char const *expression, int default_base) { return std::make_unique(symtable, expression, default_base); }, + [] (symbol_table &symtable, char const *expression) { return std::make_unique(symtable, expression); }, + [] (parsed_expression const &src) { return std::make_unique(src); })); + parsed_expression_type["set_default_base"] = &parsed_expression::set_default_base; + parsed_expression_type["parse"] = [] (parsed_expression &e, char const *string) { e.parse(string); }; + parsed_expression_type["execute"] = &parsed_expression::execute; + parsed_expression_type["is_empty"] = sol::property(&parsed_expression::is_empty); + parsed_expression_type["original_string"] = sol::property(&parsed_expression::original_string); + parsed_expression_type["symbols"] = sol::property(&parsed_expression::symbols, &parsed_expression::set_symbols); + + + auto symbol_entry_type = sol().registry().new_usertype("symbol_entry", sol::no_constructor); + symbol_entry_type["name"] = sol::property(&symbol_entry::name); + symbol_entry_type["format"] = sol::property(&symbol_entry::format); + symbol_entry_type["is_function"] = sol::property(&symbol_entry::is_function); + symbol_entry_type["is_lval"] = sol::property(&symbol_entry::is_lval); + symbol_entry_type["value"] = sol::property(&symbol_entry::value, &symbol_entry::set_value); + auto debugger_type = sol().registry().new_usertype("debugger", sol::no_constructor); debugger_type["command"] = [] (debugger_manager &debug, std::string const &cmd) { debug.console().execute_command(cmd, false); }; @@ -177,7 +312,7 @@ void lua_engine::initialize_debug(sol::table &emu) device_debug_type["wpset"] = [] (device_debug &dev, addr_space &sp, std::string const &type, offs_t addr, offs_t len, char const *cond, char const *act) { - read_or_write wptype = s_read_or_write_parser(type); + read_or_write const wptype = s_read_or_write_parser(type); int result(dev.watchpoint_set(sp.space, wptype, addr, len, cond, act)); dev.device().machine().debug_view().update_all(DVT_WATCH_POINTS); return result; diff --git a/src/frontend/mame/luaengine_input.cpp b/src/frontend/mame/luaengine_input.cpp index f32858ccce3..1812bdc17b3 100644 --- a/src/frontend/mame/luaengine_input.cpp +++ b/src/frontend/mame/luaengine_input.cpp @@ -144,29 +144,40 @@ void lua_engine::initialize_input(sol::table &emu) ioport_manager_type["count_players"] = &ioport_manager::count_players; ioport_manager_type["type_pressed"] = sol::overload( &ioport_manager::type_pressed, - [] (ioport_manager &im, ioport_type type) { return im.type_pressed(type, 0); }); + [] (ioport_manager &im, ioport_type type) { return im.type_pressed(type, 0); }, + [] (ioport_manager &im, input_type_entry const &type) { return im.type_pressed(type.type(), type.player()); }); ioport_manager_type["type_name"] = sol::overload( &ioport_manager::type_name, [] (ioport_manager &im, ioport_type type) { return im.type_name(type, 0); }); ioport_manager_type["type_group"] = sol::overload( &ioport_manager::type_group, [] (ioport_manager &im, ioport_type type) { return im.type_group(type, 0); }); - ioport_manager_type["type_seq"] = + ioport_manager_type["type_seq"] = sol::overload( [] (ioport_manager &im, ioport_type type, std::optional player, std::optional seq_type_string) { if (!player) player = 0; input_seq_type seq_type = seq_type_string ? s_seq_type_parser(*seq_type_string) : SEQ_TYPE_STANDARD; return im.type_seq(type, *player, seq_type); - }; - ioport_manager_type["set_type_seq"] = + }, + [] (ioport_manager &im, input_type_entry const &type, std::optional seq_type_string) + { + input_seq_type seq_type = seq_type_string ? s_seq_type_parser(*seq_type_string) : SEQ_TYPE_STANDARD; + return im.type_seq(type.type(), type.player(), seq_type); + }); + ioport_manager_type["set_type_seq"] = sol::overload( [] (ioport_manager &im, ioport_type type, std::optional player, std::optional seq_type_string, input_seq const &seq) { if (!player) player = 0; input_seq_type seq_type = seq_type_string ? s_seq_type_parser(*seq_type_string) : SEQ_TYPE_STANDARD; im.set_type_seq(type, *player, seq_type, seq); - }; + }, + [] (ioport_manager &im, input_type_entry const &type, std::optional seq_type_string, input_seq const &seq) + { + input_seq_type seq_type = seq_type_string ? s_seq_type_parser(*seq_type_string) : SEQ_TYPE_STANDARD; + im.set_type_seq(type.type(), type.player(), seq_type, seq); + }); ioport_manager_type["token_to_input_type"] = [] (ioport_manager &im, std::string const &string) { @@ -177,6 +188,7 @@ void lua_engine::initialize_input(sol::table &emu) ioport_manager_type["input_type_to_token"] = sol::overload( &ioport_manager::input_type_to_token, [] (ioport_manager &im, ioport_type type) { return im.input_type_to_token(type, 0); }); + ioport_manager_type["types"] = sol::property(&ioport_manager::types); ioport_manager_type["ports"] = sol::property([] (ioport_manager &im) { return tag_object_ptr_map(im.ports()); }); @@ -359,6 +371,15 @@ void lua_engine::initialize_input(sol::table &emu) ioport_field_live_type["name"] = &ioport_field_live::name; + auto input_type_entry_type = sol().registry().new_usertype("input_type_entry", sol::no_constructor); + input_type_entry_type["type"] = sol::property(&input_type_entry::type); + input_type_entry_type["group"] = sol::property(&input_type_entry::group); + input_type_entry_type["player"] = sol::property(&input_type_entry::player); + input_type_entry_type["token"] = sol::property(&input_type_entry::token); + input_type_entry_type["name"] = sol::property(&input_type_entry::name); + input_type_entry_type["is_analog"] = sol::property([] (input_type_entry const &type) { return ioport_manager::type_is_analog(type.type()); }); + + auto input_type = sol().registry().new_usertype("input", sol::no_constructor); input_type["code_value"] = &input_manager::code_value; input_type["code_pressed"] = &input_manager::code_pressed; diff --git a/src/mame/drivers/agat.cpp b/src/mame/drivers/agat.cpp index b8cd4cf9b9a..0f12a33b3d3 100644 --- a/src/mame/drivers/agat.cpp +++ b/src/mame/drivers/agat.cpp @@ -69,6 +69,9 @@ ************************************************************************/ #include "emu.h" +#include "machine/agatkeyb.h" +#include "video/agat7.h" +#include "video/agat9.h" #include "bus/a2bus/a2diskii.h" #include "bus/a2bus/agat7langcard.h" @@ -80,12 +83,9 @@ #include "cpu/m6502/m6502.h" #include "cpu/m6502/r65c02.h" #include "imagedev/cassette.h" -#include "machine/agatkeyb.h" #include "machine/bankdev.h" #include "machine/timer.h" #include "sound/spkrdev.h" -#include "video/agat7.h" -#include "video/agat9.h" #include "screen.h" #include "softlist.h" diff --git a/src/mame/drivers/asst128.cpp b/src/mame/drivers/asst128.cpp index b9ce03eab78..0f5f9e7a466 100644 --- a/src/mame/drivers/asst128.cpp +++ b/src/mame/drivers/asst128.cpp @@ -2,16 +2,17 @@ // copyright-holders:Sergey Svishchev #include "emu.h" +#include "machine/genpc.h" #include "bus/pc_joy/pc_joy.h" #include "bus/pc_kbd/keyboards.h" #include "bus/pc_kbd/pc_kbdc.h" #include "cpu/i86/i86.h" -#include "formats/asst128_dsk.h" #include "imagedev/floppy.h" -#include "machine/genpc.h" #include "machine/pc_fdc.h" +#include "formats/asst128_dsk.h" + DECLARE_DEVICE_TYPE(ASST128_MOTHERBOARD, asst128_mb_device) diff --git a/src/mame/drivers/ec184x.cpp b/src/mame/drivers/ec184x.cpp index b197d9a7b9e..04cc0ee5ac7 100644 --- a/src/mame/drivers/ec184x.cpp +++ b/src/mame/drivers/ec184x.cpp @@ -14,13 +14,14 @@ #include "emu.h" +#include "machine/genpc.h" #include "bus/isa/xsu_cards.h" #include "bus/pc_kbd/keyboards.h" #include "bus/pc_kbd/pc_kbdc.h" #include "cpu/i86/i86.h" -#include "machine/genpc.h" #include "machine/ram.h" + #include "softlist_dev.h" diff --git a/src/mame/drivers/hp_ipc.cpp b/src/mame/drivers/hp_ipc.cpp index fa396eef9b9..f3e1b64809a 100644 --- a/src/mame/drivers/hp_ipc.cpp +++ b/src/mame/drivers/hp_ipc.cpp @@ -356,17 +356,16 @@ Software to look for ******************************************************************************/ #include "emu.h" +#include "machine/hp_ipc_optrom.h" #include "bus/hp_hil/hil_devices.h" #include "bus/hp_hil/hp_hil.h" #include "bus/hp_ipc_io/hp_ipc_io.h" #include "bus/ieee488/ieee488.h" #include "cpu/m68000/m68000.h" -#include "formats/hp_ipc_dsk.h" #include "imagedev/floppy.h" #include "machine/bankdev.h" #include "machine/cop452.h" -#include "machine/hp_ipc_optrom.h" #include "machine/input_merger.h" #include "machine/mm58167.h" #include "machine/ram.h" @@ -374,11 +373,13 @@ Software to look for #include "machine/wd_fdc.h" #include "softlist_dev.h" #include "sound/dac.h" -#include "speaker.h" #include "video/hp1ll3.h" +#include "formats/hp_ipc_dsk.h" + #include "emupal.h" #include "screen.h" +#include "speaker.h" namespace { diff --git a/src/mame/drivers/iskr103x.cpp b/src/mame/drivers/iskr103x.cpp index 5f3af8bfa59..694ac815ce2 100644 --- a/src/mame/drivers/iskr103x.cpp +++ b/src/mame/drivers/iskr103x.cpp @@ -16,18 +16,20 @@ #include "emu.h" +#include "machine/genpc.h" #include "bus/isa/xsu_cards.h" #include "bus/pc_kbd/keyboards.h" #include "bus/pc_kbd/pc_kbdc.h" #include "cpu/i86/i86.h" -#include "machine/genpc.h" #include "machine/pc_lpt.h" #include "machine/ram.h" #include "softlist.h" +namespace { + class iskr103x_state : public driver_device { public: @@ -123,6 +125,9 @@ ROM_START( iskr1031 ) ROMX_LOAD( "150-07.bin", 0xc001, 0x2000, CRC(0dc4b65a) SHA1(c96f066251a7343eac8113ea9dcb2cb12d0334d5), ROM_SKIP(1) | ROM_BIOS(1)) ROM_END +} // anonymous namespace + + /*************************************************************************** Game driver(s) diff --git a/src/mame/drivers/mc1502.cpp b/src/mame/drivers/mc1502.cpp index 99822915543..a8461a599f2 100644 --- a/src/mame/drivers/mc1502.cpp +++ b/src/mame/drivers/mc1502.cpp @@ -15,11 +15,21 @@ ***************************************************************************/ #include "emu.h" +#include "machine/kb_7007_3.h" +#include "bus/centronics/ctronics.h" +#include "bus/isa/isa.h" +#include "bus/isa/mc1502_fdc.h" +#include "bus/isa/xsu_cards.h" #include "bus/rs232/rs232.h" #include "cpu/i86/i86.h" -#include "includes/mc1502.h" -#include "machine/kb_7007_3.h" +#include "imagedev/cassette.h" +#include "machine/i8251.h" +#include "machine/i8255.h" +#include "machine/pic8259.h" +#include "machine/pit8253.h" +#include "machine/ram.h" +#include "sound/spkrdev.h" #include "softlist_dev.h" #include "speaker.h" @@ -38,6 +48,82 @@ #define LOGPPI(...) LOGMASKED(LOG_PPI, __VA_ARGS__) +namespace { + +class mc1502_state : public driver_device +{ +public: + mc1502_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_upd8251(*this, "upd8251") + , m_pic8259(*this, "pic8259") + , m_pit8253(*this, "pit8253") + , m_ppi8255n1(*this, "ppi8255n1") + , m_ppi8255n2(*this, "ppi8255n2") + , m_isabus(*this, "isa") + , m_speaker(*this, "speaker") + , m_cassette(*this, "cassette") + , m_centronics(*this, "centronics") + , m_ram(*this, RAM_TAG) + , m_kbdio(*this, "Y%u", 1) + { } + + void mc1502(machine_config &config); + + void init_mc1502(); + + void fdc_config(device_t *device); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + +private: + required_device m_maincpu; + required_device m_upd8251; + required_device m_pic8259; + required_device m_pit8253; + required_device m_ppi8255n1; + required_device m_ppi8255n2; + required_device m_isabus; + required_device m_speaker; + required_device m_cassette; + required_device m_centronics; + required_device m_ram; + required_ioport_array<12> m_kbdio; + + TIMER_CALLBACK_MEMBER(keyb_signal_callback); + + struct { + uint8_t pulsing; + uint16_t mask; /* input lines */ + emu_timer *keyb_signal_timer; + } m_kbd; + + uint8_t m_ppi_portb; + uint8_t m_ppi_portc; + uint8_t m_spkrdata; + + DECLARE_WRITE_LINE_MEMBER(mc1502_pit8253_out1_changed); + DECLARE_WRITE_LINE_MEMBER(mc1502_pit8253_out2_changed); + DECLARE_WRITE_LINE_MEMBER(mc1502_speaker_set_spkrdata); + DECLARE_WRITE_LINE_MEMBER(mc1502_i8251_syndet); + + void mc1502_ppi_portb_w(uint8_t data); + void mc1502_ppi_portc_w(uint8_t data); + uint8_t mc1502_ppi_portc_r(); + uint8_t mc1502_kppi_porta_r(); + void mc1502_kppi_portb_w(uint8_t data); + void mc1502_kppi_portc_w(uint8_t data); + + void mc1502_io(address_map &map); + void mc1502_map(address_map &map); + + int m_pit_out2; +}; + + /* * onboard devices: */ @@ -387,6 +473,9 @@ ROM_START( pk88 ) ROM_LOAD( "pk88-1.064", 0xe000, 0x2000, CRC(6fa7e7ef) SHA1(d68bc273baa46ba733ac6ad4df7569dd70cf60dd)) ROM_END +} // anonymous namespace + + /*************************************************************************** Game driver(s) diff --git a/src/mame/drivers/ms0515.cpp b/src/mame/drivers/ms0515.cpp index 3b8a4f4b36b..63fc8d2ba9e 100644 --- a/src/mame/drivers/ms0515.cpp +++ b/src/mame/drivers/ms0515.cpp @@ -29,7 +29,6 @@ #include "bus/rs232/rs232.h" #include "cpu/t11/t11.h" -#include "formats/ms0515_dsk.h" #include "imagedev/floppy.h" #include "machine/clock.h" #include "machine/i8251.h" @@ -40,6 +39,8 @@ #include "machine/wd_fdc.h" #include "sound/spkrdev.h" +#include "formats/ms0515_dsk.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -59,6 +60,8 @@ #define LOGSYSREG(format, ...) LOGMASKED(LOG_SYSREG, "%11.6f at %s: " format, machine().time().as_double(), machine().describe_context(), __VA_ARGS__) +namespace { + class ms0515_state : public driver_device { public: @@ -617,6 +620,9 @@ ROM_START( ms0515 ) ROMX_LOAD( "0515h.rf4", 0xc001, 0x2000, CRC(e3ff6da9) SHA1(3febccf40abc2e3ca7db3f6f3884be117722dd8b), ROM_SKIP(1) | ROM_BIOS(1)) ROM_END +} // anonymous namespace + + /* Driver */ // YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS diff --git a/src/mame/drivers/sitcom.cpp b/src/mame/drivers/sitcom.cpp index 2fb6e85e692..389d4fcb5a8 100644 --- a/src/mame/drivers/sitcom.cpp +++ b/src/mame/drivers/sitcom.cpp @@ -33,13 +33,10 @@ #include "emu.h" #include "bus/rs232/rs232.h" - #include "cpu/i8085/i8085.h" - +#include "imagedev/bitbngr.h" #include "machine/clock.h" -#include "machine/bankdev.h" #include "machine/i8255.h" - #include "video/dl1416.h" #include "softlist_dev.h" @@ -59,9 +56,9 @@ public: : driver_device(mconfig, type, tag) , m_buttons(*this, "BUTTONS") , m_maincpu(*this, "maincpu") - , m_bank(*this, "bank") , m_digits(*this, "digit%u", 0U) , m_leds(*this, "p%c%u", unsigned('a'), 0U) + , m_bootstrap(*this, "bootstrap") , m_rxd(true) { } @@ -71,6 +68,9 @@ public: DECLARE_INPUT_CHANGED_MEMBER(update_buttons); protected: + void sitcom_mem(address_map &map); + void sitcom_io(address_map &map); + template void update_ds(offs_t offset, uint16_t data) { m_digits[(D << 2) | offset] = data; } DECLARE_WRITE_LINE_MEMBER(update_rxd) { m_rxd = bool(state); } DECLARE_READ_LINE_MEMBER(sid_line) { return m_rxd ? 1 : 0; } @@ -78,18 +78,19 @@ protected: virtual void update_ppi_pa(uint8_t data); virtual void update_ppi_pb(uint8_t data); - void sitcom_bank(address_map &map); - void sitcom_io(address_map &map); - void sitcom_mem(address_map &map); - virtual void machine_start() override; virtual void machine_reset() override; + static void sitcom_null_modem(device_t *device) + { + device->subdevice("stream")->set_interface("rs232"); + } + required_ioport m_buttons; required_device m_maincpu; - required_device m_bank; output_finder<15> m_digits; output_finder<2, 8> m_leds; + memory_view m_bootstrap; bool m_rxd; }; @@ -109,6 +110,7 @@ public: , m_ppi(*this, "ppi") , m_ds2(*this, "ds2") , m_test_led(*this, "test_led") + , m_dac(*this, "dac") , m_shutter_timer(nullptr) , m_shutter(false) , m_dac_cs(true) @@ -137,6 +139,7 @@ protected: required_device m_ppi; required_device m_ds2; output_finder<> m_test_led; + output_finder<> m_dac; emu_timer *m_shutter_timer; bool m_shutter; @@ -144,18 +147,12 @@ protected: }; -void sitcom_state::sitcom_bank(address_map &map) -{ - map.unmap_value_high(); - map(0x0000, 0x07ff).rom().region("bootstrap", 0); - map(0x8000, 0xffff).ram().share("ram"); -} - void sitcom_state::sitcom_mem(address_map &map) { map.unmap_value_high(); - map(0x0000, 0x7fff).m(m_bank, FUNC(address_map_bank_device::amap8)); - map(0x8000, 0xffff).ram().share("ram"); + map(0x0000, 0x7fff).mirror(0x8000).ram(); + map(0x0000, 0x7fff).view(m_bootstrap); + m_bootstrap[0](0x0000, 0x7fff).unmapw().rom().region("bootstrap", 0); } void sitcom_state::sitcom_io(address_map &map) @@ -222,7 +219,7 @@ void sitcom_state::machine_start() void sitcom_state::machine_reset() { - m_bank->set_bank(0); + m_bootstrap.select(0); } void sitcom_state::update_ppi_pa(uint8_t data) @@ -245,9 +242,9 @@ INPUT_CHANGED_MEMBER( sitcom_state::update_buttons ) m_maincpu->set_input_line(INPUT_LINE_RESET, (boot || reset) ? ASSERT_LINE : CLEAR_LINE); if (boot) - m_bank->set_bank(0); + m_bootstrap.select(0); else if (reset) - m_bank->set_bank(1); + m_bootstrap.disable(); } @@ -319,6 +316,7 @@ void sitcom_timer_state::machine_start() sitcom_state::machine_start(); m_test_led.resolve(); + m_dac.resolve(); m_shutter_timer = timer_alloc(TIMER_SHUTTER); @@ -339,6 +337,7 @@ void sitcom_timer_state::machine_reset() void sitcom_timer_state::update_dac(uint8_t value) { // supposed to be a DAC and an analog meter, but that's hard to do with internal layouts + m_dac = value; constexpr u8 s_7seg[10] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f }; m_digits[12] = s_7seg[value % 10]; value /= 10; @@ -357,8 +356,6 @@ void sitcom_state::sitcom(machine_config &config) m_maincpu->in_sid_func().set(FUNC(sitcom_state::sid_line)); m_maincpu->out_sod_func().set_output("sod_led"); - ADDRESS_MAP_BANK(config, "bank").set_map(&sitcom_state::sitcom_bank).set_options(ENDIANNESS_LITTLE, 8, 16, 0x8000); - CLOCK(config, "100hz", 100).signal_handler().set_inputline("maincpu", I8085_RST75_LINE); i8255_device &ppi(I8255(config, "ppi")); @@ -373,6 +370,7 @@ void sitcom_state::sitcom(machine_config &config) // host interface rs232_port_device &rs232(RS232_PORT(config, "rs232", default_rs232_devices, "null_modem")); rs232.rxd_handler().set(FUNC(sitcom_state::update_rxd)); + rs232.set_option_machine_config("null_modem", sitcom_null_modem); SOFTWARE_LIST(config, "bitb_list").set_original("sitcom"); config.set_default_layout(layout_sitcom); diff --git a/src/mame/drivers/tosh1000.cpp b/src/mame/drivers/tosh1000.cpp index 118fd70851c..90edf5c7684 100644 --- a/src/mame/drivers/tosh1000.cpp +++ b/src/mame/drivers/tosh1000.cpp @@ -38,16 +38,16 @@ #include "emu.h" +#include "machine/genpc.h" +#include "machine/tosh1000_bram.h" #include "bus/isa/isa_cards.h" #include "bus/pc_kbd/keyboards.h" #include "bus/pc_kbd/pc_kbdc.h" #include "cpu/i86/i86.h" #include "machine/bankdev.h" -#include "machine/genpc.h" #include "machine/ram.h" #include "machine/rp5c01.h" -#include "machine/tosh1000_bram.h" #include "softlist.h" diff --git a/src/mame/includes/mc1502.h b/src/mame/includes/mc1502.h deleted file mode 100644 index 14c263ea967..00000000000 --- a/src/mame/includes/mc1502.h +++ /dev/null @@ -1,101 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Sergey Svishchev -/***************************************************************************** - * - * includes/mc1502.h - * - ****************************************************************************/ - -#ifndef MAME_INCLUDES_MC1502_H -#define MAME_INCLUDES_MC1502_H - -#pragma once - -#include "imagedev/cassette.h" -#include "machine/i8251.h" -#include "machine/i8255.h" -#include "machine/pic8259.h" -#include "machine/pit8253.h" -#include "machine/ram.h" -#include "sound/spkrdev.h" - -#include "bus/centronics/ctronics.h" -#include "bus/isa/isa.h" -#include "bus/isa/xsu_cards.h" -#include "bus/isa/mc1502_fdc.h" - - -class mc1502_state : public driver_device -{ -public: - mc1502_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, "maincpu") - , m_upd8251(*this, "upd8251") - , m_pic8259(*this, "pic8259") - , m_pit8253(*this, "pit8253") - , m_ppi8255n1(*this, "ppi8255n1") - , m_ppi8255n2(*this, "ppi8255n2") - , m_isabus(*this, "isa") - , m_speaker(*this, "speaker") - , m_cassette(*this, "cassette") - , m_centronics(*this, "centronics") - , m_ram(*this, RAM_TAG) - , m_kbdio(*this, "Y%u", 1) - { } - - void mc1502(machine_config &config); - - void init_mc1502(); - - void fdc_config(device_t *device); - -protected: - virtual void machine_start() override; - virtual void machine_reset() override; - -private: - required_device m_maincpu; - required_device m_upd8251; - required_device m_pic8259; - required_device m_pit8253; - required_device m_ppi8255n1; - required_device m_ppi8255n2; - required_device m_isabus; - required_device m_speaker; - required_device m_cassette; - required_device m_centronics; - required_device m_ram; - required_ioport_array<12> m_kbdio; - - TIMER_CALLBACK_MEMBER(keyb_signal_callback); - - struct { - uint8_t pulsing; - uint16_t mask; /* input lines */ - emu_timer *keyb_signal_timer; - } m_kbd; - - uint8_t m_ppi_portb; - uint8_t m_ppi_portc; - uint8_t m_spkrdata; - - DECLARE_WRITE_LINE_MEMBER(mc1502_pit8253_out1_changed); - DECLARE_WRITE_LINE_MEMBER(mc1502_pit8253_out2_changed); - DECLARE_WRITE_LINE_MEMBER(mc1502_speaker_set_spkrdata); - DECLARE_WRITE_LINE_MEMBER(mc1502_i8251_syndet); - - void mc1502_ppi_portb_w(uint8_t data); - void mc1502_ppi_portc_w(uint8_t data); - uint8_t mc1502_ppi_portc_r(); - uint8_t mc1502_kppi_porta_r(); - void mc1502_kppi_portb_w(uint8_t data); - void mc1502_kppi_portc_w(uint8_t data); - - void mc1502_io(address_map &map); - void mc1502_map(address_map &map); - - int m_pit_out2; -}; - -#endif // MAME_INCLUDES_MC1502_H diff --git a/src/mame/layout/sitcom.lay b/src/mame/layout/sitcom.lay index 110b5b69199..25cac25a8e6 100644 --- a/src/mame/layout/sitcom.lay +++ b/src/mame/layout/sitcom.lay @@ -41,10 +41,10 @@ Basic display of LEDs for the SITCOM85 - + - + @@ -55,7 +55,7 @@ Basic display of LEDs for the SITCOM85 - + @@ -65,10 +65,10 @@ Basic display of LEDs for the SITCOM85 - + - + diff --git a/src/mame/layout/sitcomtmr.lay b/src/mame/layout/sitcomtmr.lay index f3ba1b94d67..4353c9b8304 100644 --- a/src/mame/layout/sitcomtmr.lay +++ b/src/mame/layout/sitcomtmr.lay @@ -37,78 +37,65 @@ Basic display of LEDs for the SITCOM85 - - - - - + + - - + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - - - - - - - - - - - - + + + + + + + - + - + - + + + + + + + + + +