From 9161ca9e48952dc3e082e5af08264638c41accfa Mon Sep 17 00:00:00 2001 From: cam900 Date: Tue, 10 Dec 2024 22:09:25 +0900 Subject: [PATCH 1/6] shared/xbox_nv2a.cpp: Fixed a spelling error in two comments. (#13066) --- src/mame/shared/xbox_nv2a.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mame/shared/xbox_nv2a.cpp b/src/mame/shared/xbox_nv2a.cpp index 6f9bfb8ac82..eafbb674a72 100644 --- a/src/mame/shared/xbox_nv2a.cpp +++ b/src/mame/shared/xbox_nv2a.cpp @@ -2191,7 +2191,7 @@ void nv2a_renderer::render_register_combiners(int32_t scanline, const nv2a_raste // 2: compute // 2.1: initialize combiner_initialize_registers(threadid, colorf); - // 2.2: general cmbiner stages + // 2.2: general combiner stages for (n = 0; n < combiner.setup.stages; n++) { // 2.2.1 initialize combiner_initialize_stage(threadid, n); @@ -2203,7 +2203,7 @@ void nv2a_renderer::render_register_combiners(int32_t scanline, const nv2a_raste // 2.2.4 map outputs to registers combiner_map_stage_output(threadid, n); } - // 2.3: final cmbiner stage + // 2.3: final combiner stage combiner_initialize_final(threadid); combiner_map_final_input(threadid); combiner_final_output(threadid); From 9ee91f5e9120c79d72fe82ceba9ef1c2ecbb1ecd Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 10 Dec 2024 15:13:20 +0100 Subject: [PATCH 2/6] cop01: lower soundcpu clock, copy over sound timer from magmax, misc nichibutsu: small cleanup to long comment lines --- src/mame/homebrew/zexall.cpp | 22 ++- src/mame/nichibutsu/armedf.cpp | 19 +- src/mame/nichibutsu/cop01.cpp | 319 ++++++++++++++++++------------- src/mame/nichibutsu/galivan.cpp | 12 +- src/mame/nichibutsu/magmax.cpp | 149 +++++++-------- src/mame/nichibutsu/terracre.cpp | 37 +++- 6 files changed, 317 insertions(+), 241 deletions(-) diff --git a/src/mame/homebrew/zexall.cpp b/src/mame/homebrew/zexall.cpp index 996c0ebf791..862d4ecab24 100644 --- a/src/mame/homebrew/zexall.cpp +++ b/src/mame/homebrew/zexall.cpp @@ -14,17 +14,22 @@ Ram 0000-FFFF (preloaded with binary) Special calls take place for three ram values (this interface was designed by kevtris): - FFFD - 'ack' - shared ram with output device; z80 reads from here and considers the byte at FFFF read if this value incremented - FFFE - 'req' - shared ram with output device; z80 writes an incrementing value to FFFE to indicate that there is a byte waiting at FFFF - and hence requesting the output device on the other end do something about it, until FFFD is incremented by the - output device to acknowledge receipt + FFFD - 'ack' - shared ram with output device; z80 reads from here and considers + the byte at FFFF read if this value incremented + FFFE - 'req' - shared ram with output device; z80 writes an incrementing value + to FFFE to indicate that there is a byte waiting at FFFF and hence + requesting the output device on the other end do something about it, + until FFFD is incremented by the output device to acknowledge receipt FFFF - 'data' - shared ram with output device; z80 writes the data to be sent to output device here + One i/o port is used, but left unemulated: - 0001 - bit 0 controls whether interrupt timer is enabled (1) or not (0), this is a holdover from a project of kevtris' and can be ignored. + 0001 - bit 0 controls whether interrupt timer is enabled (1) or not (0), + this is a holdover from a project of kevtris' and can be ignored. ******************************************************************************/ #include "emu.h" + #include "cpu/z80/z80.h" #include "machine/terminal.h" @@ -43,6 +48,10 @@ class zexall_state : public driver_device void zexall(machine_config &config); +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + private: uint8_t output_ack_r(); uint8_t output_req_r(); @@ -60,9 +69,6 @@ class zexall_state : public driver_device uint8_t m_out_req = 0U; // byte written to 0xFFFE uint8_t m_out_req_last = 0U; // old value at 0xFFFE before the most recent write uint8_t m_out_ack = 0U; // byte written to 0xFFFC - - virtual void machine_start() override ATTR_COLD; - virtual void machine_reset() override ATTR_COLD; }; diff --git a/src/mame/nichibutsu/armedf.cpp b/src/mame/nichibutsu/armedf.cpp index dd6dca1f18c..fb703fd7ae1 100644 --- a/src/mame/nichibutsu/armedf.cpp +++ b/src/mame/nichibutsu/armedf.cpp @@ -311,7 +311,6 @@ PCB Layout LM324 - Texas Instruments LM324 Quad Operational Amplifier with True Differential Inputs MB3730 - Fujitsu MB3730 12W BTL Single Channel Amplifier - ***********************************************************************/ #include "emu.h" @@ -641,13 +640,15 @@ void bigfghtr_state::bigfghtr_mcu_io_map(address_map &map) map(0x00600, 0x03fff).ram().share("sharedram"); } -void armedf_state::sound_map(address_map &map) // common sound map for the terra force bottom pcb, also used on armed f, tatakae big fighter, etc +// common sound map for the terra force bottom pcb, also used on armed f, tatakae big fighter, etc +void armedf_state::sound_map(address_map &map) { map(0x0000, 0xf7ff).rom(); map(0xf800, 0xffff).ram(); } -void armedf_state::cclimbr2_soundmap(address_map &map) // common sound map for the crazy climber 2 and legion bottom pcbs +// common sound map for the crazy climber 2 and legion bottom pcbs +void armedf_state::cclimbr2_soundmap(address_map &map) { map(0x0000, 0xbfff).rom(); map(0xc000, 0xffff).ram(); @@ -1134,11 +1135,17 @@ void armedf_state::sound_config_common(machine_config &config) // common amongst // Sum: 0.83325 // Multiply all 3 values by 1 / 0.83325 (i.e. 1.20012): // Final values are: ym: 0.2; dac1: 0.4; dac2: 0.4 - FILTER_BIQUAD(config, m_ymfilter).opamp_sk_lowpass_setup(RES_K(4.7), RES_K(4.7), RES_M(999.99), RES_R(0.001), CAP_N(3.3), CAP_N(1.0)); // R17, R16, nothing(infinite resistance), wire(short), C82, C68 + + // R17, R16, nothing(infinite resistance), wire(short), C82, C68 + FILTER_BIQUAD(config, m_ymfilter).opamp_sk_lowpass_setup(RES_K(4.7), RES_K(4.7), RES_M(999.99), RES_R(0.001), CAP_N(3.3), CAP_N(1.0)); m_ymfilter->add_route(ALL_OUTPUTS, "speaker", 1.0); - FILTER_BIQUAD(config, m_dacfilter1).opamp_sk_lowpass_setup(RES_K(10), RES_K(10), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); // R15, R10, nothing(infinite resistance), wire(short), C81, C60 + + // R15, R10, nothing(infinite resistance), wire(short), C81, C60 + FILTER_BIQUAD(config, m_dacfilter1).opamp_sk_lowpass_setup(RES_K(10), RES_K(10), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); m_dacfilter1->add_route(ALL_OUTPUTS, "speaker", 1.0); - FILTER_BIQUAD(config, m_dacfilter2).opamp_sk_lowpass_setup(RES_K(10), RES_K(10), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); // R13, R9, nothing(infinite resistance), wire(short), C66, C61 + + // R13, R9, nothing(infinite resistance), wire(short), C66, C61 + FILTER_BIQUAD(config, m_dacfilter2).opamp_sk_lowpass_setup(RES_K(10), RES_K(10), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); m_dacfilter2->add_route(ALL_OUTPUTS, "speaker", 1.0); DAC_8BIT_R2R(config, "dac1", 0).add_route(ALL_OUTPUTS, m_dacfilter1, 0.4); // SIP R2R DAC @ G11-1 with 74HC374P latch diff --git a/src/mame/nichibutsu/cop01.cpp b/src/mame/nichibutsu/cop01.cpp index 0d443b535ab..f58c4585ff9 100644 --- a/src/mame/nichibutsu/cop01.cpp +++ b/src/mame/nichibutsu/cop01.cpp @@ -9,11 +9,12 @@ Mighty Guy (c) 1986 Nichibutsu driver by Carlos A. Lozano TODO: -- Fix priority kludge +- fix priority kludge - Inaccurate 1412M2 protection chip emulation in mightguy, used by the sound CPU. This is probably an extra CPU (program ROM is the ic2 one), presumably - with data / address line scrambling -- Some sound problems remaining, not just 1412M2, but see also MT7949 + with data / address line scrambling. +- cop01 AY8910 filters, see MT7949 (I locally tried blindly copy-pasting the one + from magmax, but voice volume was too low) Mighty Guy board layout: @@ -60,6 +61,7 @@ Mighty Guy board layout: #include "cpu/z80/z80.h" #include "machine/gen_latch.h" +#include "machine/timer.h" #include "sound/ay8910.h" #include "sound/dac.h" #include "sound/ymopl.h" @@ -74,35 +76,26 @@ namespace { #define MIGHTGUY_HACK 0 -class cop01_state : public driver_device +class cop01_base_state : public driver_device { public: - cop01_state(const machine_config &mconfig, device_type type, const char *tag) : + cop01_base_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_audiocpu(*this, "audiocpu"), m_bgvideoram(*this, "bgvideoram"), m_spriteram(*this, "spriteram"), m_fgvideoram(*this, "fgvideoram"), m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette"), m_soundlatch(*this, "soundlatch") { } - void cop01(machine_config &config); - protected: virtual void machine_start() override ATTR_COLD; virtual void machine_reset() override ATTR_COLD; virtual void video_start() override ATTR_COLD; - uint8_t sound_command_r(); - - void cop01_base(machine_config &config); - - required_device m_audiocpu; - -private: // memory pointers required_shared_ptr m_bgvideoram; required_shared_ptr m_spriteram; @@ -113,37 +106,65 @@ class cop01_state : public driver_device tilemap_t *m_fg_tilemap = nullptr; uint8_t m_vreg[4]{}; - // sound-related - uint8_t m_pulse = 0; - static constexpr int TIMER_RATE = 11475; // unknown, hand-tuned to match audio reference - // devices required_device m_maincpu; + required_device m_audiocpu; required_device m_gfxdecode; required_device m_palette; required_device m_soundlatch; - void irq_ack_w(uint8_t data); - uint8_t sound_irq_ack_w(); - void background_w(offs_t offset, uint8_t data); - void foreground_w(offs_t offset, uint8_t data); - void vreg_w(offs_t offset, uint8_t data); + void palette(palette_device &palette) const; TILE_GET_INFO_MEMBER(get_bg_tile_info); TILE_GET_INFO_MEMBER(get_fg_tile_info); - void palette(palette_device &palette) const; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - void audio_io_map(address_map &map) ATTR_COLD; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void background_w(offs_t offset, uint8_t data); + void foreground_w(offs_t offset, uint8_t data); + void vreg_w(offs_t offset, uint8_t data); + void irq_ack_w(uint8_t data); + void main_map(address_map &map) ATTR_COLD; void io_map(address_map &map) ATTR_COLD; void sound_map(address_map &map) ATTR_COLD; + + void cop01_base(machine_config &config); +}; + +class cop01_state : public cop01_base_state +{ +public: + cop01_state(const machine_config &mconfig, device_type type, const char *tag) : + cop01_base_state(mconfig, type, tag), + m_ay(*this, "ay%u", 0U) + { } + + void cop01(machine_config &config); + +protected: + virtual void machine_start() override ATTR_COLD; + +private: + required_device_array m_ay; + + uint8_t m_ls74_q = 0; + uint8_t m_ls74_clr = 0; + + uint8_t sound_command_r(); + + TIMER_DEVICE_CALLBACK_MEMBER(sound_timer); + + void ay8910_portb_0_w(uint8_t data); + void ay8910_porta_0_w(uint8_t data); + + void audio_io_map(address_map &map) ATTR_COLD; }; -class mightguy_state : public cop01_state +class mightguy_state : public cop01_base_state { public: mightguy_state(const machine_config &mconfig, device_type type, const char *tag) : - cop01_state(mconfig, type, tag), + cop01_base_state(mconfig, type, tag), m_prot(*this, "prot_chip"), m_fake(*this, "FAKE") { } @@ -155,15 +176,22 @@ class mightguy_state : public cop01_state void init_mightguy(); private: - void audio_io_map(address_map &map) ATTR_COLD; - required_device m_prot; - required_ioport m_fake; + + uint8_t sound_command_r(); + + void audio_io_map(address_map &map) ATTR_COLD; }; -void cop01_state::palette(palette_device &palette) const +/*************************************************************************** + + Palette + +***************************************************************************/ + +void cop01_base_state::palette(palette_device &palette) const { const uint8_t *color_prom = memregion("proms")->base(); @@ -209,7 +237,7 @@ void cop01_state::palette(palette_device &palette) const ***************************************************************************/ -TILE_GET_INFO_MEMBER(cop01_state::get_bg_tile_info) +TILE_GET_INFO_MEMBER(cop01_base_state::get_bg_tile_info) { int const tile = m_bgvideoram[tile_index]; int const attr = m_bgvideoram[tile_index + 0x800]; @@ -232,7 +260,7 @@ TILE_GET_INFO_MEMBER(cop01_state::get_bg_tile_info) tileinfo.group = pri; } -TILE_GET_INFO_MEMBER(cop01_state::get_fg_tile_info) +TILE_GET_INFO_MEMBER(cop01_base_state::get_fg_tile_info) { int const tile = m_fgvideoram[tile_index]; tileinfo.set(0, tile, 0, 0); @@ -246,10 +274,10 @@ TILE_GET_INFO_MEMBER(cop01_state::get_fg_tile_info) ***************************************************************************/ -void cop01_state::video_start() +void cop01_base_state::video_start() { - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cop01_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cop01_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cop01_base_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(cop01_base_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); m_fg_tilemap->set_transparent_pen(15); @@ -260,56 +288,13 @@ void cop01_state::video_start() -/*************************************************************************** - - Memory handlers - -***************************************************************************/ - -void cop01_state::background_w(offs_t offset, uint8_t data) -{ - m_bgvideoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset & 0x7ff); -} - -void cop01_state::foreground_w(offs_t offset, uint8_t data) -{ - m_fgvideoram[offset] = data; - m_fg_tilemap->mark_tile_dirty(offset); -} - -void cop01_state::vreg_w(offs_t offset, uint8_t data) -{ - /* 0x40: --xx---- sprite bank, coin counters, flip screen - * -----x-- flip screen - * ------xx coin counters - * 0x41: xxxxxxxx xscroll - * 0x42: ---xx--- ? matches the bg tile color most of the time, but not - * during level transitions. Maybe sprite palette bank? - * (the four banks in the PROM are identical) - * ------x- unused (xscroll overflow) - * -------x msb xscroll - * 0x43: xxxxxxxx yscroll - */ - m_vreg[offset] = data; - - if (offset == 0) - { - machine().bookkeeping().coin_counter_w(0, data & 1); - machine().bookkeeping().coin_counter_w(1, data & 2); - flip_screen_set(data & 4); - } -} - - - /*************************************************************************** Display refresh ***************************************************************************/ -void cop01_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +void cop01_base_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) { for (int offs = 0; offs < m_spriteram.bytes(); offs += 4) { @@ -347,7 +332,7 @@ void cop01_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) } -uint32_t cop01_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t cop01_base_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { m_bg_tilemap->set_scrollx(0, m_vreg[1] + 256 * (m_vreg[2] & 1)); m_bg_tilemap->set_scrolly(0, m_vreg[3]); @@ -356,34 +341,88 @@ uint32_t cop01_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, draw_sprites(bitmap, cliprect); m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER0, 0); m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + return 0; } + /************************************* * - * Memory handlers + * Sound * *************************************/ +void cop01_state::ay8910_porta_0_w(uint8_t data) +{ +} + +void cop01_state::ay8910_portb_0_w(uint8_t data) +{ + // bit 0 is input to CLR line of the LS74 + m_ls74_clr = data & 1; + m_ls74_q &= m_ls74_clr; +} + +TIMER_DEVICE_CALLBACK_MEMBER(cop01_state::sound_timer) +{ + // assume timing is the same as magmax.cpp + m_ls74_q = m_ls74_clr; +} + uint8_t cop01_state::sound_command_r() { - int res = (m_soundlatch->read() & 0x7f) << 1; + return (m_soundlatch->read() << 1) | m_ls74_q; +} - // bit 0 seems to be a timer - if ((m_audiocpu->total_cycles() / TIMER_RATE) & 1) - { - if (m_pulse == 0) - res |= 1; +uint8_t mightguy_state::sound_command_r() +{ + // does not have the sound timer + return m_soundlatch->read() << 1; +} - m_pulse = 1; - } - else - m_pulse = 0; - return res; + +/************************************* + * + * Memory handlers + * + *************************************/ + +void cop01_base_state::background_w(offs_t offset, uint8_t data) +{ + m_bgvideoram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset & 0x7ff); } +void cop01_base_state::foreground_w(offs_t offset, uint8_t data) +{ + m_fgvideoram[offset] = data; + m_fg_tilemap->mark_tile_dirty(offset); +} + +void cop01_base_state::vreg_w(offs_t offset, uint8_t data) +{ + /* 0x40: --xx---- sprite bank, coin counters, flip screen + * -----x-- flip screen + * ------xx coin counters + * 0x41: xxxxxxxx xscroll + * 0x42: ---xx--- ? matches the bg tile color most of the time, but not + * during level transitions. Maybe sprite palette bank? + * (the four banks in the PROM are identical) + * ------x- unused (xscroll overflow) + * -------x msb xscroll + * 0x43: xxxxxxxx yscroll + */ + m_vreg[offset] = data; + + if (offset == 0) + { + machine().bookkeeping().coin_counter_w(0, data & 1); + machine().bookkeeping().coin_counter_w(1, data & 2); + flip_screen_set(data & 4); + } +} template int mightguy_state::area_r() @@ -391,16 +430,12 @@ int mightguy_state::area_r() return (m_fake->read() & Mask) ? 1 : 0; } -void cop01_state::irq_ack_w(uint8_t data) +void cop01_base_state::irq_ack_w(uint8_t data) { m_maincpu->set_input_line(0, CLEAR_LINE); } -uint8_t cop01_state::sound_irq_ack_w() -{ - m_audiocpu->set_input_line(0, CLEAR_LINE); - return 0; -} + /************************************* * @@ -408,16 +443,16 @@ uint8_t cop01_state::sound_irq_ack_w() * *************************************/ -void cop01_state::main_map(address_map &map) +void cop01_base_state::main_map(address_map &map) { map(0x0000, 0xbfff).rom(); map(0xc000, 0xcfff).ram(); // c000-c7ff in cop01 - map(0xd000, 0xdfff).ram().w(FUNC(cop01_state::background_w)).share(m_bgvideoram); + map(0xd000, 0xdfff).ram().w(FUNC(cop01_base_state::background_w)).share(m_bgvideoram); map(0xe000, 0xe0ff).writeonly().share(m_spriteram); - map(0xf000, 0xf3ff).w(FUNC(cop01_state::foreground_w)).share(m_fgvideoram); + map(0xf000, 0xf3ff).w(FUNC(cop01_base_state::foreground_w)).share(m_fgvideoram); } -void cop01_state::io_map(address_map &map) +void cop01_base_state::io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x00).portr("P1"); @@ -425,24 +460,24 @@ void cop01_state::io_map(address_map &map) map(0x02, 0x02).portr("SYSTEM"); map(0x03, 0x03).portr("DSW1"); map(0x04, 0x04).portr("DSW2"); - map(0x40, 0x43).w(FUNC(cop01_state::vreg_w)); + map(0x40, 0x43).w(FUNC(cop01_base_state::vreg_w)); map(0x44, 0x44).w(m_soundlatch, FUNC(generic_latch_8_device::write)); - map(0x45, 0x45).w(FUNC(cop01_state::irq_ack_w)); // ? + map(0x45, 0x45).w(FUNC(cop01_base_state::irq_ack_w)); // ? } -void cop01_state::sound_map(address_map &map) +void cop01_base_state::sound_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0x8000).r(FUNC(cop01_state::sound_irq_ack_w)); + map(0x8000, 0x8000).rw(m_soundlatch, FUNC(generic_latch_8_device::acknowledge_r), FUNC(generic_latch_8_device::acknowledge_w)); map(0xc000, 0xc7ff).ram(); } void cop01_state::audio_io_map(address_map &map) { map.global_mask(0xff); - map(0x00, 0x01).w("ay1", FUNC(ay8910_device::address_data_w)); - map(0x02, 0x03).w("ay2", FUNC(ay8910_device::address_data_w)); - map(0x04, 0x05).w("ay3", FUNC(ay8910_device::address_data_w)); + map(0x00, 0x01).w(m_ay[0], FUNC(ay8910_device::address_data_w)); + map(0x02, 0x03).w(m_ay[1], FUNC(ay8910_device::address_data_w)); + map(0x04, 0x05).w(m_ay[2], FUNC(ay8910_device::address_data_w)); map(0x06, 0x06).r(FUNC(cop01_state::sound_command_r)); } @@ -680,15 +715,21 @@ GFXDECODE_END * *************************************/ -void cop01_state::machine_start() +void cop01_base_state::machine_start() { - save_item(NAME(m_pulse)); save_item(NAME(m_vreg)); } -void cop01_state::machine_reset() +void cop01_state::machine_start() +{ + cop01_base_state::machine_start(); + + save_item(NAME(m_ls74_q)); + save_item(NAME(m_ls74_clr)); +} + +void cop01_base_state::machine_reset() { - m_pulse = 0; m_vreg[0] = 0; m_vreg[1] = 0; m_vreg[2] = 0; @@ -696,19 +737,18 @@ void cop01_state::machine_reset() } -void cop01_state::cop01_base(machine_config &config) +void cop01_base_state::cop01_base(machine_config &config) { - constexpr XTAL MAINCPU_CLOCK = XTAL(12'000'000); - // basic machine hardware - Z80(config, m_maincpu, MAINCPU_CLOCK / 2); // unknown clock / divider - m_maincpu->set_addrmap(AS_PROGRAM, &cop01_state::main_map); - m_maincpu->set_addrmap(AS_IO, &cop01_state::io_map); - m_maincpu->set_vblank_int("screen", FUNC(cop01_state::irq0_line_assert)); + Z80(config, m_maincpu, 12_MHz_XTAL / 2); // unknown divider + m_maincpu->set_addrmap(AS_PROGRAM, &cop01_base_state::main_map); + m_maincpu->set_addrmap(AS_IO, &cop01_base_state::io_map); + m_maincpu->set_vblank_int("screen", FUNC(cop01_base_state::irq0_line_assert)); - Z80(config, m_audiocpu, XTAL(3'000'000)); // unknown clock / divider, hand-tuned to match audio reference - m_audiocpu->set_addrmap(AS_PROGRAM, &cop01_state::sound_map); - m_audiocpu->set_addrmap(AS_IO, &cop01_state::audio_io_map); + Z80(config, m_audiocpu, 20_MHz_XTAL / 8); // matches audio reference + m_audiocpu->set_addrmap(AS_PROGRAM, &cop01_base_state::sound_map); + + config.set_maximum_quantum(attotime::from_hz(600)); // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -716,40 +756,47 @@ void cop01_state::cop01_base(machine_config &config) screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(32*8, 32*8); screen.set_visarea(0*8, 32*8-1, 2*8, 30*8-1); - screen.set_screen_update(FUNC(cop01_state::screen_update)); + screen.set_screen_update(FUNC(cop01_base_state::screen_update)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_cop01); - PALETTE(config, m_palette, FUNC(cop01_state::palette), 16+8*16+16*16, 256); + PALETTE(config, m_palette, FUNC(cop01_base_state::palette), 16+8*16+16*16, 256); // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, m_soundlatch).data_pending_callback().set_inputline(m_audiocpu, 0); + m_soundlatch->set_separate_acknowledge(true); } void cop01_state::cop01(machine_config &config) { cop01_base(config); - AY8910(config, "ay1", 1250000).add_route(ALL_OUTPUTS, "mono", 0.50); // unknown clock / divider, hand-tuned to match audio reference - AY8910(config, "ay2", 1250000).add_route(ALL_OUTPUTS, "mono", 0.25); // " - AY8910(config, "ay3", 1250000).add_route(ALL_OUTPUTS, "mono", 0.25); // " + // sound hardware + m_audiocpu->set_addrmap(AS_IO, &cop01_state::audio_io_map); + + AY8910(config, m_ay[0], 20_MHz_XTAL / 16).add_route(ALL_OUTPUTS, "mono", 0.25); + m_ay[0]->port_a_write_callback().set(FUNC(cop01_state::ay8910_porta_0_w)); + m_ay[0]->port_b_write_callback().set(FUNC(cop01_state::ay8910_portb_0_w)); + + AY8910(config, m_ay[1], 20_MHz_XTAL / 16).add_route(ALL_OUTPUTS, "mono", 0.25); + AY8910(config, m_ay[2], 20_MHz_XTAL / 16).add_route(ALL_OUTPUTS, "mono", 0.25); + + TIMER(config, "sound_timer").configure_scanline(FUNC(cop01_state::sound_timer), "screen", 64, 128); } void mightguy_state::mightguy(machine_config &config) { cop01_base(config); - constexpr XTAL AUDIOCPU_CLOCK = XTAL(8'000'000); - - m_audiocpu->set_clock(AUDIOCPU_CLOCK / 2); // unknown divider + // sound hardware m_audiocpu->set_addrmap(AS_IO, &mightguy_state::audio_io_map); - NB1412M2(config, m_prot, XTAL(8'000'000) / 2); // divided by 2 maybe + NB1412M2(config, m_prot, 8_MHz_XTAL / 2); // divided by 2 maybe m_prot->dac_callback().set("dac", FUNC(dac_byte_interface::data_w)); - YM3526(config, "ymsnd", AUDIOCPU_CLOCK / 2).add_route(ALL_OUTPUTS, "mono", 1.0); // unknown divider + YM3526(config, "ymsnd", 8_MHz_XTAL / 2).add_route(ALL_OUTPUTS, "mono", 1.0); DAC_8BIT_R2R(config, "dac", 0).add_route(ALL_OUTPUTS, "mono", 0.5); // unknown DAC } diff --git a/src/mame/nichibutsu/galivan.cpp b/src/mame/nichibutsu/galivan.cpp index 319b2414004..9b296f4330c 100644 --- a/src/mame/nichibutsu/galivan.cpp +++ b/src/mame/nichibutsu/galivan.cpp @@ -1197,11 +1197,17 @@ void galivan_state::common(machine_config &config) Sum: 0.67015 Multiply all 3 values by 1 / 0.67015 (i.e. 1.492203): Final values are: ym: 0.492203; dac1: 0.209505; dac2: 0.298291 */ - FILTER_BIQUAD(config, m_ymfilter).opamp_sk_lowpass_setup(RES_K(4.7), RES_K(4.7), RES_M(999.99), RES_R(0.001), CAP_N(3.3), CAP_N(1.0)); // R15, R14, nothing(infinite resistance), wire(short), C9, C11 + + // R15, R14, nothing(infinite resistance), wire(short), C9, C11 + FILTER_BIQUAD(config, m_ymfilter).opamp_sk_lowpass_setup(RES_K(4.7), RES_K(4.7), RES_M(999.99), RES_R(0.001), CAP_N(3.3), CAP_N(1.0)); m_ymfilter->add_route(ALL_OUTPUTS, "speaker", 1.0); - FILTER_BIQUAD(config, m_dacfilter1).opamp_sk_lowpass_setup(RES_K(10), RES_K(10), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); // R11, R10, nothing(infinite resistance), wire(short), C7, C17 + + // R11, R10, nothing(infinite resistance), wire(short), C7, C17 + FILTER_BIQUAD(config, m_dacfilter1).opamp_sk_lowpass_setup(RES_K(10), RES_K(10), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); m_dacfilter1->add_route(ALL_OUTPUTS, "speaker", 1.0); - FILTER_BIQUAD(config, m_dacfilter2).opamp_sk_lowpass_setup(RES_K(10), RES_K(10), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); // R13, R12, nothing(infinite resistance), wire(short), C8, C18 + + // R13, R12, nothing(infinite resistance), wire(short), C8, C18 + FILTER_BIQUAD(config, m_dacfilter2).opamp_sk_lowpass_setup(RES_K(10), RES_K(10), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); m_dacfilter2->add_route(ALL_OUTPUTS, "speaker", 1.0); YM3526(config, "ymsnd", XTAL(8'000'000) / 2).add_route(ALL_OUTPUTS, m_ymfilter, 0.4922); diff --git a/src/mame/nichibutsu/magmax.cpp b/src/mame/nichibutsu/magmax.cpp index 72f78b7bc0f..d9e9827e1e9 100644 --- a/src/mame/nichibutsu/magmax.cpp +++ b/src/mame/nichibutsu/magmax.cpp @@ -32,6 +32,7 @@ Stephh's notes (based on the game M68000 code and some tests) : #include "cpu/z80/z80.h" #include "machine/gen_latch.h" #include "machine/rescap.h" +#include "machine/timer.h" #include "sound/ay8910.h" #include "sound/flt_biquad.h" #include "sound/mixer.h" @@ -79,7 +80,6 @@ class magmax_state : public driver_device protected: virtual void machine_start() override ATTR_COLD; - virtual void machine_reset() override ATTR_COLD; virtual void video_start() override ATTR_COLD; private: @@ -102,7 +102,6 @@ class magmax_state : public driver_device uint8_t m_ls74_clr = 0; uint8_t m_ls74_q = 0; uint8_t m_gain_control = 0; - emu_timer *m_interrupt_timer = nullptr; uint8_t m_flipscreen = 0; std::unique_ptr m_prom_tab; bitmap_ind16 m_bitmap; @@ -115,7 +114,7 @@ class magmax_state : public driver_device void palette(palette_device &palette) const; uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - TIMER_CALLBACK_MEMBER(scanline_callback); + TIMER_DEVICE_CALLBACK_MEMBER(sound_timer); void main_map(address_map &map) ATTR_COLD; void sound_io_map(address_map &map) ATTR_COLD; @@ -136,6 +135,7 @@ class magmax_state : public driver_device bit 0 -- 2.2kohm resistor -- RED/GREEN/BLUE ***************************************************************************/ + void magmax_state::palette(palette_device &palette) const { const uint8_t *color_prom = memregion("proms")->base(); @@ -233,10 +233,10 @@ uint32_t magmax_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap uint32_t const prom_data = m_prom_tab[(ls283 >> 6) & 0xff]; rom18d_addr &= 0x20f8; - rom18d_addr += (prom_data & 0x1f00) + ((ls283 & 0x38) >>3); + rom18d_addr += (prom_data & 0x1f00) + ((ls283 & 0x38) >> 3); rom15f_addr &= 0x201c; - rom15f_addr += (m_rom18b[0x4000 + rom18d_addr]<<5) + ((ls283 & 0x6)>>1); + rom15f_addr += (m_rom18b[0x4000 + rom18d_addr] << 5) + ((ls283 & 0x6) >> 1); rom15f_addr += (prom_data & 0x4000); uint32_t const graph_color = (prom_data & 0x0070); @@ -249,7 +249,7 @@ uint32_t magmax_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap line_data[h] = pen_base + graph_color + graph_data; // priority: background over sprites - if (map_v_scr_100 && ((graph_data & 0x0c)==0x0c)) + if (map_v_scr_100 && ((graph_data & 0x0c) == 0x0c)) m_bitmap.pix(v, h) = line_data[h]; } @@ -346,88 +346,71 @@ void magmax_state::ay8910_portb_0_w(uint8_t data) { // bit 0 is input to CLR line of the LS74 m_ls74_clr = data & 1; - if (m_ls74_clr == 0) - m_ls74_q = 0; + m_ls74_q &= m_ls74_clr; } -TIMER_CALLBACK_MEMBER(magmax_state::scanline_callback) +TIMER_DEVICE_CALLBACK_MEMBER(magmax_state::sound_timer) { - int scanline = param; - /* bit 0 goes hi whenever line V6 from video part goes lo->hi that is when scanline is 64 and 192 accordingly */ - if (m_ls74_clr != 0) - m_ls74_q = 1; - - scanline += 128; - scanline &= 255; - - m_interrupt_timer->adjust(m_screen->time_until_pos(scanline), scanline); + m_ls74_q = m_ls74_clr; } void magmax_state::machine_start() { - // Create interrupt timer - m_interrupt_timer = timer_alloc(FUNC(magmax_state::scanline_callback), this); - // Set up save state save_item(NAME(m_ls74_clr)); save_item(NAME(m_ls74_q)); save_item(NAME(m_gain_control)); } -void magmax_state::machine_reset() -{ - m_interrupt_timer->adjust(m_screen->time_until_pos(64), 64); -} - void magmax_state::ay8910_porta_0_w(uint8_t data) { -/*There are three AY8910 chips and four(!) separate amplifiers on the board -* Each of AY channels is hardware mapped in following way: -* amplifier 0 gain x 1.00 <- AY0 CHA -* amplifier 1 gain x 1.00 <- AY0 CHB + AY0 CHC + AY1 CHA + AY1 CHB -* amplifier 2 gain x 4.54 (150K/33K) <- AY1 CHC + AY2 CHA -* amplifier 3 gain x 4.54 (150K/33K) <- AY2 CHB + AY2 CHC -* -* Each of the amps has its own analog circuit: -* amp0, amp1 and amp2 are different from each other; amp3 is the same as amp2 -* -* Outputs of those amps are inputs to post amps, each having own circuit -* that is partially controlled by AY #0 port A. -* PORT A BIT 0 - control postamp 0 (gain x10.0 | gain x 5.00) -* PORT A BIT 1 - control postamp 1 (gain x4.54 | gain x 2.27) -* PORT A BIT 2 - control postamp 2 (gain x1.00 | gain x 0.50) -* PORT A BIT 3 - control postamp 3 (gain x1.00 | gain x 0.50) -* -* The "control" means assert/clear input pins on chip called 4066 (it is analog switch) -* which results in volume gain (exactly 2 times). -* I use set_output_gain() to emulate the effect. - -gain summary: -port A control ON OFF -amp0 = *1*10.0=10.0 *1*5.0 = 5.0 -amp1 = *1*4.54=4.54 *1*2.27 = 2.27 -amp2 = *4.54*1=4.54 *4.54*0.5= 2.27 -amp3 = *4.54*1=4.54 *4.54*0.5= 2.27 -*/ - -/* -bit0 - SOUND Chan#0 name=AY-3-8910 #0 Ch A - -bit1 - SOUND Chan#1 name=AY-3-8910 #0 Ch B -bit1 - SOUND Chan#2 name=AY-3-8910 #0 Ch C -bit1 - SOUND Chan#3 name=AY-3-8910 #1 Ch A -bit1 - SOUND Chan#4 name=AY-3-8910 #1 Ch B - -bit2 - SOUND Chan#5 name=AY-3-8910 #1 Ch C -bit2 - SOUND Chan#6 name=AY-3-8910 #2 Ch A - -bit3 - SOUND Chan#7 name=AY-3-8910 #2 Ch B -bit3 - SOUND Chan#8 name=AY-3-8910 #2 Ch C -*/ + /* There are three AY8910 chips and four(!) separate amplifiers on the board + * Each of AY channels is hardware mapped in following way: + * amplifier 0 gain x 1.00 <- AY0 CHA + * amplifier 1 gain x 1.00 <- AY0 CHB + AY0 CHC + AY1 CHA + AY1 CHB + * amplifier 2 gain x 4.54 (150K/33K) <- AY1 CHC + AY2 CHA + * amplifier 3 gain x 4.54 (150K/33K) <- AY2 CHB + AY2 CHC + * + * Each of the amps has its own analog circuit: + * amp0, amp1 and amp2 are different from each other; amp3 is the same as amp2 + * + * Outputs of those amps are inputs to post amps, each having own circuit + * that is partially controlled by AY #0 port A. + * PORT A BIT 0 - control postamp 0 (gain x10.0 | gain x 5.00) + * PORT A BIT 1 - control postamp 1 (gain x4.54 | gain x 2.27) + * PORT A BIT 2 - control postamp 2 (gain x1.00 | gain x 0.50) + * PORT A BIT 3 - control postamp 3 (gain x1.00 | gain x 0.50) + * + * The "control" means assert/clear input pins on chip called 4066 (it is analog switch) + * which results in volume gain (exactly 2 times). + * I use set_output_gain() to emulate the effect. + + gain summary: + port A control ON OFF + amp0 = *1*10.0=10.0 *1*5.0 = 5.0 + amp1 = *1*4.54=4.54 *1*2.27 = 2.27 + amp2 = *4.54*1=4.54 *4.54*0.5= 2.27 + amp3 = *4.54*1=4.54 *4.54*0.5= 2.27 + */ + + /* + bit0 - SOUND Chan#0 name=AY-3-8910 #0 Ch A + + bit1 - SOUND Chan#1 name=AY-3-8910 #0 Ch B + bit1 - SOUND Chan#2 name=AY-3-8910 #0 Ch C + bit1 - SOUND Chan#3 name=AY-3-8910 #1 Ch A + bit1 - SOUND Chan#4 name=AY-3-8910 #1 Ch B + + bit2 - SOUND Chan#5 name=AY-3-8910 #1 Ch C + bit2 - SOUND Chan#6 name=AY-3-8910 #2 Ch A + + bit3 - SOUND Chan#7 name=AY-3-8910 #2 Ch B + bit3 - SOUND Chan#8 name=AY-3-8910 #2 Ch C + */ if (m_gain_control == (data & 0x0f)) return; @@ -436,11 +419,13 @@ bit3 - SOUND Chan#8 name=AY-3-8910 #2 Ch C LOGGAINCTRL("gain_ctrl = %2x", data & 0x0f); - const double mix_resistors[4] = { RES_K(1.0), RES_K(2.2), RES_K(10.0), RES_K(10.0) }; // R35, R33, R32, R34 for (int i = 0; i < 4; i++) { - // RES_K(5) == (1.0 / ((1.0 / RES_K(10)) + (1.0 / RES_K(10)))) because of the optional extra 10k in parallel in each inverting amplifier circuit - // the total max number of output gain 'units' of all 4 inputs is 10 + 10/2.2 + 1 + 1 = 16.545454, so we divide the gain amount by this number so we don't clip + const double mix_resistors[4] = { RES_K(1.0), RES_K(2.2), RES_K(10.0), RES_K(10.0) }; // R35, R33, R32, R34 + + // RES_K(5) == (1.0 / ((1.0 / RES_K(10)) + (1.0 / RES_K(10)))) because of the optional extra 10k in parallel in each inverting amplifier circuit. + // The total max number of output gain 'units' of all 4 inputs is 10 + 10/2.2 + 1 + 1 = 16.545454, + // so we divide the gain amount by this number so we don't clip. m_ayfilter[i]->set_output_gain(0, (-1.0 * (((m_gain_control & (1 << i)) ? RES_K(10) : RES_K(5)) / mix_resistors[i] )) / 16.545454); //m_ayfilter[i]->set_output_gain(0, (m_gain_control & (1 << i)) ? 1.0 : 0.5); } @@ -595,7 +580,7 @@ GFXDECODE_END void magmax_state::magmax(machine_config &config) { // basic machine hardware - M68000(config, m_maincpu, XTAL(16'000'000) / 2); // verified on PCB + M68000(config, m_maincpu, XTAL(16'000'000) / 2); // verified on PCB m_maincpu->set_addrmap(AS_PROGRAM, &magmax_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(magmax_state::irq1_line_assert)); @@ -605,7 +590,6 @@ void magmax_state::magmax(machine_config &config) config.set_maximum_quantum(attotime::from_hz(600)); - // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); @@ -620,13 +604,20 @@ void magmax_state::magmax(machine_config &config) // sound hardware SPEAKER(config, "speaker").front_center(); - FILTER_BIQUAD(config, m_ayfilter[0]).opamp_sk_lowpass_setup(RES_K(10), RES_K(10), RES_M(999.99), RES_R(0.001), CAP_N(22), CAP_N(10)); // R22, R23, nothing(infinite resistance), wire(short), C16, C19 + // R22, R23, nothing(infinite resistance), wire(short), C16, C19 + FILTER_BIQUAD(config, m_ayfilter[0]).opamp_sk_lowpass_setup(RES_K(10), RES_K(10), RES_M(999.99), RES_R(0.001), CAP_N(22), CAP_N(10)); m_ayfilter[0]->add_route(ALL_OUTPUTS, "speaker", 1.0); // <- gain here is controlled by m_ay[0] IOA0 and resistor R35 - FILTER_BIQUAD(config, m_ayfilter[1]).opamp_sk_lowpass_setup(RES_K(4.7), RES_K(4.7), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); // R26, R27, nothing(infinite resistance), wire(short), C18, C14 + + // R26, R27, nothing(infinite resistance), wire(short), C18, C14 + FILTER_BIQUAD(config, m_ayfilter[1]).opamp_sk_lowpass_setup(RES_K(4.7), RES_K(4.7), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); m_ayfilter[1]->add_route(ALL_OUTPUTS, "speaker", 1.0); // <- gain here is controlled by m_ay[0] IOA1 and resistor R33 - FILTER_BIQUAD(config, m_ayfilter[2]).opamp_mfb_lowpass_setup(RES_K(33), 0.0, RES_K(150), 0.0, CAP_P(330)); // R24, wire(short), R28, wire(short), C22 + + // R24, wire(short), R28, wire(short), C22 + FILTER_BIQUAD(config, m_ayfilter[2]).opamp_mfb_lowpass_setup(RES_K(33), 0.0, RES_K(150), 0.0, CAP_P(330)); m_ayfilter[2]->add_route(ALL_OUTPUTS, "speaker", 1.0); // <- gain here is controlled by m_ay[0] IOA2 and resistor R32 - FILTER_BIQUAD(config, m_ayfilter[3]).opamp_mfb_lowpass_setup(RES_K(33), 0.0, RES_K(150), 0.0, CAP_P(330)); // R25, wire(short), R31, wire(short), C23 + + // R25, wire(short), R31, wire(short), C23 + FILTER_BIQUAD(config, m_ayfilter[3]).opamp_mfb_lowpass_setup(RES_K(33), 0.0, RES_K(150), 0.0, CAP_P(330)); m_ayfilter[3]->add_route(ALL_OUTPUTS, "speaker", 1.0); // <- gain here is controlled by m_ay[0] IOA3 and resistor R34 MIXER(config, m_aymixer[0]).add_route(0, m_ayfilter[1], 1.0); @@ -653,6 +644,8 @@ void magmax_state::magmax(machine_config &config) GENERIC_LATCH_8(config, m_soundlatch); m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0); m_soundlatch->set_separate_acknowledge(true); + + TIMER(config, "sound_timer").configure_scanline(FUNC(magmax_state::sound_timer), "screen", 64, 128); } diff --git a/src/mame/nichibutsu/terracre.cpp b/src/mame/nichibutsu/terracre.cpp index 463d71312d2..fd7e4d275f4 100644 --- a/src/mame/nichibutsu/terracre.cpp +++ b/src/mame/nichibutsu/terracre.cpp @@ -2,6 +2,7 @@ // copyright-holders: Carlos A. Lozano /****************************************************************** + Terra Cresta (preliminary) Nichibutsu 1985 68000 + Z80 @@ -79,6 +80,7 @@ AT-2 2148 2148 2148 2148 1 2 3 6116 22MHz + */ #include "emu.h" @@ -784,14 +786,20 @@ void terracre_state::ym3526(machine_config &config) // Sum: 0.796296 // Multiply all 3 values by 1 / 0.796296 (i.e. 1.255814): // Final values are: ym: 0.255814; dac1: 0.232558; dac2: 0.511628) - FILTER_BIQUAD(config, m_ymfilter).opamp_sk_lowpass_setup(RES_K(4.7), RES_K(4.7), RES_M(999.99), RES_R(0.001), CAP_N(3.3), CAP_N(1.0)); // R10, R11, nothing(infinite resistance), wire(short), C11, C12 + + // R10, R11, nothing(infinite resistance), wire(short), C11, C12 + FILTER_BIQUAD(config, m_ymfilter).opamp_sk_lowpass_setup(RES_K(4.7), RES_K(4.7), RES_M(999.99), RES_R(0.001), CAP_N(3.3), CAP_N(1.0)); m_ymfilter->add_route(ALL_OUTPUTS, "speaker", 1.0); - FILTER_BIQUAD(config, m_dacfilter1).opamp_sk_lowpass_setup(RES_K(22), RES_K(22), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); // R17, R18, nothing(infinite resistance), wire(short), C19, C17 + + // R17, R18, nothing(infinite resistance), wire(short), C19, C17 + FILTER_BIQUAD(config, m_dacfilter1).opamp_sk_lowpass_setup(RES_K(22), RES_K(22), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); m_dacfilter1->add_route(ALL_OUTPUTS, "speaker", 1.0); - FILTER_BIQUAD(config, m_dacfilter2).opamp_sk_lowpass_setup(RES_K(22), RES_K(22), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); // R16, R15, nothing(infinite resistance), wire(short), C18, C21 + + // R16, R15, nothing(infinite resistance), wire(short), C18, C21 + FILTER_BIQUAD(config, m_dacfilter2).opamp_sk_lowpass_setup(RES_K(22), RES_K(22), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); m_dacfilter2->add_route(ALL_OUTPUTS, "speaker", 1.0); - YM3526(config, "ymsnd", XTAL(16'000'000) / 4).add_route(ALL_OUTPUTS, m_ymfilter, 0.2558); // 4MHz verified on PCB + YM3526(config, "ymsnd", XTAL(16'000'000) / 4).add_route(ALL_OUTPUTS, m_ymfilter, 0.2558); // 4MHz verified on PCB DAC_8BIT_R2R(config, "dac1", 0).add_route(ALL_OUTPUTS, m_dacfilter1, 0.2326); // SIP R2R DAC @ RA-1 with 74HC374P latch DAC_8BIT_R2R(config, "dac2", 0).add_route(ALL_OUTPUTS, m_dacfilter2, 0.5116); // SIP R2R DAC @ RA-2 with 74HC374P latch @@ -830,11 +838,17 @@ void terracre_state::ym2203(machine_config &config) // Sum: 0.7245 // Multiply all 5 values by 1 / 0.7245 (i.e. 1.380): // ym: 0.2415; dac1: 0.2196; dac2: 0.4830, ssgA+B: 0.0222; ssgC: 0.0337 - FILTER_BIQUAD(config, m_ymfilter).opamp_sk_lowpass_setup(RES_K(4.7), RES_K(4.7), RES_M(999.99), RES_R(0.001), CAP_N(3.3), CAP_N(1.0)); // R10, R11, nothing(infinite resistance), wire(short), C11, C12 + + // R10, R11, nothing(infinite resistance), wire(short), C11, C12 + FILTER_BIQUAD(config, m_ymfilter).opamp_sk_lowpass_setup(RES_K(4.7), RES_K(4.7), RES_M(999.99), RES_R(0.001), CAP_N(3.3), CAP_N(1.0)); m_ymfilter->add_route(ALL_OUTPUTS, "speaker", 1.0); - FILTER_BIQUAD(config, m_dacfilter1).opamp_sk_lowpass_setup(RES_K(22), RES_K(22), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); // R17, R18, nothing(infinite resistance), wire(short), C19, C17 + + // R17, R18, nothing(infinite resistance), wire(short), C19, C17 + FILTER_BIQUAD(config, m_dacfilter1).opamp_sk_lowpass_setup(RES_K(22), RES_K(22), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); m_dacfilter1->add_route(ALL_OUTPUTS, "speaker", 1.0); - FILTER_BIQUAD(config, m_dacfilter2).opamp_sk_lowpass_setup(RES_K(22), RES_K(22), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); // R16, R15, nothing(infinite resistance), wire(short), C18, C21 + + // R16, R15, nothing(infinite resistance), wire(short), C18, C21 + FILTER_BIQUAD(config, m_dacfilter2).opamp_sk_lowpass_setup(RES_K(22), RES_K(22), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); m_dacfilter2->add_route(ALL_OUTPUTS, "speaker", 1.0); //TODO: the ym2203 sub-board has a complicated and convoluted enough set of analog @@ -847,17 +861,20 @@ void terracre_state::ym2203(machine_config &config) // unconventional way. // This filter is a differential amplifier, with no real cutoff, and a gain of -2.127 - FILTER_BIQUAD(config, m_ssgfilter_cgain).opamp_mfb_lowpass_setup(RES_K(4.7), 0.0, RES_K(10), 0.0, CAP_N(22)/100.0); // YR12, N/A(short), YR15, N/A(unpopulated), (parasitic capacitance from YC3) + // YR12, N/A(short), YR15, N/A(unpopulated), (parasitic capacitance from YC3) + FILTER_BIQUAD(config, m_ssgfilter_cgain).opamp_mfb_lowpass_setup(RES_K(4.7), 0.0, RES_K(10), 0.0, CAP_N(22)/100.0); m_ssgfilter_cgain->add_route(ALL_OUTPUTS, "speaker", 1.0); // This filter is a 2nd order sallen-key lowpass, unity gain. - FILTER_BIQUAD(config, m_ssgfilter_cfilt).opamp_sk_lowpass_setup(RES_K(10), RES_K(10), RES_M(999.99), RES_R(0.001), CAP_N(22), CAP_N(10)); // YR3, YR5, nothing(infinite resistance), wire(short), YC3, YC6 + // YR3, YR5, nothing(infinite resistance), wire(short), YC3, YC6 + FILTER_BIQUAD(config, m_ssgfilter_cfilt).opamp_sk_lowpass_setup(RES_K(10), RES_K(10), RES_M(999.99), RES_R(0.001), CAP_N(22), CAP_N(10)); m_ssgfilter_cfilt->add_route(ALL_OUTPUTS, m_ssgfilter_cgain, 1.0); // This filter is a differential amplifier, with no real cutoff, and a gain of -4.5454 // Technically it was probably intended as first order MFB lowpass, but the cap ("YC0") // near/bypassing YR7 was left unpopulated. - FILTER_BIQUAD(config, m_ssgfilter_abgain).opamp_mfb_lowpass_setup(RES_K(33), 0.0, RES_K(150), 0.0, CAP_N(100)/10000.0); // YR8, N/A(short), YR7, N/A(unpopulated), (parasitic capacitance from YC1) + // YR8, N/A(short), YR7, N/A(unpopulated), (parasitic capacitance from YC1) + FILTER_BIQUAD(config, m_ssgfilter_abgain).opamp_mfb_lowpass_setup(RES_K(33), 0.0, RES_K(150), 0.0, CAP_N(100)/10000.0); m_ssgfilter_abgain->add_route(ALL_OUTPUTS, "speaker", 1.0); MIXER(config, m_ssgmixer); From 50b2bdd904f2df033f52246d92b996e3bb978ddd Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 10 Dec 2024 19:35:38 +0100 Subject: [PATCH 3/6] skykid: small cleanup to dipswitches --- src/mame/namco/skykid.cpp | 178 +++++++++++++++---------------- src/mame/nichibutsu/dacholer.cpp | 4 +- 2 files changed, 92 insertions(+), 90 deletions(-) diff --git a/src/mame/namco/skykid.cpp b/src/mame/namco/skykid.cpp index 5b12db5ee44..d14c7e0c943 100644 --- a/src/mame/namco/skykid.cpp +++ b/src/mame/namco/skykid.cpp @@ -371,19 +371,19 @@ uint8_t skykid_state::inputport_r() { switch (m_inputport_selected) { - case 0x00: // DSW B (bits 0-4) + case 0x00: // DSW B (bits 0-4) return (m_dsw[1]->read() & 0xf8) >> 3; - case 0x01: // DSW B (bits 5-7), DSW A (bits 0-1) + case 0x01: // DSW B (bits 5-7), DSW A (bits 0-1) return ((m_dsw[1]->read() & 0x07) << 2) | ((m_dsw[0]->read() & 0xc0) >> 6); - case 0x02: // DSW A (bits 2-6) + case 0x02: // DSW A (bits 2-6) return (m_dsw[0]->read() & 0x3e) >> 1; - case 0x03: // DSW A (bit 7), DSW C (bits 0-3) + case 0x03: // DSW A (bit 7), DSW C (bits 0-3) return ((m_dsw[0]->read() & 0x01) << 4) | (m_button2->read() & 0x0f); - case 0x04: // coins, start + case 0x04: // coins, start return m_system->read(); - case 0x05: // 2P controls + case 0x05: // 2P controls return m_pl[1]->read(); - case 0x06: // 1P controls + case 0x06: // 1P controls return m_pl[0]->read(); default: return 0xff; @@ -454,8 +454,8 @@ void skykid_state::main_map(address_map &map) void skykid_state::mcu_map(address_map &map) { - map(0x1000, 0x13ff).rw(m_cus30, FUNC(namco_cus30_device::namcos1_cus30_r), FUNC(namco_cus30_device::namcos1_cus30_w)); // PSG device, shared RAM/ - map(0x2000, 0x3fff).w("watchdog", FUNC(watchdog_timer_device::reset_w)); // ? + map(0x1000, 0x13ff).rw(m_cus30, FUNC(namco_cus30_device::namcos1_cus30_r), FUNC(namco_cus30_device::namcos1_cus30_w)); // PSG device, shared RAM + map(0x2000, 0x3fff).w("watchdog", FUNC(watchdog_timer_device::reset_w)); // ? map(0x4000, 0x7fff).w(FUNC(skykid_state::irq_2_ctrl_w)); map(0x8000, 0x9fff).rom().region("mcusub", 0); map(0xc000, 0xc7ff).ram(); @@ -464,47 +464,47 @@ void skykid_state::mcu_map(address_map &map) static INPUT_PORTS_START( skykid ) - PORT_START("DSWA") // DSW A - PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWA:1" ) - PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:3,2") + PORT_START("DSWA") + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:8,7") PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x60, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) + PORT_DIPNAME( 0x04, 0x04, "Freeze" ) PORT_DIPLOCATION("SWA:6") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, "Round Skip" ) PORT_DIPLOCATION("SWA:5") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWA:4") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "Round Skip" ) PORT_DIPLOCATION("SWA:5") - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, "Freeze" ) PORT_DIPLOCATION("SWA:6") - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:8,7") + PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:3,2") PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x60, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) + PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWA:1" ) - PORT_START("DSWB") // DSW B - PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:2,1") - PORT_DIPSETTING( 0x80, "1" ) - PORT_DIPSETTING( 0x40, "2" ) - PORT_DIPSETTING( 0xc0, "3" ) - PORT_DIPSETTING( 0x00, "5" ) - PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:4,3") + PORT_START("DSWB") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWB:8") + PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x02, 0x02, "Allow Buy In" ) PORT_DIPLOCATION("SWB:7") + PORT_DIPSETTING( 0x00, DEF_STR( No ) ) + PORT_DIPSETTING( 0x02, DEF_STR( Yes ) ) + PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SWB:6" ) + PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SWB:5" ) + PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:4,3") PORT_DIPSETTING( 0x00, "20k every 80k" ) PORT_DIPSETTING( 0x10, "20k and 80k" ) PORT_DIPSETTING( 0x20, "30k every 90k" ) PORT_DIPSETTING( 0x30, "30k and 90k" ) - PORT_DIPUNKNOWN_DIPLOC( 0x08, 0x08, "SWB:5" ) - PORT_DIPUNKNOWN_DIPLOC( 0x04, 0x04, "SWB:6" ) - PORT_DIPNAME( 0x02, 0x02, "Allow Buy In" ) PORT_DIPLOCATION("SWB:7") - PORT_DIPSETTING( 0x00, DEF_STR( No ) ) - PORT_DIPSETTING( 0x02, DEF_STR( Yes ) ) - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SWB:8") - PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWB:2,1") + PORT_DIPSETTING( 0x80, "1" ) + PORT_DIPSETTING( 0x40, "2" ) + PORT_DIPSETTING( 0xc0, "3" ) + PORT_DIPSETTING( 0x00, "5" ) PORT_START("BUTTON2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -513,7 +513,7 @@ static INPUT_PORTS_START( skykid ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("SYSTEM") // IN 0 + PORT_START("SYSTEM") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) @@ -521,7 +521,7 @@ static INPUT_PORTS_START( skykid ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("P1") // IN 1 + PORT_START("P1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) @@ -529,7 +529,7 @@ static INPUT_PORTS_START( skykid ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("P2") // IN 2 + PORT_START("P2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) @@ -541,13 +541,13 @@ INPUT_PORTS_END static INPUT_PORTS_START( skykids ) PORT_INCLUDE( skykid ) - PORT_MODIFY("DSWA") // DSW A - PORT_DIPNAME( 0x08, 0x08, "Round Select" ) PORT_DIPLOCATION("SWA:5") + PORT_MODIFY("DSWA") + PORT_DIPNAME( 0x08, 0x08, "Round Select" ) PORT_DIPLOCATION("SWA:5") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x08, DEF_STR( On ) ) - PORT_MODIFY("DSWB") // DSW B - PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:4,3") + PORT_MODIFY("DSWB") + PORT_DIPNAME( 0x30, 0x30, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SWB:4,3") PORT_DIPSETTING( 0x00, "30k every 80k" ) PORT_DIPSETTING( 0x10, "30k and 80k" ) PORT_DIPSETTING( 0x20, "40k every 90k" ) @@ -555,51 +555,51 @@ static INPUT_PORTS_START( skykids ) INPUT_PORTS_END static INPUT_PORTS_START( drgnbstr ) - PORT_START("DSWA") // DSW A - PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWA:1" ) - PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:3,2") + PORT_START("DSWA") + PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:8,7") PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x60, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) + PORT_DIPNAME( 0x04, 0x04, "Freeze" ) PORT_DIPLOCATION("SWA:6") + PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) + PORT_DIPNAME( 0x08, 0x08, "Round Skip" ) PORT_DIPLOCATION("SWA:5") + PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) + PORT_DIPSETTING( 0x00, DEF_STR( On ) ) PORT_DIPNAME( 0x10, 0x10, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SWA:4") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x10, DEF_STR( On ) ) - PORT_DIPNAME( 0x08, 0x08, "Round Skip" ) PORT_DIPLOCATION("SWA:5") - PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x04, 0x04, "Freeze" ) PORT_DIPLOCATION("SWA:6") - PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) - PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SWA:8,7") + PORT_DIPNAME( 0x60, 0x60, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SWA:3,2") PORT_DIPSETTING( 0x00, DEF_STR( 3C_1C ) ) - PORT_DIPSETTING( 0x01, DEF_STR( 2C_1C ) ) - PORT_DIPSETTING( 0x03, DEF_STR( 1C_1C ) ) - PORT_DIPSETTING( 0x02, DEF_STR( 1C_2C ) ) + PORT_DIPSETTING( 0x20, DEF_STR( 2C_1C ) ) + PORT_DIPSETTING( 0x60, DEF_STR( 1C_1C ) ) + PORT_DIPSETTING( 0x40, DEF_STR( 1C_2C ) ) + PORT_SERVICE_DIPLOC( 0x80, IP_ACTIVE_LOW, "SWA:1" ) - PORT_START("DSWB") // DSW B - PORT_DIPNAME( 0x80, 0x80, "Spurt Time" ) PORT_DIPLOCATION("SWB:1") - PORT_DIPSETTING( 0x80, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Difficult ) ) - PORT_DIPNAME( 0x40, 0x40, "Level of Monster" ) PORT_DIPLOCATION("SWB:2") - PORT_DIPSETTING( 0x40, DEF_STR( Normal ) ) - PORT_DIPSETTING( 0x00, DEF_STR( Difficult ) ) - PORT_DIPNAME( 0x30, 0x30, "Starting Vitality" ) PORT_DIPLOCATION("SWB:4,3") - PORT_DIPSETTING( 0x00, "160" ) - PORT_DIPSETTING( 0x30, "128" ) - PORT_DIPSETTING( 0x10, "96" ) - PORT_DIPSETTING( 0x20, "64" ) - PORT_DIPNAME( 0x0c, 0x0c, "Bonus Vitality" ) PORT_DIPLOCATION("SWB:6,5") /* Clear Mountain, Tower, ect... */ - PORT_DIPSETTING( 0x00, "64" ) - PORT_DIPSETTING( 0x08, "48/64" ) - PORT_DIPSETTING( 0x04, "32/64" ) - PORT_DIPSETTING( 0x0c, DEF_STR( None ) ) - PORT_DIPNAME( 0x02, 0x02, "Bonus Level" ) PORT_DIPLOCATION("SWB:7") /* Clear Round */ - PORT_DIPSETTING( 0x02, "Full" ) - PORT_DIPSETTING( 0x00, "Partial" ) - PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SWB:8") + PORT_START("DSWB") + PORT_DIPNAME( 0x01, 0x01, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SWB:8") // Does not work? PORT_DIPSETTING( 0x01, DEF_STR( No ) ) PORT_DIPSETTING( 0x00, DEF_STR( Yes ) ) + PORT_DIPNAME( 0x02, 0x02, "Bonus Level" ) PORT_DIPLOCATION("SWB:7") // Clear Round + PORT_DIPSETTING( 0x00, "Partial" ) + PORT_DIPSETTING( 0x02, "Full" ) + PORT_DIPNAME( 0x0c, 0x0c, "Bonus Vitality" ) PORT_DIPLOCATION("SWB:6,5") // Clear Mountain, Tower, etc... + PORT_DIPSETTING( 0x04, "32/64" ) + PORT_DIPSETTING( 0x08, "48/64" ) + PORT_DIPSETTING( 0x00, "64" ) + PORT_DIPSETTING( 0x0c, DEF_STR( None ) ) + PORT_DIPNAME( 0x30, 0x30, "Starting Vitality" ) PORT_DIPLOCATION("SWB:4,3") + PORT_DIPSETTING( 0x20, "64" ) + PORT_DIPSETTING( 0x10, "96" ) + PORT_DIPSETTING( 0x30, "128" ) + PORT_DIPSETTING( 0x00, "160" ) + PORT_DIPNAME( 0x40, 0x40, "Level of Monster" ) PORT_DIPLOCATION("SWB:2") + PORT_DIPSETTING( 0x40, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Difficult ) ) + PORT_DIPNAME( 0x80, 0x80, "Spurt Time" ) PORT_DIPLOCATION("SWB:1") + PORT_DIPSETTING( 0x80, DEF_STR( Normal ) ) + PORT_DIPSETTING( 0x00, DEF_STR( Difficult ) ) PORT_START("BUTTON2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) @@ -610,7 +610,7 @@ static INPUT_PORTS_START( drgnbstr ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("SYSTEM") // IN 0 + PORT_START("SYSTEM") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN2 ) @@ -618,7 +618,7 @@ static INPUT_PORTS_START( drgnbstr ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 ) PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("P1") // IN 1 + PORT_START("P1") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY @@ -626,7 +626,7 @@ static INPUT_PORTS_START( drgnbstr ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_BIT( 0xe0, IP_ACTIVE_LOW, IPT_UNUSED ) - PORT_START("P2") // IN 2 + PORT_START("P2") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_COCKTAIL PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_COCKTAIL PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_COCKTAIL @@ -699,10 +699,10 @@ void skykid_state::skykid(machine_config &config) m_mcu->set_addrmap(AS_PROGRAM, &skykid_state::mcu_map); m_mcu->in_p1_cb().set(FUNC(skykid_state::inputport_r)); m_mcu->out_p1_cb().set(FUNC(skykid_state::inputport_select_w)); - m_mcu->in_p2_cb().set_constant(0xff); // leds won't work otherwise + m_mcu->in_p2_cb().set_constant(0xff); // leds won't work otherwise m_mcu->out_p2_cb().set(FUNC(skykid_state::led_w)); - config.set_maximum_quantum(attotime::from_hz(6000)); // we need heavy synch + config.set_maximum_quantum(attotime::from_hz(6000)); // we need heavy sync WATCHDOG_TIMER(config, "watchdog"); diff --git a/src/mame/nichibutsu/dacholer.cpp b/src/mame/nichibutsu/dacholer.cpp index f091f155480..fa452df0f4f 100644 --- a/src/mame/nichibutsu/dacholer.cpp +++ b/src/mame/nichibutsu/dacholer.cpp @@ -33,11 +33,13 @@ ******************************************************************************/ #include "emu.h" + #include "cpu/z80/z80.h" #include "machine/gen_latch.h" #include "sound/msm5205.h" #include "sound/ay8910.h" #include "video/resnet.h" + #include "emupal.h" #include "screen.h" #include "speaker.h" @@ -308,7 +310,7 @@ void dacholer_state::snd_ack_w(uint8_t data) int dacholer_state::snd_ack_r() { - return m_snd_ack; //guess ... + return m_snd_ack; // guess ... } void dacholer_state::snd_irq_w(uint8_t data) From fc5073bc74beb510a94992ec8fe7f82bdfa60e75 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 10 Dec 2024 19:45:00 +0100 Subject: [PATCH 4/6] nbbatman2bl: fix palette array oob access --- src/mame/irem/m92.cpp | 83 ++++++++++++++++++++++++------------------- src/mame/irem/m92.h | 10 +++--- 2 files changed, 53 insertions(+), 40 deletions(-) diff --git a/src/mame/irem/m92.cpp b/src/mame/irem/m92.cpp index 283bef7ded2..89099963bdf 100644 --- a/src/mame/irem/m92.cpp +++ b/src/mame/irem/m92.cpp @@ -251,7 +251,6 @@ TIMER_DEVICE_CALLBACK_MEMBER(m92_state::scanline_interrupt) { m_upd71059c->ir0_w(0); } - } } @@ -300,7 +299,7 @@ void m92_state::sound_reset_w(uint16_t data) void m92_state::m92_base_map(address_map &map) { - map(0xe0000, 0xeffff).ram(); /* System ram */ + map(0xe0000, 0xeffff).ram(); // System ram map(0xf8000, 0xf87ff).ram().share("spriteram"); map(0xf8800, 0xf8fff).rw(FUNC(m92_state::paletteram_r), FUNC(m92_state::paletteram_w)); map(0xf9000, 0xf900f).w(FUNC(m92_state::spritecontrol_w)).share("spritecontrol"); @@ -308,7 +307,7 @@ void m92_state::m92_base_map(address_map &map) map(0xffff0, 0xfffff).rom().region("maincpu", 0x7fff0); } -/* appears to be an earlier board */ +// appears to be an earlier board void m92_state::lethalth_map(address_map &map) { m92_base_map(map); @@ -320,7 +319,7 @@ void m92_state::m92_map(address_map &map) { m92_base_map(map); map(0x00000, 0xbffff).rom(); - map(0xc0000, 0xcffff).rom().region("maincpu", 0x00000); /* Mirror used by In The Hunt as protection */ + map(0xc0000, 0xcffff).rom().region("maincpu", 0x00000); // Mirror used by In The Hunt as protection map(0xd0000, 0xdffff).ram().w(FUNC(m92_state::vram_w)).share("vram_data"); } @@ -329,17 +328,27 @@ void m92_state::m92_banked_map(address_map &map) m92_base_map(map); map(0x00000, 0x9ffff).rom(); map(0xa0000, 0xbffff).bankr("mainbank"); - map(0xc0000, 0xcffff).rom().region("maincpu", 0x00000); /* Mirror used by In The Hunt as protection */ + map(0xc0000, 0xcffff).rom().region("maincpu", 0x00000); // Mirror used by In The Hunt as protection map(0xd0000, 0xdffff).ram().w(FUNC(m92_state::vram_w)).share("vram_data"); } -/* This game has an eeprom on the game board */ +// This game has an eeprom on the game board void m92_state::majtitl2_map(address_map &map) { m92_banked_map(map); map(0xf0000, 0xf3fff).rw("eeprom", FUNC(eeprom_parallel_28xx_device::read), FUNC(eeprom_parallel_28xx_device::write)).umask16(0x00ff); } +void m92_state::nbbatman2bl_map(address_map &map) +{ + m92_banked_map(map); + + // disable for now, it has different sprite hardware + map(0xf8000, 0xf87ff).unmaprw(); + map(0xf9000, 0xf900f).unmapw(); + map(0xf9800, 0xf9801).unmapw(); +} + void m92_state::m92_portmap(address_map &map) { map(0x00, 0x00).w("soundlatch", FUNC(generic_latch_8_device::write)); @@ -348,7 +357,7 @@ void m92_state::m92_portmap(address_map &map) map(0x02, 0x02).w(FUNC(m92_state::coincounter_w)); map(0x04, 0x05).portr("DSW"); map(0x06, 0x07).portr("P3_P4"); - map(0x08, 0x08).r("soundlatch2", FUNC(generic_latch_8_device::read)); // answer from sound CPU + map(0x08, 0x08).r("soundlatch2", FUNC(generic_latch_8_device::read)); // answer from sound CPU map(0x40, 0x43).rw(m_upd71059c, FUNC(pic8259_device::read), FUNC(pic8259_device::write)).umask16(0x00ff); map(0x80, 0x87).w(FUNC(m92_state::pf_control_w<0>)); map(0x88, 0x8f).w(FUNC(m92_state::pf_control_w<1>)); @@ -424,7 +433,7 @@ static INPUT_PORTS_START( m92_2player ) PORT_DIPUNKNOWN_DIPLOC( 0x8000, 0x8000, "SW3:8" ) PORT_START("DSW") - /* Dip switch bank 1 */ + /* DIP switch bank 1 */ PORT_DIPUNKNOWN_DIPLOC( 0x0001, 0x0001, "SW1:1" ) PORT_DIPUNKNOWN_DIPLOC( 0x0002, 0x0002, "SW1:2" ) PORT_DIPUNKNOWN_DIPLOC( 0x0004, 0x0004, "SW1:3" ) @@ -437,7 +446,7 @@ static INPUT_PORTS_START( m92_2player ) PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_SERVICE_DIPLOC( 0x0080, IP_ACTIVE_LOW, "SW1:8" ) - /* Dip switch bank 2 */ + /* DIP switch bank 2 */ PORT_DIPNAME( 0x0100, 0x0100, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) @@ -490,10 +499,10 @@ INPUT_PORTS_END static INPUT_PORTS_START( bmaster ) PORT_INCLUDE(m92_2player) - /* Game manual specificly mentions dip switch bank 3 is unused */ + /* Game manual specificly mentions DIP switch bank 3 is unused */ PORT_MODIFY("DSW") - /* Dip switch bank 1 */ + /* DIP switch bank 1 */ PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x0000, "1" ) PORT_DIPSETTING( 0x0003, "2" ) @@ -514,7 +523,7 @@ static INPUT_PORTS_START( gunforce ) PORT_INCLUDE(m92_2player) PORT_MODIFY("DSW") - /* Dip switch bank 1 */ + /* DIP switch bank 1 */ PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x0002, "2" ) PORT_DIPSETTING( 0x0003, "3" ) @@ -535,7 +544,7 @@ static INPUT_PORTS_START( lethalth ) PORT_INCLUDE(m92_2player) PORT_MODIFY("COINS_DSW3") - /* Dip switch bank 3 */ + /* DIP switch bank 3 */ PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("SW3:1,2") PORT_DIPSETTING( 0x0200, "500K & 1M" ) PORT_DIPSETTING( 0x0300, "700K & 1.5M" ) @@ -543,7 +552,7 @@ static INPUT_PORTS_START( lethalth ) PORT_DIPSETTING( 0x0100, "1M & 2M" ) PORT_MODIFY("DSW") - /* Dip switch bank 1 */ + /* DIP switch bank 1 */ PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x0002, "2" ) PORT_DIPSETTING( 0x0003, "3" ) @@ -564,7 +573,7 @@ static INPUT_PORTS_START( thndblst ) PORT_INCLUDE(lethalth) PORT_MODIFY("DSW") - /* Dip switch bank 1 */ + /* DIP switch bank 1 */ PORT_DIPNAME( 0x0010, 0x0000, "Continuous Play" ) PORT_DIPLOCATION("SW1:5") /* manual says Unused */ PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) @@ -575,7 +584,7 @@ static INPUT_PORTS_START( hook ) PORT_INCLUDE(m92_4player) PORT_MODIFY("DSW") - /* Dip switch bank 1 */ + /* DIP switch bank 1 */ PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x0000, "1" ) PORT_DIPSETTING( 0x0003, "2" ) @@ -597,7 +606,7 @@ static INPUT_PORTS_START( majtitl2 ) PORT_INCLUDE(m92_4player) PORT_MODIFY("COINS_DSW3") - /* Dip switch bank 3 */ + /* DIP switch bank 3 */ PORT_DIPNAME( 0x0100, 0x0100, "Ticket Dispenser" ) PORT_DIPLOCATION("SW3:1") PORT_DIPSETTING( 0x0100, DEF_STR( Off ) ) /* "Ticket payout function is not working now" will be shown on screen */ PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) /* Stored data is shown on screen with the option to clear data */ @@ -615,12 +624,12 @@ static INPUT_PORTS_START( majtitl2 ) PORT_DIPSETTING( 0x0000, "DL 4SS" ) PORT_MODIFY("DSW") - /* Dip switch bank 2 */ + /* DIP switch bank 2 */ PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:2") PORT_DIPSETTING( 0x0200, DEF_STR( Upright ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Cocktail ) ) - /* Dip switch bank 1 */ + /* DIP switch bank 1 */ PORT_DIPNAME( 0x0001, 0x0001, "Given Holes/Stroke Play" ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x0000, "1" ) PORT_DIPSETTING( 0x0001, "2" ) @@ -646,7 +655,7 @@ static INPUT_PORTS_START( mysticri ) PORT_INCLUDE(m92_2player) PORT_MODIFY("DSW") - /* Dip switch bank 1 */ + /* DIP switch bank 1 */ PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x0002, "2" ) PORT_DIPSETTING( 0x0003, "3" ) @@ -667,7 +676,7 @@ static INPUT_PORTS_START( uccops ) PORT_INCLUDE(m92_3player) PORT_MODIFY("DSW") - /* Dip switch bank 1 */ + /* DIP switch bank 1 */ PORT_DIPNAME( 0x0003, 0x0002, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x0000, "1" ) PORT_DIPSETTING( 0x0003, "2" ) @@ -690,7 +699,7 @@ static INPUT_PORTS_START( rtypeleo ) PORT_INCLUDE(m92_2player) PORT_MODIFY("DSW") - /* Dip switch bank 1 */ + /* DIP switch bank 1 */ PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x0002, "2" ) PORT_DIPSETTING( 0x0003, "3" ) @@ -708,7 +717,7 @@ static INPUT_PORTS_START( inthunt ) PORT_INCLUDE(m92_2player) PORT_MODIFY("DSW") - /* Dip switch bank 1 */ + /* DIP switch bank 1 */ PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x0002, "2" ) PORT_DIPSETTING( 0x0003, "3" ) @@ -729,7 +738,7 @@ static INPUT_PORTS_START( nbbatman ) PORT_INCLUDE(m92_4player) PORT_MODIFY("DSW") - /* Dip switch bank 1 */ + /* DIP switch bank 1 */ PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x0000, "1" ) PORT_DIPSETTING( 0x0003, "2" ) @@ -753,7 +762,7 @@ static INPUT_PORTS_START( psoldier ) IREM_GENERIC_JOYSTICKS_3_BUTTONS(1, 2) PORT_MODIFY("DSW") - /* Dip switch bank 1 */ + /* DIP switch bank 1 */ PORT_DIPNAME( 0x0020, 0x0000, "Any Button to Start" ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x0020, DEF_STR( No ) ) PORT_DIPSETTING( 0x0000, DEF_STR( Yes ) ) @@ -772,10 +781,10 @@ INPUT_PORTS_END static INPUT_PORTS_START( dsoccr94j ) PORT_INCLUDE(m92_4player) - /* Dip Switch 2, dip 2 is listed as "Don't Change" and is "OFF" */ + /* DIP Switch 2, dip 2 is listed as "Don't Change" and is "OFF" */ PORT_MODIFY("COINS_DSW3") - /* Dip switch bank 3 */ + /* DIP switch bank 3 */ PORT_DIPNAME( 0x0300, 0x0300, "Player Power" ) PORT_DIPLOCATION("SW3:1,2") PORT_DIPSETTING( 0x0000, "500" ) PORT_DIPSETTING( 0x0300, "1000" ) @@ -783,7 +792,7 @@ static INPUT_PORTS_START( dsoccr94j ) PORT_DIPSETTING( 0x0200, "2000" ) PORT_MODIFY("DSW") - /* Dip switch bank 1 */ + /* DIP switch bank 1 */ PORT_DIPNAME( 0x0003, 0x0003, "Time" ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x0000, "1:30" ) PORT_DIPSETTING( 0x0003, "2:00" ) @@ -798,11 +807,11 @@ static INPUT_PORTS_START( dsoccr94j ) PORT_DIPSETTING( 0x0010, "Match Mode" ) PORT_DIPSETTING( 0x0000, "Power Mode" ) /* - Match Mode: Winner advances to the next game. Game Over for the loser - Power Mode: The Players can play the game until their respective powers run - out, reguardless of whether they win or lose the game. - Player 2 can join in any time during the game - Player power (time) can be adjusted by dip switch #3 + Match Mode: Winner advances to the next game. Game Over for the loser + Power Mode: The Players can play the game until their respective powers run + out, reguardless of whether they win or lose the game. + Player 2 can join in any time during the game + Player power (time) can be adjusted by DIP switch #3 */ PORT_DIPNAME( 0x0020, 0x0020, "Starting Button" ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x0000, "Button 1" ) @@ -814,7 +823,7 @@ static INPUT_PORTS_START( gunforc2 ) PORT_INCLUDE(m92_2player) PORT_MODIFY("DSW") - /* Dip switch bank 1 */ + /* DIP switch bank 1 */ PORT_DIPNAME( 0x0003, 0x0003, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x0002, "3" ) PORT_DIPSETTING( 0x0003, "2" ) @@ -897,8 +906,8 @@ static const gfx_layout bootleg_spritelayout = static GFXDECODE_START( gfx_bootleg ) - GFXDECODE_ENTRY( "gfx1", 0, bootleg_charlayout, 0x400, 128 ) - GFXDECODE_ENTRY( "gfx2", 0, bootleg_spritelayout, 0x400, 128 ) + GFXDECODE_ENTRY( "gfx1", 0, bootleg_charlayout, 0, 128 ) + GFXDECODE_ENTRY( "gfx2", 0, bootleg_spritelayout, 0, 128 ) GFXDECODE_END @@ -1071,6 +1080,8 @@ void m92_state::nbbatman2bl(machine_config &config) config.device_remove("ymsnd"); config.device_remove("irem"); + m_maincpu->set_addrmap(AS_PROGRAM, &m92_state::nbbatman2bl_map); + m_gfxdecode->set_info(gfx_bootleg); /* 8951 MCU as sound CPU */ diff --git a/src/mame/irem/m92.h b/src/mame/irem/m92.h index 9a33994b344..09facc2c0ea 100644 --- a/src/mame/irem/m92.h +++ b/src/mame/irem/m92.h @@ -15,16 +15,17 @@ #include "machine/timer.h" #include "sound/okim6295.h" #include "video/bufsprite.h" + #include "emupal.h" #include "screen.h" #include "tilemap.h" struct M92_pf_layer_info { - tilemap_t * tmap = nullptr; - tilemap_t * wide_tmap = nullptr; - uint16_t vram_base = 0; - uint16_t control[4]{}; + tilemap_t *tmap = nullptr; + tilemap_t *wide_tmap = nullptr; + uint16_t vram_base = 0; + uint16_t control[4]{}; }; class m92_state : public driver_device @@ -126,6 +127,7 @@ class m92_state : public driver_device void m92_base_map(address_map &map) ATTR_COLD; void m92_portmap(address_map &map) ATTR_COLD; void majtitl2_map(address_map &map) ATTR_COLD; + void nbbatman2bl_map(address_map &map) ATTR_COLD; void ppan_portmap(address_map &map) ATTR_COLD; void sound_map(address_map &map) ATTR_COLD; From a5835c9d350bb5f24ff2e5b0d5fb0d50f287a413 Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 10 Dec 2024 20:07:53 +0100 Subject: [PATCH 5/6] qbeebing: add missing change button --- src/mame/subsino/subsino2.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/mame/subsino/subsino2.cpp b/src/mame/subsino/subsino2.cpp index 3535f6976dc..b28ee4f4182 100644 --- a/src/mame/subsino/subsino2.cpp +++ b/src/mame/subsino/subsino2.cpp @@ -1689,6 +1689,17 @@ static INPUT_PORTS_START( queenbee ) PORT_DIPSETTING( 0x00, "Fruit Holders" ) INPUT_PORTS_END +/*************************************************************************** + Queen Bee Bingo +***************************************************************************/ + +static INPUT_PORTS_START( qbeebing ) + PORT_INCLUDE( humlan ) + + PORT_MODIFY("IN-A") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_POKER_CANCEL ) PORT_NAME("Change") +INPUT_PORTS_END + /*************************************************************************** Express Card / Top Card ***************************************************************************/ @@ -4017,6 +4028,6 @@ GAME( 2002, xreel, queenbee, humlan, humlan, subsino2_state, empty_ini GAME( 2002, squeenb, 0, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino", "Super Queen Bee (Ver. 101)", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // severe timing issues -GAME( 2003, qbeebing, 0, humlan, humlan, subsino2_state, empty_init, ROT0, "Subsino", "Queen Bee Bingo", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) +GAME( 2003, qbeebing, 0, humlan, qbeebing, subsino2_state, empty_init, ROT0, "Subsino", "Queen Bee Bingo", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) GAME( 200?, treamary, 0, bishjan, bishjan, subsino2_state, empty_init, ROT0, "Subsino", "Treasure Mary", MACHINE_NOT_WORKING | MACHINE_NO_SOUND | MACHINE_IMPERFECT_GRAPHICS ) From 3bd3ca709344525c07d94062739dde06f45f87ac Mon Sep 17 00:00:00 2001 From: hap Date: Tue, 10 Dec 2024 21:18:34 +0100 Subject: [PATCH 6/6] system1: increase 2nd sn volume --- src/mame/sega/system1.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mame/sega/system1.cpp b/src/mame/sega/system1.cpp index c4e79d711c8..c535eeff7dd 100644 --- a/src/mame/sega/system1.cpp +++ b/src/mame/sega/system1.cpp @@ -2225,10 +2225,11 @@ void system1_state::sys1ppi(machine_config &config) GENERIC_LATCH_8(config, m_soundlatch); - SN76489A(config, m_sn[0], SOUND_CLOCK/4).add_route(ALL_OUTPUTS, "mono", 0.50); + // 1st SN audio output actually goes to 2nd SN audio input (pin 9) + SN76489A(config, m_sn[0], SOUND_CLOCK/4).add_route(ALL_OUTPUTS, "mono", 0.40); // 2nd SN's clock is selectable via jumper - SN76489A(config, m_sn[1], SOUND_CLOCK/2).add_route(ALL_OUTPUTS, "mono", 0.50); + SN76489A(config, m_sn[1], SOUND_CLOCK/2).add_route(ALL_OUTPUTS, "mono", 0.60); input_merger_device &sn_ready(INPUT_MERGER_ANY_LOW(config, "sn_ready")); sn_ready.output_handler().set_inputline(m_soundcpu, Z80_INPUT_LINE_WAIT);