dmac: Add support for Rev. 2

This commit is contained in:
Dirk Best 2025-02-16 17:41:49 +01:00
parent 00a4fdec5d
commit 31323a61a4
10 changed files with 102 additions and 83 deletions

View File

@ -386,10 +386,10 @@ Below is an incomplete list of Commodore part numbers:
</part>
</software>
<!-- 317612-01 Workbench 1.2 Rev. 33.56 A500 (Fr/Be) -->
<!-- 317612-01 Workbench 1.2 Rev. 33.56 A500 (Fr/Be) [label found] -->
<!-- 317613-01 Workbench 1.2 Rev. 33.56 A500 (It) -->
<!-- 317615-01 Workbench 1.2 Rev. 33.56 A500 (Se/Fi) [label found] -->
<!-- 317617-01 Workbench 1.2 Rev. 33.56 A500 (Dk) -->
<!-- 317617-01 Workbench 1.2 Rev. 33.56 A500 (Dk) [label found] -->
<!-- 317617-02 Workbench 1.2 A500 (Dk) Okt. 87 -->
<!-- 317619-01 A500 (probably No) -->
<!-- 317621-01 Workbench 1.2 Rev. 33.56 A500 (Ch) [label found] -->
@ -573,6 +573,7 @@ Below is an incomplete list of Commodore part numbers:
<year>1988</year>
<publisher>Commodore</publisher>
<part name="workbench" interface="floppy_3_5">
<!-- original label found -->
<feature name="part_id" value="Workbench 1.3 (Dk)" />
<dataarea name="flop" size="901120">
<rom name="317798-01_workbench.adf" size="901120" crc="6b3bc3b2" sha1="d48769a027c3a156bcc11f9a04fadb5301407552" />
@ -701,6 +702,8 @@ Below is an incomplete list of Commodore part numbers:
</part>
</software>
<!-- 317798-03 Workbench 1.3.2 (Dk) [label found] -->
<software name="wb132_a3000" cloneof="wb132">
<description>Workbench 1.3.2 Rev. 34.28 A3000 (US)</description>
<year>1990</year>
@ -841,6 +844,7 @@ Below is an incomplete list of Commodore part numbers:
<year>1990</year>
<publisher>Commodore</publisher>
<part name="workbench" interface="floppy_3_5">
<!-- original label found -->
<feature name="part_id" value="Workbench 1.3.3 (Dk)" />
<dataarea name="flop" size="901120">
<rom name="317798-04_workbench.adf" size="901120" crc="6395ec1f" sha1="8d8314faa3b5fbc472c11d5fc669358522c1d00b" status="baddump" />

View File

