summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers
diff options
context:
space:
mode:
author MooglyGuy <therealmogminer@gmail.com>2020-02-26 23:44:30 +0100
committer mooglyguy <therealmogminer@gmail.com>2020-02-26 23:45:29 +0100
commit13b6ea2ac19c0a204344e731772c6fb669cdb5ac (patch)
tree1c4bd7e47a2585d4d525eea6bc18561c7eb8b1d1 /src/mame/drivers
parent15205cf4a5060e5640c886f8f25d02cc2f8cf69c (diff)
-pxa255: Converted to logmacro, added more GPIO callbacks, removed unnecessary prefixes. [Ryan Holtz]
-zaurus: Split into per-SoC-type machine configs, enabled RTC hack, and adjusted to correct clocks. [Ryan Holtz]
Diffstat (limited to 'src/mame/drivers')
-rw-r--r--src/mame/drivers/39in1.cpp39
-rw-r--r--src/mame/drivers/zaurus.cpp137
2 files changed, 80 insertions, 96 deletions
diff --git a/src/mame/drivers/39in1.cpp b/src/mame/drivers/39in1.cpp
index f2d7386883e..75f9c3fef84 100644
--- a/src/mame/drivers/39in1.cpp
+++ b/src/mame/drivers/39in1.cpp
@@ -88,24 +88,14 @@ READ32_MEMBER(_39in1_state::eeprom_r)
return (m_eeprom->do_read() << 5) | (1 << 1); // Must be on. Probably a DIP switch.
}
-WRITE32_MEMBER(_39in1_state::eeprom_set_w)
+WRITE32_MEMBER(_39in1_state::eeprom_w)
{
- if (BIT(data, 2))
+ if (BIT(mem_mask, 2))
m_eeprom->cs_write(ASSERT_LINE);
- if (BIT(data, 3))
- m_eeprom->clk_write(ASSERT_LINE);
- if (BIT(data, 4))
- m_eeprom->di_write(1);
-}
-
-WRITE32_MEMBER(_39in1_state::eeprom_clear_w)
-{
- if (BIT(data, 2))
- m_eeprom->cs_write(ASSERT_LINE);
- if (BIT(data, 3))
- m_eeprom->clk_write(CLEAR_LINE);
- if (BIT(data, 4))
- m_eeprom->di_write(0);
+ if (BIT(mem_mask, 3))
+ m_eeprom->clk_write(BIT(data, 3) ? ASSERT_LINE : CLEAR_LINE);
+ if (BIT(mem_mask, 4))
+ m_eeprom->di_write(BIT(data, 4));
}
READ32_MEMBER(_39in1_state::cpld_r)
@@ -206,12 +196,12 @@ void _39in1_state::_39in1_map(address_map &map)
map(0x00000000, 0x0007ffff).rom();
map(0x00400000, 0x005fffff).rom().region("data", 0);
map(0x04000000, 0x047fffff).rw(FUNC(_39in1_state::cpld_r), FUNC(_39in1_state::cpld_w));
- map(0x40000000, 0x400002ff).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::pxa255_dma_r), FUNC(pxa255_periphs_device::pxa255_dma_w));
- map(0x40400000, 0x40400083).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::pxa255_i2s_r), FUNC(pxa255_periphs_device::pxa255_i2s_w));
- map(0x40a00000, 0x40a0001f).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::pxa255_ostimer_r), FUNC(pxa255_periphs_device::pxa255_ostimer_w));
- map(0x40d00000, 0x40d00017).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::pxa255_intc_r), FUNC(pxa255_periphs_device::pxa255_intc_w));
- map(0x40e00000, 0x40e0006b).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::pxa255_gpio_r), FUNC(pxa255_periphs_device::pxa255_gpio_w));
- map(0x44000000, 0x4400021f).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::pxa255_lcd_r), FUNC(pxa255_periphs_device::pxa255_lcd_w));
+ map(0x40000000, 0x400002ff).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::dma_r), FUNC(pxa255_periphs_device::dma_w));
+ map(0x40400000, 0x40400083).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::i2s_r), FUNC(pxa255_periphs_device::i2s_w));
+ map(0x40a00000, 0x40a0001f).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::ostimer_r), FUNC(pxa255_periphs_device::ostimer_w));
+ map(0x40d00000, 0x40d00017).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::intc_r), FUNC(pxa255_periphs_device::intc_w));
+ map(0x40e00000, 0x40e0006b).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::gpio_r), FUNC(pxa255_periphs_device::gpio_w));
+ map(0x44000000, 0x4400021f).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::lcd_r), FUNC(pxa255_periphs_device::lcd_w));
map(0xa0000000, 0xa07fffff).ram().share("ram");
}
@@ -281,9 +271,8 @@ void _39in1_state::_39in1(machine_config &config)
EEPROM_93C66_16BIT(config, "eeprom");
PXA255_PERIPHERALS(config, m_pxa_periphs, 200000000, m_maincpu);
- m_pxa_periphs->gpio0_set_cb().set(FUNC(_39in1_state::eeprom_set_w));
- m_pxa_periphs->gpio0_clear_cb().set(FUNC(_39in1_state::eeprom_clear_w));
- m_pxa_periphs->gpio0_in_cb().set(FUNC(_39in1_state::eeprom_r));
+ m_pxa_periphs->gpio0_write().set(FUNC(_39in1_state::eeprom_w));
+ m_pxa_periphs->gpio0_read().set(FUNC(_39in1_state::eeprom_r));
}
void _39in1_state::_60in1(machine_config &config)
diff --git a/src/mame/drivers/zaurus.cpp b/src/mame/drivers/zaurus.cpp
index 7e3d7416e22..5ce16d231e9 100644
--- a/src/mame/drivers/zaurus.cpp
+++ b/src/mame/drivers/zaurus.cpp
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Angelo Salese
+// copyright-holders:Angelo Salese, Ryan Holtz
/****************************************************************************************************************************************
Sharp Zaurus PDA skeleton driver (SL, ARM/Linux based, 4th generation)
@@ -7,9 +7,9 @@
TODO:
- PXA-255 ID opcode fails on this
- ARM TLB look-up errors?
- - RTC irq doesn't fire?
+ - RTC IRQ doesn't fire?
- For whatever reason, after RTC check ARM executes invalid code at 0-0x200
- - Dumps are questionable to say the least
+ - Dumps are questionable
=========================================================================================================================================
Sharp Zaurus
@@ -1413,7 +1413,10 @@ Note:
#include "speaker.h"
-#define MAIN_CLOCK XTAL(8'000'000)
+#define SA1110_CLOCK 206000000
+#define PXA250_CLOCK 400000000
+#define PXA255_CLOCK 400000000
+#define PXA270_CLOCK 416000000
class zaurus_state : public driver_device
{
@@ -1425,74 +1428,59 @@ public:
, m_ram(*this, "ram")
{ }
- void zaurus(machine_config &config);
+ void zaurus_base(machine_config &config);
+ void zaurus_sa1110(machine_config &config);
+ void zaurus_pxa250(machine_config &config);
+ void zaurus_pxa255(machine_config &config);
+ void zaurus_pxa270(machine_config &config);
private:
+ // driver_device overrides
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
+ void zaurus_map(address_map &map);
+
// devices
required_device<pxa255_periphs_device> m_pxa_periphs;
required_device<cpu_device> m_maincpu;
required_shared_ptr<uint32_t> m_ram;
uint8_t m_rtc_tick;
- DECLARE_READ32_MEMBER(pxa255_rtc_r);
- DECLARE_WRITE32_MEMBER(pxa255_rtc_w);
+ DECLARE_READ32_MEMBER(rtc_r);
+ DECLARE_WRITE32_MEMBER(rtc_w);
TIMER_DEVICE_CALLBACK_MEMBER(rtc_irq_callback);
-
- // screen updates
- uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
-
- void zaurus_map(address_map &map);
-
- // driver_device overrides
- virtual void machine_start() override;
- virtual void machine_reset() override;
-
- virtual void video_start() override;
};
-void zaurus_state::video_start()
-{
-}
-
-uint32_t zaurus_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )
-{
- return 0;
-}
-
-
-READ32_MEMBER(zaurus_state::pxa255_rtc_r)
+READ32_MEMBER(zaurus_state::rtc_r)
{
- printf("%08x\n",offset << 2);
+ osd_printf_debug("%08x\n", offset << 2);
return 0;
}
-WRITE32_MEMBER(zaurus_state::pxa255_rtc_w)
+WRITE32_MEMBER(zaurus_state::rtc_w)
{
- printf("%08x %08x\n",offset << 2,data);
-
+ osd_printf_debug("%08x %08x\n", offset << 2, data);
}
void zaurus_state::zaurus_map(address_map &map)
{
map(0x00000000, 0x001fffff).ram().region("firmware", 0);
- map(0x40900000, 0x4090000f).rw(FUNC(zaurus_state::pxa255_rtc_r), FUNC(zaurus_state::pxa255_rtc_w));
- map(0x40000000, 0x400002ff).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::pxa255_dma_r), FUNC(pxa255_periphs_device::pxa255_dma_w));
- map(0x40400000, 0x40400083).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::pxa255_i2s_r), FUNC(pxa255_periphs_device::pxa255_i2s_w));
- map(0x40a00000, 0x40a0001f).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::pxa255_ostimer_r), FUNC(pxa255_periphs_device::pxa255_ostimer_w));
- map(0x40d00000, 0x40d00017).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::pxa255_intc_r), FUNC(pxa255_periphs_device::pxa255_intc_w));
- map(0x40e00000, 0x40e0006b).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::pxa255_gpio_r), FUNC(pxa255_periphs_device::pxa255_gpio_w));
- map(0x44000000, 0x4400021f).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::pxa255_lcd_r), FUNC(pxa255_periphs_device::pxa255_lcd_w));
+ map(0x40900000, 0x4090000f).rw(FUNC(zaurus_state::rtc_r), FUNC(zaurus_state::rtc_w));
+ map(0x40000000, 0x400002ff).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::dma_r), FUNC(pxa255_periphs_device::dma_w));
+ map(0x40400000, 0x40400083).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::i2s_r), FUNC(pxa255_periphs_device::i2s_w));
+ map(0x40a00000, 0x40a0001f).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::ostimer_r), FUNC(pxa255_periphs_device::ostimer_w));
+ map(0x40d00000, 0x40d00017).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::intc_r), FUNC(pxa255_periphs_device::intc_w));
+ map(0x40e00000, 0x40e0006b).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::gpio_r), FUNC(pxa255_periphs_device::gpio_w));
+ map(0x44000000, 0x4400021f).rw(m_pxa_periphs, FUNC(pxa255_periphs_device::lcd_r), FUNC(pxa255_periphs_device::lcd_w));
map(0xa0000000, 0xa07fffff).ram().share("ram");
}
-
static INPUT_PORTS_START( zaurus )
INPUT_PORTS_END
-
-
void zaurus_state::machine_start()
{
}
@@ -1505,45 +1493,52 @@ void zaurus_state::machine_reset()
/* TODO: Hack */
TIMER_DEVICE_CALLBACK_MEMBER(zaurus_state::rtc_irq_callback)
{
-#if 0
+#if 1
m_rtc_tick++;
- m_rtc_tick&=1;
+ m_rtc_tick &= 1;
if(m_rtc_tick & 1)
- pxa255_set_irq_line(PXA255_INT_RTC_HZ,1);
+ m_pxa_periphs->set_irq_line(PXA255_INT_RTC_HZ, 1);
else
- pxa255_set_irq_line(PXA255_INT_RTC_HZ,0);
+ m_pxa_periphs->set_irq_line(PXA255_INT_RTC_HZ, 0);
#else
(void)m_rtc_tick;
#endif
}
-// TODO: main CPU differs greatly between versions!
-void zaurus_state::zaurus(machine_config &config)
+void zaurus_state::zaurus_base(machine_config &config)
{
- /* basic machine hardware */
- PXA255(config, m_maincpu, MAIN_CLOCK);
m_maincpu->set_addrmap(AS_PROGRAM, &zaurus_state::zaurus_map);
-
TIMER(config, "rtc_timer").configure_periodic(FUNC(zaurus_state::rtc_irq_callback), attotime::from_hz(XTAL(32'768)));
+}
- /* video hardware */
- screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
- screen.set_refresh_hz(60);
- screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500));
- screen.set_screen_update(FUNC(zaurus_state::screen_update));
- screen.set_size(32*8, 32*8);
- screen.set_visarea(0*8, 32*8-1, 0*8, 32*8-1);
-
- PALETTE(config, "palette").set_entries(8);
+void zaurus_state::zaurus_sa1110(machine_config &config)
+{
+ SA1110(config, m_maincpu, SA1110_CLOCK);
+ PXA255_PERIPHERALS(config, m_pxa_periphs, SA1110_CLOCK, m_maincpu); // TODO: Correct peripherals
+ zaurus_base(config);
+}
- /* sound hardware */
- SPEAKER(config, "mono").front_center();
-// AY8910(config, "aysnd", MAIN_CLOCK/4).add_route(ALL_OUTPUTS, "mono", 0.30);
+void zaurus_state::zaurus_pxa250(machine_config &config)
+{
+ PXA255(config, m_maincpu, PXA250_CLOCK); // TODO: Correct CPU type
+ PXA255_PERIPHERALS(config, m_pxa_periphs, PXA250_CLOCK, m_maincpu); // TODO: Correct peripherals
+ zaurus_base(config);
+}
- PXA255_PERIPHERALS(config, m_pxa_periphs, MAIN_CLOCK, m_maincpu);
+void zaurus_state::zaurus_pxa255(machine_config &config)
+{
+ PXA255(config, m_maincpu, PXA255_CLOCK);
+ PXA255_PERIPHERALS(config, m_pxa_periphs, PXA255_CLOCK, m_maincpu);
+ zaurus_base(config);
}
+void zaurus_state::zaurus_pxa270(machine_config &config)
+{
+ PXA255(config, m_maincpu, PXA270_CLOCK); // TODO: Correct CPU type
+ PXA255_PERIPHERALS(config, m_pxa_periphs, PXA270_CLOCK, m_maincpu); // TODO: Correct peripherals
+ zaurus_base(config);
+}
/***************************************************************************
@@ -1582,9 +1577,9 @@ ROM_START( zslc1000 )
ROM_LOAD( "openzaurus 3.5.3 - zimage-sharp sl-c1000-20050427214434.bin", 0x000000, 0x128980, BAD_DUMP CRC(1e1a9279) SHA1(909ac3f00385eced55822d6a155b79d9d25f43b3) )
ROM_END
-COMP( 2002, zsl5500, 0, 0, zaurus, zaurus, zaurus_state, empty_init, "Sharp", "Zaurus SL-5500 \"Collie\"", MACHINE_IS_SKELETON )
-COMP( 2002, zsl5600, 0, 0, zaurus, zaurus, zaurus_state, empty_init, "Sharp", "Zaurus SL-5600 / SL-B500 \"Poodle\"", MACHINE_IS_SKELETON )
-COMP( 2003, zslc750, 0, 0, zaurus, zaurus, zaurus_state, empty_init, "Sharp", "Zaurus SL-C750 \"Shepherd\" (Japan)", MACHINE_IS_SKELETON )
-COMP( 2004, zslc760, 0, 0, zaurus, zaurus, zaurus_state, empty_init, "Sharp", "Zaurus SL-C760 \"Husky\" (Japan)", MACHINE_IS_SKELETON )
-COMP( 200?, zslc3000, 0, 0, zaurus, zaurus, zaurus_state, empty_init, "Sharp", "Zaurus SL-C3000 \"Spitz\" (Japan)", MACHINE_IS_SKELETON )
-COMP( 200?, zslc1000, 0, 0, zaurus, zaurus, zaurus_state, empty_init, "Sharp", "Zaurus SL-C3000 \"Akita\" (Japan)", MACHINE_IS_SKELETON )
+COMP( 2002, zsl5500, 0, 0, zaurus_sa1110, zaurus, zaurus_state, empty_init, "Sharp", "Zaurus SL-5500 \"Collie\"", MACHINE_IS_SKELETON )
+COMP( 2002, zsl5600, 0, 0, zaurus_pxa250, zaurus, zaurus_state, empty_init, "Sharp", "Zaurus SL-5600 / SL-B500 \"Poodle\"", MACHINE_IS_SKELETON )
+COMP( 2003, zslc750, 0, 0, zaurus_pxa255, zaurus, zaurus_state, empty_init, "Sharp", "Zaurus SL-C750 \"Shepherd\" (Japan)", MACHINE_IS_SKELETON )
+COMP( 2004, zslc760, 0, 0, zaurus_pxa255, zaurus, zaurus_state, empty_init, "Sharp", "Zaurus SL-C760 \"Husky\" (Japan)", MACHINE_IS_SKELETON )
+COMP( 200?, zslc3000, 0, 0, zaurus_pxa270, zaurus, zaurus_state, empty_init, "Sharp", "Zaurus SL-C3000 \"Spitz\" (Japan)", MACHINE_IS_SKELETON )
+COMP( 200?, zslc1000, 0, 0, zaurus_pxa270, zaurus, zaurus_state, empty_init, "Sharp", "Zaurus SL-C3000 \"Akita\" (Japan)", MACHINE_IS_SKELETON )