diff --git a/src/mame/kawai/kawai_acr20.cpp b/src/mame/kawai/acr20.cpp similarity index 100% rename from src/mame/kawai/kawai_acr20.cpp rename to src/mame/kawai/acr20.cpp diff --git a/src/mame/kawai/kawai_k1.cpp b/src/mame/kawai/k1.cpp similarity index 68% rename from src/mame/kawai/kawai_k1.cpp rename to src/mame/kawai/k1.cpp index afda9d008f7..61da134b5fa 100644 --- a/src/mame/kawai/kawai_k1.cpp +++ b/src/mame/kawai/k1.cpp @@ -7,6 +7,7 @@ ***************************************************************************/ #include "emu.h" +#include "mb63h158.h" #include "cpu/upd78k/upd78k3.h" #include "machine/nvram.h" @@ -20,21 +21,29 @@ public: } void k1(machine_config &config); + void k1m(machine_config &config); private: - void mem_map(address_map &map); + void k1_map(address_map &map); + void k1m_map(address_map &map); required_device m_mpu; }; -void kawai_k1_state::mem_map(address_map &map) +void kawai_k1_state::k1m_map(address_map &map) { map(0x0000, 0x7fff).rom().region("coderom", 0); map(0x8000, 0x9fff).ram(); map(0xa000, 0xbfff).ram().share("toneram"); } +void kawai_k1_state::k1_map(address_map &map) +{ + k1m_map(map); + map(0xf000, 0xf0ff).mirror(0x700).r("sensor", FUNC(mb63h158_device::read)); +} + static INPUT_PORTS_START(k1) INPUT_PORTS_END @@ -42,9 +51,19 @@ INPUT_PORTS_END void kawai_k1_state::k1(machine_config &config) { UPD78310(config, m_mpu, 12_MHz_XTAL); // µPD78310G-36 - m_mpu->set_addrmap(AS_PROGRAM, &kawai_k1_state::mem_map); + m_mpu->set_addrmap(AS_PROGRAM, &kawai_k1_state::k1_map); NVRAM(config, "toneram", nvram_device::DEFAULT_ALL_0); // LC3564PL-12 + battery + + MB63H158(config, "sensor", 7.2_MHz_XTAL); +} + +void kawai_k1_state::k1m(machine_config &config) +{ + k1(config); + + m_mpu->set_addrmap(AS_PROGRAM, &kawai_k1_state::k1m_map); + config.device_remove("sensor"); } ROM_START(k1) @@ -87,8 +106,8 @@ ROM_START(k1rii) ROM_LOAD("p106.bin", 0x00000, 0x80000, NO_DUMP) ROM_END -SYST(1988, k1, 0, 0, k1, k1, kawai_k1_state, empty_init, "Kawai Musical Instrument Manufacturing", "K1 Digital Multi-Dimensional Synthesizer", MACHINE_IS_SKELETON) -SYST(1988, k1m, k1, 0, k1, k1, kawai_k1_state, empty_init, "Kawai Musical Instrument Manufacturing", "K1m Digital Multi-Dimensional Synthesizer Module", MACHINE_IS_SKELETON) -SYST(1988, k1r, k1, 0, k1, k1, kawai_k1_state, empty_init, "Kawai Musical Instrument Manufacturing", "K1r Digital Multi-Dimensional Synthesizer Module", MACHINE_IS_SKELETON) +SYST(1988, k1, 0, 0, k1, k1, kawai_k1_state, empty_init, "Kawai Musical Instrument Manufacturing", "K1 Digital Multi-Dimensional Synthesizer", MACHINE_IS_SKELETON) +SYST(1988, k1m, k1, 0, k1m, k1, kawai_k1_state, empty_init, "Kawai Musical Instrument Manufacturing", "K1m Digital Multi-Dimensional Synthesizer Module", MACHINE_IS_SKELETON) +SYST(1988, k1r, k1, 0, k1m, k1, kawai_k1_state, empty_init, "Kawai Musical Instrument Manufacturing", "K1r Digital Multi-Dimensional Synthesizer Module", MACHINE_IS_SKELETON) -SYST(1989, k1rii, 0, 0, k1, k1, kawai_k1_state, empty_init, "Kawai Musical Instrument Manufacturing", "K1rII Digital Multi-Dimensional Synthesizer Module", MACHINE_IS_SKELETON) +SYST(1989, k1rii, 0, 0, k1m, k1, kawai_k1_state, empty_init, "Kawai Musical Instrument Manufacturing", "K1rII Digital Multi-Dimensional Synthesizer Module", MACHINE_IS_SKELETON) diff --git a/src/mame/kawai/kawai_k4.cpp b/src/mame/kawai/k4.cpp similarity index 100% rename from src/mame/kawai/kawai_k4.cpp rename to src/mame/kawai/k4.cpp diff --git a/src/mame/kawai/kawai_k5.cpp b/src/mame/kawai/k5.cpp similarity index 100% rename from src/mame/kawai/kawai_k5.cpp rename to src/mame/kawai/k5.cpp diff --git a/src/mame/kawai/kawai_ksp10.cpp b/src/mame/kawai/ksp10.cpp similarity index 100% rename from src/mame/kawai/kawai_ksp10.cpp rename to src/mame/kawai/ksp10.cpp diff --git a/src/mame/kawai/mb63h158.cpp b/src/mame/kawai/mb63h158.cpp new file mode 100644 index 00000000000..7ae574ffb7e --- /dev/null +++ b/src/mame/kawai/mb63h158.cpp @@ -0,0 +1,44 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + Kawai MB63H158 Touch Sensor + + This is a 64-pin Fujitsu CMOS gate array programmed as a keyboard + scanner. The matrix it scans has 5 or 6 address lines and 4 active + high return lines. Typically, additional HCMOS logic ICs are used to + decode the former and multiplex the latter. It also manages a pair of + 150 ns static RAMs as a 512×15-bit private buffer. + + SDIP and QFP versions appear to have different numberings for the same + functional set of pins, including two mode pins that are variously + strapped. The CPU interface includes a byte-wide data bus, 8 address + lines and two CS inputs that are normally tied together. The device + has no CPU-writable registers and does not generate interrupts. + +***************************************************************************/ + +#include "emu.h" +#include "mb63h158.h" + +// device type definition +DEFINE_DEVICE_TYPE(MB63H158, mb63h158_device, "mb63h158", "Kawai MB63H158 Touch Sensor") + +mb63h158_device::mb63h158_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : device_t(mconfig, MB63H158, tag, owner, clock) +{ +} + +void mb63h158_device::device_start() +{ +} + +void mb63h158_device::device_reset() +{ +} + +u8 mb63h158_device::read(offs_t offset) +{ + // TODO + return 0; +} diff --git a/src/mame/kawai/mb63h158.h b/src/mame/kawai/mb63h158.h new file mode 100644 index 00000000000..48c1166beef --- /dev/null +++ b/src/mame/kawai/mb63h158.h @@ -0,0 +1,42 @@ +// license:BSD-3-Clause +// copyright-holders:AJR +/*************************************************************************** + + Kawai MB63H158 Touch Sensor + +***************************************************************************/ + +#ifndef MAME_MACHINE_MB63H158_H +#define MAME_MACHINE_MB63H158_H + +#pragma once + +//************************************************************************** +// TYPE DEFINITIONS +//************************************************************************** + +// ======================> mb63h114_device + +class mb63h158_device : public device_t +{ +public: + // device type constructor + mb63h158_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + + // CPU read handler + u8 read(offs_t offset); + +protected: + // device-specific overrides + virtual void device_start() override; + virtual void device_reset() override; + +private: + // TODO +}; + + +// device type declaration +DECLARE_DEVICE_TYPE(MB63H158, mb63h158_device) + +#endif // MAME_MACHINE_MB63H158_H diff --git a/src/mame/kawai/kawai_r100.cpp b/src/mame/kawai/r100.cpp similarity index 96% rename from src/mame/kawai/kawai_r100.cpp rename to src/mame/kawai/r100.cpp index c98fc17366c..2343a942a2e 100644 --- a/src/mame/kawai/kawai_r100.cpp +++ b/src/mame/kawai/r100.cpp @@ -7,6 +7,7 @@ ***************************************************************************/ #include "emu.h" +#include "mb63h158.h" #include "cpu/m6502/m50734.h" #include "machine/nvram.h" #include "video/hd44780.h" @@ -35,7 +36,6 @@ private: void p1_w(u8 data); void p2_w(u8 data); void p3_w(u8 data); - u8 sensor_lsi_r(offs_t offset); void buffer_w(u8 data); void main_map(address_map &map); @@ -75,11 +75,6 @@ void kawai_r100_state::p3_w(u8 data) { } -u8 kawai_r100_state::sensor_lsi_r(offs_t offset) -{ - return 0; -} - void kawai_r100_state::buffer_w(u8 data) { } @@ -88,7 +83,7 @@ void kawai_r100_state::main_map(address_map &map) { map(0x0000, 0x1fff).ram().share("nvram1"); map(0x2000, 0x3fff).ram().share("nvram2"); - map(0x4100, 0x41ff).r(FUNC(kawai_r100_state::sensor_lsi_r)); + map(0x4100, 0x41ff).r("sensor", FUNC(mb63h158_device::read)); map(0x4200, 0x4200).mirror(0xff).w(m_lcdc, FUNC(hd44780_device::db_w)); map(0x4300, 0x4300).mirror(0xff).w(FUNC(kawai_r100_state::buffer_w)); map(0x4400, 0xffff).rom().region("program", 0x4400); @@ -119,6 +114,8 @@ void kawai_r100_state::r100(machine_config &config) NVRAM(config, "nvram1", nvram_device::DEFAULT_ALL_0); // MB8464-15LL-SK + battery NVRAM(config, "nvram2", nvram_device::DEFAULT_ALL_0); // MB8464-15LL-SK + battery + MB63H158(config, "sensor", 16_MHz_XTAL / 4); + //M60009_AGU_DGU(config, "pcm", 5_MHz_XTAL); // LCD unit diff --git a/src/mame/kawai/kawai_sx240.cpp b/src/mame/kawai/sx240.cpp similarity index 100% rename from src/mame/kawai/kawai_sx240.cpp rename to src/mame/kawai/sx240.cpp diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 25e640e0691..b4474e6d4ea 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -19575,30 +19575,30 @@ wndrplnt // (c) 1987 Data East Corporation (Japan) @source:misc/kas89.cpp kas89 // 1989, SFC S.R.L. -@source:kawai/kawai_acr20.cpp +@source:kawai/acr20.cpp acr20 // -@source:kawai/kawai_k1.cpp +@source:kawai/k1.cpp k1 // k1m // k1r // k1rii // -@source:kawai/kawai_k4.cpp +@source:kawai/k4.cpp k4 // k4r // -@source:kawai/kawai_k5.cpp +@source:kawai/k5.cpp k5 // k5m // -@source:kawai/kawai_ksp10.cpp +@source:kawai/ksp10.cpp ksp10 // -@source:kawai/kawai_r100.cpp +@source:kawai/r100.cpp r100 // -@source:kawai/kawai_sx240.cpp +@source:kawai/sx240.cpp sx240 // @source:kaypro/kaypro.cpp diff --git a/src/mame/mess.flt b/src/mame/mess.flt index a5647921162..139f2059f54 100644 --- a/src/mame/mess.flt +++ b/src/mame/mess.flt @@ -415,13 +415,13 @@ intel/sdk86.cpp intergraph/interpro.cpp interton/vc4000.cpp isc/compucolor.cpp -kawai/kawai_acr20.cpp -kawai/kawai_k1.cpp -kawai/kawai_k4.cpp -kawai/kawai_k5.cpp -kawai/kawai_ksp10.cpp -kawai/kawai_r100.cpp -kawai/kawai_sx240.cpp +kawai/acr20.cpp +kawai/k1.cpp +kawai/k4.cpp +kawai/k5.cpp +kawai/ksp10.cpp +kawai/r100.cpp +kawai/sx240.cpp kaypro/kaypro.cpp koei/pasogo.cpp kontron/kdt6.cpp