@ -2,7 +2,7 @@
// copyright-holders: Dirk Best
/***************************************************************************
Commodore A590
Commodore A570
DMAC based CD-ROM controller for the A500
@ -94,7 +94,7 @@ const tiny_rom_entry *a570_device::device_rom_region() const
void a570_device::device_add_mconfig(machine_config &config)
{
AMIGA_DMAC(config, m_dmac, 28.37516_MHz_XTAL / 4); // 7M
AMIGA_DMAC_REV2(config, m_dmac, 28.37516_MHz_XTAL / 4); // 7M
m_dmac->cfgout_cb().set([this] (int state) { m_host->cfgout_w(state); });
m_dmac->int_cb().set([this] (int state) { m_host->int2_w(state); });

View File

@ -38,7 +38,7 @@ protected:
private:
void map(address_map &map) ATTR_COLD;
required_device<amiga_dmac_device> m_dmac;
required_device<amiga_dmac_rev2_device> m_dmac;
required_ioport m_config;
std::unique_ptr<uint16_t[]> m_ram;

View File

@ -11,12 +11,13 @@
- Commodore supplied XT drives: Epson HMD-755 or WD WD93028-X-A
TODO:
- 20/40 MB jumper
- DIP switch order/polarity
- JP3/JP4 switches (not really needed)
- Bootrom disable
- SCSI drives (fatalerrors early if you enable a drive)
- The XT drive should be a slot option
- Data corruption when installing WB31 (DMAC issue?)
- Only DMAC Rev. 1: Data corruption when installing wb31
***************************************************************************/
@ -110,7 +111,9 @@ ROM_START( firmware )
ROMX_LOAD("390388-01.u12", 0x4001, 0x2000, CRC(4d1b9757) SHA1(43ff80f7c5770566012d87118552842bb01010f5), ROM_SKIP(1) | ROM_BIOS(0))
ROM_SYSTEM_BIOS(1, "v46", "Version 4.6")
// 390389-02 ©1989 CBM V4.6 0703
ROMX_LOAD("390389-02.u13", 0x0000, 0x2000, CRC(26013266) SHA1(60dedda8d406b2762ad1504a88a4d6e29c0fb10d), ROM_SKIP(1) | ROM_BIOS(1))
// 390388-02 ©1989 CBM V4.6 E7E4
ROMX_LOAD("390388-02.u12", 0x0001, 0x2000, CRC(6c9cb089) SHA1(bd8c6bb79ae91a4d1b9ee76fdd11aaf97ca4358b), ROM_SKIP(1) | ROM_BIOS(1))
ROMX_LOAD("390389-02.u13", 0x4000, 0x2000, CRC(26013266) SHA1(60dedda8d406b2762ad1504a88a4d6e29c0fb10d), ROM_SKIP(1) | ROM_BIOS(1))
ROMX_LOAD("390388-02.u12", 0x4001, 0x2000, CRC(6c9cb089) SHA1(bd8c6bb79ae91a4d1b9ee76fdd11aaf97ca4358b), ROM_SKIP(1) | ROM_BIOS(1))
@ -124,7 +127,9 @@ ROM_START( firmware )
ROMX_LOAD("390388-03.u12", 0x4001, 0x2000, CRC(b0b8cf24) SHA1(fcf4017505f4d441814b45d559c19eab43816b30), ROM_SKIP(1) | ROM_BIOS(2))
ROM_SYSTEM_BIOS(3, "v61", "Version 6.1")
// COPYRIGHT ©1990 CBM ALL RIGHTS RESERVED 390721-01 V6.1 F4B8
ROMX_LOAD("390721-01.u13", 0x0000, 0x2000, CRC(00dbf615) SHA1(503940d04fb3b49eaa61100fd3a487018b35e25a), ROM_SKIP(1) | ROM_BIOS(3))
// COPYRIGHT ©1990 CBM ALL RIGHTS RESERVED 390722-01 V6.1 088B
ROMX_LOAD("390722-01.u12", 0x0001, 0x2000, CRC(c460cfdb) SHA1(0de457daec3b84f75e8fb344defe24ce56cda3e0), ROM_SKIP(1) | ROM_BIOS(3))
ROMX_LOAD("390721-01.u13", 0x4000, 0x2000, CRC(00dbf615) SHA1(503940d04fb3b49eaa61100fd3a487018b35e25a), ROM_SKIP(1) | ROM_BIOS(3))
ROMX_LOAD("390722-01.u12", 0x4001, 0x2000, CRC(c460cfdb) SHA1(0de457daec3b84f75e8fb344defe24ce56cda3e0), ROM_SKIP(1) | ROM_BIOS(3))
@ -171,7 +176,7 @@ void a590_device::wd33c93_config(device_t *device)
void a590_device::device_add_mconfig(machine_config &config)
{
AMIGA_DMAC(config, m_dmac, 28.37516_MHz_XTAL / 4); // 7M
AMIGA_DMAC_REV2(config, m_dmac, 28.37516_MHz_XTAL / 4); // 7M
m_dmac->set_rom("bootrom");
m_dmac->cfgout_cb().set([this] (int state) { m_host->cfgout_w(state); });
m_dmac->int_cb().set([this] (int state) { m_host->int2_w(state); });

View File

@ -47,7 +47,7 @@ private:
uint8_t dip_r(offs_t offset);
required_device<input_merger_any_high_device> m_irq;
required_device<amiga_dmac_device> m_dmac;
required_device<amiga_dmac_rev2_device> m_dmac;
required_device<wd33c93a_device> m_wdc;
required_device<xt_hdc_device> m_xt;
required_ioport m_jp1;

View File

@ -122,11 +122,15 @@ ROM_START( firmware )
ROMX_LOAD("390721-02.u13", 0x4000, 0x2000, CRC(c0871d25) SHA1(e155f18abb90cf820589c15e70559d3b6b391af8), ROM_SKIP(1) | ROM_BIOS(2))
ROMX_LOAD("390722-02.u12", 0x4001, 0x2000, CRC(e536bbb2) SHA1(fd7f8a6da18c1b02d07eb990c2467a24183ede12), ROM_SKIP(1) | ROM_BIOS(2))
ROM_SYSTEM_BIOS(3, "v70", "Version 7.0") // also seen with -07
ROMX_LOAD("390721-04.u13", 0x0000, 0x2000, CRC(2942747a) SHA1(dbd7648e79c753337ff3e4f491de224bf05e6bb6), ROM_SKIP(1) | ROM_BIOS(3))
ROMX_LOAD("390722-04.u12", 0x0001, 0x2000, CRC(a9ccffed) SHA1(149f5bd52e2d29904e3de483b9ad772448e9278e), ROM_SKIP(1) | ROM_BIOS(3))
ROMX_LOAD("390721-04.u13", 0x4000, 0x2000, CRC(2942747a) SHA1(dbd7648e79c753337ff3e4f491de224bf05e6bb6), ROM_SKIP(1) | ROM_BIOS(3))
ROMX_LOAD("390722-04.u12", 0x4001, 0x2000, CRC(a9ccffed) SHA1(149f5bd52e2d29904e3de483b9ad772448e9278e), ROM_SKIP(1) | ROM_BIOS(3))
ROM_SYSTEM_BIOS(3, "v70", "Version 7.0")
// 360721-07 ©1994 CBM V7.0 081C U13
// A590 / A2091 390721-4 V7.0 ROM - (U13) ©1993 CAI (different pn - same content?)
ROMX_LOAD("390721-07.u13", 0x0000, 0x2000, CRC(2942747a) SHA1(dbd7648e79c753337ff3e4f491de224bf05e6bb6), ROM_SKIP(1) | ROM_BIOS(3))
// 390722-07 ©1994 CBM V7.0 3EF2 U12
// A590 / A2091 390722-4 V7.0 ROM - (U12) ©1993 CAI (different pn - same content?)
ROMX_LOAD("390722-07.u12", 0x0001, 0x2000, CRC(a9ccffed) SHA1(149f5bd52e2d29904e3de483b9ad772448e9278e), ROM_SKIP(1) | ROM_BIOS(3))
ROMX_LOAD("390721-07.u13", 0x4000, 0x2000, CRC(2942747a) SHA1(dbd7648e79c753337ff3e4f491de224bf05e6bb6), ROM_SKIP(1) | ROM_BIOS(3))
ROMX_LOAD("390722-07.u12", 0x4001, 0x2000, CRC(a9ccffed) SHA1(149f5bd52e2d29904e3de483b9ad772448e9278e), ROM_SKIP(1) | ROM_BIOS(3))
// third-party upgrade ROM, requires a small ROM adapter pcb
ROM_SYSTEM_BIOS(4, "g614", "Guru-ROM 6.14")
@ -156,7 +160,7 @@ void a2091_device::wd33c93_config(device_t *device)
void a2091_device::device_add_mconfig(machine_config &config)
{
AMIGA_DMAC(config, m_dmac, 28.37516_MHz_XTAL / 4); // 7M
AMIGA_DMAC_REV2(config, m_dmac, 28.37516_MHz_XTAL / 4); // 7M
m_dmac->set_rom("bootrom");
m_dmac->cfgout_cb().set([this] (int state) { m_zorro->cfgout_w(state); });
m_dmac->int_cb().set([this] (int state) { m_zorro->int2_w(state); });

View File

@ -46,7 +46,7 @@ private:
void xt_w(offs_t offset, uint8_t data);
required_device<input_merger_any_high_device> m_irq;
required_device<amiga_dmac_device> m_dmac;
required_device<amiga_dmac_rev2_device> m_dmac;
required_device<wd33c93a_device> m_wdc;
required_device<xt_hdc_device> m_xt;
required_ioport m_jp1;

View File

@ -35,10 +35,11 @@
// TYPE DEFINITIONS
//**************************************************************************
DEFINE_DEVICE_TYPE(AMIGA_DMAC, amiga_dmac_device, "amiga_dmac", "Amiga DMAC DMA Controller")
DEFINE_DEVICE_TYPE(AMIGA_DMAC_REV1, amiga_dmac_rev1_device, "amiga_dmac_rev1", "Amiga DMAC Rev. 1 DMA Controller")
DEFINE_DEVICE_TYPE(AMIGA_DMAC_REV2, amiga_dmac_rev2_device, "amiga_dmac_rev2", "Amiga DMAC Rev. 2 DMA Controller")
amiga_dmac_device::amiga_dmac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, AMIGA_DMAC, tag, owner, clock),
amiga_dmac_device::amiga_dmac_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, bool rev1) :
device_t(mconfig, type, tag, owner, clock),
amiga_autoconfig(),
m_cfgout_cb(*this),
m_int_cb(*this),
@ -56,6 +57,7 @@ amiga_dmac_device::amiga_dmac_device(const machine_config &mconfig, const char *
m_space(nullptr),
m_ram(nullptr),
m_ram_size(-1),
m_rev1(rev1),
m_cntr(0),
m_istr(0),
m_wtc(0),
@ -70,6 +72,16 @@ amiga_dmac_device::amiga_dmac_device(const machine_config &mconfig, const char *
{
}
amiga_dmac_rev1_device::amiga_dmac_rev1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
amiga_dmac_device(mconfig, AMIGA_DMAC_REV1, tag, owner, clock, true)
{
}
amiga_dmac_rev2_device::amiga_dmac_rev2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
amiga_dmac_device(mconfig, AMIGA_DMAC_REV2, tag, owner, clock, false)
{
}
//**************************************************************************
// ADDRESS MAPS
@ -80,8 +92,8 @@ void amiga_dmac_device::map(address_map &map)
map(0x0000, 0x003f).rw(FUNC(amiga_dmac_device::autoconfig_r), FUNC(amiga_dmac_device::autoconfig_w));
map(0x0040, 0x0041).r(FUNC(amiga_dmac_device::istr_r));
map(0x0042, 0x0043).rw(FUNC(amiga_dmac_device::cntr_r), FUNC(amiga_dmac_device::cntr_w));
map(0x0080, 0x0081).w(FUNC(amiga_dmac_device::wtc_hi_w));
map(0x0082, 0x0083).w(FUNC(amiga_dmac_device::wtc_lo_w));
map(0x0080, 0x0081).w(FUNC(amiga_dmac_device::wtc_hi_w)); // read?
map(0x0082, 0x0083).w(FUNC(amiga_dmac_device::wtc_lo_w)); // read?
map(0x0084, 0x0085).w(FUNC(amiga_dmac_device::acr_hi_w));
map(0x0086, 0x0087).w(FUNC(amiga_dmac_device::acr_lo_w));
map(0x008e, 0x008f).w(FUNC(amiga_dmac_device::dawr_w));
@ -180,7 +192,7 @@ TIMER_CALLBACK_MEMBER(amiga_dmac_device::update_dma)
m_acr++;
if (m_cntr & CNTR_TCEN)
if (m_rev1 && (m_cntr & CNTR_TCEN))
{
// we count words
if ((m_acr & 1) == 0)
@ -242,16 +254,22 @@ void amiga_dmac_device::wtc_hi_w(offs_t offset, uint16_t data, uint16_t mem_mask
{
LOGMASKED(LOG_REGS, "wtc_hi_w: %04x & %04x\n", data, mem_mask);
m_wtc &= (~(uint32_t) mem_mask) << 16 | 0x0000ffff;
m_wtc |= ((uint32_t) data & mem_mask) << 16;
if (m_rev1)
{
m_wtc &= (~(uint32_t) mem_mask) << 16 | 0x0000ffff;
m_wtc |= ((uint32_t) data & mem_mask) << 16;
}
}
void amiga_dmac_device::wtc_lo_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
LOGMASKED(LOG_REGS, "wtc_lo_w: %04x & %04x\n", data, mem_mask);
m_wtc &= 0xffff0000 & (~mem_mask);
m_wtc |= data & mem_mask;
if (m_rev1)
{
m_wtc &= 0xffff0000 & (~mem_mask);
m_wtc |= data & mem_mask;
}
}
void amiga_dmac_device::acr_hi_w(offs_t offset, uint16_t data, uint16_t mem_mask)
@ -267,7 +285,7 @@ void amiga_dmac_device::acr_lo_w(offs_t offset, uint16_t data, uint16_t mem_mask
LOGMASKED(LOG_REGS, "acr_lo_w: %04x & %04x\n", data, mem_mask);
m_acr &= 0xffff0000 & (~mem_mask);
m_acr |= (data & mem_mask) & 0xfffc; // 0xfffe for rev 2
m_acr |= (data & mem_mask) & (m_rev1 ? 0xfffc : 0xfffe);
}
void amiga_dmac_device::dawr_w(offs_t offset, uint16_t data, uint16_t mem_mask)
@ -283,64 +301,34 @@ void amiga_dmac_device::csx0_w(offs_t offset, uint8_t data) { m_csx0_write_cb(of
uint8_t amiga_dmac_device::csx1_r(offs_t offset) { return m_csx1_read_cb(offset); }
void amiga_dmac_device::csx1_w(offs_t offset, uint8_t data) { m_csx1_write_cb(offset, data); }
uint16_t amiga_dmac_device::st_dma_r(offs_t offset, uint16_t mem_mask)
void amiga_dmac_device::st_dma()
{
LOGMASKED(LOG_DMA, "st_dma_r\n");
start_dma();
return 0;
}
void amiga_dmac_device::st_dma_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
LOGMASKED(LOG_DMA, "st_dma_w\n");
LOGMASKED(LOG_DMA, "st_dma\n");
start_dma();
}
uint16_t amiga_dmac_device::sp_dma_r(offs_t offset, uint16_t mem_mask)
void amiga_dmac_device::sp_dma()
{
LOGMASKED(LOG_DMA, "sp_dma_r\n");
stop_dma();
return 0;
}
void amiga_dmac_device::sp_dma_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
LOGMASKED(LOG_REGS, "sp_dma_w\n");
LOGMASKED(LOG_DMA, "sp_dma\n");
stop_dma();
}
uint16_t amiga_dmac_device::cint_r(offs_t offset, uint16_t mem_mask)
void amiga_dmac_device::cint()
{
LOGMASKED(LOG_INT, "cint_r\n");
m_istr = 0;
update_interrupts();
return 0;
}
void amiga_dmac_device::cint_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
LOGMASKED(LOG_INT, "cint_w\n");
LOGMASKED(LOG_DMA, "cint\n");
m_istr = 0;
update_interrupts();
}
uint16_t amiga_dmac_device::flush_r(offs_t offset, uint16_t mem_mask)
void amiga_dmac_device::flush()
{
LOGMASKED(LOG_REGS, "flush_r\n");
LOGMASKED(LOG_DMA, "flush\n");
return 0;
}
void amiga_dmac_device::flush_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
LOGMASKED(LOG_REGS, "flush_w\n");
if (!m_rev1)
{
m_istr &= ~ISTR_FF_FLG;
m_istr |= ISTR_FE_FLG;
}
}
void amiga_dmac_device::ramsz_w(int state)
@ -486,7 +474,7 @@ void amiga_dmac_device::configin_w(int state)
autoconfig_multi_device(false);
autoconfig_8meg_preferred(false);
autoconfig_can_shutup(true);
autoconfig_product(2); // or 3 for rev 2
autoconfig_product(m_rev1 ? 2 : 3);
autoconfig_manufacturer(514);
autoconfig_serial(0x00000000);
}

