diff options
| -rw-r--r-- | docs/source/plugins/inputmacro.rst | 84 | ||||
| -rw-r--r-- | docs/source/plugins/offscreenreload.rst | 8 | ||||
| -rw-r--r-- | src/mame/sega/segaybd.cpp | 37 | ||||
| -rw-r--r-- | src/mame/skeleton/aws.cpp | 42 |
4 files changed, 108 insertions, 63 deletions
diff --git a/docs/source/plugins/inputmacro.rst b/docs/source/plugins/inputmacro.rst index 0a537cd1134..0cdbc0c25ad 100644 --- a/docs/source/plugins/inputmacro.rst +++ b/docs/source/plugins/inputmacro.rst @@ -20,13 +20,13 @@ the running events in Track & Field, or the eating minigame in Daisu-Kiss. To configure the input macro plugin, activate the main menu (press **Tab** during emulation by default), select **Plugin Options**, and then select **Input Macros**. Configured input macros for the current system are listed, along with -their activation sequences (initially there will be no input macros configured). -Select a macro to edit it, or choose **Add macro** to set up a new input macro. -See :ref:`plugins-inputmacro-settings` for details on editing input macros. You -can delete an input macro by highlighting it in the menu and pressing the UI -Clear key (Del/Delete/Forward Delete on the keyboard by default). You can also -delete a macro by selecting the macro to edit it and then selecting **Delete -macro** from the menu. +their activation combinations (initially there will be no input macros +configured). Select a macro to edit it, or choose **Add macro** to set up a new +input macro. See :ref:`plugins-inputmacro-settings` for details on editing +input macros. You can delete an input macro by highlighting it in the menu and +pressing the UI Clear key (Del/Delete/Forward Delete on the keyboard by +default). You can also delete a macro by selecting the macro to edit it and +then selecting **Delete macro** from the menu. Input macros are saved in the **inputmacro** folder in the plugin data folder (see the :ref:`homepath option <mame-commandline-homepath>`). A file is created @@ -46,7 +46,7 @@ The options for editing input macros are the same whether you’re creating a ne macro or editing an existing macro. Input macros consist of a sequence of *steps*. Each step optionally waits for a configurable delay, then activates one or more emulated inputs for a specified duration. You can choose what -should happen if the activation sequence is still held when the final step of +should happen if the activation combination is still held when the final step of the macro completes: the emulated inputs can be released, the final step can be prolonged, or the macro can loop back to any step in the sequence. @@ -63,21 +63,21 @@ whole: controls) you want to use to activate the macro. Keep in mind that regular input assignments still apply, so you will probably want to use a combination that isn’t being used for any other emulated input in the system. -* Set **On release** to specify what should happen if the activation sequence is - released before the macro completes. When set to *Stop immediately*, any +* Set **On release** to specify what should happen if the activation combination + is released before the macro completes. When set to *Stop immediately*, any emulated inputs activated by the macro will be released immediately, and no further steps will be processed; when set to *Complete macro*, the macro will continue to be processed until the end of the final step. -* Set **When held** to specify what should happen if the activation sequence is - held after the final step of the macro completes. When set to *Release*, any - inputs activated by the macro will be released, and the macro will not be - reactivated until the activation sequence is released and pressed again; when - set to *Prolong step <n>* where *<n>* is the number of the final step of the - macro, the emulated inputs activated by the final step of the macro will - remain active until the activation sequence is released; when set to *Loop to - step <n>* where *<n>* is a step number, macro processing will return to that - step, including its delay, if the activation sequence is held after the final - step completes. +* Set **When held** to specify what should happen if the activation combination + is held after the final step of the macro completes. When set to *Release*, + any inputs activated by the macro will be released, and the macro will not be + reactivated until the activation combination is released and pressed again; + when set to *Prolong step <n>* where *<n>* is the number of the final step of + the macro, the emulated inputs activated by the final step of the macro will + remain active until the activation combination is released; when set to *Loop + to step <n>* where *<n>* is a step number, macro processing will return to + that step, including its delay, if the activation combination is held after + the final step completes. Each step has delay, duration and input settings: @@ -116,12 +116,12 @@ item will only appear after you set the first input for the initially created step when creating a new macro. When creating a new macro, there is a **Cancel** option that changes to -**Create** after you set the activation sequence and the first input for the +**Create** after you set the activation combination and the first input for the initially created step. Select **Create** to finish creating the macro and return to the list of input macros. The new macro will be added at the end of the list. Press the UI Back key, or select **Cancel** before setting the -activation sequence/input, to return to the previous menu without creating the -new macro. +activation combination/input, to return to the previous menu without creating +the new macro. When editing an existing macro, select **Done** or press the UI Back key to return to the list of input macros. Changes take effect immediately. @@ -238,9 +238,9 @@ pressing a single key: * **Input 1**: P1 Jab Punch This macro involves steps that activate multiple inputs. The macro will -complete if the activation sequence is released early, allowing you to tap the -key momentarily to perform the move. Holding the activation sequence holds down -the attack button. +complete if the activation combination is released early, allowing you to tap +the key momentarily to perform the move. Holding the activation sequence holds +down the attack button. Virtua Cop Aim Off-Screen ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -262,3 +262,35 @@ the screen: * **Value (36-425)**: 36 This macro involves setting analog input values. + +Invasion: The Abductors Reload +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In order to reload, this game requires the lightgun to be pointed away from the +screen for about a tenth of a second before pulling the trigger, and it requires +the trigger to be held for a similar duration. This makes it unsuitable for use +with the :ref:`Off-Screen Reload Helper plugin <plugins-offscreenreload>`. +However, you can use a two-step macro to produce the required actions when +pressing a key or button: + +* **Name**: 1P Reload +* **Activation combination**: Kbd Shift +* **On release**: Complete macro +* **When held**: Prolong step 2 +* **Step 1**: + + * **Delay (frames)**: 0 + * **Duration (frames)**: 6 + * **Input 1**: Lightgun X + * **Value (0-255)**: 255 +* **Step 2**: + + * **Delay (frames)**: 0 + * **Duration (frames)**: 6 + * **Input 1**: Lightgun X + * **Value (0-255)**: 255 + * **Input 2**: P1 Button 1 + +This macro involves multiple steps, setting analog input values, activating +multiple inputs simultaneously, and completing the macro even if the activation +combination is only pressed momentarily. diff --git a/docs/source/plugins/offscreenreload.rst b/docs/source/plugins/offscreenreload.rst index a7c4d9f5214..99985876fda 100644 --- a/docs/source/plugins/offscreenreload.rst +++ b/docs/source/plugins/offscreenreload.rst @@ -29,6 +29,14 @@ Delete on the keyboard by default). You can also delete an off-screen reload helper by selecting it to edit it and then selecting **Delete reload helper** from the menu. +This plugin works with games that recognise the simple condition of pulling the +lightgun trigger while one of the lightgun axes reports its minimum value. This +includes, for example, Lethal Enforcers and Virtua cop. Some games, for example +Invasion: The Abductors, have more complex requirements to trigger reloading. +Although this plugin is not suitable for use with those games, you can use the +:ref:`Input Macro plugin <plugins-inputmacro>` to use a key or button +combination to reload easily. + Off-screen reload helpers are saved in the **offscreenreload** folder in the plugin data folder (see the :ref:`homepath option <mame-commandline-homepath>`). A file is created for each system with off-screen reload helpers configured, diff --git a/src/mame/sega/segaybd.cpp b/src/mame/sega/segaybd.cpp index b83b4fd2746..88a7790e1ef 100644 --- a/src/mame/sega/segaybd.cpp +++ b/src/mame/sega/segaybd.cpp @@ -196,6 +196,13 @@ EPR-12028 - 27C256 EPROM #include "emu.h" + +#include "315_5296.h" +#include "sega16sp.h" +#include "segaic16.h" +#include "segaic16_m.h" +#include "segaipt.h" + #include "cpu/m68000/m68000musashi.h" #include "cpu/z80/z80.h" #include "machine/gen_latch.h" @@ -206,13 +213,7 @@ EPR-12028 - 27C256 EPROM #include "sound/segapcm.h" #include "sound/ymopm.h" -#include "segaic16.h" -#include "segaic16_m.h" -#include "sega16sp.h" #include "screen.h" -#include "segaipt.h" - -#include "315_5296.h" #include "speaker.h" #include "pdrift.lh" @@ -269,17 +270,17 @@ public: { } - void yboard_deluxe(machine_config &config); - void yboard_link(machine_config &config); - void yboard(machine_config &config); + void yboard_deluxe(machine_config &config) ATTR_COLD; + void yboard_link(machine_config &config) ATTR_COLD; + void yboard(machine_config &config) ATTR_COLD; // game-specific driver init - void init_generic(); - void init_pdrift(); - void init_r360(); - void init_gforce2(); - void init_rchase(); - void init_gloc(); + void init_generic() ATTR_COLD; + void init_pdrift() ATTR_COLD; + void init_r360() ATTR_COLD; + void init_gforce2() ATTR_COLD; + void init_rchase() ATTR_COLD; + void init_gloc() ATTR_COLD; protected: // device overrides @@ -288,6 +289,9 @@ protected: virtual void video_start() override ATTR_COLD; private: + // internal types + using output_delegate = delegate<void (uint16_t)>; + // main CPU read/write handlers void output1_w(uint8_t data); void misc_output_w(uint8_t data); @@ -327,9 +331,6 @@ private: void subx_map(address_map &map) ATTR_COLD; void suby_map(address_map &map) ATTR_COLD; - // internal types - typedef delegate<void (uint16_t)> output_delegate; - // internal helpers TIMER_CALLBACK_MEMBER(irq2_gen_tick); void update_irqs(); diff --git a/src/mame/skeleton/aws.cpp b/src/mame/skeleton/aws.cpp index f162110b5ae..51c95bcb35c 100644 --- a/src/mame/skeleton/aws.cpp +++ b/src/mame/skeleton/aws.cpp @@ -7,15 +7,18 @@ */ #include "emu.h" + +#include "aws_kb.h" + +#include "cpu/i86/i86.h" +#include "machine/clock.h" +#include "machine/i8257.h" #include "machine/pic8259.h" #include "machine/pit8253.h" #include "machine/upd765.h" -#include "machine/i8257.h" -#include "video/i8275.h" #include "machine/z80sio.h" -#include "cpu/i86/i86.h" -#include "machine/clock.h" -#include "aws_kb.h" +#include "video/i8275.h" + #include "screen.h" @@ -37,18 +40,19 @@ public: m_fdc(*this, "fdc"), m_fdc_serial(*this, "fdc_serial"), m_fdc_pit(*this, "fdc_pit") - {} + { + } - void aws200(machine_config &config); - void aws220(machine_config &config); - void aws_base(machine_config &config); - void fdc_board(machine_config &config); + void aws200(machine_config &config) ATTR_COLD; + void aws220(machine_config &config) ATTR_COLD; + void aws_base(machine_config &config) ATTR_COLD; + void fdc_board(machine_config &config) ATTR_COLD; protected: - void aws_mem(address_map &map); - void aws_io(address_map &map); - void aws220_mem(address_map &map); - void aws220_io(address_map &map); + void aws_mem(address_map &map) ATTR_COLD; + void aws_io(address_map &map) ATTR_COLD; + void aws220_mem(address_map &map) ATTR_COLD; + void aws220_io(address_map &map) ATTR_COLD; private: required_device<i8086_cpu_device> m_maincpu; @@ -92,9 +96,9 @@ void aws_state::pit_out2_w(int state) I8275_DRAW_CHARACTER_MEMBER(aws_state::display_pixels) { // using namespace i8275_attributes; - for(int i=0;i<9;i++) + for (int i = 0; i < 9; i++) { - if(i>=7) + if (i >= 7) bitmap.pix(y, x + i) = rgb_t::black(); else bitmap.pix(y, x + i) = BIT(m_fontrom[((linecount & 0x0f) << 7) | (charcode & 0x7f)],i) ? rgb_t::white() : rgb_t::black(); @@ -137,9 +141,9 @@ void aws_state::aws220_mem(address_map &map) void aws_state::aws_io(address_map &map) { map(0x0000, 0x000f).rw(m_dmac, FUNC(i8257_device::read), FUNC(i8257_device::write)); - map(0x0020, 0x0023).rw(m_crtc, FUNC(i8275_device::read), FUNC(i8275_device::write)).umask16(0x00ff); - map(0x0040, 0x0047).rw(m_pit, FUNC(pit8253_device::read), FUNC(pit8253_device::write)).umask16(0x00ff); - map(0x0060, 0x0067).rw(m_serial, FUNC(upd7201_device::ba_cd_r), FUNC(upd7201_device::ba_cd_w)).umask16(0x00ff); + map(0x0020, 0x0023).umask16(0x00ff).rw(m_crtc, FUNC(i8275_device::read), FUNC(i8275_device::write)); + map(0x0040, 0x0047).umask16(0x00ff).rw(m_pit, FUNC(pit8253_device::read), FUNC(pit8253_device::write)); + map(0x0060, 0x0067).umask16(0x00ff).rw(m_serial, FUNC(upd7201_device::ba_cd_r), FUNC(upd7201_device::ba_cd_w)); } void aws_state::aws220_io(address_map &map) |
