From 79db8d2a593b202eea019d5c453999ade31c340b Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Mon, 7 Apr 2025 00:24:48 +1000 Subject: [PATCH] -cpu/e132xs: Use word addressing for I/O. * There are no byte enable or write strobe signals for I/O, and there's only a single operand size, so word addresses make more sense. * Also changed STBS/STWS to allow any valid signed or unsigned value of the applicable size. This allows vamphalf attract mode to work as well as the storage test. -misc/limenko.cpp: Better input types for spotty. --- src/devices/cpu/e132xs/e132xs.cpp | 56 ++--- src/devices/cpu/e132xs/e132xs.h | 6 +- src/devices/cpu/e132xs/e132xsdrc.cpp | 4 +- src/devices/cpu/e132xs/e132xsdrc_ops.hxx | 24 +- src/devices/cpu/e132xs/e132xsop.hxx | 12 +- src/devices/sound/ks0164.cpp | 24 +- src/mame/f32/f-32.cpp | 60 ++--- src/mame/misc/dgpix.cpp | 43 +--- src/mame/misc/limenko.cpp | 46 ++-- src/mame/misc/mjsenpu.cpp | 28 +-- src/mame/misc/pasha2.cpp | 24 +- src/mame/misc/vamphalf.cpp | 284 +++++++++++------------ src/mame/promat/gstream.cpp | 26 +-- 13 files changed, 293 insertions(+), 344 deletions(-) diff --git a/src/devices/cpu/e132xs/e132xs.cpp b/src/devices/cpu/e132xs/e132xs.cpp index 67b940abe94..20a3ecf1c51 100644 --- a/src/devices/cpu/e132xs/e132xs.cpp +++ b/src/devices/cpu/e132xs/e132xs.cpp @@ -136,8 +136,8 @@ void hyperstone_xs_device::iram_16k_map(address_map &map) void hyperstone_x_device::internal_io_map(address_map &map) { - map(0x7000, 0x77ff).w(FUNC(hyperstone_x_device::power_down_w)); - map(0x7800, 0x7fff).w(FUNC(hyperstone_x_device::sleep_w)); + map(0x1c00, 0x1dff).w(FUNC(hyperstone_x_device::power_down_w)); + map(0x1e00, 0x1fff).w(FUNC(hyperstone_x_device::sleep_w)); } @@ -157,7 +157,7 @@ hyperstone_device::hyperstone_device( address_map_constructor internal_map) : cpu_device(mconfig, type, tag, owner, clock) , m_program_config("program", ENDIANNESS_BIG, prg_data_width, 32, 0, internal_map) - , m_io_config("io", ENDIANNESS_BIG, io_data_width, io_addr_bits) + , m_io_config("io", ENDIANNESS_BIG, io_data_width, io_addr_bits, (io_data_width == 16) ? -1 : -2) , m_cache(CACHE_SIZE + sizeof(hyperstone_device)) , m_drcuml(nullptr) , m_drcfe(nullptr) @@ -203,7 +203,7 @@ hyperstone_x_device::hyperstone_x_device( uint32_t io_addr_bits, address_map_constructor internal_map) : hyperstone_device(mconfig, type, tag, owner, clock, prg_data_width, io_data_width, io_addr_bits, internal_map) - , m_internal_config("internal", ENDIANNESS_BIG, 32, 10 + 3 + 2, 0, address_map_constructor(FUNC(hyperstone_x_device::internal_io_map), this)) + , m_internal_config("internal", ENDIANNESS_BIG, 32, 10 + 3, -2, address_map_constructor(FUNC(hyperstone_x_device::internal_io_map), this)) { } @@ -215,7 +215,7 @@ hyperstone_x_device::hyperstone_x_device( e116_device::e116_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device( mconfig, E116, tag, owner, clock, - 16, 16, 6 + 3 + 2, address_map_constructor(FUNC(e116_device::iram_4k_map), this)) + 16, 16, 6 + 3, address_map_constructor(FUNC(e116_device::iram_4k_map), this)) { } @@ -227,7 +227,7 @@ e116_device::e116_device(const machine_config &mconfig, const char *tag, device_ e116x_device::e116x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_x_device( mconfig, E116X, tag, owner, clock, - 16, 16, 6 + 3 + 2, address_map_constructor(FUNC(e116x_device::iram_8k_map), this)) + 16, 16, 6 + 3, address_map_constructor(FUNC(e116x_device::iram_8k_map), this)) { } @@ -239,7 +239,7 @@ e116x_device::e116x_device(const machine_config &mconfig, const char *tag, devic e116xs_device::e116xs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_xs_device( mconfig, E116XS, tag, owner, clock, - 16, 16, 6 + 3 + 2, address_map_constructor(FUNC(e116xs_device::iram_16k_map), this)) + 16, 16, 6 + 3, address_map_constructor(FUNC(e116xs_device::iram_16k_map), this)) { } @@ -251,7 +251,7 @@ e116xs_device::e116xs_device(const machine_config &mconfig, const char *tag, dev e116xsr_device::e116xsr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_xsr_device( mconfig, E116XSR, tag, owner, clock, - 16, 16, 6 + 3 + 2, address_map_constructor(FUNC(e116xsr_device::iram_16k_map), this)) + 16, 16, 6 + 3, address_map_constructor(FUNC(e116xsr_device::iram_16k_map), this)) { } @@ -263,7 +263,7 @@ e116xsr_device::e116xsr_device(const machine_config &mconfig, const char *tag, d e132_device::e132_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device( mconfig, E132, tag, owner, clock, - 32, 32, 10 + 3 + 2, address_map_constructor(FUNC(e132_device::iram_4k_map), this)) + 32, 32, 10 + 3, address_map_constructor(FUNC(e132_device::iram_4k_map), this)) { } @@ -275,7 +275,7 @@ e132_device::e132_device(const machine_config &mconfig, const char *tag, device_ e132x_device::e132x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_x_device( mconfig, E132X, tag, owner, clock, - 32, 32, 10 + 3 + 2, address_map_constructor(FUNC(e132x_device::iram_8k_map), this)) + 32, 32, 10 + 3, address_map_constructor(FUNC(e132x_device::iram_8k_map), this)) { } @@ -287,7 +287,7 @@ e132x_device::e132x_device(const machine_config &mconfig, const char *tag, devic e132xs_device::e132xs_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_xs_device( mconfig, E132XS, tag, owner, clock, - 32, 32, 10 + 3 + 2, address_map_constructor(FUNC(e132xs_device::iram_16k_map), this)) + 32, 32, 10 + 3, address_map_constructor(FUNC(e132xs_device::iram_16k_map), this)) { } @@ -299,7 +299,7 @@ e132xs_device::e132xs_device(const machine_config &mconfig, const char *tag, dev e132xsr_device::e132xsr_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_xsr_device( mconfig, E132XSR, tag, owner, clock, - 32, 32, 10 + 3 + 2, address_map_constructor(FUNC(e132xsr_device::iram_16k_map), this)) + 32, 32, 10 + 3, address_map_constructor(FUNC(e132xsr_device::iram_16k_map), this)) { } @@ -311,7 +311,7 @@ e132xsr_device::e132xsr_device(const machine_config &mconfig, const char *tag, d gms30c2116_device::gms30c2116_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device( mconfig, GMS30C2116, tag, owner, clock, - 16, 16, 6 + 3 + 2, address_map_constructor(FUNC(gms30c2116_device::iram_4k_map), this)) + 16, 16, 6 + 3, address_map_constructor(FUNC(gms30c2116_device::iram_4k_map), this)) { } @@ -323,7 +323,7 @@ gms30c2116_device::gms30c2116_device(const machine_config &mconfig, const char * gms30c2132_device::gms30c2132_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_device( mconfig, GMS30C2132, tag, owner, clock, - 32, 32, 10 + 3 + 2, address_map_constructor(FUNC(gms30c2132_device::iram_4k_map), this)) + 32, 32, 10 + 3, address_map_constructor(FUNC(gms30c2132_device::iram_4k_map), this)) { } @@ -335,7 +335,7 @@ gms30c2132_device::gms30c2132_device(const machine_config &mconfig, const char * gms30c2216_device::gms30c2216_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_x_device( mconfig, GMS30C2216, tag, owner, clock, - 16, 16, 6 + 3 + 2, address_map_constructor(FUNC(gms30c2216_device::iram_8k_map), this)) + 16, 16, 6 + 3, address_map_constructor(FUNC(gms30c2216_device::iram_8k_map), this)) { } @@ -347,7 +347,7 @@ gms30c2216_device::gms30c2216_device(const machine_config &mconfig, const char * gms30c2232_device::gms30c2232_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : hyperstone_x_device( mconfig, GMS30C2232, tag, owner, clock, - 32, 32, 10 + 3 + 2, address_map_constructor(FUNC(gms30c2232_device::iram_8k_map), this)) + 32, 32, 10 + 3, address_map_constructor(FUNC(gms30c2232_device::iram_8k_map), this)) { } @@ -1535,14 +1535,14 @@ void hyperstone_device::device_start() if (iospace.data_width() == 16) { iospace.specific(m_io16); - m_read_io = w_r_delegate([this] (offs_t address) -> uint32_t { return m_io16.read_word((address >> 11) & 0x7ffc); }); - m_write_io = w_w_delegate([this] (offs_t address, uint32_t data) { m_io16.write_word((address >> 11) & 0x7ffc, uint16_t(data)); }); + m_read_io = w_r_delegate([this] (offs_t address) -> uint32_t { return m_io16.read_word(address >> 13); }); + m_write_io = w_w_delegate([this] (offs_t address, uint32_t data) { m_io16.write_word(address >> 13, uint16_t(data)); }); } else { iospace.specific(m_io32); - m_read_io = w_r_delegate([this] (offs_t address) -> uint32_t { return m_io32.read_dword((address >> 11) & 0x7ffc); }); - m_write_io = w_w_delegate([this] (offs_t address, uint32_t data) { m_io32.write_dword((address >> 11) & 0x7ffc, data); }); + m_read_io = w_r_delegate([this] (offs_t address) -> uint32_t { return m_io32.read_dword(address >> 13); }); + m_write_io = w_w_delegate([this] (offs_t address, uint32_t data) { m_io32.write_dword(address >> 13, data); }); } m_timer = timer_alloc(FUNC(hyperstone_device::timer_callback), this); @@ -1694,17 +1694,17 @@ void hyperstone_x_device::device_start() [this] (offs_t address) -> uint32_t { if (!BIT(address, 27)) - return m_io16.read_word((address >> 11) & 0x7ffc); + return m_io16.read_word(address >> 13); else - return m_internal_specific.read_dword((address >> 11) & 0x7ffc); + return m_internal_specific.read_dword(address >> 13); }); m_write_io = w_w_delegate( [this] (offs_t address, uint32_t data) { if (!BIT(address, 27)) - m_io16.write_word((address >> 11) & 0x7ffc, uint16_t(data)); + m_io16.write_word(address >> 13, uint16_t(data)); else - m_internal_specific.write_dword((address >> 11) & 0x7ffc, data); + m_internal_specific.write_dword(address >> 13, data); }); } else @@ -1713,17 +1713,17 @@ void hyperstone_x_device::device_start() [this] (offs_t address) -> uint32_t { if (!BIT(address, 27)) - return m_io32.read_dword((address >> 11) & 0x7ffc); + return m_io32.read_dword(address >> 13); else - return m_internal_specific.read_dword((address >> 11) & 0x7ffc); + return m_internal_specific.read_dword(address >> 13); }); m_write_io = w_w_delegate( [this] (offs_t address, uint32_t data) { if (!BIT(address, 27)) - m_io32.write_dword((address >> 11) & 0x7ffc, data); + m_io32.write_dword(address >> 13, data); else - m_internal_specific.write_dword((address >> 11) & 0x7ffc, data); + m_internal_specific.write_dword(address >> 13, data); }); } } diff --git a/src/devices/cpu/e132xs/e132xs.h b/src/devices/cpu/e132xs/e132xs.h index 662e45aa293..6933acc5c13 100644 --- a/src/devices/cpu/e132xs/e132xs.h +++ b/src/devices/cpu/e132xs/e132xs.h @@ -283,8 +283,8 @@ protected: memory_access<32, 1, 0, ENDIANNESS_BIG>::specific m_specific16; memory_access<32, 2, 0, ENDIANNESS_BIG>::specific m_specific32; - memory_access< 6 + 3 + 2, 1, 0, ENDIANNESS_BIG>::specific m_io16; - memory_access<10 + 3 + 2, 2, 0, ENDIANNESS_BIG>::specific m_io32; + memory_access< 6 + 3, 1, -1, ENDIANNESS_BIG>::specific m_io16; + memory_access<10 + 3, 2, -2, ENDIANNESS_BIG>::specific m_io32; b_r_delegate m_read_byte; hw_r_delegate m_read_halfword; @@ -634,7 +634,7 @@ protected: const address_space_config m_internal_config; private: - memory_access<10 + 3 + 2, 2, 0, ENDIANNESS_BIG>::specific m_internal_specific; + memory_access<10 + 3, 2, -2, ENDIANNESS_BIG>::specific m_internal_specific; }; diff --git a/src/devices/cpu/e132xs/e132xsdrc.cpp b/src/devices/cpu/e132xs/e132xsdrc.cpp index 8348b98cb33..0f70aed2658 100644 --- a/src/devices/cpu/e132xs/e132xsdrc.cpp +++ b/src/devices/cpu/e132xs/e132xsdrc.cpp @@ -519,7 +519,7 @@ void hyperstone_device::static_generate_io_accessor(drcuml_block &block, uml::co // write: const uml::operand_size size = (space(AS_IO).data_width() == 16) ? uml::SIZE_WORD : uml::SIZE_DWORD; - UML_ROLAND(block, I4, I0, 21, 0x7ffc); + UML_SHR(block, I4, I0, 13); if (iswrite) UML_WRITE(block, I4, I1, size, SPACE_IO); else @@ -541,7 +541,7 @@ void hyperstone_x_device::static_generate_io_accessor(drcuml_block &block, uml:: const int internal = label++; const int done = label++; - UML_ROLAND(block, I4, I0, 21, 0x7ffc); + UML_SHR(block, I4, I0, 13); UML_TEST(block, I0, 1 << 27); UML_JMPc(block, uml::COND_NZ, internal); diff --git a/src/devices/cpu/e132xs/e132xsdrc_ops.hxx b/src/devices/cpu/e132xs/e132xsdrc_ops.hxx index 8e53afa5edb..1f17b598819 100644 --- a/src/devices/cpu/e132xs/e132xsdrc_ops.hxx +++ b/src/devices/cpu/e132xs/e132xsdrc_ops.hxx @@ -3033,11 +3033,11 @@ void hyperstone_device::generate_stxx1(drcuml_block &block, compiler_state &comp if (sub_type == 0) { const int no_exception = compiler.next_label(); - //UML_SEXT(block, I0, I1, SIZE_BYTE); - //UML_CMP(block, I0, I1); - //UML_JMPc(block, uml::COND_E, no_exception); UML_TEST(block, I1, 0xffffff00); UML_JMPc(block, uml::COND_Z, no_exception); + UML_SEXT(block, I0, I1, SIZE_BYTE); + UML_CMP(block, I0, I1); + UML_JMPc(block, uml::COND_E, no_exception); generate_raise_exception(block, compiler, desc, TRAPNO_RANGE_ERROR); UML_LABEL(block, no_exception); } @@ -3051,11 +3051,11 @@ void hyperstone_device::generate_stxx1(drcuml_block &block, compiler_state &comp if (extra_s & 1) { const int no_exception = compiler.next_label(); - //UML_SEXT(block, I0, I1, SIZE_WORD); - //UML_CMP(block, I0, I1); - //UML_JMPc(block, uml::COND_E, no_exception); UML_TEST(block, I1, 0xffff0000); UML_JMPc(block, uml::COND_Z, no_exception); + UML_SEXT(block, I0, I1, SIZE_WORD); + UML_CMP(block, I0, I1); + UML_JMPc(block, uml::COND_E, no_exception); generate_raise_exception(block, compiler, desc, TRAPNO_RANGE_ERROR); UML_LABEL(block, no_exception); } @@ -3172,11 +3172,11 @@ void hyperstone_device::generate_stxx2(drcuml_block &block, compiler_state &comp if (sub_type == 0) { const int no_exception = compiler.next_label(); - //UML_SEXT(block, I0, I1, SIZE_BYTE); - //UML_CMP(block, I0, I1); - //UML_JMPc(block, uml::COND_E, no_exception); UML_TEST(block, I1, 0xffffff00); UML_JMPc(block, uml::COND_Z, no_exception); + UML_SEXT(block, I0, I1, SIZE_BYTE); + UML_CMP(block, I0, I1); + UML_JMPc(block, uml::COND_E, no_exception); generate_raise_exception(block, compiler, desc, TRAPNO_RANGE_ERROR); UML_LABEL(block, no_exception); } @@ -3197,11 +3197,11 @@ void hyperstone_device::generate_stxx2(drcuml_block &block, compiler_state &comp if (extra_s & 1) { const int no_exception = compiler.next_label(); - //UML_SEXT(block, I0, I1, SIZE_WORD); - //UML_CMP(block, I0, I1); - //UML_JMPc(block, uml::COND_E, no_exception); UML_TEST(block, I1, 0xffff0000); UML_JMPc(block, uml::COND_Z, no_exception); + UML_SEXT(block, I0, I1, SIZE_WORD); + UML_CMP(block, I0, I1); + UML_JMPc(block, uml::COND_E, no_exception); generate_raise_exception(block, compiler, desc, TRAPNO_RANGE_ERROR); UML_LABEL(block, no_exception); } diff --git a/src/devices/cpu/e132xs/e132xsop.hxx b/src/devices/cpu/e132xs/e132xsop.hxx index 156696389bf..c570f9f5c6c 100644 --- a/src/devices/cpu/e132xs/e132xsop.hxx +++ b/src/devices/cpu/e132xs/e132xsop.hxx @@ -1845,8 +1845,7 @@ void hyperstone_device::hyperstone_stxx1() { case 0: // STBS.D WRITE_B(dreg + extra_s, uint8_t(sreg)); - //if (int8_t(uint8_t(sreg)) != int32_t(sreg)) - if (uint8_t(sreg) != sreg) + if ((uint8_t(sreg) != sreg) && (int8_t(uint8_t(sreg)) != int32_t(sreg))) execute_exception(TRAPNO_RANGE_ERROR); break; @@ -1856,8 +1855,7 @@ void hyperstone_device::hyperstone_stxx1() case 2: // STHS.D, STHU.D WRITE_HW(dreg + (extra_s & ~1), uint16_t(sreg)); - //if ((extra_s & 1) && (int16_t(uint16_t(sreg)) != int32_t(sreg))) - if ((extra_s & 1) && (uint16_t(sreg) != sreg)) + if ((extra_s & 1) && (uint16_t(sreg) != sreg) && (int16_t(uint16_t(sreg)) != int32_t(sreg))) execute_exception(TRAPNO_RANGE_ERROR); break; @@ -1965,8 +1963,7 @@ void hyperstone_device::hyperstone_stxx2() { case 0: // STBS.N WRITE_B(dreg, (uint8_t)sreg); - //range_error = int8_t(uint8_t(sreg)) != int32_t(sreg); - range_error = uint8_t(sreg) != sreg; + range_error = (uint8_t(sreg) != sreg) && (int8_t(uint8_t(sreg)) != int32_t(sreg)); (DstGlobal ? m_core->global_regs : m_core->local_regs)[dst_code] += extra_s; if (range_error) execute_exception(TRAPNO_RANGE_ERROR); @@ -1979,8 +1976,7 @@ void hyperstone_device::hyperstone_stxx2() case 2: // STHS.N, STHU.N WRITE_HW(dreg, (uint16_t)sreg); - //range_error = (extra_s & 1) && (int16_t(uint16_t(sreg)) != int32_t(sreg)); - range_error = (extra_s & 1) && (uint16_t(sreg) != sreg); + range_error = (extra_s & 1) && (uint16_t(sreg) != sreg) && (int16_t(uint16_t(sreg)) != int32_t(sreg)); (DstGlobal ? m_core->global_regs : m_core->local_regs)[dst_code] += extra_s & ~1; if (range_error) execute_exception(TRAPNO_RANGE_ERROR); diff --git a/src/devices/sound/ks0164.cpp b/src/devices/sound/ks0164.cpp index fc45a2f74cb..78b24423b2e 100644 --- a/src/devices/sound/ks0164.cpp +++ b/src/devices/sound/ks0164.cpp @@ -6,6 +6,12 @@ #include "emu.h" #include "ks0164.h" +#define LOG_KEYON (1U << 1) +#define LOG_SERIAL (1U << 2) + +//#define VERBOSE (LOG_GENERAL | LOG_KEYON | LOG_SERIAL) +#include "logmacro.h" + DEFINE_DEVICE_TYPE(KS0164, ks0164_device, "ks0164", "Samsung KS0164 Wavetable Synthesizer") @@ -153,7 +159,7 @@ TIMER_CALLBACK_MEMBER(ks0164_device::irq_timer_tick) void ks0164_device::tra_complete() { - logerror("transmit done\n"); + LOGMASKED(LOG_SERIAL, "transmit done\n"); } void ks0164_device::rcv_complete() @@ -163,7 +169,7 @@ void ks0164_device::rcv_complete() m_midi_in_active = true; m_cpu->set_input_line(6, ASSERT_LINE); - logerror("recieved %02x\n", m_midi_in); + LOGMASKED(LOG_SERIAL, "recieved %02x\n", m_midi_in); } void ks0164_device::tra_callback() @@ -180,7 +186,7 @@ u8 ks0164_device::midi_r() void ks0164_device::midi_w(u8 data) { - logerror("want to transmit %02x\n", data); + LOG("want to transmit %02x\n", data); } u8 ks0164_device::midi_status_r() @@ -191,7 +197,7 @@ u8 ks0164_device::midi_status_r() void ks0164_device::midi_status_w(u8 data) { - logerror("midi status_w %02x\n", data); + LOG("midi status_w %02x\n", data); } @@ -336,9 +342,9 @@ void ks0164_device::voice_w(offs_t offset, u16 data, u16 mem_mask) u16 old = m_sregs[m_voice_select & 0x1f][offset]; COMBINE_DATA(&m_sregs[m_voice_select & 0x1f][offset]); if(0 && m_sregs[m_voice_select & 0x1f][offset] != old && offset == 0) - logerror("voice %02x.%02x = %04x @ %04x (%04x)\n", m_voice_select & 0x1f, offset, m_sregs[m_voice_select & 0x1f][offset], mem_mask, m_cpu->pc()); + LOGMASKED(LOG_KEYON, "voice %02x.%02x = %04x @ %04x (%04x)\n", m_voice_select & 0x1f, offset, m_sregs[m_voice_select & 0x1f][offset], mem_mask, m_cpu->pc()); if(offset == 0 && (data & 1) && !(old & 1)) - logerror("keyon %02x mode=%04x (%s %c %c %c %c) cur=%02x%04x.%04x loop=%02x%04x.%04x end=%02x%04x.%04x pitch=%x.%03x 10=%02x/%02x:%02x/%02x 14=%03x/%03x:%03x/%03x 18=%04x/%04x c=%04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x\n", + LOGMASKED(LOG_KEYON, "keyon %02x mode=%04x (%s %c %c %c %c) cur=%02x%04x.%04x loop=%02x%04x.%04x end=%02x%04x.%04x pitch=%x.%03x 10=%02x/%02x:%02x/%02x 14=%03x/%03x:%03x/%03x 18=%04x/%04x c=%04x %04x %04x %04x %04x %04x %04x %04x %04x %04x %04x\n", m_voice_select, m_sregs[m_voice_select & 0x1f][0x00], @@ -419,7 +425,7 @@ u8 ks0164_device::irqen_77_r() void ks0164_device::irqen_77_w(u8 data) { m_irqen_77 = data; - logerror("irqen_77 = %02x (%04x)\n", m_irqen_77, m_cpu->pc()); + LOG("irqen_77 = %02x (%04x)\n", m_irqen_77, m_cpu->pc()); } u8 ks0164_device::unk60_r() @@ -430,7 +436,7 @@ u8 ks0164_device::unk60_r() void ks0164_device::unk60_w(u8 data) { m_unk60 = data; - logerror("unk60 = %02x (%04x)\n", m_unk60, m_cpu->pc()); + LOG("unk60 = %02x (%04x)\n", m_unk60, m_cpu->pc()); } u8 ks0164_device::voice_select_r() @@ -490,7 +496,7 @@ void ks0164_device::sound_stream_update(sound_stream &stream, std::vectorset_entry(data & 0x03); })); // TODO: double check this + map(0x1b00, 0x1b00).lw32(NAME([this] (uint32_t data) { m_okibank->set_entry(data & 0x03); })); // TODO: double check this - map(0x6d00, 0x6d03).w(FUNC(royalpk2_state::protection_seed_w)); + map(0x1b40, 0x1b40).w(FUNC(royalpk2_state::protection_seed_w)); - map(0x7000, 0x7003).w(FUNC(royalpk2_state::outputs_w<0>)); - map(0x7100, 0x7103).w(FUNC(royalpk2_state::outputs_w<1>)); - map(0x7200, 0x7203).w(FUNC(royalpk2_state::outputs_w<2>)); - map(0x7300, 0x7303).w(FUNC(royalpk2_state::outputs_w<3>)); - map(0x7400, 0x7403).w(FUNC(royalpk2_state::outputs_w<4>)); + map(0x1c00, 0x1c00).w(FUNC(royalpk2_state::outputs_w<0>)); + map(0x1c40, 0x1c40).w(FUNC(royalpk2_state::outputs_w<1>)); + map(0x1c80, 0x1c80).w(FUNC(royalpk2_state::outputs_w<2>)); + map(0x1cc0, 0x1cc0).w(FUNC(royalpk2_state::outputs_w<3>)); + map(0x1d00, 0x1d00).w(FUNC(royalpk2_state::outputs_w<4>)); } void royalpk2_state::oki_map(address_map &map) diff --git a/src/mame/misc/dgpix.cpp b/src/mame/misc/dgpix.cpp index f67da302ba8..817ce0b5ba4 100644 --- a/src/mame/misc/dgpix.cpp +++ b/src/mame/misc/dgpix.cpp @@ -210,11 +210,6 @@ private: u32 vblank_r(); - void mpu401_data_w(offs_t, u32 data, u32 mem_mask); - void mpu401_ctrl_w(offs_t, u32 data, u32 mem_mask); - u32 mpu401_data_r(offs_t, u32 mem_mask); - u32 mpu401_status_r(); - u16 flash_raw_rom_r(offs_t offset); required_ioport m_vblank; @@ -272,30 +267,6 @@ private: required_memory_region m_ks0164_bank; }; -void dgpix_state::mpu401_data_w(offs_t, u32 data, u32 mem_mask) -{ - if(ACCESSING_BITS_0_7) - m_sound->mpu401_data_w(data); -} - -void dgpix_state::mpu401_ctrl_w(offs_t, u32 data, u32 mem_mask) -{ - if(ACCESSING_BITS_0_7) - m_sound->mpu401_ctrl_w(data); -} - -u32 dgpix_state::mpu401_data_r(offs_t, u32 mem_mask) -{ - if(ACCESSING_BITS_0_7) - return m_sound->mpu401_data_r(); - return 0; -} - -u32 dgpix_state::mpu401_status_r() -{ - return m_sound->mpu401_status_r(); -} - u16 dgpix_state::flash_r(offs_t offset) { const auto bank = offset / 0x200000; @@ -398,13 +369,13 @@ void dgpix_bmkey_state::mem_map(address_map &map) void dgpix_state::io_map(address_map &map) { - map(0x0200, 0x0203).nopr(); // used to sync with the protecion PIC? tested bits 0 and 1 - map(0x0400, 0x0403).rw(FUNC(dgpix_state::vblank_r), FUNC(dgpix_state::vbuffer_w)); - map(0x0a10, 0x0a13).portr("INPUTS"); - map(0x0200, 0x0203).w(FUNC(dgpix_state::coin_w)); - map(0x0c00, 0x0c03).nopw(); // writes only: 1, 0, 1 at startup - map(0x0c80, 0x0c83).rw(FUNC(dgpix_state::mpu401_data_r), FUNC(dgpix_state::mpu401_data_w)); - map(0x0c84, 0x0c87).rw(FUNC(dgpix_state::mpu401_status_r), FUNC(dgpix_state::mpu401_ctrl_w)); + map(0x0080, 0x0080).nopr(); // used to sync with the protecion PIC? tested bits 0 and 1 + map(0x0080, 0x0080).w(FUNC(dgpix_state::coin_w)); + map(0x0100, 0x0100).rw(FUNC(dgpix_state::vblank_r), FUNC(dgpix_state::vbuffer_w)); + map(0x0284, 0x0284).portr("INPUTS"); + map(0x0300, 0x0300).nopw(); // writes only: 1, 0, 1 at startup + map(0x0320, 0x0320).umask32(0x000000ff).rw(m_sound, FUNC(ks0164_device::mpu401_data_r), FUNC(ks0164_device::mpu401_data_w)); + map(0x0321, 0x0321).umask32(0x000000ff).rw(m_sound, FUNC(ks0164_device::mpu401_status_r), FUNC(ks0164_device::mpu401_ctrl_w)); } static INPUT_PORTS_START( dgpix ) diff --git a/src/mame/misc/limenko.cpp b/src/mame/misc/limenko.cpp index 8fa02da77be..80e57a98466 100644 --- a/src/mame/misc/limenko.cpp +++ b/src/mame/misc/limenko.cpp @@ -270,12 +270,12 @@ void limenko_state::limenko_map(address_map &map) void limenko_state::limenko_io_map(address_map &map) { - map(0x0000, 0x0003).portr("IN0"); - map(0x0800, 0x0803).portr("IN1"); - map(0x1000, 0x1003).portr("IN2"); - map(0x4000, 0x4003).w(FUNC(limenko_state::coincounter_w)); - map(0x4800, 0x4803).portw("EEPROMOUT"); - map(0x5000, 0x5003).w(m_soundlatch, FUNC(generic_latch_8_device::write)).umask32(0x00ff0000).cswidth(32); + map(0x0000, 0x0000).portr("IN0"); + map(0x0200, 0x0200).portr("IN1"); + map(0x0400, 0x0400).portr("IN2"); + map(0x1000, 0x1000).w(FUNC(limenko_state::coincounter_w)); + map(0x1200, 0x1200).portw("EEPROMOUT"); + map(0x1400, 0x1400).umask32(0x00ff0000).w(m_soundlatch, FUNC(generic_latch_8_device::write)); } @@ -298,12 +298,12 @@ void limenko_state::spotty_map(address_map &map) void limenko_state::spotty_io_map(address_map &map) { - map(0x0000, 0x0003).portr("IN0"); - map(0x0800, 0x0803).portr("IN1"); - map(0x0800, 0x0803).nopw(); // hopper related - map(0x1000, 0x1003).portr("IN2"); - map(0x4800, 0x4803).portw("EEPROMOUT"); - map(0x5000, 0x5003).w(m_soundlatch, FUNC(generic_latch_8_device::write)).umask32(0x00ff0000).cswidth(32); + map(0x0000, 0x0000).portr("IN0"); + map(0x0200, 0x0200).portr("IN1"); + map(0x0200, 0x0200).nopw(); // hopper related + map(0x0400, 0x0400).portr("IN2"); + map(0x1200, 0x1200).portw("EEPROMOUT"); + map(0x1400, 0x1400).umask32(0x00ff0000).w(m_soundlatch, FUNC(generic_latch_8_device::write)); } @@ -634,13 +634,13 @@ INPUT_PORTS_END static INPUT_PORTS_START(spotty) PORT_START("IN0") - PORT_BIT(0x00010000, IP_ACTIVE_LOW, IPT_JOYSTICK_UP) PORT_NAME("Hold 1") - PORT_BIT(0x00020000, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN) PORT_NAME("Hold 2") - PORT_BIT(0x00040000, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT) PORT_NAME("Hold 3") - PORT_BIT(0x00080000, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT) PORT_NAME("Hold 4") - PORT_BIT(0x00100000, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Bet") - PORT_BIT(0x00200000, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_NAME("Stop") - PORT_BIT(0x00400000, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_NAME("Change") + PORT_BIT(0x00010000, IP_ACTIVE_LOW, IPT_POKER_HOLD1) + PORT_BIT(0x00020000, IP_ACTIVE_LOW, IPT_POKER_HOLD2) + PORT_BIT(0x00040000, IP_ACTIVE_LOW, IPT_POKER_HOLD3) + PORT_BIT(0x00080000, IP_ACTIVE_LOW, IPT_POKER_HOLD4) + PORT_BIT(0x00100000, IP_ACTIVE_LOW, IPT_GAMBLE_BET) + PORT_BIT(0x00200000, IP_ACTIVE_LOW, IPT_GAMBLE_TAKE) PORT_NAME("Stop") + PORT_BIT(0x00400000, IP_ACTIVE_LOW, IPT_GAMBLE_DEAL) PORT_NAME("Change") PORT_BIT(0x00800000, IP_ACTIVE_LOW, IPT_UNUSED) PORT_BIT(0xff00ffff, IP_ACTIVE_LOW, IPT_UNUSED) @@ -649,9 +649,9 @@ static INPUT_PORTS_START(spotty) PORT_BIT(0x00020000, IP_ACTIVE_LOW, IPT_UNUSED) PORT_BIT(0x00040000, IP_ACTIVE_LOW, IPT_UNUSED) PORT_BIT(0x00080000, IP_ACTIVE_LOW, IPT_UNUSED) - PORT_BIT(0x00100000, IP_ACTIVE_LOW, IPT_BUTTON4) PORT_NAME("Prize Hopper 1") - PORT_BIT(0x00200000, IP_ACTIVE_LOW, IPT_BUTTON5) PORT_NAME("Prize Hopper 2") - PORT_BIT(0x00400000, IP_ACTIVE_LOW, IPT_BUTTON6) PORT_NAME("Prize Hopper 3") + PORT_BIT(0x00100000, IP_ACTIVE_LOW, IPT_BUTTON1) PORT_NAME("Prize Hopper 1") + PORT_BIT(0x00200000, IP_ACTIVE_LOW, IPT_BUTTON2) PORT_NAME("Prize Hopper 2") + PORT_BIT(0x00400000, IP_ACTIVE_LOW, IPT_BUTTON3) PORT_NAME("Prize Hopper 3") PORT_BIT(0x00800000, IP_ACTIVE_LOW, IPT_UNUSED) PORT_BIT(0xff00ffff, IP_ACTIVE_LOW, IPT_UNUSED) @@ -1001,7 +1001,7 @@ Spotty | SW1 SW2 32MHz CG_ROM3 | +---------------------------------+ -Hyundia GMS30C2232 (Hyperstone core) +Hyundai GMS30C2232 (Hyperstone core) Atmel AT89C4051 (8051 MCU with internal code) SYS L2D HYP Ver 1.0 ASIC Express EEPROM 93C46 diff --git a/src/mame/misc/mjsenpu.cpp b/src/mame/misc/mjsenpu.cpp index d7abe9f1a0e..015f20627be 100644 --- a/src/mame/misc/mjsenpu.cpp +++ b/src/mame/misc/mjsenpu.cpp @@ -94,8 +94,8 @@ private: uint8_t m_control = 0; uint8_t m_key_matrix_select = 0; - void control_w(uint8_t data); - void key_matrix_w(uint8_t data); + void control_w(uint32_t data); + void key_matrix_w(uint32_t data); uint32_t key_matrix_r(); @@ -128,7 +128,7 @@ void mjsenpu_state::vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) COMBINE_DATA(&m_vram[BIT(m_control, 0)][offset]); } -void mjsenpu_state::control_w(uint8_t data) +void mjsenpu_state::control_w(uint32_t data) { // bit 0x80 is always set? (sometimes disabled during screen transitions briefly, could be display enable?) @@ -143,13 +143,13 @@ void mjsenpu_state::control_w(uint8_t data) machine().bookkeeping().coin_counter_w(0, BIT(data, 1)); // coin or key-in // bit 0x01 alternates frequently, using as video buffer, but that's a complete guess - m_control = data; + m_control = uint8_t(data); // if (data &~0x9e) // logerror("control_w %02x\n", data); } -void mjsenpu_state::key_matrix_w(uint8_t data) +void mjsenpu_state::key_matrix_w(uint32_t data) { if ((data & 0xe0) != 0x80) logerror("key_matrix_w %02x\n", data); @@ -157,7 +157,7 @@ void mjsenpu_state::key_matrix_w(uint8_t data) // bit 0 to 4: Key matrix select // Bit 5 to 6: unknown, always clear? // bit 7: unknown, always set? - m_key_matrix_select = data; + m_key_matrix_select = uint8_t(data); } uint32_t mjsenpu_state::key_matrix_r() @@ -190,18 +190,18 @@ void mjsenpu_state::main_map(address_map &map) void mjsenpu_state::main_portmap(address_map &map) { - map(0x4000, 0x4003).r(FUNC(mjsenpu_state::key_matrix_r)); - map(0x4010, 0x4013).portr("IN1"); + map(0x1000, 0x1000).r(FUNC(mjsenpu_state::key_matrix_r)); + map(0x1004, 0x1004).portr("IN1"); - map(0x4023, 0x4023).w(FUNC(mjsenpu_state::control_w)); + map(0x1008, 0x1008).w(FUNC(mjsenpu_state::control_w)); - map(0x4030, 0x4033).portr("DSW1"); - map(0x4040, 0x4043).portr("DSW2"); - map(0x4050, 0x4053).portr("DSW3"); + map(0x100c, 0x100c).portr("DSW1"); + map(0x1010, 0x1010).portr("DSW2"); + map(0x1014, 0x1014).portr("DSW3"); - map(0x4063, 0x4063).w(FUNC(mjsenpu_state::key_matrix_w)); + map(0x1018, 0x1018).w(FUNC(mjsenpu_state::key_matrix_w)); - map(0x4073, 0x4073).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x101c, 0x101c).umask32(0x000000ff).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); } static INPUT_PORTS_START( mjsenpu ) diff --git a/src/mame/misc/pasha2.cpp b/src/mame/misc/pasha2.cpp index bfa7c73be0b..988f1c9e91c 100644 --- a/src/mame/misc/pasha2.cpp +++ b/src/mame/misc/pasha2.cpp @@ -249,18 +249,18 @@ void pasha2_state::pasha2_map(address_map &map) void pasha2_state::pasha2_io(address_map &map) { - map(0x08, 0x09).nopr(); //sound status? - map(0x18, 0x19).nopr(); //sound status? - map(0x20, 0x21).w(FUNC(pasha2_state::pasha2_lamps_w)); - map(0x40, 0x41).portr("COINS"); - map(0x60, 0x61).portr("DSW"); - map(0x80, 0x81).portr("INPUTS"); - map(0xa0, 0xa1).nopw(); //soundlatch? - map(0xc0, 0xc1).w(FUNC(pasha2_state::misc_w)); - map(0xe1, 0xe1).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0xe5, 0xe5).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0xe8, 0xe9).w(FUNC(pasha2_state::oki_bank_w<0>)); - map(0xec, 0xed).w(FUNC(pasha2_state::oki_bank_w<1>)); + map(0x02, 0x02).nopr(); //sound status? + map(0x06, 0x06).nopr(); //sound status? + map(0x08, 0x08).w(FUNC(pasha2_state::pasha2_lamps_w)); + map(0x10, 0x10).portr("COINS"); + map(0x18, 0x18).portr("DSW"); + map(0x20, 0x20).portr("INPUTS"); + map(0x28, 0x28).nopw(); //soundlatch? + map(0x30, 0x30).w(FUNC(pasha2_state::misc_w)); + map(0x38, 0x38).umask16(0x00ff).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x39, 0x39).umask16(0x00ff).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x3a, 0x3a).w(FUNC(pasha2_state::oki_bank_w<0>)); + map(0x3b, 0x3b).w(FUNC(pasha2_state::oki_bank_w<1>)); } void pasha2_state::zdrum_audio_map(address_map &map) diff --git a/src/mame/misc/vamphalf.cpp b/src/mame/misc/vamphalf.cpp index 655e5b03abe..aa647cb0631 100644 --- a/src/mame/misc/vamphalf.cpp +++ b/src/mame/misc/vamphalf.cpp @@ -144,11 +144,8 @@ public: ioport_value boonggab_photo_sensors_r(); u16 eeprom_r(); - u32 eeprom32_r(); void eeprom_w(u16 data); - void eeprom32_w(u32 data); void flipscreen_w(u16 data); - void flipscreen32_w(u32 data); u16 vram_r(offs_t offset) { return m_tiles[offset]; } void vram_w(offs_t offset, u16 data, u16 mem_mask = ~0) { COMBINE_DATA(&m_tiles[offset]); } @@ -167,7 +164,7 @@ public: protected: virtual void video_start() override ATTR_COLD; - u32 m_flip_bit; + u16 m_flip_bit; u8 m_palshift; required_device m_maincpu; @@ -212,7 +209,6 @@ private: u32 aoh_speedup_r(); - void aoh_oki_bank_w(u32 data); void boonggab_oki_bank_w(u16 data); void mrkicker_oki_bank_w(u16 data); void qs1000_p3_w(u8 data); @@ -222,18 +218,20 @@ private: void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void draw_sprites_aoh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void handle_flipped_visible_area(screen_device &screen); - void aoh_io(address_map &map) ATTR_COLD; - void aoh_map(address_map &map) ATTR_COLD; - void banked_oki_map(address_map &map) ATTR_COLD; - void boonggab_io(address_map &map) ATTR_COLD; + + void vamphalf_io(address_map &map) ATTR_COLD; void coolmini_io(address_map &map) ATTR_COLD; + void mrkicker_io(address_map &map) ATTR_COLD; + void suplup_io(address_map &map) ATTR_COLD; void jmpbreak_io(address_map &map) ATTR_COLD; void worldadv_io(address_map &map) ATTR_COLD; - void mrdig_io(address_map &map) ATTR_COLD; - void mrkicker_io(address_map &map) ATTR_COLD; void solitaire_io(address_map &map) ATTR_COLD; - void suplup_io(address_map &map) ATTR_COLD; - void vamphalf_io(address_map &map) ATTR_COLD; + void mrdig_io(address_map &map) ATTR_COLD; + void aoh_map(address_map &map) ATTR_COLD; + void aoh_io(address_map &map) ATTR_COLD; + void boonggab_io(address_map &map) ATTR_COLD; + + void banked_oki_map(address_map &map) ATTR_COLD; }; class vamphalf_qdsp_state : public vamphalf_state @@ -306,11 +304,6 @@ u16 vamphalf_state::eeprom_r() return m_eeprom->do_read(); } -u32 vamphalf_state::eeprom32_r() -{ - return m_eeprom->do_read(); -} - void vamphalf_state::eeprom_w(u16 data) { m_eeprom->di_write(data & 0x01); @@ -320,13 +313,6 @@ void vamphalf_state::eeprom_w(u16 data) // data & 8? } -void vamphalf_state::eeprom32_w(u32 data) -{ - m_eeprom->di_write(data & 0x01); - m_eeprom->cs_write((data & 0x04) ? ASSERT_LINE : CLEAR_LINE ); - m_eeprom->clk_write((data & 0x02) ? ASSERT_LINE : CLEAR_LINE ); -} - void vamphalf_nvram_state::finalgdr_eeprom_w(u32 data) { m_eeprom->di_write((data & 0x4000) >> 14); @@ -346,11 +332,6 @@ void vamphalf_state::flipscreen_w(u16 data) m_flipscreen = data & m_flip_bit; } -void vamphalf_state::flipscreen32_w(u32 data) -{ - m_flipscreen = data & m_flip_bit; -} - void vamphalf_state::jmpbreak_flipscreen_w(u16 data) { m_flipscreen = data & 0x8000; @@ -432,11 +413,6 @@ void vamphalf_nvram_state::finalgdr_prize_w(u32 data) } } -void vamphalf_state::aoh_oki_bank_w(u32 data) -{ - m_okibank->set_entry(data & 0x3); -} - void vamphalf_state::boonggab_oki_bank_w(u16 data) { m_okibank->set_entry(data & 0x7); @@ -471,7 +447,7 @@ void vamphalf_state::boonggab_lamps_w(offs_t offset, u16 data) // data & 0x0020 == lamp 12 on // data & 0x0040 == lamp 13 on } - else if (offset == 2) + else if (offset == 1) { // data & 0x0100 == lamp 0 on // data & 0x0200 == lamp 1 on @@ -519,145 +495,145 @@ void vamphalf_qdsp_state::yorijori_32bit_map(address_map &map) void vamphalf_state::vamphalf_io(address_map &map) { - map(0x0c1, 0x0c1).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x141, 0x141).w("ymsnd", FUNC(ym2151_device::address_w)); - map(0x145, 0x145).rw("ymsnd", FUNC(ym2151_device::status_r), FUNC(ym2151_device::data_w)); - map(0x1c0, 0x1c1).r(FUNC(vamphalf_state::eeprom_r)); - map(0x240, 0x241).w(FUNC(vamphalf_state::flipscreen_w)); - map(0x600, 0x601).portr("SYSTEM"); - map(0x604, 0x605).portr("P1_P2"); - map(0x608, 0x609).w(FUNC(vamphalf_state::eeprom_w)); + map(0x030, 0x030).umask16(0x00ff).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x050, 0x050).umask16(0x00ff).w("ymsnd", FUNC(ym2151_device::address_w)); + map(0x051, 0x051).umask16(0x00ff).rw("ymsnd", FUNC(ym2151_device::status_r), FUNC(ym2151_device::data_w)); + map(0x070, 0x070).r(FUNC(vamphalf_state::eeprom_r)); + map(0x090, 0x090).w(FUNC(vamphalf_state::flipscreen_w)); + map(0x180, 0x180).portr("SYSTEM"); + map(0x181, 0x181).portr("P1_P2"); + map(0x182, 0x182).w(FUNC(vamphalf_state::eeprom_w)); } void vamphalf_qdsp_state::misncrft_io(address_map &map) { - map(0x100, 0x101).w(FUNC(vamphalf_state::flipscreen_w)); - map(0x200, 0x201).portr("P1_P2"); - map(0x240, 0x241).portr("SYSTEM"); - map(0x3c0, 0x3c1).w(FUNC(vamphalf_state::eeprom_w)); - map(0x401, 0x401).w(m_soundlatch, FUNC(generic_latch_8_device::write)); - map(0x580, 0x581).r(FUNC(vamphalf_state::eeprom_r)); + map(0x040, 0x040).w(FUNC(vamphalf_state::flipscreen_w)); + map(0x080, 0x080).portr("P1_P2"); + map(0x090, 0x090).portr("SYSTEM"); + map(0x0f0, 0x0f0).w(FUNC(vamphalf_state::eeprom_w)); + map(0x100, 0x100).umask16(0x00ff).w(m_soundlatch, FUNC(generic_latch_8_device::write)); + map(0x160, 0x161).r(FUNC(vamphalf_state::eeprom_r)); } void vamphalf_state::coolmini_io(address_map &map) { - map(0x200, 0x201).w(FUNC(vamphalf_state::flipscreen_w)); - map(0x300, 0x301).portr("SYSTEM"); - map(0x304, 0x305).portr("P1_P2"); - map(0x308, 0x309).w(FUNC(vamphalf_state::eeprom_w)); - map(0x4c1, 0x4c1).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x541, 0x541).w("ymsnd", FUNC(ym2151_device::address_w)); - map(0x545, 0x545).rw("ymsnd", FUNC(ym2151_device::status_r), FUNC(ym2151_device::data_w)); - map(0x7c0, 0x7c1).r(FUNC(vamphalf_state::eeprom_r)); + map(0x080, 0x080).w(FUNC(vamphalf_state::flipscreen_w)); + map(0x0c0, 0x0c0).portr("SYSTEM"); + map(0x0c1, 0x0c1).portr("P1_P2"); + map(0x0c2, 0x0c2).w(FUNC(vamphalf_state::eeprom_w)); + map(0x130, 0x130).umask16(0x00ff).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x150, 0x150).umask16(0x00ff).w("ymsnd", FUNC(ym2151_device::address_w)); + map(0x151, 0x151).umask16(0x00ff).rw("ymsnd", FUNC(ym2151_device::status_r), FUNC(ym2151_device::data_w)); + map(0x1f0, 0x1f0).r(FUNC(vamphalf_state::eeprom_r)); } void vamphalf_state::mrkicker_io(address_map &map) { coolmini_io(map); - map(0x000, 0x001).w(FUNC(vamphalf_state::mrkicker_oki_bank_w)); + map(0x000, 0x000).w(FUNC(vamphalf_state::mrkicker_oki_bank_w)); } void vamphalf_state::suplup_io(address_map &map) { - map(0x020, 0x021).w(FUNC(vamphalf_state::eeprom_w)); - map(0x040, 0x041).portr("P1_P2"); - map(0x060, 0x061).portr("SYSTEM"); - map(0x081, 0x081).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x0c1, 0x0c1).w("ymsnd", FUNC(ym2151_device::address_w)).umask16(0x00ff); - map(0x0c5, 0x0c5).rw("ymsnd", FUNC(ym2151_device::status_r), FUNC(ym2151_device::data_w)).umask16(0x00ff); - map(0x100, 0x101).r(FUNC(vamphalf_state::eeprom_r)); + map(0x008, 0x008).w(FUNC(vamphalf_state::eeprom_w)); + map(0x010, 0x010).portr("P1_P2"); + map(0x018, 0x018).portr("SYSTEM"); + map(0x020, 0x020).umask16(0x00ff).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x030, 0x030).umask16(0x00ff).w("ymsnd", FUNC(ym2151_device::address_w)); + map(0x031, 0x031).umask16(0x00ff).rw("ymsnd", FUNC(ym2151_device::status_r), FUNC(ym2151_device::data_w)); + map(0x040, 0x040).r(FUNC(vamphalf_state::eeprom_r)); } void vamphalf_qdsp_state::wyvernwg_io(address_map &map) { - map(0x1800, 0x1803).rw(FUNC(vamphalf_qdsp_state::wyvernwg_prot_r), FUNC(vamphalf_qdsp_state::wyvernwg_prot_w)); - map(0x2000, 0x2003).w(FUNC(vamphalf_state::flipscreen32_w)); - map(0x2800, 0x2803).portr("P1_P2"); - map(0x3000, 0x3003).portr("SYSTEM"); - map(0x5400, 0x5403).w(m_soundlatch, FUNC(generic_latch_8_device::write)).umask32(0x000000ff).cswidth(32); - map(0x7000, 0x7003).w(FUNC(vamphalf_state::eeprom32_w)); - map(0x7c00, 0x7c03).r(FUNC(vamphalf_state::eeprom32_r)); + map(0x0600, 0x0600).rw(FUNC(vamphalf_qdsp_state::wyvernwg_prot_r), FUNC(vamphalf_qdsp_state::wyvernwg_prot_w)); + map(0x0800, 0x0800).umask32(0x0000ffff).w(FUNC(vamphalf_state::flipscreen_w)); + map(0x0a00, 0x0a00).portr("P1_P2"); + map(0x0c00, 0x0c00).portr("SYSTEM"); + map(0x1500, 0x1500).umask32(0x000000ff).w(m_soundlatch, FUNC(generic_latch_8_device::write)); + map(0x1c00, 0x1c00).umask32(0x0000ffff).w(FUNC(vamphalf_state::eeprom_w)); + map(0x1f00, 0x1f00).umask32(0x0000ffff).r(FUNC(vamphalf_state::eeprom_r)); } void vamphalf_nvram_state::finalgdr_io(address_map &map) { - map(0x2400, 0x2403).r(FUNC(vamphalf_nvram_state::finalgdr_prot_r)); - map(0x2800, 0x2803).w(FUNC(vamphalf_nvram_state::finalgdr_backupram_bank_w)); - map(0x2c00, 0x2dff).rw(FUNC(vamphalf_nvram_state::finalgdr_backupram_r), FUNC(vamphalf_nvram_state::finalgdr_backupram_w)); - map(0x3000, 0x3007).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask32(0x0000ff00); - map(0x3402, 0x3402).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x3800, 0x3803).portr("P1_P2"); - map(0x3c00, 0x3c03).portr("SYSTEM"); - map(0x4400, 0x4403).r(FUNC(vamphalf_state::eeprom32_r)); - map(0x6000, 0x6003).nopr(); //? - map(0x6000, 0x6003).w(FUNC(vamphalf_nvram_state::finalgdr_eeprom_w)); - map(0x6040, 0x6043).w(FUNC(vamphalf_nvram_state::finalgdr_prot_w)); - map(0x6060, 0x6063).w(FUNC(vamphalf_nvram_state::finalgdr_prize_w)); - //map(0x6080, 0x6083).w(FUNC(vamphalf_nvram_state::flipscreen32_w)); //? - map(0x60a0, 0x60a3).w(FUNC(vamphalf_nvram_state::finalgdr_oki_bank_w)); + map(0x0900, 0x0900).r(FUNC(vamphalf_nvram_state::finalgdr_prot_r)); + map(0x0a00, 0x0a00).w(FUNC(vamphalf_nvram_state::finalgdr_backupram_bank_w)); + map(0x0b00, 0x0b7f).rw(FUNC(vamphalf_nvram_state::finalgdr_backupram_r), FUNC(vamphalf_nvram_state::finalgdr_backupram_w)); + map(0x0c00, 0x0c01).umask32(0x0000ff00).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0x0d00, 0x0d00).umask32(0x0000ff00).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x0e00, 0x0e00).portr("P1_P2"); + map(0x0f00, 0x0f00).portr("SYSTEM"); + map(0x1100, 0x1100).umask32(0x0000ffff).r(FUNC(vamphalf_state::eeprom_r)); + map(0x1800, 0x1800).nopr(); //? + map(0x1800, 0x1800).w(FUNC(vamphalf_nvram_state::finalgdr_eeprom_w)); + map(0x1810, 0x1810).w(FUNC(vamphalf_nvram_state::finalgdr_prot_w)); + map(0x1818, 0x1818).w(FUNC(vamphalf_nvram_state::finalgdr_prize_w)); + //map(0x1820, 0x1820).w(FUNC(vamphalf_nvram_state::flipscreen32_w)); //? + map(0x1828, 0x1828).w(FUNC(vamphalf_nvram_state::finalgdr_oki_bank_w)); } void vamphalf_nvram_state::mrkickera_io(address_map &map) { - map(0x2400, 0x2403).r(FUNC(vamphalf_state::eeprom32_r)); - map(0x4000, 0x4003).nopr(); //? - map(0x4000, 0x4003).w(FUNC(vamphalf_nvram_state::finalgdr_eeprom_w)); - map(0x4040, 0x4043).w(FUNC(vamphalf_nvram_state::finalgdr_prot_w)); - map(0x4084, 0x4087).nopw(); //? - map(0x40a0, 0x40a3).w(FUNC(vamphalf_nvram_state::finalgdr_oki_bank_w)); - map(0x6400, 0x6403).r(FUNC(vamphalf_nvram_state::finalgdr_prot_r)); - map(0x7000, 0x7007).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask32(0x0000ff00); - map(0x7402, 0x7402).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x7800, 0x7803).portr("P1_P2"); - map(0x7c00, 0x7c03).portr("SYSTEM"); + map(0x0900, 0x0900).umask32(0x0000ffff).r(FUNC(vamphalf_state::eeprom_r)); + map(0x1000, 0x1000).nopr(); //? + map(0x1000, 0x1000).w(FUNC(vamphalf_nvram_state::finalgdr_eeprom_w)); + map(0x1010, 0x1010).w(FUNC(vamphalf_nvram_state::finalgdr_prot_w)); + map(0x1021, 0x1021).nopw(); //? + map(0x1028, 0x1028).w(FUNC(vamphalf_nvram_state::finalgdr_oki_bank_w)); + map(0x1900, 0x1900).r(FUNC(vamphalf_nvram_state::finalgdr_prot_r)); + map(0x1c00, 0x1c01).umask32(0x0000ff00).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0x1d00, 0x1d00).umask32(0x0000ff00).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x1e00, 0x1e00).portr("P1_P2"); + map(0x1f00, 0x1f00).portr("SYSTEM"); } void vamphalf_state::jmpbreak_io(address_map &map) { - map(0x0c0, 0x0c1).noprw(); // ? - map(0x100, 0x101).nopw(); // ? - map(0x240, 0x241).portr("P1_P2"); - map(0x280, 0x281).w(FUNC(vamphalf_state::eeprom_w)); - map(0x2c0, 0x2c1).r(FUNC(vamphalf_state::eeprom_r)); - map(0x441, 0x441).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x540, 0x541).portr("SYSTEM"); - map(0x681, 0x681).w("ymsnd", FUNC(ym2151_device::address_w)); - map(0x685, 0x685).rw("ymsnd", FUNC(ym2151_device::status_r), FUNC(ym2151_device::data_w)); + map(0x030, 0x030).noprw(); // ? + map(0x040, 0x040).nopw(); // ? + map(0x090, 0x090).portr("P1_P2"); + map(0x0a0, 0x0a0).w(FUNC(vamphalf_state::eeprom_w)); + map(0x0b0, 0x0b0).r(FUNC(vamphalf_state::eeprom_r)); + map(0x110, 0x110).umask16(0x00ff).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x150, 0x150).portr("SYSTEM"); + map(0x1a0, 0x1a0).umask16(0x00ff).w("ymsnd", FUNC(ym2151_device::address_w)); + map(0x1a1, 0x1a1).umask16(0x00ff).rw("ymsnd", FUNC(ym2151_device::status_r), FUNC(ym2151_device::data_w)); } void vamphalf_state::worldadv_io(address_map &map) { - map(0x180, 0x181).w(FUNC(vamphalf_state::eeprom_w)); - map(0x280, 0x281).portr("P1_P2"); - map(0x340, 0x341).portr("SYSTEM"); - map(0x641, 0x641).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x701, 0x701).w("ymsnd", FUNC(ym2151_device::address_w)); - map(0x705, 0x705).rw("ymsnd", FUNC(ym2151_device::status_r), FUNC(ym2151_device::data_w)); - map(0x780, 0x781).r(FUNC(vamphalf_state::eeprom_r)); + map(0x060, 0x060).w(FUNC(vamphalf_state::eeprom_w)); + map(0x0a0, 0x0a0).portr("P1_P2"); + map(0x0d0, 0x0d0).portr("SYSTEM"); + map(0x190, 0x190).umask16(0x00ff).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x1c0, 0x1c0).umask16(0x00ff).w("ymsnd", FUNC(ym2151_device::address_w)); + map(0x1c1, 0x1c1).umask16(0x00ff).rw("ymsnd", FUNC(ym2151_device::status_r), FUNC(ym2151_device::data_w)); + map(0x1e0, 0x1e0).r(FUNC(vamphalf_state::eeprom_r)); } void vamphalf_state::solitaire_io(address_map &map) { - map(0x000, 0x001).r(FUNC(vamphalf_state::eeprom_r)); - map(0x0c0, 0x0c1).portr("P1_P2"); - map(0x141, 0x141).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x440, 0x441).portr("SYSTEM"); - // map(0x504, 0x50b) // lamps - map(0x581, 0x581).w("ymsnd", FUNC(ym2151_device::address_w)); - map(0x585, 0x585).rw("ymsnd", FUNC(ym2151_device::status_r), FUNC(ym2151_device::data_w)); - map(0x680, 0x681).w(FUNC(vamphalf_state::eeprom_w)); + map(0x000, 0x000).r(FUNC(vamphalf_state::eeprom_r)); + map(0x030, 0x030).portr("P1_P2"); + map(0x050, 0x050).umask16(0x00ff).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x110, 0x110).portr("SYSTEM"); + //map(0x141, 0x142) // lamps + map(0x160, 0x160).umask16(0x00ff).w("ymsnd", FUNC(ym2151_device::address_w)); + map(0x161, 0x161).umask16(0x00ff).rw("ymsnd", FUNC(ym2151_device::status_r), FUNC(ym2151_device::data_w)); + map(0x1a0, 0x1a0).w(FUNC(vamphalf_state::eeprom_w)); } void vamphalf_state::mrdig_io(address_map &map) { - map(0x081, 0x081).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x0c1, 0x0c1).w("ymsnd", FUNC(ym2151_device::address_w)); - map(0x0c5, 0x0c5).rw("ymsnd", FUNC(ym2151_device::status_r), FUNC(ym2151_device::data_w)); - map(0x180, 0x181).r(FUNC(vamphalf_state::eeprom_r)); - map(0x280, 0x281).portr("SYSTEM"); - map(0x3c0, 0x3c1).w(FUNC(vamphalf_state::eeprom_w)); - map(0x500, 0x501).portr("P1_P2"); + map(0x020, 0x020).umask16(0x00ff).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x030, 0x030).umask16(0x00ff).w("ymsnd", FUNC(ym2151_device::address_w)); + map(0x031, 0x031).umask16(0x00ff).rw("ymsnd", FUNC(ym2151_device::status_r), FUNC(ym2151_device::data_w)); + map(0x060, 0x060).r(FUNC(vamphalf_state::eeprom_r)); + map(0x0a0, 0x0a0).portr("SYSTEM"); + map(0x0f0, 0x0f0).w(FUNC(vamphalf_state::eeprom_w)); + map(0x140, 0x140).portr("P1_P2"); } void vamphalf_state::aoh_map(address_map &map) @@ -672,39 +648,39 @@ void vamphalf_state::aoh_map(address_map &map) void vamphalf_state::aoh_io(address_map &map) { - map(0x0480, 0x0483).w(FUNC(vamphalf_state::eeprom32_w)); - map(0x0622, 0x0622).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x0662, 0x0662).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x0640, 0x0647).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask32(0x0000ff00); - map(0x0680, 0x0683).w(FUNC(vamphalf_state::aoh_oki_bank_w)); + map(0x0120, 0x0120).umask32(0x0000ffff).w(FUNC(vamphalf_state::eeprom_w)); + map(0x0188, 0x0188).umask32(0x0000ff00).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x0190, 0x0191).umask32(0x0000ff00).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)); + map(0x0198, 0x0198).umask32(0x0000ff00).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x01a0, 0x01a0).umask32(0x0000ffff).w(FUNC(vamphalf_state::mrkicker_oki_bank_w)); } void vamphalf_state::boonggab_io(address_map &map) { - map(0x0c0, 0x0c1).r(FUNC(vamphalf_state::eeprom_r)); - map(0x200, 0x201).noprw(); // seems unused - map(0x300, 0x301).w(FUNC(vamphalf_state::flipscreen_w)); - map(0x400, 0x401).portr("SYSTEM"); - map(0x404, 0x405).portr("P1_P2"); - map(0x408, 0x409).w(FUNC(vamphalf_state::eeprom_w)); - map(0x410, 0x411).w(FUNC(vamphalf_state::boonggab_prize_w)); - map(0x414, 0x41b).w(FUNC(vamphalf_state::boonggab_lamps_w)); - map(0x600, 0x601).w(FUNC(vamphalf_state::boonggab_oki_bank_w)); - map(0x701, 0x701).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); - map(0x741, 0x741).w("ymsnd", FUNC(ym2151_device::address_w)); - map(0x745, 0x745).rw("ymsnd", FUNC(ym2151_device::status_r), FUNC(ym2151_device::data_w)); + map(0x030, 0x030).r(FUNC(vamphalf_state::eeprom_r)); + map(0x080, 0x080).noprw(); // seems unused + map(0x0c0, 0x0c0).w(FUNC(vamphalf_state::flipscreen_w)); + map(0x100, 0x100).portr("SYSTEM"); + map(0x101, 0x101).portr("P1_P2"); + map(0x102, 0x102).w(FUNC(vamphalf_state::eeprom_w)); + map(0x104, 0x104).w(FUNC(vamphalf_state::boonggab_prize_w)); + map(0x105, 0x106).w(FUNC(vamphalf_state::boonggab_lamps_w)); + map(0x180, 0x180).w(FUNC(vamphalf_state::boonggab_oki_bank_w)); + map(0x1c0, 0x1c0).umask16(0x00ff).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x1d0, 0x1d0).umask16(0x00ff).w("ymsnd", FUNC(ym2151_device::address_w)); + map(0x1d1, 0x1d1).umask16(0x00ff).rw("ymsnd", FUNC(ym2151_device::status_r), FUNC(ym2151_device::data_w)); } void vamphalf_qdsp_state::yorijori_io(address_map &map) { - map(0x2400, 0x2403).r(FUNC(vamphalf_qdsp_state::finalgdr_prot_r)); - map(0x3400, 0x3403).portr("P1_P2"); - map(0x3800, 0x3803).w(m_soundlatch, FUNC(generic_latch_8_device::write)).umask32(0x0000ff00).cswidth(32); - map(0x3c00, 0x3c03).portr("SYSTEM"); - map(0x4400, 0x4403).r(FUNC(vamphalf_state::eeprom32_r)); - map(0x6000, 0x6003).nopr(); //? - map(0x6000, 0x6003).w(FUNC(vamphalf_qdsp_state::yorijori_eeprom_w)); - map(0x6040, 0x6043).w(FUNC(vamphalf_qdsp_state::finalgdr_prot_w)); + map(0x0900, 0x0900).r(FUNC(vamphalf_qdsp_state::finalgdr_prot_r)); + map(0x0d00, 0x0d00).portr("P1_P2"); + map(0x0e00, 0x0e00).umask32(0x0000ff00).w(m_soundlatch, FUNC(generic_latch_8_device::write)); + map(0x0f00, 0x0f00).portr("SYSTEM"); + map(0x1100, 0x1100).umask32(0x0000ffff).r(FUNC(vamphalf_state::eeprom_r)); + map(0x1800, 0x1800).nopr(); //? + map(0x1800, 0x1800).w(FUNC(vamphalf_qdsp_state::yorijori_eeprom_w)); + map(0x1810, 0x1810).w(FUNC(vamphalf_qdsp_state::finalgdr_prot_w)); } void vamphalf_state::banked_oki_map(address_map &map) diff --git a/src/mame/promat/gstream.cpp b/src/mame/promat/gstream.cpp index 47d65575c75..b594d847801 100644 --- a/src/mame/promat/gstream.cpp +++ b/src/mame/promat/gstream.cpp @@ -353,13 +353,13 @@ void gstream_state::gstream_oki_4040_w(uint32_t data) void gstream_state::gstream_io(address_map &map) { - map(0x4000, 0x4003).portr("IN0"); - map(0x4010, 0x4013).portr("IN1"); - map(0x4020, 0x4023).portr("IN2"); // extra coin switches etc - map(0x4030, 0x4033).w(FUNC(gstream_state::gstream_oki_banking_w)); // oki banking - map(0x4040, 0x4043).w(FUNC(gstream_state::gstream_oki_4040_w)); // some clocking? - map(0x4053, 0x4053).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // music and samples - map(0x4063, 0x4063).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // music and samples + map(0x1000, 0x1000).portr("IN0"); + map(0x1004, 0x1004).portr("IN1"); + map(0x1008, 0x1008).portr("IN2"); // extra coin switches etc + map(0x100c, 0x100c).w(FUNC(gstream_state::gstream_oki_banking_w)); // oki banking + map(0x1010, 0x1010).w(FUNC(gstream_state::gstream_oki_4040_w)); // some clocking? + map(0x1014, 0x1014).umask32(0x000000ff).rw(m_oki[0], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // music and samples + map(0x1018, 0x1018).umask32(0x000000ff).rw(m_oki[1], FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // music and samples } @@ -391,12 +391,12 @@ void gstream_state::x2222_sound_w(uint32_t data) void gstream_state::x2222_io(address_map &map) { - map(0x4000, 0x4003).portr("P1"); - map(0x4004, 0x4007).portr("P2"); - map(0x4008, 0x400b).portr("SYS"); - map(0x4010, 0x4013).portr("DSW"); - map(0x4028, 0x402b).w(FUNC(gstream_state::x2222_sound_w)); - map(0x4034, 0x4037).portr("IN4"); + map(0x1000, 0x1000).portr("P1"); + map(0x1001, 0x1001).portr("P2"); + map(0x1002, 0x1002).portr("SYS"); + map(0x1004, 0x1004).portr("DSW"); + map(0x100a, 0x100a).w(FUNC(gstream_state::x2222_sound_w)); + map(0x100d, 0x100d).portr("IN4"); } static INPUT_PORTS_START( gstream )