View File

@ -19,8 +19,6 @@
class amiga_dmac_device : public device_t, public amiga_autoconfig
{
public:
amiga_dmac_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// callbacks
auto cfgout_cb() { return m_cfgout_cb.bind(); }
auto int_cb() { return m_int_cb.bind(); }
@ -48,6 +46,8 @@ public:
void xdreq_w(int state);
protected:
amiga_dmac_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, bool rev1);
virtual void device_start() override ATTR_COLD;
// amiga_autoconfig overrides
@ -81,14 +81,18 @@ private:
void csx1_w(offs_t offset, uint8_t data);
// strobe register
uint16_t st_dma_r(offs_t offset, uint16_t mem_mask);
void st_dma_w(offs_t offset, uint16_t data, uint16_t mem_mask);
uint16_t sp_dma_r(offs_t offset, uint16_t mem_mask);
void sp_dma_w(offs_t offset, uint16_t data, uint16_t mem_mask);
uint16_t cint_r(offs_t offset, uint16_t mem_mask);
void cint_w(offs_t offset, uint16_t data, uint16_t mem_mask);
uint16_t flush_r(offs_t offset, uint16_t mem_mask);
void flush_w(offs_t offset, uint16_t data, uint16_t mem_mask);
void st_dma();
uint16_t st_dma_r(offs_t offset, uint16_t mem_mask) { st_dma(); return 0; };
void st_dma_w(offs_t offset, uint16_t data, uint16_t mem_mask) { st_dma(); };
void sp_dma();
uint16_t sp_dma_r(offs_t offset, uint16_t mem_mask) { sp_dma(); return 0; };
void sp_dma_w(offs_t offset, uint16_t data, uint16_t mem_mask) { sp_dma(); };
void cint();
uint16_t cint_r(offs_t offset, uint16_t mem_mask) { cint(); return 0; };
void cint_w(offs_t offset, uint16_t data, uint16_t mem_mask) { cint(); };
void flush();
uint16_t flush_r(offs_t offset, uint16_t mem_mask) { flush(); return 0; };
void flush_w(offs_t offset, uint16_t data, uint16_t mem_mask) { flush(); };
// control register definitions
static constexpr uint16_t CNTR_TCEN = 0x80; // terminal count enable
@ -127,6 +131,7 @@ private:
address_space *m_space;
uint16_t *m_ram;
int m_ram_size;
bool m_rev1;
// internal registers
uint16_t m_cntr; // control register
@ -148,7 +153,20 @@ private:
offs_t m_ram_address;
};
class amiga_dmac_rev1_device : public amiga_dmac_device
{
public:
amiga_dmac_rev1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
class amiga_dmac_rev2_device : public amiga_dmac_device
{
public:
amiga_dmac_rev2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
};
// device type definition
DECLARE_DEVICE_TYPE(AMIGA_DMAC, amiga_dmac_device)
DECLARE_DEVICE_TYPE(AMIGA_DMAC_REV1, amiga_dmac_rev1_device)
DECLARE_DEVICE_TYPE(AMIGA_DMAC_REV2, amiga_dmac_rev2_device)
#endif // MAME_MACHINE_DMAC_H

View File

@ -377,7 +377,7 @@ protected:
private:
// devices
required_device<msm6242_device> m_rtc;
required_device<amiga_dmac_device> m_dmac;
required_device<amiga_dmac_rev1_device> m_dmac;
required_device<tpi6525_device> m_tpi;
required_device<cr511b_device> m_cdrom;
@ -1965,7 +1965,7 @@ void cdtv_state::cdtv(machine_config &config)
MSM6242(config, m_rtc, XTAL(32'768));
// cd-rom controller
AMIGA_DMAC(config, m_dmac, amiga_state::CLK_7M_PAL);
AMIGA_DMAC_REV1(config, m_dmac, amiga_state::CLK_7M_PAL);
m_dmac->css_read_cb().set(FUNC(cdtv_state::dmac_scsi_data_read));
m_dmac->css_write_cb().set(FUNC(cdtv_state::dmac_scsi_data_write));
m_dmac->csx0_read_cb().set(m_cdrom, FUNC(cr511b_device::read));