mirror of
https://github.com/holub/mame
synced 2025-04-25 17:56:43 +03:00
apple/macquadra700.cpp,apple/macquadra800.cpp: Finish hooking up built-in SONIC ethernet. [R. Belmont]
This commit is contained in:
parent
b79c06713c
commit
37fbd9091a
@ -96,6 +96,7 @@ private:
|
||||
|
||||
u32 *m_ram_ptr = nullptr, *m_rom_ptr = nullptr;
|
||||
u32 m_ram_mask = 0, m_ram_size = 0, m_rom_size = 0;
|
||||
u8 m_mac[6];
|
||||
|
||||
emu_timer *m_6015_timer = nullptr;
|
||||
|
||||
@ -168,6 +169,8 @@ private:
|
||||
else
|
||||
m_swim->write((offset >> 8) & 0xf, data>>8);
|
||||
}
|
||||
|
||||
u8 ethernet_mac_r(offs_t offset);
|
||||
};
|
||||
|
||||
void macquadra_state::field_interrupts()
|
||||
@ -202,9 +205,21 @@ void macquadra_state::field_interrupts()
|
||||
|
||||
void macquadra_state::machine_start()
|
||||
{
|
||||
const u8 *MAC = (u8 *)m_sonic->get_mac();
|
||||
|
||||
m_dafb->set_turboscsi1_device(m_ncr1);
|
||||
m_dafb->set_turboscsi2_device(nullptr);
|
||||
|
||||
// MAC PROM is stored with a bit swizzle and must match one of 2
|
||||
// Apple-assigned OUI blocks 00:05:02 or 08:00:07
|
||||
m_mac[0] = bitswap<8>(0x00, 0, 1, 2, 3, 7, 6, 5, 4);
|
||||
m_mac[1] = bitswap<8>(0x05, 0, 1, 2, 3, 7, 6, 5, 4);
|
||||
m_mac[2] = bitswap<8>(0x02, 0, 1, 2, 3, 7, 6, 5, 4);
|
||||
m_mac[3] = bitswap<8>(MAC[3], 0, 1, 2, 3, 7, 6, 5, 4);
|
||||
m_mac[4] = bitswap<8>(MAC[4], 0, 1, 2, 3, 7, 6, 5, 4);
|
||||
m_mac[5] = bitswap<8>(MAC[5], 0, 1, 2, 3, 7, 6, 5, 4);
|
||||
m_sonic->set_mac(&m_mac[0]);
|
||||
|
||||
m_ram_ptr = (u32*)m_ram->pointer();
|
||||
m_ram_size = m_ram->size()>>1;
|
||||
m_ram_mask = m_ram_size - 1;
|
||||
@ -412,6 +427,27 @@ u32 macquadra_state::rom_switch_r(offs_t offset)
|
||||
return m_rom_ptr[offset & ((m_rom_size - 1)>>2)];
|
||||
}
|
||||
|
||||
u8 macquadra_state::ethernet_mac_r(offs_t offset)
|
||||
{
|
||||
if (offset < 6)
|
||||
{
|
||||
return m_mac[offset];
|
||||
}
|
||||
else if (offset == 7)
|
||||
{
|
||||
u8 xor_total = 0;
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
xor_total ^= (u8)m_mac[i];
|
||||
}
|
||||
|
||||
return xor_total ^ 0xff;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
TIMER_CALLBACK_MEMBER(macquadra_state::mac_6015_tick)
|
||||
{
|
||||
/* handle ADB keyboard/mouse */
|
||||
@ -427,7 +463,7 @@ void macquadra_state::quadra700_map(address_map &map)
|
||||
|
||||
map(0x50000000, 0x50001fff).rw(FUNC(macquadra_state::mac_via_r), FUNC(macquadra_state::mac_via_w)).mirror(0x00fc0000);
|
||||
map(0x50002000, 0x50003fff).rw(FUNC(macquadra_state::mac_via2_r), FUNC(macquadra_state::mac_via2_w)).mirror(0x00fc0000);
|
||||
// 50008000 = Ethernet MAC ID PROM
|
||||
map(0x50008000, 0x50008007).r(FUNC(macquadra_state::ethernet_mac_r)).mirror(0x00fc0000);
|
||||
map(0x5000a000, 0x5000b0ff).m(m_sonic, FUNC(dp83932c_device::map)).umask32(0x0000ffff).mirror(0x00fc0000);
|
||||
// 5000e000 = Orwell controls
|
||||
map(0x5000f000, 0x5000f0ff).rw(m_dafb, FUNC(dafb_device::turboscsi_r<0>), FUNC(dafb_device::turboscsi_w<0>)).mirror(0x00fc0000);
|
||||
@ -595,6 +631,7 @@ void macquadra_state::macqd700(machine_config &config)
|
||||
|
||||
DP83932C(config, m_sonic, 40_MHz_XTAL / 2); // clock is C20M on the schematics
|
||||
m_sonic->set_bus(m_maincpu, 0);
|
||||
m_sonic->out_int_cb().set(m_via2, FUNC(via6522_device::write_pa0)).invert(); // IRQ is active low
|
||||
|
||||
nubus_device &nubus(NUBUS(config, "nubus", 40_MHz_XTAL / 4));
|
||||
nubus.set_space(m_maincpu, AS_PROGRAM);
|
||||
|
@ -86,6 +86,8 @@ private:
|
||||
required_device<ncr53c96_device> m_ncr1;
|
||||
required_device<dp83932c_device> m_sonic;
|
||||
|
||||
u8 m_mac[6];
|
||||
|
||||
virtual void machine_start() override;
|
||||
virtual void machine_reset() override;
|
||||
|
||||
@ -96,11 +98,24 @@ private:
|
||||
return (result << 8) | result;
|
||||
}
|
||||
void mac_scc_2_w(offs_t offset, u16 data) { m_iosb->via_sync(); m_scc->dc_ab_w(offset, data >> 8); }
|
||||
|
||||
u8 ethernet_mac_r(offs_t offset);
|
||||
};
|
||||
|
||||
void quadra800_state::machine_start()
|
||||
{
|
||||
m_djmemc->set_ram_info((u32 *) m_ram->pointer(), m_ram->size());
|
||||
|
||||
const u8 *MAC = (u8 *)m_sonic->get_mac();
|
||||
// MAC PROM is stored with a bit swizzle and must match one of 2
|
||||
// Apple-assigned OUI blocks 00:05:02 or 08:00:07
|
||||
m_mac[0] = bitswap<8>(0x08, 0, 1, 2, 3, 7, 6, 5, 4);
|
||||
m_mac[1] = bitswap<8>(0x00, 0, 1, 2, 3, 7, 6, 5, 4);
|
||||
m_mac[2] = bitswap<8>(0x07, 0, 1, 2, 3, 7, 6, 5, 4);
|
||||
m_mac[3] = bitswap<8>(MAC[3], 0, 1, 2, 3, 7, 6, 5, 4);
|
||||
m_mac[4] = bitswap<8>(MAC[4], 0, 1, 2, 3, 7, 6, 5, 4);
|
||||
m_mac[5] = bitswap<8>(MAC[5], 0, 1, 2, 3, 7, 6, 5, 4);
|
||||
m_sonic->set_mac(&m_mac[0]);
|
||||
}
|
||||
|
||||
void quadra800_state::machine_reset()
|
||||
@ -111,6 +126,27 @@ void quadra800_state::init_macqd800()
|
||||
{
|
||||
}
|
||||
|
||||
u8 quadra800_state::ethernet_mac_r(offs_t offset)
|
||||
{
|
||||
if (offset < 6)
|
||||
{
|
||||
return m_mac[offset];
|
||||
}
|
||||
else if (offset == 7)
|
||||
{
|
||||
u8 xor_total = 0;
|
||||
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
xor_total ^= (u8)m_mac[i];
|
||||
}
|
||||
|
||||
return xor_total ^ 0xff;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
ADDRESS MAPS
|
||||
***************************************************************************/
|
||||
@ -119,7 +155,7 @@ void quadra800_state::quadra800_map(address_map &map)
|
||||
map(0x00000000, 0xffffffff).m(m_djmemc, FUNC(djmemc_device::map));
|
||||
map(0x50000000, 0x5fffffff).m(m_iosb, FUNC(iosb_device::map));
|
||||
|
||||
// 50008000 = Ethernet MAC ID PROM
|
||||
map(0x50008000, 0x50008007).r(FUNC(quadra800_state::ethernet_mac_r)).mirror(0x00fc0000);
|
||||
map(0x5000a000, 0x5000b0ff).m(m_sonic, FUNC(dp83932c_device::map)).umask32(0x0000ffff).mirror(0x00fc0000);
|
||||
map(0x5000c000, 0x5000dfff).rw(FUNC(quadra800_state::mac_scc_r), FUNC(quadra800_state::mac_scc_2_w)).mirror(0x00fc0000);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user