diff options
author | 2018-03-04 01:39:52 +0900 | |
---|---|---|
committer | 2018-03-03 11:39:52 -0500 | |
commit | 25472091b626bd01ef47f11389a4b2ebe0fc0008 (patch) | |
tree | 7976f48c5d43d22ee8b1fde867ce5d5525dea75e | |
parent | 6569affe948a868daa23bdaeac7fa9e10ba8f992 (diff) |
es5510, taito_en Updates (#3284)
* es5510.* Updates :
Add notes
Fix dram read/write
Convert gpr, instr, dram into std::unique_ptr
Add save states
Minor cleanup
taito_en.* Updates :
Add notes
Move imperfect_features() into es5510.h
Verify ESP Input clock/output channels(from GunBuster Schematics, same in other PCBs?)
Add m_bankmask instead runtime tag lookups
* es5510.h : Add notes
* es5510.h : Fix compile
* es5510.h : Compile fixes
* esqpump.cpp : Split ES5506 case of interface, Add imperfect_features Because it has not perfectly emulated
esqasr.cpp, esqkt.cpp : Add esqpump for es5510 interface
taito_en.h : Restore imperfect_features Because sound emulation has still not perfect
* es5510.h : Moved imperfect_feature into esqpump.h from this, Add notes
* Revert "Moved imperfect_feature into esqpump.h from this", Because the current ES5510 core still has emulation issue
* esqpump.cpp : Cleanup unused m_otis/m_otto, Convert e[0x4000] into std::unique_ptr if used
* Fix compile
* esqkt.cpp : Fix company tags
-rw-r--r-- | src/devices/cpu/es5510/es5510.cpp | 175 | ||||
-rw-r--r-- | src/devices/cpu/es5510/es5510.h | 18 | ||||
-rw-r--r-- | src/devices/sound/esqpump.cpp | 9 | ||||
-rw-r--r-- | src/devices/sound/esqpump.h | 8 | ||||
-rw-r--r-- | src/mame/audio/taito_en.cpp | 39 | ||||
-rw-r--r-- | src/mame/audio/taito_en.h | 2 | ||||
-rw-r--r-- | src/mame/drivers/esq5505.cpp | 23 | ||||
-rw-r--r-- | src/mame/drivers/esqasr.cpp | 62 | ||||
-rw-r--r-- | src/mame/drivers/esqkt.cpp | 47 |
9 files changed, 265 insertions, 118 deletions
diff --git a/src/devices/cpu/es5510/es5510.cpp b/src/devices/cpu/es5510/es5510.cpp index 6a8e566e823..79ba2b3544c 100644 --- a/src/devices/cpu/es5510/es5510.cpp +++ b/src/devices/cpu/es5510/es5510.cpp @@ -1,11 +1,15 @@ // license:BSD-3-Clause // copyright-holders:Christian Brunschen -/*************************************************************************** +/*************************************************************************************** * * es5510.c - Ensoniq ES5510 (ESP) emulation * by Christian Brunschen * - ***************************************************************************/ + * TODO + * ridingf, ringrage and clones: Exception after logo is displayed (MT #06894) + * DRAM Size isn't verified, differs per machines? + * + ***************************************************************************************/ #include "emu.h" #include "es5510.h" @@ -15,7 +19,7 @@ #include "debugger.h" #include <cstdio> - +#include <algorithm> static constexpr int32_t MIN_24 = -(1 << 23); static constexpr int32_t MAX_24 = (1 << 23) - 1; @@ -126,52 +130,48 @@ inline static int32_t asl(int32_t value, int shift, uint8_t &flags) { return saturate(result, flags, signBefore != 0); } +// Initialize ESP to mostly zeroed, configured for 64k samples of delay line memory, running (not halted) es5510_device::es5510_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : cpu_device(mconfig, ES5510, tag, owner, clock) + , icount(0) + , halt_asserted(false) + , pc(0) + , state(STATE_HALTED) + , gpr(nullptr) + , ser0r(0) + , ser0l(0) + , ser1r(0) + , ser1l(0) + , ser2r(0) + , ser2l(0) + , ser3r(0) + , ser3l(0) + , machl(0) + , dil(0) + , memsiz(0x00ffffff) + , memmask(0x00000000) + , memincrement(0x01000000) + , memshift(24) + , dlength(0) + , abase(0) + , bbase(0) + , dbase(0) + , sigreg(1) + , mulshift(1) + , ccr(0) + , cmr(0) + , dol_count(0) + , instr(nullptr) + , dram(nullptr) + , dol_latch(0) + , dil_latch(0) + , dadr_latch(0) + , gpr_latch(0) + , instr_latch(0) + , ram_sel(0) + , host_control(0) { - // Initialize ESP to mostly zeroed, configured for 64k samples of delay line memory, running (not halted) - halt_asserted = false; - icount = 0; - pc = 0; - state = STATE_HALTED; - memset(gpr, 0, 0xc0 * sizeof(gpr[0])); - ser0r = 0; - ser0l = 0; - ser1r = 0; - ser1l = 0; - ser2r = 0; - ser2l = 0; - ser3r = 0; - ser3l = 0; - machl = 0; - dil = 0; - memsiz = 0x00ffffff; - memmask = 0x00000000; - memincrement = 0x01000000; - memshift = 24; - dlength = 0; - abase = 0; - bbase = 0; - dbase = 0; - sigreg = 1; - mulshift = 1; - ccr = 0; - cmr = 0; dol[0] = dol[1] = 0; - dol_count = 0; - - memset(instr, 0, 160 * sizeof(instr[0])); - memset(dram, 0, (1<<20) * sizeof(dram[0])); - - dol_latch = 0; - dil_latch = 0; - dadr_latch = 0; - gpr_latch = 0; - instr_latch = 0; - ram_sel = 0; - host_control = 0; - - pc = 0; memset(&alu, 0, sizeof(alu)); memset(&mulacc, 0, sizeof(mulacc)); } @@ -439,11 +439,11 @@ WRITE8_MEMBER(es5510_device::host_w) dadr_latch = (dadr_latch&0x00ffff) | ((data&0xff)<<16); if (ram_sel) { - dil_latch = dram[dadr_latch] << 8; + dil_latch = dram_r(dadr_latch) << 8; } else { - dram[dadr_latch] = dol_latch >> 8; + dram_w(dadr_latch, dol_latch >> 8); } break; @@ -550,16 +550,87 @@ void es5510_device::ser_w(int offset, int16_t data) } void es5510_device::device_start() { + gpr = std::make_unique<int32_t[]>(0xc0); // 24 bits, right justified + instr = std::make_unique<uint64_t[]>(160); // 48 bits, right justified + dram = std::make_unique<int16_t[]>(DRAM_SIZE); // there are up to 20 address bits (at least 16 expected), left justified within the 24 bits of a gpr or dadr; we preallocate all of it. m_icountptr = &icount; state_add(STATE_GENPC,"GENPC", pc).noshow(); state_add(STATE_GENPCBASE, "CURPC", pc).noshow(); + + save_item(NAME(icount)); + save_item(NAME(halt_asserted)); + save_item(NAME(pc)); + save_item(NAME(ser0r)); + save_item(NAME(ser0l)); + save_item(NAME(ser1r)); + save_item(NAME(ser1l)); + save_item(NAME(ser2r)); + save_item(NAME(ser2l)); + save_item(NAME(ser3r)); + save_item(NAME(ser3l)); + save_item(NAME(machl)); + save_item(NAME(mac_overflow)); + save_item(NAME(dil)); + save_item(NAME(memsiz)); + save_item(NAME(memmask)); + save_item(NAME(memincrement)); + save_item(NAME(memshift)); + save_item(NAME(dlength)); + save_item(NAME(abase)); + save_item(NAME(bbase)); + save_item(NAME(dbase)); + save_item(NAME(sigreg)); + save_item(NAME(mulshift)); + save_item(NAME(ccr)); + save_item(NAME(cmr)); + save_item(NAME(dol)); + save_item(NAME(dol_count)); + + save_pointer(NAME(gpr.get()), 0xc0); + save_pointer(NAME(instr.get()), 160); + save_pointer(NAME(dram.get()), DRAM_SIZE); + + save_item(NAME(dol_latch)); + save_item(NAME(dil_latch)); + save_item(NAME(dadr_latch)); + save_item(NAME(gpr_latch)); + save_item(NAME(instr_latch)); + save_item(NAME(ram_sel)); + save_item(NAME(host_control)); + + save_item(NAME(alu.aReg)); + save_item(NAME(alu.bReg)); + save_item(NAME(alu.op)); + save_item(NAME(alu.aValue)); + save_item(NAME(alu.bValue)); + save_item(NAME(alu.result)); + save_item(NAME(alu.update_ccr)); + save_item(NAME(alu.write_result)); + + save_item(NAME(mulacc.cReg)); + save_item(NAME(mulacc.dReg)); + save_item(NAME(mulacc.accumulate)); + save_item(NAME(mulacc.cValue)); + save_item(NAME(mulacc.dValue)); + save_item(NAME(mulacc.product)); + save_item(NAME(mulacc.result)); + save_item(NAME(mulacc.write_result)); + + save_item(NAME(ram.address)); + save_item(NAME(ram.io)); + + save_item(NAME(ram_p.address)); + save_item(NAME(ram_p.io)); + + save_item(NAME(ram_pp.address)); + save_item(NAME(ram_pp.io)); } void es5510_device::device_reset() { pc = 0x00; - memset(gpr, 0, sizeof(*gpr) * 0xc0); - memset(instr, 0, sizeof(*instr) * 0xa0); - memset(dram, 0, sizeof(*dram) * (1<<20)); + std::fill(&gpr[0], &gpr[0xc0], 0); + std::fill(&instr[0], &instr[160], 0); + std::fill(&dram[0], &dram[DRAM_SIZE], 0); state = STATE_RUNNING; dil_latch = dol_latch = dadr_latch = gpr_latch = 0; instr_latch = uint64_t(0); @@ -724,7 +795,7 @@ void es5510_device::execute_run() { if (ram_pp.io) { // read from I/O and store into DIL dil = 0; // read_io(ram_pp.address);; } else { // read from DRAM and store into DIL - dil = dram[ram_pp.address] << 8; + dil = dram_r(ram_pp.address) << 8; LOG_EXEC((" . RAM: read %x (%d) from address %x\n", dil, dil, ram_pp.address)); } } @@ -897,7 +968,7 @@ void es5510_device::execute_run() { if (ram_p.io) { // write_io(ram_p.io, dol[0]); } else { - dram[ram_p.address] = dol[0] >> 8; + dram_w(ram_p.address, dol[0] >> 8); LOG_EXEC((" . RAM: writing %x (%d) [of %x (%d)] to address %x\n", dol[0]&0xffff00, SX(dol[0]&0xffff00), dol[0], SX(dol[0]), ram_p.address)); } } diff --git a/src/devices/cpu/es5510/es5510.h b/src/devices/cpu/es5510/es5510.h index 0fd41807684..e92b68ab765 100644 --- a/src/devices/cpu/es5510/es5510.h +++ b/src/devices/cpu/es5510/es5510.h @@ -12,9 +12,13 @@ #pragma once - class es5510_device : public cpu_device { public: + // TODO : Not verified, Most of games are using 128KB DRAM. + static constexpr uint32_t DRAM_SIZE = (1<<20); + static constexpr uint32_t DRAM_MASK = (DRAM_SIZE-1); + static constexpr feature_type imperfect_features() { return feature::SOUND; } + es5510_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); DECLARE_READ8_MEMBER(host_r); @@ -114,7 +118,7 @@ public: // for testing purposes uint64_t &_instr(int pc) { return instr[pc % 160]; } - int16_t &_dram(int addr) { return dram[addr & 0xfffff]; } + int16_t &_dram(int addr) { return dram[addr & DRAM_MASK]; } // publicly visible for testing purposes int32_t read_reg(uint8_t reg); @@ -142,7 +146,7 @@ private: bool halt_asserted; uint8_t pc; state_t state; - int32_t gpr[0xc0]; // 24 bits, right justified + std::unique_ptr<int32_t[]> gpr; int16_t ser0r; int16_t ser0l; int16_t ser1r; @@ -169,8 +173,12 @@ private: int32_t dol[2]; int dol_count; - uint64_t instr[160]; // 48 bits, right justified - int16_t dram[1<<20]; // there are up to 20 address bits (at least 16 expected), left justified within the 24 bits of a gpr or dadr; we preallocate all of it. + std::unique_ptr<uint64_t[]> instr; + std::unique_ptr<int16_t[]> dram; + + // TODO : Masked address? + int16_t dram_r(int addr) { return dram[addr & DRAM_MASK]; } + void dram_w(int addr, int16_t data) { dram[addr & DRAM_MASK] = data; } // latch registers for host interaction int32_t dol_latch; // 24 bits diff --git a/src/devices/sound/esqpump.cpp b/src/devices/sound/esqpump.cpp index f11356d56f8..f817b0d7274 100644 --- a/src/devices/sound/esqpump.cpp +++ b/src/devices/sound/esqpump.cpp @@ -2,7 +2,7 @@ // copyright-holders:Christian Brunschen /*************************************************************************** - esqpump.c - Ensoniq 5505/5506 to 5510 interface. + esqpump.cpp - Ensoniq 5505/5506 to 5510 interface. By Christian Brunschen @@ -16,9 +16,12 @@ DEFINE_DEVICE_TYPE(ESQ_5505_5510_PUMP, esq_5505_5510_pump_device, "esq_5505_5510 esq_5505_5510_pump_device::esq_5505_5510_pump_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, ESQ_5505_5510_PUMP, tag, owner, clock) , device_sound_interface(mconfig, *this) - , m_stream(nullptr), m_timer(nullptr), m_otis(nullptr), m_esp(nullptr) + , m_stream(nullptr), m_timer(nullptr), m_esp(nullptr) , m_esp_halted(true), ticks_spent_processing(0), samples_processed(0) { +#if !PUMP_FAKE_ESP_PROCESSING && PUMP_REPLACE_ESP_PROGRAM + e = nullptr; +#endif } void esq_5505_5510_pump_device::device_start() @@ -44,7 +47,7 @@ void esq_5505_5510_pump_device::device_start() #endif #if !PUMP_FAKE_ESP_PROCESSING && PUMP_REPLACE_ESP_PROGRAM - memset(e, 0, 0x4000 * sizeof(e[0])); + e = make_unique_clear<int16_t[]>(0x4000); ei = 0; #endif } diff --git a/src/devices/sound/esqpump.h b/src/devices/sound/esqpump.h index 637ee8ab618..a95ee84c292 100644 --- a/src/devices/sound/esqpump.h +++ b/src/devices/sound/esqpump.h @@ -16,9 +16,10 @@ class esq_5505_5510_pump_device : public device_t, public device_sound_interface { public: + static constexpr feature_type imperfect_features() { return feature::SOUND; } + esq_5505_5510_pump_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - void set_otis(es5505_device *otis) { m_otis = otis; } void set_esp(es5510_device *esp) { m_esp = esp; } void set_esp_halted(bool esp_halted) { m_esp_halted = esp_halted; @@ -86,9 +87,6 @@ private: // per-sample timer emu_timer *m_timer; - // OTIS sound generator - es5505_device *m_otis; - // ESP signal processor es5510_device *m_esp; @@ -112,7 +110,7 @@ private: #endif #if !PUMP_FAKE_ESP_PROCESSING && PUMP_REPLACE_ESP_PROGRAM - int16_t e[0x4000]; + std::unique_ptr<int16_t[]> e; int ei; #endif }; diff --git a/src/mame/audio/taito_en.cpp b/src/mame/audio/taito_en.cpp index d02fdaad95d..915c171cfc8 100644 --- a/src/mame/audio/taito_en.cpp +++ b/src/mame/audio/taito_en.cpp @@ -6,7 +6,9 @@ TODO: - * ES5510 ESP emulation is not perfect, Verify ES5505 Output Channels + * ES5510 ESP emulation is not perfect + * ES5510 Input Clock and ES5505 Output channels are same in other PCBs? + (Currently these are verified from Gun Buster schematics) * Where does the MB8421 go? Taito F3 (and Super Chase) have 2 of them on the sound area, Taito JC has one. @@ -21,16 +23,16 @@ DEFINE_DEVICE_TYPE(TAITO_EN, taito_en_device, "taito_en", "Taito Ensoniq Sound System") taito_en_device::taito_en_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : device_t(mconfig, TAITO_EN, tag, owner, clock), - m_audiocpu(*this, "audiocpu"), - m_ensoniq(*this, "ensoniq"), - m_esp(*this, "esp"), - m_pump(*this, "pump"), - m_duart68681(*this, "duart68681"), - m_mb87078(*this, "mb87078"), - m_osram(*this, "osram"), - m_osrom(*this, "audiocpu"), - m_cpubank(*this, "cpubank%u", 1) + : device_t(mconfig, TAITO_EN, tag, owner, clock) + , m_audiocpu(*this, "audiocpu") + , m_ensoniq(*this, "ensoniq") + , m_esp(*this, "esp") + , m_pump(*this, "pump") + , m_duart68681(*this, "duart68681") + , m_mb87078(*this, "mb87078") + , m_osram(*this, "osram") + , m_osrom(*this, "audiocpu") + , m_cpubank(*this, "cpubank%u", 1) { } @@ -40,12 +42,14 @@ taito_en_device::taito_en_device(const machine_config &mconfig, const char *tag, void taito_en_device::device_start() { - m_pump->set_otis(m_ensoniq); + // tell the pump about the ESP chips m_pump->set_esp(m_esp); uint8_t *ROM = m_osrom->base(); uint32_t max = (m_osrom->bytes() - 0x100000) / 0x20000; for (int i = 0; i < 3; i++) m_cpubank[i]->configure_entries(0, max, &ROM[0x100000], 0x20000); + + m_bankmask = (memregion(":ensoniq.0")->bytes()/0x200000)-1; } @@ -77,10 +81,8 @@ void taito_en_device::device_reset() WRITE16_MEMBER( taito_en_device::en_es5505_bank_w ) { - uint32_t max_banks_this_game = (memregion(":ensoniq.0")->bytes()/0x200000)-1; - /* mask out unused bits */ - data &= max_banks_this_game; + data &= m_bankmask; m_ensoniq->voice_bank_w(offset,data<<20); } @@ -199,7 +201,7 @@ MACHINE_CONFIG_START(taito_en_device::device_add_mconfig) MCFG_CPU_ADD("audiocpu", M68000, XTAL(30'476'100) / 2) MCFG_CPU_PROGRAM_MAP(en_sound_map) - MCFG_CPU_ADD("esp", ES5510, XTAL(10'000'000)) // ES5510 Clock is unverified + MCFG_CPU_ADD("esp", ES5510, XTAL(10'000'000)) // from Gun Buster schematics MCFG_DEVICE_DISABLE() MCFG_DEVICE_ADD("duart68681", MC68681, XTAL(16'000'000) / 4) @@ -213,15 +215,16 @@ MACHINE_CONFIG_START(taito_en_device::device_add_mconfig) MCFG_DEVICE_ADD("dpram", MB8421, 0) // host accesses this from the other side /* sound hardware */ + MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + MCFG_SOUND_ADD("pump", ESQ_5505_5510_PUMP, XTAL(30'476'100) / (2 * 16 * 32)) MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) - MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") MCFG_SOUND_ADD("ensoniq", ES5505, XTAL(30'476'100) / 2) MCFG_ES5505_REGION0("ensoniq.0") MCFG_ES5505_REGION1("ensoniq.0") - MCFG_ES5506_CHANNELS(4) // TODO : Verify output channels + MCFG_ES5506_CHANNELS(4) MCFG_SOUND_ROUTE_EX(0, "pump", 1.0, 0) MCFG_SOUND_ROUTE_EX(1, "pump", 1.0, 1) MCFG_SOUND_ROUTE_EX(2, "pump", 1.0, 2) diff --git a/src/mame/audio/taito_en.h b/src/mame/audio/taito_en.h index d36b089a231..18a97756dfc 100644 --- a/src/mame/audio/taito_en.h +++ b/src/mame/audio/taito_en.h @@ -52,6 +52,8 @@ private: required_memory_region m_osrom; required_memory_bank_array<3> m_cpubank; + uint32_t m_bankmask; + DECLARE_WRITE_LINE_MEMBER(duart_irq_handler); DECLARE_WRITE8_MEMBER(duart_output); diff --git a/src/mame/drivers/esq5505.cpp b/src/mame/drivers/esq5505.cpp index fd32eb5d40a..43c53dfd03b 100644 --- a/src/mame/drivers/esq5505.cpp +++ b/src/mame/drivers/esq5505.cpp @@ -170,21 +170,19 @@ class esq5505_state : public driver_device { public: esq5505_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_duart(*this, "duart"), - m_otis(*this, "otis"), - m_esp(*this, "esp"), - m_pump(*this, "pump"), - m_fdc(*this, "wd1772"), - m_panel(*this, "panel"), - m_dmac(*this, "mc68450"), - m_mdout(*this, "mdout") + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_duart(*this, "duart") + , m_esp(*this, "esp") + , m_pump(*this, "pump") + , m_fdc(*this, "wd1772") + , m_panel(*this, "panel") + , m_dmac(*this, "mc68450") + , m_mdout(*this, "mdout") { } required_device<m68000_device> m_maincpu; required_device<mc68681_device> m_duart; - required_device<es5505_device> m_otis; required_device<es5510_device> m_esp; required_device<esq_5505_5510_pump_device> m_pump; optional_device<wd1772_device> m_fdc; @@ -273,8 +271,7 @@ IRQ_CALLBACK_MEMBER(esq5505_state::maincpu_irq_acknowledge_callback) void esq5505_state::machine_start() { driver_device::machine_start(); - // tell the pump about the OTIS & ESP chips - m_pump->set_otis(m_otis); + // tell the pump about the ESP chips m_pump->set_esp(m_esp); m_rom = (uint16_t *)(void *)memregion("osrom")->base(); diff --git a/src/mame/drivers/esqasr.cpp b/src/mame/drivers/esqasr.cpp index fcaa4a8924f..ae445bb74f5 100644 --- a/src/mame/drivers/esqasr.cpp +++ b/src/mame/drivers/esqasr.cpp @@ -44,6 +44,7 @@ #include "machine/esqvfd.h" #include "machine/upd765.h" #include "sound/es5506.h" +#include "sound/esqpump.h" #include "speaker.h" @@ -52,16 +53,19 @@ class esqasr_state : public driver_device { public: esqasr_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_esp(*this, "esp"), - m_sq1vfd(*this, "sq1vfd") + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_esp(*this, "esp") + , m_pump(*this, "pump") + , m_sq1vfd(*this, "sq1vfd") { } required_device<cpu_device> m_maincpu; - required_device<es5510_device> m_esp; + optional_device<es5510_device> m_esp; + optional_device<esq_5505_5510_pump_device> m_pump; required_device<esq2x40_sq1_device> m_sq1vfd; - + + virtual void machine_start() override; virtual void machine_reset() override; DECLARE_DRIVER_INIT(asr); @@ -73,6 +77,16 @@ public: void asrx_map(address_map &map); }; +void esqasr_state::machine_start() +{ + if (m_pump.found()) + { + // tell the pump about the ESP chips + if (m_esp.found()) + m_pump->set_esp(m_esp); + } +} + void esqasr_state::machine_reset() { } @@ -107,28 +121,44 @@ MACHINE_CONFIG_START(esqasr_state::asr) MCFG_ESQ2X40_SQ1_ADD("sq1vfd") MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + + MCFG_SOUND_ADD("pump", ESQ_5505_5510_PUMP, XTAL(16'000'000) / (16 * 32)) + MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) + MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ADD("ensoniq", ES5506, XTAL(16'000'000)) MCFG_ES5506_REGION0("waverom") /* Bank 0 */ MCFG_ES5506_REGION1("waverom2") /* Bank 1 */ MCFG_ES5506_REGION2("waverom3") /* Bank 0 */ MCFG_ES5506_REGION3("waverom4") /* Bank 1 */ - MCFG_ES5506_CHANNELS(1) /* channels */ + MCFG_ES5506_CHANNELS(4) /* channels, Not verified from real hardware */ MCFG_ES5506_IRQ_CB(WRITELINE(esqasr_state, esq5506_otto_irq)) /* irq */ MCFG_ES5506_READ_PORT_CB(READ16(esqasr_state, esq5506_read_adc)) - MCFG_SOUND_ROUTE(0, "lspeaker", 2.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 2.0) + MCFG_SOUND_ROUTE_EX(0, "pump", 1.0, 0) + MCFG_SOUND_ROUTE_EX(1, "pump", 1.0, 1) + MCFG_SOUND_ROUTE_EX(2, "pump", 1.0, 2) + MCFG_SOUND_ROUTE_EX(3, "pump", 1.0, 3) + MCFG_SOUND_ROUTE_EX(4, "pump", 1.0, 4) + MCFG_SOUND_ROUTE_EX(5, "pump", 1.0, 5) + MCFG_SOUND_ROUTE_EX(6, "pump", 1.0, 6) + MCFG_SOUND_ROUTE_EX(7, "pump", 1.0, 7) MACHINE_CONFIG_END MACHINE_CONFIG_START(esqasr_state::asrx) - MCFG_CPU_ADD("maincpu", M68020, XTAL(16'000'000)) // unknown, possibly 68340? + MCFG_CPU_ADD("maincpu", M68340, XTAL(16'000'000)) // 68340 MCFG_CPU_PROGRAM_MAP(asrx_map) - MCFG_CPU_ADD("esp", ES5510, XTAL(10'000'000)) + MCFG_CPU_ADD("esp", ES5510, XTAL(10'000'000)) // Actually ES5511 MCFG_DEVICE_DISABLE() MCFG_ESQ2X40_SQ1_ADD("sq1vfd") MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") + + MCFG_SOUND_ADD("pump", ESQ_5505_5510_PUMP, XTAL(16'000'000) / (16 * 32)) // Actually ES5511 + MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) + MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + MCFG_SOUND_ADD("ensoniq", ES5506, XTAL(16'000'000)) MCFG_ES5506_REGION0("waverom") /* Bank 0 */ MCFG_ES5506_REGION1("waverom2") /* Bank 1 */ @@ -137,8 +167,14 @@ MACHINE_CONFIG_START(esqasr_state::asrx) MCFG_ES5506_CHANNELS(1) /* channels */ MCFG_ES5506_IRQ_CB(WRITELINE(esqasr_state, esq5506_otto_irq)) /* irq */ MCFG_ES5506_READ_PORT_CB(READ16(esqasr_state, esq5506_read_adc)) - MCFG_SOUND_ROUTE(0, "lspeaker", 2.0) - MCFG_SOUND_ROUTE(1, "rspeaker", 2.0) + MCFG_SOUND_ROUTE_EX(0, "pump", 1.0, 0) + MCFG_SOUND_ROUTE_EX(1, "pump", 1.0, 1) + MCFG_SOUND_ROUTE_EX(2, "pump", 1.0, 2) + MCFG_SOUND_ROUTE_EX(3, "pump", 1.0, 3) + MCFG_SOUND_ROUTE_EX(4, "pump", 1.0, 4) + MCFG_SOUND_ROUTE_EX(5, "pump", 1.0, 5) + MCFG_SOUND_ROUTE_EX(6, "pump", 1.0, 6) + MCFG_SOUND_ROUTE_EX(7, "pump", 1.0, 7) MACHINE_CONFIG_END static INPUT_PORTS_START( asr ) diff --git a/src/mame/drivers/esqkt.cpp b/src/mame/drivers/esqkt.cpp index 6c3f3bfdbd8..1fed678febe 100644 --- a/src/mame/drivers/esqkt.cpp +++ b/src/mame/drivers/esqkt.cpp @@ -96,6 +96,7 @@ #include "cpu/m68000/m68000.h" #include "machine/mc68681.h" #include "sound/es5506.h" +#include "sound/esqpump.h" #include "speaker.h" @@ -107,6 +108,7 @@ public: : driver_device(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_esp(*this, "esp") + , m_pump(*this, "pump") , m_duart(*this, "duart") , m_sq1panel(*this, "sq1panel") , m_mdout(*this, "mdout") @@ -114,10 +116,12 @@ public: required_device<m68ec020_device> m_maincpu; required_device<es5510_device> m_esp; + required_device<esq_5505_5510_pump_device> m_pump; required_device<scn2681_device> m_duart; required_device<esqpanel2x16_sq1_device> m_sq1panel; required_device<midi_port_device> m_mdout; - + + virtual void machine_start() override; virtual void machine_reset() override; DECLARE_WRITE_LINE_MEMBER(duart_irq_handler); @@ -136,6 +140,12 @@ public: void kt_map(address_map &map); }; +void esqkt_state::machine_start() +{ + // tell the pump about the ESP chips + m_pump->set_esp(m_esp); +} + void esqkt_state::machine_reset() { m_bCalibSecondByte = false; @@ -143,7 +153,7 @@ void esqkt_state::machine_reset() ADDRESS_MAP_START(esqkt_state::kt_map) AM_RANGE(0x000000, 0x07ffff) AM_ROM AM_REGION("osrom", 0) - AM_RANGE(0x200000, 0x20003f) AM_DEVREADWRITE8("ensoniq", es5506_device, read, write, 0xffffffff) + AM_RANGE(0x200000, 0x20003f) AM_DEVREADWRITE8("ensoniq1", es5506_device, read, write, 0xffffffff) AM_RANGE(0x240000, 0x24003f) AM_DEVREADWRITE8("ensoniq2", es5506_device, read, write, 0xffffffff) AM_RANGE(0x280000, 0x2801ff) AM_DEVREADWRITE8("esp", es5510_device, host_r, host_w, 0xffffffff) AM_RANGE(0x300000, 0x30001f) AM_DEVREADWRITE8("duart", scn2681_device, read, write, 0xffffffff) @@ -227,24 +237,43 @@ MACHINE_CONFIG_START(esqkt_state::kt) MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout") MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") - MCFG_SOUND_ADD("ensoniq", ES5506, XTAL(16'000'000)) + + MCFG_SOUND_ADD("pump", ESQ_5505_5510_PUMP, XTAL(16'000'000) / (16 * 32)) + MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) + MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) + + MCFG_SOUND_ADD("ensoniq1", ES5506, XTAL(16'000'000)) MCFG_ES5506_REGION0("waverom") /* Bank 0 */ MCFG_ES5506_REGION1("waverom2") /* Bank 1 */ MCFG_ES5506_REGION2("waverom3") /* Bank 0 */ MCFG_ES5506_REGION3("waverom4") /* Bank 1 */ - MCFG_ES5506_CHANNELS(1) /* channels */ + MCFG_ES5506_CHANNELS(4) /* channels */ MCFG_ES5506_IRQ_CB(WRITELINE(esqkt_state, esq5506_otto_irq)) /* irq */ MCFG_ES5506_READ_PORT_CB(READ16(esqkt_state, esq5506_read_adc)) - MCFG_SOUND_ROUTE(0, "lspeaker", 0.5) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.5) + MCFG_SOUND_ROUTE_EX(0, "pump", 1.0, 0) + MCFG_SOUND_ROUTE_EX(1, "pump", 1.0, 1) + MCFG_SOUND_ROUTE_EX(2, "pump", 1.0, 2) + MCFG_SOUND_ROUTE_EX(3, "pump", 1.0, 3) + MCFG_SOUND_ROUTE_EX(4, "pump", 1.0, 4) + MCFG_SOUND_ROUTE_EX(5, "pump", 1.0, 5) + MCFG_SOUND_ROUTE_EX(6, "pump", 1.0, 6) + MCFG_SOUND_ROUTE_EX(7, "pump", 1.0, 7) + MCFG_SOUND_ADD("ensoniq2", ES5506, XTAL(16'000'000)) MCFG_ES5506_REGION0("waverom") /* Bank 0 */ MCFG_ES5506_REGION1("waverom2") /* Bank 1 */ MCFG_ES5506_REGION2("waverom3") /* Bank 0 */ MCFG_ES5506_REGION3("waverom4") /* Bank 1 */ - MCFG_ES5506_CHANNELS(1) /* channels */ - MCFG_SOUND_ROUTE(0, "lspeaker", 0.5) - MCFG_SOUND_ROUTE(1, "rspeaker", 0.5) + MCFG_ES5506_CHANNELS(4) /* channels */ + MCFG_SOUND_ROUTE_EX(0, "pump", 1.0, 0) + MCFG_SOUND_ROUTE_EX(1, "pump", 1.0, 1) + MCFG_SOUND_ROUTE_EX(2, "pump", 1.0, 2) + MCFG_SOUND_ROUTE_EX(3, "pump", 1.0, 3) + MCFG_SOUND_ROUTE_EX(4, "pump", 1.0, 4) + MCFG_SOUND_ROUTE_EX(5, "pump", 1.0, 5) + MCFG_SOUND_ROUTE_EX(6, "pump", 1.0, 6) + MCFG_SOUND_ROUTE_EX(7, "pump", 1.0, 7) + MACHINE_CONFIG_END static INPUT_PORTS_START( kt ) |