Previous 15994 Revisions Next

r13182 Sunday 6th November, 2011 at 20:35:59 UTC by R. Belmont
mac: Fixed name of Asante MC3NB card, added Apple NuBus Ethernet Card which the Asante is a perfect clone of, fixed 24-bit mirroring so ethernet cards work in all slots [R. Belmont]
[src/mess]mess_dev.lst
[src/mess/drivers]mac.c
[src/mess/machine]nubus_asntmc3b.c nubus_asntmc3b.h

src/mess/machine/nubus_asntmc3b.c
r13181r13182
11/***************************************************************************
22
3  Asante MC3B NuBus Ethernet card
3  Asante MC3NB NuBus Ethernet card (DP83902)
4  Apple NuBus Ethernet Card (DP8390)
45
5  Based on National Semiconductor DP83902 "ST-NIC"
6  Based on National Semiconductor DP8390 family chips
67
7  Fs*D0000 - 64k RAM buffer (used as DP83902 DMA target)
8  Fs*E0000 - DP83902 registers
8  FssD0000 - 64k RAM buffer (used as DP83902 DMA target)
9  FssE0000 - DP83902 registers
910
1011***************************************************************************/
1112
1213#include "emu.h"
1314#include "machine/nubus_asntmc3b.h"
1415
15#define ASNTMC3B_ROM_REGION  "asntm3b_rom"
16#define ASNTMC3B_DP83902  "dp83902"
16#define MAC8390_ROM_REGION  "asntm3b_rom"
17#define MAC8390_839X  "dp83902"
1718
1819static const dp8390_interface dp8390_interface =
1920{
20   DEVCB_LINE_MEMBER(nubus_asntm3b_device, dp_irq_w),
21   DEVCB_LINE_MEMBER(nubus_mac8390_device, dp_irq_w),
2122   DEVCB_NULL,
22   DEVCB_MEMBER(nubus_asntm3b_device, dp_mem_read),
23   DEVCB_MEMBER(nubus_asntm3b_device, dp_mem_write)
23   DEVCB_MEMBER(nubus_mac8390_device, dp_mem_read),
24   DEVCB_MEMBER(nubus_mac8390_device, dp_mem_write)
2425};
2526
2627MACHINE_CONFIG_FRAGMENT( asntm3b )
27   MCFG_DP8390D_ADD(ASNTMC3B_DP83902, dp8390_interface)
28   MCFG_DP8390D_ADD(MAC8390_839X, dp8390_interface)
2829MACHINE_CONFIG_END
2930
30ROM_START( asntm3b )
31   ROM_REGION(0x4000, ASNTMC3B_ROM_REGION, 0)
31ROM_START( asntm3nb )
32   ROM_REGION(0x4000, MAC8390_ROM_REGION, 0)
3233   ROM_LOAD( "asante_mc3b.bin", 0x000000, 0x004000, CRC(4f86d451) SHA1(d0a41df667e6b51fbc63f9251d593f4fc49104ba) )
3334ROM_END
3435
36ROM_START( appleenet )
37   ROM_REGION(0x4000, MAC8390_ROM_REGION, 0)
38    ROM_LOAD( "aenet1",       0x000000, 0x004000, CRC(e3ae8c26) SHA1(01ddc15ee84b17128203cb812f29bac6b20fd642) )
39ROM_END
40
3541//**************************************************************************
3642//  GLOBAL VARIABLES
3743//**************************************************************************
3844
39const device_type NUBUS_ASNTMC3B = &device_creator<nubus_asntm3b_device>;
45const device_type NUBUS_ASNTMC3NB = &device_creator<nubus_asntmc3nb_device>;
46const device_type NUBUS_APPLEENET = &device_creator<nubus_appleenet_device>;
4047
4148
4249//-------------------------------------------------
r13181r13182
4451//  machine configurations
4552//-------------------------------------------------
4653
47machine_config_constructor nubus_asntm3b_device::device_mconfig_additions() const
54machine_config_constructor nubus_mac8390_device::device_mconfig_additions() const
4855{
4956   return MACHINE_CONFIG_NAME( asntm3b );
5057}
r13181r13182
5360//  rom_region - device-specific ROM region
5461//-------------------------------------------------
5562
56const rom_entry *nubus_asntm3b_device::device_rom_region() const
63const rom_entry *nubus_mac8390_device::device_rom_region() const
5764{
58   return ROM_NAME( asntm3b );
65   return ROM_NAME( asntm3nb );
5966}
6067
68const rom_entry *nubus_appleenet_device::device_rom_region() const
69{
70   return ROM_NAME( appleenet );
71}
72
6173//**************************************************************************
6274//  LIVE DEVICE
6375//**************************************************************************
6476
6577//-------------------------------------------------
66//  nubus_asntm3b_device - constructor
78//  nubus_mac8390_device - constructor
6779//-------------------------------------------------
6880
69nubus_asntm3b_device::nubus_asntm3b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
70        device_t(mconfig, NUBUS_ASNTMC3B, "Asante MC3B Ethernet card", tag, owner, clock),
81nubus_mac8390_device::nubus_mac8390_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
82        device_t(mconfig, NUBUS_ASNTMC3NB, name, tag, owner, clock),
7183      device_nubus_card_interface(mconfig, *this),
72      m_dp83902(*this, ASNTMC3B_DP83902)
84      m_dp83902(*this, MAC8390_839X)
7385{
74   m_shortname = "nb_amc3b";
7586}
7687
77nubus_asntm3b_device::nubus_asntm3b_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) :
78        device_t(mconfig, type, name, tag, owner, clock),
79      device_nubus_card_interface(mconfig, *this),
80      m_dp83902(*this, ASNTMC3B_DP83902)
88nubus_asntmc3nb_device::nubus_asntmc3nb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
89        nubus_mac8390_device(mconfig, NUBUS_ASNTMC3NB, "Asante MC3NB Ethernet card", tag, owner, clock)
8190{
8291   m_shortname = "nb_amc3b";
8392}
8493
94nubus_appleenet_device::nubus_appleenet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
95        nubus_mac8390_device(mconfig, NUBUS_APPLEENET, "Apple NuBus Ethernet card", tag, owner, clock)
96{
97   m_shortname = "nb_aenet";
98}
99
85100//-------------------------------------------------
86101//  device_start - device-specific startup
87102//-------------------------------------------------
88103
89void nubus_asntm3b_device::device_start()
104void nubus_mac8390_device::device_start()
90105{
91106   UINT32 slotspace;
92107   char mac[7];
r13181r13182
99114
100115   // set_nubus_device makes m_slot valid
101116   set_nubus_device();
102   install_declaration_rom(this, ASNTMC3B_ROM_REGION, true);
117   install_declaration_rom(this, MAC8390_ROM_REGION, true);
103118
104119   slotspace = get_slotspace();
105120
106//  printf("[ASNTMC3B %p] slotspace = %x\n", this, slotspace);
121//  printf("[ASNTMC3NB %p] slotspace = %x\n", this, slotspace);
107122
108   m_nubus->install_device(slotspace+0xd0000, slotspace+0xdffff, read8_delegate(FUNC(nubus_asntm3b_device::asntm3b_ram_r), this), write8_delegate(FUNC(nubus_asntm3b_device::asntm3b_ram_w), this));
109   m_nubus->install_device(slotspace+0xbd0000, slotspace+0xbdffff, read8_delegate(FUNC(nubus_asntm3b_device::asntm3b_ram_r), this), write8_delegate(FUNC(nubus_asntm3b_device::asntm3b_ram_w), this));
110   m_nubus->install_device(slotspace+0xe0000, slotspace+0xe003f, read32_delegate(FUNC(nubus_asntm3b_device::en_r), this), write32_delegate(FUNC(nubus_asntm3b_device::en_w), this));
111   m_nubus->install_device(slotspace+0xbe0000, slotspace+0xbe003f, read32_delegate(FUNC(nubus_asntm3b_device::en_r), this), write32_delegate(FUNC(nubus_asntm3b_device::en_w), this));
123    // TODO: move 24-bit mirroring down into nubus.c
124    UINT32 ofs_24bit = m_slot<<20;
125   m_nubus->install_device(slotspace+0xd0000, slotspace+0xdffff, read8_delegate(FUNC(nubus_mac8390_device::asntm3b_ram_r), this), write8_delegate(FUNC(nubus_mac8390_device::asntm3b_ram_w), this));
126   m_nubus->install_device(slotspace+0xe0000, slotspace+0xe003f, read32_delegate(FUNC(nubus_mac8390_device::en_r), this), write32_delegate(FUNC(nubus_mac8390_device::en_w), this));
127   m_nubus->install_device(slotspace+0xd0000+ofs_24bit, slotspace+0xdffff+ofs_24bit, read8_delegate(FUNC(nubus_mac8390_device::asntm3b_ram_r), this), write8_delegate(FUNC(nubus_mac8390_device::asntm3b_ram_w), this));
128   m_nubus->install_device(slotspace+0xe0000+ofs_24bit, slotspace+0xe003f+ofs_24bit, read32_delegate(FUNC(nubus_mac8390_device::en_r), this), write32_delegate(FUNC(nubus_mac8390_device::en_w), this));
112129}
113130
114131//-------------------------------------------------
115132//  device_reset - device-specific reset
116133//-------------------------------------------------
117134
118void nubus_asntm3b_device::device_reset()
135void nubus_mac8390_device::device_reset()
119136{
120137    m_dp83902->dp8390_reset(0);
121138    m_dp83902->dp8390_cs(0);
122139}
123140
124WRITE8_MEMBER( nubus_asntm3b_device::asntm3b_ram_w )
141WRITE8_MEMBER( nubus_mac8390_device::asntm3b_ram_w )
125142{
126//    printf("MC3B: CPU wrote %02x to RAM @ %x\n", data, offset);
143//    printf("MC3NB: CPU wrote %02x to RAM @ %x\n", data, offset);
127144    m_ram[offset] = data;
128145}
129146
130READ8_MEMBER( nubus_asntm3b_device::asntm3b_ram_r )
147READ8_MEMBER( nubus_mac8390_device::asntm3b_ram_r )
131148{
132//    printf("MC3B: CPU read %02x @ RAM %x\n", m_ram[offset], offset);
149//    printf("MC3NB: CPU read %02x @ RAM %x\n", m_ram[offset], offset);
133150    return m_ram[offset];
134151}
135152
136WRITE32_MEMBER( nubus_asntm3b_device::en_w )
153WRITE32_MEMBER( nubus_mac8390_device::en_w )
137154{
138155    if (mem_mask == 0xff000000)
139156    {
r13181r13182
148165    }
149166    else
150167    {
151        fatalerror("asntm3b: write %08x to DP83902 @ %x with unhandled mask %08x (PC=%x)\n", data, offset, mem_mask, cpu_get_pc(&space.device()));
168        fatalerror("asntmc3nb: write %08x to DP83902 @ %x with unhandled mask %08x (PC=%x)\n", data, offset, mem_mask, cpu_get_pc(&space.device()));
152169    }
153170}
154171
155READ32_MEMBER( nubus_asntm3b_device::en_r )
172READ32_MEMBER( nubus_mac8390_device::en_r )
156173{
157174    if (mem_mask == 0xff000000)
158175    {
r13181r13182
166183    }
167184    else
168185    {
169        fatalerror("asntm3b: read DP83902 @ %x with unhandled mask %08x (PC=%x)\n", offset, mem_mask, cpu_get_pc(&space.device()));
186        fatalerror("asntmc3nb: read DP83902 @ %x with unhandled mask %08x (PC=%x)\n", offset, mem_mask, cpu_get_pc(&space.device()));
170187    }
171188
172189    return 0;
173190}
174191
175WRITE_LINE_MEMBER( nubus_asntm3b_device::dp_irq_w )
192WRITE_LINE_MEMBER( nubus_mac8390_device::dp_irq_w )
176193{
177194    if (state)
178195    {
r13181r13182
184201    }
185202}
186203
187READ8_MEMBER( nubus_asntm3b_device::dp_mem_read )
204READ8_MEMBER( nubus_mac8390_device::dp_mem_read )
188205{
189//    printf("MC3B: 8390 read RAM @ %x = %02x\n", offset, m_ram[offset]);
206//    printf("MC3NB: 8390 read RAM @ %x = %02x\n", offset, m_ram[offset]);
190207   return m_ram[offset];
191208}
192209
193WRITE8_MEMBER( nubus_asntm3b_device::dp_mem_write )
210WRITE8_MEMBER( nubus_mac8390_device::dp_mem_write )
194211{
195//    printf("MC3B: 8390 wrote %02x to RAM @ %x\n", data, offset);
212//    printf("MC3NB: 8390 wrote %02x to RAM @ %x\n", data, offset);
196213   m_ram[offset] = data;
197214}
src/mess/machine/nubus_asntmc3b.h
r13181r13182
1111//  TYPE DEFINITIONS
1212//**************************************************************************
1313
14// ======================> nubus_asntm3b_device
14// ======================> nubus_mac8390_device
1515
16class nubus_asntm3b_device :
16class nubus_mac8390_device :
1717      public device_t,
1818      public device_nubus_card_interface
1919{
2020public:
2121        // construction/destruction
22        nubus_asntm3b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
23      nubus_asntm3b_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
22      nubus_mac8390_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
2423
2524      // optional information overrides
2625      virtual machine_config_constructor device_mconfig_additions() const;
r13181r13182
4746        UINT8 m_prom[16];
4847};
4948
49class nubus_asntmc3nb_device : public nubus_mac8390_device
50{
51public:
52    nubus_asntmc3nb_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
53};
5054
55class nubus_appleenet_device : public nubus_mac8390_device
56{
57public:
58    nubus_appleenet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
59    virtual const rom_entry *device_rom_region() const;
60};
61
5162// device type definition
52extern const device_type NUBUS_ASNTMC3B;
63extern const device_type NUBUS_ASNTMC3NB;
64extern const device_type NUBUS_APPLEENET;
5365
5466#endif  /* __NUBUS_ASNTMC3B_H__ */
src/mess/mess_dev.lst
r13181r13182
100100NUBUS_SPECPDQ
101101NUBUS_M2HIRES
102102NUBUS_SPEC8S3
103NUBUS_ASNTMC3B
103NUBUS_ASNTMC3NB
104104NUBUS_RADIUSTPD
105105NUBUS_WSPORTRAIT
106NUBUS_APPLEENET
106107PC1512_KEYBOARD
107108S1410
108109SED1330
src/mess/drivers/mac.c
r13181r13182
868868   SLOT_INTERFACE("spec8s3", NUBUS_SPEC8S3)   /* SuperMac Spectrum/8 Series III */
869869//  SLOT_INTERFACE("thundergx", NUBUS_THUNDERGX)        /* Radius Thunder GX (not yet) */
870870   SLOT_INTERFACE("radiustpd", NUBUS_RADIUSTPD)      /* Radius Two Page Display */
871   SLOT_INTERFACE("asmc3b", NUBUS_ASNTMC3B)   /* Asante MC3B Ethernet card */
871   SLOT_INTERFACE("asmc3nb", NUBUS_ASNTMC3NB)   /* Asante MC3NB Ethernet card */
872872   SLOT_INTERFACE("portrait", NUBUS_WSPORTRAIT)   /* Apple Macintosh II Portrait video card */
873   SLOT_INTERFACE("enetnb", NUBUS_APPLEENET)   /* Apple NuBus Ethernet */
873874SLOT_INTERFACE_END
874875
875876/***************************************************************************

Previous 15994 Revisions Next


© 1998-2018 The MESS Team