summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2024-03-05 23:17:42 +0100
committer Olivier Galibert <galibert@pobox.com>2024-03-05 23:17:48 +0100
commit84f5fb0653d891053d4dd123764677b733746b42 (patch)
tree65a5118702618e9522bf5393748a781482dbb373
parent190f332a302f7600e01847733ed43f065fed25eb (diff)
Re-add the subcomponents to the swx00 and tweak the adc
-rw-r--r--src/devices/cpu/h8/swx00.cpp20
-rw-r--r--src/devices/cpu/h8/swx00.h4
-rw-r--r--src/devices/cpu/sh/sh_port.cpp2
-rw-r--r--src/mame/yamaha/ymmu15.cpp9
-rw-r--r--src/mame/yamaha/ympsr340.cpp5
5 files changed, 13 insertions, 27 deletions
diff --git a/src/devices/cpu/h8/swx00.cpp b/src/devices/cpu/h8/swx00.cpp
index 50cd3baf051..e06780fb83e 100644
--- a/src/devices/cpu/h8/swx00.cpp
+++ b/src/devices/cpu/h8/swx00.cpp
@@ -8,7 +8,6 @@ DEFINE_DEVICE_TYPE(SWX00, swx00_device, "swx00", "Yamaha SWX00")
swx00_device::swx00_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, u8 mode) :
h8s2000_device(mconfig, SWX00, tag, owner, clock, address_map_constructor(FUNC(swx00_device::map), this)),
m_intc(*this, "intc"),
-#if 0
m_adc(*this, "adc"),
m_dma(*this, "dma"),
m_dma0(*this, "dma:0"),
@@ -36,7 +35,6 @@ swx00_device::swx00_device(const machine_config &mconfig, const char *tag, devic
m_timer16_4(*this, "timer16:4"),
m_timer16_5(*this, "timer16:5"),
m_watchdog(*this, "watchdog"),
-#endif
m_data_config(mode & MODE_DUAL ? "s" : "c", ENDIANNESS_BIG, 16, mode & MODE_DUAL ? 24 : 22),
m_mode(mode),
m_syscr(0)
@@ -46,8 +44,7 @@ swx00_device::swx00_device(const machine_config &mconfig, const char *tag, devic
void swx00_device::map(address_map &map)
{
- map(0xffec00, 0xfffbff).ram();
-#if 0
+ map(0xffe100, 0xfffbff).ram();
map(0xfffe80, 0xfffe80).rw(m_timer16_3, FUNC(h8_timer16_channel_device::tcr_r), FUNC(h8_timer16_channel_device::tcr_w));
map(0xfffe81, 0xfffe81).rw(m_timer16_3, FUNC(h8_timer16_channel_device::tmdr_r), FUNC(h8_timer16_channel_device::tmdr_w));
map(0xfffe82, 0xfffe83).rw(m_timer16_3, FUNC(h8_timer16_channel_device::tior_r), FUNC(h8_timer16_channel_device::tior_w));
@@ -163,9 +160,9 @@ void swx00_device::map(address_map &map)
map(0xffff8c, 0xffff8c).rw(m_sci[2], FUNC(h8_sci_device::ssr_r), FUNC(h8_sci_device::ssr_w));
map(0xffff8d, 0xffff8d).r(m_sci[2], FUNC(h8_sci_device::rdr_r));
map(0xffff8e, 0xffff8e).rw(m_sci[2], FUNC(h8_sci_device::scmr_r), FUNC(h8_sci_device::scmr_w));
- map(0xffff90, 0xffff9f).r(m_adc, FUNC(h8_adc_device::addr16_r));
- map(0xffffa0, 0xffffa0).rw(m_adc, FUNC(h8_adc_device::adcsr_r), FUNC(h8_adc_device::adcsr_w));
- map(0xffffa1, 0xffffa1).rw(m_adc, FUNC(h8_adc_device::adcr_r), FUNC(h8_adc_device::adcr_w));
+ map(0xffff90, 0xffff97).r(m_adc, FUNC(h8_adc_device::addr8_r));
+ map(0xffff98, 0xffff98).rw(m_adc, FUNC(h8_adc_device::adcsr_r), FUNC(h8_adc_device::adcsr_w));
+ map(0xffff99, 0xffff99).rw(m_adc, FUNC(h8_adc_device::adcr_r), FUNC(h8_adc_device::adcr_w));
map(0xffffb0, 0xffffb0).rw(m_timer8_0, FUNC(h8_timer8_channel_device::tcr_r), FUNC(h8_timer8_channel_device::tcr_w));
map(0xffffb1, 0xffffb1).rw(m_timer8_1, FUNC(h8_timer8_channel_device::tcr_r), FUNC(h8_timer8_channel_device::tcr_w));
map(0xffffb2, 0xffffb2).rw(m_timer8_0, FUNC(h8_timer8_channel_device::tcsr_r), FUNC(h8_timer8_channel_device::tcsr_w));
@@ -199,14 +196,12 @@ void swx00_device::map(address_map &map)
map(0xfffff5, 0xfffff5).rw(m_timer16_2, FUNC(h8_timer16_channel_device::tsr_r), FUNC(h8_timer16_channel_device::tsr_w));
map(0xfffff6, 0xfffff7).rw(m_timer16_2, FUNC(h8_timer16_channel_device::tcnt_r), FUNC(h8_timer16_channel_device::tcnt_w));
map(0xfffff8, 0xfffffb).rw(m_timer16_2, FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w));
-#endif
}
void swx00_device::device_add_mconfig(machine_config &config)
{
H8S_INTC(config, m_intc, *this);
-#if 0
- H8_ADC_2655(config, m_adc, *this, m_intc, 28);
+ H8_ADC_2357(config, m_adc, *this, m_intc, 28);
H8S_DMA(config, m_dma, *this);
H8S_DMA_CHANNEL(config, m_dma0, *this, m_dma, m_intc);
H8S_DMA_CHANNEL(config, m_dma1, *this, m_dma, m_intc);
@@ -282,7 +277,6 @@ void swx00_device::device_add_mconfig(machine_config &config)
h8_timer16_channel_device::INPUT_D);
H8_SCI(config, m_sci[2], 2, *this, m_intc, 88, 89, 90, 91);
H8_WATCHDOG(config, m_watchdog, *this, m_intc, 25, h8_watchdog_device::S);
-#endif
H8_SCI(config, m_sci[0], 0, *this, m_intc, 80, 81, 82, 83);
H8_SCI(config, m_sci[1], 1, *this, m_intc, 84, 85, 86, 87);
}
@@ -393,7 +387,6 @@ void swx00_device::interrupt_taken()
void swx00_device::internal_update(u64 current_time)
{
u64 event_time = 0;
-#if 0
add_event(event_time, m_adc->internal_update(current_time));
add_event(event_time, m_sci[0]->internal_update(current_time));
add_event(event_time, m_sci[1]->internal_update(current_time));
@@ -407,14 +400,12 @@ void swx00_device::internal_update(u64 current_time)
add_event(event_time, m_timer16_4->internal_update(current_time));
add_event(event_time, m_timer16_5->internal_update(current_time));
add_event(event_time, m_watchdog->internal_update(current_time));
-#endif
recompute_bcount(event_time);
}
void swx00_device::notify_standby(int state)
{
-#if 0
m_adc->notify_standby(state);
m_sci[0]->notify_standby(state);
m_sci[1]->notify_standby(state);
@@ -428,7 +419,6 @@ void swx00_device::notify_standby(int state)
m_timer16_4->notify_standby(state);
m_timer16_5->notify_standby(state);
m_watchdog->notify_standby(state);
-#endif
}
void swx00_device::device_start()
diff --git a/src/devices/cpu/h8/swx00.h b/src/devices/cpu/h8/swx00.h
index 7b15a5cc6f1..3fb2426cc92 100644
--- a/src/devices/cpu/h8/swx00.h
+++ b/src/devices/cpu/h8/swx00.h
@@ -50,7 +50,6 @@ public:
int s_bus_id() const { return m_mode & MODE_DUAL ? AS_DATA : AS_PROGRAM; }
int c_bus_id() const { return m_mode & MODE_DUAL ? AS_PROGRAM : AS_DATA; }
-#if 0
auto read_port1() { return m_read_port [PORT_1].bind(); }
auto write_port1() { return m_write_port[PORT_1].bind(); }
auto read_port2() { return m_read_port [PORT_2].bind(); }
@@ -76,14 +75,12 @@ public:
auto write_portf() { return m_write_port[PORT_F].bind(); }
auto read_portg() { return m_read_port [PORT_G].bind(); }
auto write_portg() { return m_write_port[PORT_G].bind(); }
-#endif
u8 syscr_r();
void syscr_w(u8 data);
protected:
required_device<h8s_intc_device> m_intc;
-#if 0
required_device<h8_adc_device> m_adc;
required_device<h8s_dma_device> m_dma;
required_device<h8s_dma_channel_device> m_dma0;
@@ -111,7 +108,6 @@ protected:
required_device<h8s_timer16_channel_device> m_timer16_4;
required_device<h8s_timer16_channel_device> m_timer16_5;
required_device<h8_watchdog_device> m_watchdog;
-#endif
address_space_config m_data_config;
diff --git a/src/devices/cpu/sh/sh_port.cpp b/src/devices/cpu/sh/sh_port.cpp
index 8bc962f65cd..ddd93a1a4e2 100644
--- a/src/devices/cpu/sh/sh_port.cpp
+++ b/src/devices/cpu/sh/sh_port.cpp
@@ -81,7 +81,7 @@ void sh_port32_device::device_reset()
u32 sh_port32_device::dr_r()
{
- if(~m_io & ~m_mask)
+ if((~m_io) & (~m_mask))
return (m_dr & m_io) | (m_cpu->do_read_port32(m_index) & ~m_io);
return m_dr;
}
diff --git a/src/mame/yamaha/ymmu15.cpp b/src/mame/yamaha/ymmu15.cpp
index 89ea335cd72..03e7a912931 100644
--- a/src/mame/yamaha/ymmu15.cpp
+++ b/src/mame/yamaha/ymmu15.cpp
@@ -36,7 +36,8 @@ public:
, m_maincpu(*this, "maincpu")
// , m_nvram(*this, "ram")
, m_lcd(*this, "lcd")
- , m_ram(*this, "ram")
+ , m_ram1(*this, "ram1")
+ , m_ram2(*this, "ram2")
{ }
void mu15(machine_config &config);
@@ -46,7 +47,8 @@ private:
// required_device<nvram_device> m_nvram;
// required_device<swp00_device> m_swp00;
required_device<mu5lcd_device> m_lcd;
- required_shared_ptr<u16> m_ram;
+ required_shared_ptr<u16> m_ram1;
+ required_shared_ptr<u16> m_ram2;
void c_map(address_map &map);
void s_map(address_map &map);
@@ -66,7 +68,8 @@ void mu15_state::machine_reset()
void mu15_state::s_map(address_map &map)
{
map(0x000000, 0x3fffff).rom().region("swx00", 0);
- map(0x400000, 0x40ffff).ram().share(m_ram);
+ map(0x400000, 0x40ffff).ram().share(m_ram1);
+ map(0xc00000, 0xc03fff).ram().share(m_ram2);
// map(0x400000, 0x4007ff).m(m_swp00, FUNC(swp00_device::map));
}
diff --git a/src/mame/yamaha/ympsr340.cpp b/src/mame/yamaha/ympsr340.cpp
index a4bf7192845..76767517380 100644
--- a/src/mame/yamaha/ympsr340.cpp
+++ b/src/mame/yamaha/ympsr340.cpp
@@ -275,6 +275,7 @@ void psr340_state::psr340(machine_config &config)
SWX00(config, m_maincpu, 8.4672_MHz_XTAL*2, 1);
m_maincpu->set_addrmap(m_maincpu->c_bus_id(), &psr340_state::c_map);
m_maincpu->set_addrmap(m_maincpu->s_bus_id(), &psr340_state::s_map);
+ m_maincpu->read_adc<0>().set_constant(0x3ff); // Battery level
// SCI0 is externally clocked at the 31250 Hz MIDI rate by the mks3
m_maincpu->sci_set_external_clock_period(0, attotime::from_hz(31250 * 16));
@@ -303,10 +304,6 @@ ROM_START( psr340 )
ROM_REGION(0x200000, "maincpu", 0)
ROM_LOAD16_WORD_SWAP("xv89710.bin", 0x000000, 0x200000, CRC(271ccb8a) SHA1(ec6abbdb82a5e851b77338c79ecabfd8040f023d))
- // patch out battery check for now (SWX00B customized H8S reads ADC *value* at FFFF90)
- ROM_FILL(0x20e6, 1, 0x54)
- ROM_FILL(0x20e7, 1, 0x70)
-
ROM_REGION16_BE(0x200000, "wave", 0)
ROM_LOAD("xv89810.bin", 0x000000, 0x200000, CRC(10e68363) SHA1(5edee814bf07c49088da44474fdd5c817e7c5af0))