summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Dirk Best <mail@dirk-best.de>2018-11-21 11:08:30 +0100
committer Dirk Best <mail@dirk-best.de>2018-11-21 11:09:10 +0100
commit56f1d01eaaf0f517b686bbaecf8826a51e6ffe1a (patch)
treec4d53e9d901f0fc37164a4a5b6b2f01e01365162
parent05449c1ca3849571e825c1f158b266cdb8407737 (diff)
a2065: Fix DMA/memory accesses
-rw-r--r--src/devices/bus/amiga/zorro/a2065.cpp34
-rw-r--r--src/devices/bus/amiga/zorro/a2065.h6
2 files changed, 28 insertions, 12 deletions
diff --git a/src/devices/bus/amiga/zorro/a2065.cpp b/src/devices/bus/amiga/zorro/a2065.cpp
index 2c6ddca8e47..cfe687817c1 100644
--- a/src/devices/bus/amiga/zorro/a2065.cpp
+++ b/src/devices/bus/amiga/zorro/a2065.cpp
@@ -33,8 +33,8 @@ void a2065_device::device_add_mconfig(machine_config &config)
{
AM7990(config, m_lance);
m_lance->intr_out().set(FUNC(a2065_device::lance_irq_w));
- m_lance->dma_in().set(FUNC(a2065_device::ram_r));
- m_lance->dma_out().set(FUNC(a2065_device::ram_w));
+ m_lance->dma_in().set(FUNC(a2065_device::lance_ram_r));
+ m_lance->dma_out().set(FUNC(a2065_device::lance_ram_w));
}
@@ -97,8 +97,8 @@ void a2065_device::autoconfig_base_address(offs_t address)
// install access to onboard ram (32k)
m_slot->m_space->install_readwrite_handler(address + 0x8000, address + 0x8000 + 0x7fff,
- read16_delegate(FUNC(a2065_device::ram_r), this),
- write16_delegate(FUNC(a2065_device::ram_w), this), 0xffff);
+ read16_delegate(FUNC(a2065_device::host_ram_r), this),
+ write16_delegate(FUNC(a2065_device::host_ram_w), this), 0xffff);
// we're done
m_slot->cfgout_w(0);
@@ -117,7 +117,7 @@ WRITE_LINE_MEMBER( a2065_device::cfgin_w )
autoconfig_product(0x70);
autoconfig_manufacturer(0x0202);
- autoconfig_serial(0x00000000); // last 3 bytes = last 3 bytes of mac address
+ autoconfig_serial(0x00123456); // last 3 bytes = last 3 bytes of mac address
autoconfig_link_into_memory(false);
autoconfig_rom_vector_valid(false);
@@ -132,16 +132,30 @@ WRITE_LINE_MEMBER( a2065_device::cfgin_w )
}
}
-READ16_MEMBER( a2065_device::ram_r )
+READ16_MEMBER( a2065_device::host_ram_r )
{
- // logerror("read offset %04x\n", offset);
+ // logerror("host read offset %04x\n", offset);
return m_ram[offset & 0x3fff];
}
-WRITE16_MEMBER( a2065_device::ram_w )
+WRITE16_MEMBER( a2065_device::host_ram_w )
{
- // logerror("write %04x = %04x\n", offset, data);
- m_ram[offset & 0x3fff] = data;
+ // logerror("host write %04x = %04x\n", offset, data);
+ COMBINE_DATA(&m_ram[offset]);
+}
+
+READ16_MEMBER( a2065_device::lance_ram_r )
+{
+ offset = (offset >> 1) & 0x3fff;
+ // logerror("lance read offset %04x\n", offset);
+ return m_ram[offset];
+}
+
+WRITE16_MEMBER( a2065_device::lance_ram_w )
+{
+ offset = (offset >> 1) & 0x3fff;
+ // logerror("lance write %04x = %04x\n", offset, data);
+ COMBINE_DATA(&m_ram[offset]);
}
WRITE_LINE_MEMBER( a2065_device::lance_irq_w )
diff --git a/src/devices/bus/amiga/zorro/a2065.h b/src/devices/bus/amiga/zorro/a2065.h
index 6eb8c4599ed..bdc0db72475 100644
--- a/src/devices/bus/amiga/zorro/a2065.h
+++ b/src/devices/bus/amiga/zorro/a2065.h
@@ -30,9 +30,11 @@ public:
// construction/destruction
a2065_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- DECLARE_READ16_MEMBER( ram_r );
- DECLARE_WRITE16_MEMBER( ram_w );
+ DECLARE_READ16_MEMBER( host_ram_r );
+ DECLARE_WRITE16_MEMBER( host_ram_w );
+ DECLARE_READ16_MEMBER( lance_ram_r );
+ DECLARE_WRITE16_MEMBER( lance_ram_w );
DECLARE_WRITE_LINE_MEMBER( lance_irq_w );
protected: