summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess
diff options
context:
space:
mode:
author Curt Coder <curtcoder@mail.com>2012-11-07 15:30:50 +0000
committer Curt Coder <curtcoder@mail.com>2012-11-07 15:30:50 +0000
commit4a85620161a27421ae74217890408d60c26059db (patch)
treed82d061f315cc450727c4c98822b1cf87d8e6151 /src/mess
parent491d28aba000e610603073cd42f2c73274e8337f (diff)
(MESS) adam: Created an ADAMnet slot interface and separated the ADAMnet devices from the driver. [Curt Coder]
Diffstat (limited to 'src/mess')
-rw-r--r--src/mess/drivers/adam.c1234
-rw-r--r--src/mess/includes/adam.h107
-rw-r--r--src/mess/machine/adam_ddp.c315
-rw-r--r--src/mess/machine/adam_ddp.h69
-rw-r--r--src/mess/machine/adam_fdc.c324
-rw-r--r--src/mess/machine/adam_fdc.h76
-rw-r--r--src/mess/machine/adam_kb.c413
-rw-r--r--src/mess/machine/adam_kb.h67
-rw-r--r--src/mess/machine/adam_prn.c258
-rw-r--r--src/mess/machine/adam_prn.h63
-rw-r--r--src/mess/machine/adam_spi.c175
-rw-r--r--src/mess/machine/adam_spi.h59
-rw-r--r--src/mess/machine/adamnet.c258
-rw-r--r--src/mess/machine/adamnet.h139
-rw-r--r--src/mess/mess.mak6
15 files changed, 2401 insertions, 1162 deletions
diff --git a/src/mess/drivers/adam.c b/src/mess/drivers/adam.c
index 822d13b4066..3228bd774b3 100644
--- a/src/mess/drivers/adam.c
+++ b/src/mess/drivers/adam.c
@@ -236,17 +236,17 @@ FE Joystick #2 (In only)
Notes:
1) Port 41 or port 43 is used by the Eve 80 column unit as a keyboard input port.
-2) Not useable from expansion card slots (can't read or write data to or from ports) -
+2) Not useable from expansion card slots (can't read or write data to or from ports) -
may be available on side port.
3) Powermate IDE hard disk drive will not interfere with Powermate serial ports.
4) Powermate serial ports will probably interfere with autodialer.
-5) Reserved ports in Powermate serial port map: Input ports 12 and 1A - screw up serial
- ports if used; Input port 1C doesn't bother anything but the 2681 drives the bus;
+5) Reserved ports in Powermate serial port map: Input ports 12 and 1A - screw up serial
+ ports if used; Input port 1C doesn't bother anything but the 2681 drives the bus;
6) Orphanware serial port number 4 probably interferes with the ADAMlink modem.
- 7) According to my analysis of circuit U6 in the ADAM computer, all of upper I/O address
- space is decoded (by an LS138). However, not all outputs appear to be used. The
- circuit description follows. Please correct any misassumptions I've made. Note that
- if my analysis is correct, then the Orphanware hard disk should be interfering with
+ 7) According to my analysis of circuit U6 in the ADAM computer, all of upper I/O address
+ space is decoded (by an LS138). However, not all outputs appear to be used. The
+ circuit description follows. Please correct any misassumptions I've made. Note that
+ if my analysis is correct, then the Orphanware hard disk should be interfering with
the signal STA\ (which is associated with the joysticks in some way).
@@ -273,7 +273,7 @@ WAIT\ ----o|G2B Y5|o---- 1 0 1 C0-DF Read (Not Used)
Conventions:
-1) The "o" symbol next to an input or an output implies that the pin requires an active
+1) The "o" symbol next to an input or an output implies that the pin requires an active
low signal.
2) The "\" symbol following a signal mnemonic indicates that the signal is active low.
@@ -287,8 +287,8 @@ Mark Gordon
TODO:
- - floppy
- - slot interface
+ - floppy
+ - slot interface
- printer
- SPI
- sound (PSG RDY -> Z80 WAIT)
@@ -352,7 +352,7 @@ void adam_state::bankswitch()
switch (m_mioc & 0x03)
{
case LO_SMARTWRITER:
- if (BIT(m_adamnet, 1))
+ if (BIT(m_an, 1))
{
program.unmap_readwrite(0x0000, 0x5fff);
program.install_rom(0x6000, 0x7fff, memregion("wp")->base() + 0x8000);
@@ -429,18 +429,18 @@ WRITE8_MEMBER( adam_state::mioc_w )
{
/*
- bit description
+ bit description
- 0 Lower memory option 0
- 1 Lower memory option 1
- 2 Upper memory option 0
- 3 Upper memory option 1
- 4
- 5
- 6
- 7
+ 0 Lower memory option 0
+ 1 Lower memory option 1
+ 2 Upper memory option 0
+ 3 Upper memory option 1
+ 4
+ 5
+ 6
+ 7
- */
+ */
m_mioc = data;
@@ -454,29 +454,12 @@ WRITE8_MEMBER( adam_state::mioc_w )
//**************************************************************************
//-------------------------------------------------
-// adamnet_txd_w -
-//-------------------------------------------------
-
-void adam_state::adamnet_txd_w(int device, int state)
-{
- m_txd[device] = state;
-
- m_rxd = 1;
-
- for (int i = 0; i < 4; i++)
- {
- if (!m_txd[i]) m_rxd = 0;
- }
-}
-
-
-//-------------------------------------------------
// adamnet_r -
//-------------------------------------------------
READ8_MEMBER( adam_state::adamnet_r )
{
- return m_adamnet & 0x0f;
+ return m_an & 0x0f;
}
@@ -488,110 +471,101 @@ WRITE8_MEMBER( adam_state::adamnet_w )
{
/*
- bit description
+ bit description
- 0 Network reset
- 1 EOS enable
- 2
- 3
- 4
- 5
- 6
- 7
+ 0 Network reset
+ 1 EOS enable
+ 2
+ 3
+ 4
+ 5
+ 6
+ 7
- */
+ */
- // network reset
- if (BIT(m_adamnet, 0) && !BIT(data, 0))
+ if (BIT(m_an, 0) && !BIT(data, 0))
{
- m_reset = 1;
-
- machine().device(M6801_KB_TAG)->reset();
- machine().device(M6801_DDP_TAG)->reset();
- machine().device(M6801_PRN_TAG)->reset();
- machine().device(M6801_FDC_TAG)->reset();
- wd17xx_mr_w(m_fdc, 0);
- wd17xx_mr_w(m_fdc, 1);
- //machine().device(M6801_SPI_TAG)->reset();
-
- m_reset = 0;
+ // network reset
+ m_adamnet->reset_w(ASSERT_LINE);
+ m_adamnet->reset_w(CLEAR_LINE);
}
- m_adamnet = data;
+ m_an = data;
bankswitch();
}
//-------------------------------------------------
-// kb6801_p1_r -
+// m6801_p1_w -
//-------------------------------------------------
-WRITE8_MEMBER( adam_state::master6801_p1_w )
+WRITE8_MEMBER( adam_state::m6801_p1_w )
{
/*
- bit description
+ bit description
- 0 BA8
- 1 BA9
- 2 BA10
- 3 BA11
- 4 BA12
- 5 BA13
- 6 BA14
- 7 BA15
+ 0 BA8
+ 1 BA9
+ 2 BA10
+ 3 BA11
+ 4 BA12
+ 5 BA13
+ 6 BA14
+ 7 BA15
- */
+ */
m_ba = (data << 8) | (m_ba & 0xff);
}
//-------------------------------------------------
-// master6801_p2_r -
+// m6801_p2_r -
//-------------------------------------------------
-READ8_MEMBER( adam_state::master6801_p2_r )
+READ8_MEMBER( adam_state::m6801_p2_r )
{
/*
- bit description
+ bit description
- 0 M6801 mode bit 0
- 1 M6801 mode bit 1
- 2 M6801 mode bit 2
- 3 NET RXD
- 4
+ 0 M6801 mode bit 0
+ 1 M6801 mode bit 1
+ 2 M6801 mode bit 2
+ 3 NET RXD
+ 4
- */
+ */
UINT8 data = M6801_MODE_7;
// NET RXD
- data |= m_rxd << 3;
+ data |= m_adamnet->rxd_r() << 3;
return data;
}
//-------------------------------------------------
-// master6801_p2_w -
+// m6801_p2_w -
//-------------------------------------------------
-WRITE8_MEMBER( adam_state::master6801_p2_w )
+WRITE8_MEMBER( adam_state::m6801_p2_w )
{
/*
- bit description
+ bit description
- 0 _DMA
- 1
- 2 _BWR
- 3
- 4 NET TXD
+ 0 _DMA
+ 1
+ 2 _BWR
+ 3
+ 4 NET TXD
- */
+ */
// DMA
m_dma = BIT(data, 0);
@@ -600,663 +574,85 @@ WRITE8_MEMBER( adam_state::master6801_p2_w )
m_bwr = BIT(data, 2);
// NET TXD
- adamnet_txd_w(ADAMNET_MASTER, BIT(data, 4));
+ m_adamnet->txd_w(BIT(data, 4));
}
//-------------------------------------------------
-// master6801_p3_r -
+// m6801_p3_r -
//-------------------------------------------------
-READ8_MEMBER( adam_state::master6801_p3_r )
+READ8_MEMBER( adam_state::m6801_p3_r )
{
/*
- bit description
+ bit description
- 0 BD0
- 1 BD1
- 2 BD2
- 3 BD3
- 4 BD4
- 5 BD5
- 6 BD6
- 7 BD7
+ 0 BD0
+ 1 BD1
+ 2 BD2
+ 3 BD3
+ 4 BD4
+ 5 BD5
+ 6 BD6
+ 7 BD7
- */
+ */
return m_data_out;
}
//-------------------------------------------------
-// master6801_p3_w -
+// m6801_p3_w -
//-------------------------------------------------
-WRITE8_MEMBER( adam_state::master6801_p3_w )
+WRITE8_MEMBER( adam_state::m6801_p3_w )
{
/*
- bit description
+ bit description
- 0 BD0
- 1 BD1
- 2 BD2
- 3 BD3
- 4 BD4
- 5 BD5
- 6 BD6
- 7 BD7
+ 0 BD0
+ 1 BD1
+ 2 BD2
+ 3 BD3
+ 4 BD4
+ 5 BD5
+ 6 BD6
+ 7 BD7
- */
+ */
m_data_in = data;
}
//-------------------------------------------------
-// master6801_p4_w -
+// m6801_p4_w -
//-------------------------------------------------
-WRITE8_MEMBER( adam_state::master6801_p4_w )
+WRITE8_MEMBER( adam_state::m6801_p4_w )
{
/*
- bit description
+ bit description
- 0 BA0
- 1 BA1
- 2 BA2
- 3 BA3
- 4 BA4
- 5 BA5
- 6 BA6
- 7 BA7
+ 0 BA0
+ 1 BA1
+ 2 BA2
+ 3 BA3
+ 4 BA4
+ 5 BA5
+ 6 BA6
+ 7 BA7
- */
+ */
m_ba = (m_ba & 0xff00) | data;
}
-//-------------------------------------------------
-// kb6801_p1_r -
-//-------------------------------------------------
-
-READ8_MEMBER( adam_state::kb6801_p1_r )
-{
- /*
-
- bit description
-
- 0 X0
- 1 X1
- 2 X2
- 3 X3
- 4 X4
- 5 X5
- 6 X6
- 7 X7
-
- */
-
- UINT8 data = 0xff;
-
- if (!BIT(m_key_y, 0)) data &= ioport("Y0")->read();
- if (!BIT(m_key_y, 1)) data &= ioport("Y1")->read();
- if (!BIT(m_key_y, 2)) data &= ioport("Y2")->read();
- if (!BIT(m_key_y, 3)) data &= ioport("Y3")->read();
- if (!BIT(m_key_y, 4)) data &= ioport("Y4")->read();
- if (!BIT(m_key_y, 5)) data &= ioport("Y5")->read();
- if (!BIT(m_key_y, 6)) data &= ioport("Y6")->read();
- if (!BIT(m_key_y, 7)) data &= ioport("Y7")->read();
- if (!BIT(m_key_y, 8)) data &= ioport("Y8")->read();
- if (!BIT(m_key_y, 9)) data &= ioport("Y9")->read();
- if (!BIT(m_key_y, 10)) data &= ioport("Y10")->read();
- if (!BIT(m_key_y, 11)) data &= ioport("Y11")->read();
- if (!BIT(m_key_y, 12)) data &= ioport("Y12")->read();
-
- return data;
-}
-
-
-//-------------------------------------------------
-// kb6801_p2_r -
-//-------------------------------------------------
-
-READ8_MEMBER( adam_state::kb6801_p2_r )
-{
- /*
-
- bit description
-
- 0 mode bit 0
- 1 mode bit 1
- 2 mode bit 2
- 3 NET RXD
- 4 NET TXD
-
- */
-
- UINT8 data = M6801_MODE_7;
-
- // NET RXD
- data |= m_rxd << 3;
-
- return data;
-}
-
-
-//-------------------------------------------------
-// kb6801_p2_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( adam_state::kb6801_p2_w )
-{
- /*
-
- bit description
-
- 0 mode bit 0
- 1 mode bit 1
- 2 mode bit 2
- 3 NET RXD
- 4 NET TXD
-
- */
-
- adamnet_txd_w(ADAMNET_KEYBOARD, BIT(data, 4));
-}
-
-
-//-------------------------------------------------
-// kb6801_p3_r -
-//-------------------------------------------------
-
-READ8_MEMBER( adam_state::kb6801_p3_r )
-{
- return 0xff;
-}
-
-
-//-------------------------------------------------
-// kb6801_p3_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( adam_state::kb6801_p3_w )
-{
- /*
-
- bit description
-
- 0 Y0
- 1 Y1
- 2 Y2
- 3 Y3
- 4 Y4
- 5 Y5
- 6 Y6
- 7 Y7
-
- */
-
- m_key_y = (m_key_y & 0x1f00) | data;
-}
-
-
-//-------------------------------------------------
-// kb6801_p4_r -
-//-------------------------------------------------
-
-READ8_MEMBER( adam_state::kb6801_p4_r )
-{
- return 0xff;
-}
-
-
-//-------------------------------------------------
-// kb6801_p4_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( adam_state::kb6801_p4_w )
-{
- /*
-
- bit description
-
- 0 Y8
- 1 Y9
- 2 Y10
- 3 Y11
- 4 Y12
- 5
- 6
- 7
-
- */
-
- m_key_y = ((data & 0x1f) << 8) | (m_key_y & 0xff);
-}
-
-
-//-------------------------------------------------
-// ddp6801_p1_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( adam_state::ddp6801_p1_w )
-{
- /*
-
- bit description
-
- 0 SPD SEL (0=20 ips, 1=80ips)
- 1 STOP0
- 2 STOP1
- 3 _GO FWD
- 4 _GO REV
- 5 BRAKE
- 6 _WR0
- 7 _WR1
-
- */
-
- if(m_ddp0->exists())
- {
- m_ddp0->set_speed(BIT(data, 0) ? (double) 80/1.875 : 20/1.875); // speed select
- if(!(data & 0x08)) m_ddp0->go_forward();
- if(!(data & 0x10)) m_ddp0->go_reverse();
- m_ddp0->change_state(BIT(data, 1) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); // motor control
- }
-
- if(m_ddp1->exists())
- {
- m_ddp1->set_speed(BIT(data, 0) ? (double) 80/1.875 : 20/1.875); // speed select
- if(!(data & 0x08)) m_ddp1->go_forward();
- if(!(data & 0x10)) m_ddp1->go_reverse();
- m_ddp1->change_state(BIT(data, 2) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); // motor control
- }
-
- // data write 0
- m_wr0 = BIT(data, 6);
-
- // data write 1
- m_wr1 = BIT(data, 7);
-}
-
-
-//-------------------------------------------------
-// ddp6801_p2_r -
-//-------------------------------------------------
-
-READ8_MEMBER( adam_state::ddp6801_p2_r )
-{
- /*
-
- bit description
-
- 0 mode bit 0
- 1 mode bit 1 / CIP1
- 2 mode bit 2
- 3 NET RXD
- 4
-
- */
-
- UINT8 data = 0;
-
- if (m_reset)
- data |= M6801_MODE_6;
- else
- data |= m_ddp1->exists() << 1; // Cassette in place 1
-
- // NET RXD
- data |= m_rxd << 3;
-
- return data;
-}
-
-
-//-------------------------------------------------
-// ddp6801_p2_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( adam_state::ddp6801_p2_w )
-{
- /*
-
- bit description
-
- 0 WRT DATA
- 1
- 2 TRACK A/B (0=B, 1=A)
- 3
- 4 NET TXD
-
- */
-
- if(m_ddp0->exists())
- {
- m_ddp0->set_channel(!BIT(data, 2)); // Track select
- if (!m_wr0) m_ddp0->output(BIT(data, 0) ? 1.0 : -1.0); // write data
- }
-
- if(m_ddp1->exists())
- {
- m_ddp1->set_channel(!BIT(data, 2));
- if (!m_wr1) m_ddp1->output(BIT(data, 0) ? 1.0 : -1.0);
- }
-
- // NET TXD
- adamnet_txd_w(ADAMNET_DDP, BIT(data, 4));
-}
-
-//-------------------------------------------------
-// ddp6801_p4_r -
-//-------------------------------------------------
-
-READ8_MEMBER( adam_state::ddp6801_p4_r )
-{
- /*
-
- bit description
-
- 0 A8
- 1 A9
- 2 A10 (2114 _S)
- 3 MSENSE 0
- 4 MSENSE 1
- 5 CIP0
- 6 RD DATA 0 (always 1)
- 7 RD DATA 1 (data from drives ORed together)
-
- */
-
- UINT8 data = 0;
-
- // drive 0
- if(m_ddp0->exists())
- {
- data |= ((m_ddp0->get_state() & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED) << 3; // motion sense
- data |= 1 << 5; // cassette in place
- data |= (m_ddp0->input() < 0) << 7; // read data
- }
-
- // drive 1
- if(m_ddp1->exists())
- {
- data |= ((m_ddp1->get_state() & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED) << 4; // motion sense
- data |= (m_ddp1->input() < 0) << 7; // read data
- }
-
- // read data 0 (always 1)
- data |= 0x40;
-
- return data;
-}
-
-
-//-------------------------------------------------
-// printer6801_p1_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( adam_state::printer6801_p1_w )
-{
- /*
-
- bit description
-
- 0 M2 phase D
- 1 M2 phase B
- 2 M2 phase C
- 3 M2 phase A
- 4 M3 phase B
- 5 M3 phase D
- 6 M3 phase A
- 7 M3 phase C
-
- */
-}
-
-
-//-------------------------------------------------
-// printer6801_p2_r -
-//-------------------------------------------------
-
-READ8_MEMBER( adam_state::printer6801_p2_r )
-{
- /*
-
- bit description
-
- 0 mode bit 0
- 1 mode bit 1
- 2 mode bit 2
- 3 NET RXD
- 4 NET TXD
-
- */
-
- UINT8 data = M6801_MODE_7;
-
- // NET RXD
- data |= m_rxd << 3;
-
- return data;
-}
-
-
-//-------------------------------------------------
-// printer6801_p2_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( adam_state::printer6801_p2_w )
-{
- /*
-
- bit description
-
- 0 mode bit 0
- 1 mode bit 1
- 2 mode bit 2
- 3 NET RXD
- 4 NET TXD
-
- */
-
- adamnet_txd_w(ADAMNET_PRINTER, BIT(data, 4));
-}
-
-
-//-------------------------------------------------
-// printer6801_p3_r -
-//-------------------------------------------------
-
-READ8_MEMBER( adam_state::printer6801_p3_r )
-{
- return 0xff;
-}
-
-
-//-------------------------------------------------
-// printer6801_p4_r -
-//-------------------------------------------------
-
-READ8_MEMBER( adam_state::printer6801_p4_r )
-{
- /*
-
- bit description
-
- 0
- 1
- 2
- 3
- 4 left margin
- 5 platen detent
- 6 wheel home
- 7 self-test
-
- */
-
- return 0x80;
-}
-
-
-//-------------------------------------------------
-// printer6801_p4_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( adam_state::printer6801_p4_w )
-{
- /*
-
- bit description
-
- 0 print hammer solenoid
- 1 ribbon advance solenoid
- 2 platen motor advance
- 3 platen motor break
- 4
- 5
- 6
- 7
-
- */
-}
-
-
-//-------------------------------------------------
-// fdc6801_p1_r -
-//-------------------------------------------------
-
-READ8_MEMBER( adam_state::fdc6801_p1_r )
-{
- /*
-
- bit description
-
- 0 disk in place
- 1
- 2 FDC DRQ
- 3
- 4
- 5
- 6
- 7 SW3 (0=DS1, 1=DS2)
-
- */
-
- UINT8 data = 0x01;
-
- // floppy data request
- data |= wd17xx_drq_r(m_fdc) << 2;
-
- return data;
-}
-
-
-//-------------------------------------------------
-// fdc6801_p1_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( adam_state::fdc6801_p1_w )
-{
- /*
-
- bit description
-
- 0
- 1 FDC ENP
- 2
- 3 FDC _DDEN
- 4
- 5 DRIVE SELECT
- 6 MOTOR ON
- 7
-
- */
-
- // density select
- wd17xx_dden_w(m_fdc, BIT(data, 3));
-
- // motor enable
- floppy_mon_w(m_floppy0, !BIT(data, 6));
- floppy_drive_set_ready_state(m_floppy0, 1, 1);
-}
-
-
-//-------------------------------------------------
-// fdc6801_p2_r -
-//-------------------------------------------------
-
-READ8_MEMBER( adam_state::fdc6801_p2_r )
-{
- /*
-
- bit description
-
- 0 mode bit 0
- 1 mode bit 1
- 2 mode bit 2
- 3 NET RXD
- 4
-
- */
-
- UINT8 data = M6801_MODE_2;
-
- // NET RXD
- data |= m_rxd << 3;
-
- return data;
-}
-
-
-//-------------------------------------------------
-// fdc6801_p2_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( adam_state::fdc6801_p2_w )
-{
- /*
-
- bit description
-
- 0
- 1
- 2
- 3
- 4 NET TXD
-
- */
-
- adamnet_txd_w(ADAMNET_FDC, BIT(data, 4));
-}
-
-
-//-------------------------------------------------
-// fdc6801_p4_w -
-//-------------------------------------------------
-
-WRITE8_MEMBER( adam_state::fdc6801_p4_w )
-{
- /*
-
- bit description
-
- 0 A8
- 1 A9
- 2 A10
- 3 A11
- 4 _WE
- 5 FDC CA0
- 6 FDC CA1
- 7 chip select logic?
-
- */
-}
-
-
//**************************************************************************
// PADDLES
@@ -1333,15 +729,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( adam_io, AS_IO, 8, adam_state )
ADDRESS_MAP_GLOBAL_MASK(0xff)
-// AM_RANGE(0x1e, 0x1e) Optional Auto Dialer
AM_RANGE(0x20, 0x20) AM_MIRROR(0x1f) AM_READWRITE(adamnet_r, adamnet_w)
-// AM_RANGE(0x40, 0x40) Printer Data
-// AM_RANGE(0x42, 0x42) Expansion RAM Page Select
-// AM_RANGE(0x52, 0x52) Adam Resident Debugger ?
-// AM_RANGE(0x54, 0x54) Adam Resident Debugger ?
-// AM_RANGE(0x55, 0x55) Adam Resident Debugger ?
-// AM_RANGE(0x5e, 0x5e) Optional Modem Data I/O
-// AM_RANGE(0x5f, 0x5f) Optional Modem Control Status
AM_RANGE(0x60, 0x60) AM_MIRROR(0x1f) AM_READWRITE(mioc_r, mioc_w)
AM_RANGE(0x80, 0x80) AM_MIRROR(0x1f) AM_WRITE(paddle_w)
AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x1e) AM_DEVREADWRITE(TMS9928A_TAG, tms9928a_device, vram_read, vram_write)
@@ -1354,261 +742,38 @@ ADDRESS_MAP_END
//-------------------------------------------------
-// ADDRESS_MAP( master6801_mem )
-//-------------------------------------------------
-
-static ADDRESS_MAP_START( master6801_mem, AS_PROGRAM, 8, adam_state )
- AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(m6801_io_r, m6801_io_w)
- AM_RANGE(0x0080, 0x00ff) AM_RAM
- AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION(M6801_MAIN_TAG, 0)
-ADDRESS_MAP_END
-
-
-//-------------------------------------------------
-// ADDRESS_MAP( master6801_io )
-//-------------------------------------------------
-
-static ADDRESS_MAP_START( master6801_io, AS_IO, 8, adam_state )
- AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE(master6801_p1_w)
- AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(master6801_p2_r, master6801_p2_w)
- AM_RANGE(M6801_PORT3, M6801_PORT3) AM_READWRITE(master6801_p3_r, master6801_p3_w)
- AM_RANGE(M6801_PORT4, M6801_PORT4) AM_WRITE(master6801_p4_w)
-ADDRESS_MAP_END
-
-
-//-------------------------------------------------
-// ADDRESS_MAP( kb6801_mem )
-//-------------------------------------------------
-
-static ADDRESS_MAP_START( kb6801_mem, AS_PROGRAM, 8, adam_state )
- AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(m6801_io_r, m6801_io_w)
- AM_RANGE(0x0080, 0x00ff) AM_RAM
- AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION(M6801_KB_TAG, 0)
-ADDRESS_MAP_END
-
-
-//-------------------------------------------------
-// ADDRESS_MAP( kb6801_io )
+// ADDRESS_MAP( m6801_mem )
//-------------------------------------------------
-static ADDRESS_MAP_START( kb6801_io, AS_IO, 8, adam_state )
- AM_RANGE(M6801_PORT1, M6801_PORT1) AM_READ(kb6801_p1_r)
- AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(kb6801_p2_r, kb6801_p2_w)
- AM_RANGE(M6801_PORT3, M6801_PORT3) AM_READWRITE(kb6801_p3_r, kb6801_p3_w)
- AM_RANGE(M6801_PORT4, M6801_PORT4) AM_READWRITE(kb6801_p4_r, kb6801_p4_w)
-ADDRESS_MAP_END
-
-
-//-------------------------------------------------
-// ADDRESS_MAP( ddp6801_mem )
-//-------------------------------------------------
-
-static ADDRESS_MAP_START( ddp6801_mem, AS_PROGRAM, 8, adam_state )
+static ADDRESS_MAP_START( m6801_mem, AS_PROGRAM, 8, adam_state )
AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(m6801_io_r, m6801_io_w)
AM_RANGE(0x0080, 0x00ff) AM_RAM
- AM_RANGE(0x0400, 0x07ff) AM_RAM
- AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION(M6801_DDP_TAG, 0)
+ AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION(M6801_TAG, 0)
ADDRESS_MAP_END
//-------------------------------------------------
-// ADDRESS_MAP( ddp6801_io )
+// ADDRESS_MAP( m6801_io )
//-------------------------------------------------
-static ADDRESS_MAP_START( ddp6801_io, AS_IO, 8, adam_state )
- AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE(ddp6801_p1_w)
- AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(ddp6801_p2_r, ddp6801_p2_w)
- AM_RANGE(M6801_PORT3, M6801_PORT3) AM_NOP // Multiplexed Address/Data
- AM_RANGE(M6801_PORT4, M6801_PORT4) AM_READ(ddp6801_p4_r)
-ADDRESS_MAP_END
-
-
-//-------------------------------------------------
-// ADDRESS_MAP( printer6801_mem )
-//-------------------------------------------------
-
-static ADDRESS_MAP_START( printer6801_mem, AS_PROGRAM, 8, adam_state )
- AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(m6801_io_r, m6801_io_w)
- AM_RANGE(0x0080, 0x00ff) AM_RAM
- AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION(M6801_PRN_TAG, 0)
-ADDRESS_MAP_END
-
-
-//-------------------------------------------------
-// ADDRESS_MAP( printer6801_io )
-//-------------------------------------------------
-
-static ADDRESS_MAP_START( printer6801_io, AS_IO, 8, adam_state )
- AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE(printer6801_p1_w)
- AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(printer6801_p2_r, printer6801_p2_w)
- AM_RANGE(M6801_PORT3, M6801_PORT3) AM_READ(printer6801_p3_r)
- AM_RANGE(M6801_PORT4, M6801_PORT4) AM_READWRITE(printer6801_p4_r, printer6801_p4_w)
-ADDRESS_MAP_END
-
-
-//-------------------------------------------------
-// ADDRESS_MAP( fdc6801_mem )
-//-------------------------------------------------
-
-static ADDRESS_MAP_START( fdc6801_mem, AS_PROGRAM, 8, adam_state )
- AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(m6801_io_r, m6801_io_w)
- AM_RANGE(0x0080, 0x00ff) AM_RAM
- AM_RANGE(0x0400, 0x07ff) AM_RAM AM_WRITEONLY AM_SHARE("fdc_ram")
- AM_RANGE(0x0800, 0x0800) AM_MIRROR(0xff) AM_DEVREAD_LEGACY(WD2793_TAG, wd17xx_status_r)
- AM_RANGE(0x1400, 0x17ff) AM_RAM AM_READONLY AM_SHARE("fdc_ram")
- AM_RANGE(0x1800, 0x1800) AM_MIRROR(0xff) AM_DEVWRITE_LEGACY(WD2793_TAG, wd17xx_command_w)
- AM_RANGE(0x2800, 0x2800) AM_MIRROR(0xff) AM_DEVREAD_LEGACY(WD2793_TAG, wd17xx_track_r)
- AM_RANGE(0x3800, 0x3800) AM_MIRROR(0xff) AM_DEVWRITE_LEGACY(WD2793_TAG, wd17xx_track_w)
- AM_RANGE(0x4800, 0x4800) AM_MIRROR(0xff) AM_DEVREAD_LEGACY(WD2793_TAG, wd17xx_sector_r)
- AM_RANGE(0x5800, 0x5800) AM_MIRROR(0xff) AM_DEVWRITE_LEGACY(WD2793_TAG, wd17xx_sector_w)
- AM_RANGE(0x6800, 0x6800) AM_MIRROR(0xff) AM_DEVREAD_LEGACY(WD2793_TAG, wd17xx_data_r)
- AM_RANGE(0x7800, 0x7800) AM_MIRROR(0xff) AM_DEVWRITE_LEGACY(WD2793_TAG, wd17xx_data_w)
- AM_RANGE(0x8000, 0x8fff) AM_MIRROR(0x7000) AM_ROM AM_REGION(M6801_FDC_TAG, 0)
-ADDRESS_MAP_END
-
-
-//-------------------------------------------------
-// ADDRESS_MAP( fdc6801_io )
-//-------------------------------------------------
-
-static ADDRESS_MAP_START( fdc6801_io, AS_IO, 8, adam_state )
- AM_RANGE(M6801_PORT1, M6801_PORT1) AM_READWRITE(fdc6801_p1_r, fdc6801_p1_w)
- AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(fdc6801_p2_r, fdc6801_p2_w)
- AM_RANGE(M6801_PORT3, M6801_PORT3)
- AM_RANGE(M6801_PORT4, M6801_PORT4) AM_WRITE(fdc6801_p4_w)
+static ADDRESS_MAP_START( m6801_io, AS_IO, 8, adam_state )
+ AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE(m6801_p1_w)
+ AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(m6801_p2_r, m6801_p2_w)
+ AM_RANGE(M6801_PORT3, M6801_PORT3) AM_READWRITE(m6801_p3_r, m6801_p3_w)
+ AM_RANGE(M6801_PORT4, M6801_PORT4) AM_WRITE(m6801_p4_w)
ADDRESS_MAP_END
//**************************************************************************
-// INPUT PORTS
-//**************************************************************************
-
-//-------------------------------------------------
-// INPUT_PORTS( adam )
-//-------------------------------------------------
-
-static INPUT_PORTS_START( adam )
- PORT_START("Y0")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("WILD CARD") PORT_CODE(KEYCODE_F7)
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("I") PORT_CODE(KEYCODE_F1)
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("II") PORT_CODE(KEYCODE_F2)
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("III") PORT_CODE(KEYCODE_F3)
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("IV") PORT_CODE(KEYCODE_F4)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("V") PORT_CODE(KEYCODE_F5)
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("VI") PORT_CODE(KEYCODE_F6)
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("UNDO") PORT_CODE(KEYCODE_F8)
-
- PORT_START("Y1")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@')
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('_')
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&')
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*')
-
- PORT_START("Y2")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t')
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q')
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W')
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E')
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R')
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T')
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y')
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U')
-
- PORT_START("Y3")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A')
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S')
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D')
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F')
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G')
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H')
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J')
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K')
-
- PORT_START("Y4")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z')
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X')
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C')
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V')
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B')
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N')
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M')
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
-
- PORT_START("Y5")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(')
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')')
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('\'')
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('+') PORT_CHAR('=')
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('^') PORT_CHAR('~')
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L')
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':')
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('\"')
-
- PORT_START("Y6")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I')
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O')
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P')
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{')
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}')
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
-
- PORT_START("Y7")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|')
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ESCAPE/WP") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC))
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("MOVE/COPY") PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT))
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("STORE/GET") PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME))
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_PGUP) PORT_CHAR(UCHAR_MAMEKEY(PGUP))
-
- PORT_START("Y8")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP))
- PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
- PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
- PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT))
- PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("BACKSPACE") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8)
- PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("INSERT") PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL))
- PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("PRINT") PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(END))
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("DELETE") PORT_CODE(KEYCODE_PGDN) PORT_CHAR(UCHAR_MAMEKEY(PGDN))
-
- PORT_START("Y9")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CONTROL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL))
- PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
-
- PORT_START("Y10")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
- PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
-
- PORT_START("Y11")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK))
- PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
-
- PORT_START("Y12")
- PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("HOME") PORT_CODE(KEYCODE_F9)
- PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
-
- PORT_INCLUDE( coleco )
-INPUT_PORTS_END
-
-
-
-//**************************************************************************
// DEVICE CONFIGURATION
//**************************************************************************
//-------------------------------------------------
-// TMS9928a_interface tms9928a_interface
+// TMS9928A_INTERFACE( vdc_intf )
//-------------------------------------------------
-WRITE_LINE_MEMBER( adam_state::adam_vdp_interrupt )
+WRITE_LINE_MEMBER( adam_state::vdc_int_w )
{
if (state && !m_vdp_nmi)
{
@@ -1618,66 +783,11 @@ WRITE_LINE_MEMBER( adam_state::adam_vdp_interrupt )
m_vdp_nmi = state;
}
-static TMS9928A_INTERFACE(vcd_intf)
+static TMS9928A_INTERFACE( vdc_intf )
{
SCREEN_TAG,
0x4000,
- DEVCB_DRIVER_LINE_MEMBER(adam_state, adam_vdp_interrupt)
-};
-
-//-------------------------------------------------
-// cassette_interface adam_cassette_interface
-//-------------------------------------------------
-
-static const struct CassetteOptions adam_cassette_options =
-{
- 2, /* channels */
- 16, /* bits per sample */
- 44100 /* sample frequency */
-};
-
-static const cassette_interface adam_cassette_interface =
-{
- coleco_adam_cassette_formats,
- &adam_cassette_options,
- (cassette_state)(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED),
- "adam_cass",
- NULL
-};
-
-
-//-------------------------------------------------
-// wd17xx_interface fdc_intf
-//-------------------------------------------------
-
-static LEGACY_FLOPPY_OPTIONS_START( adam )
- LEGACY_FLOPPY_OPTION( adam, "dsk", "Coleco Adam floppy disk image", basicdsk_identify_default, basicdsk_construct_default, NULL,
- HEADS([1])
- TRACKS([40])
- SECTORS([8])
- SECTOR_LENGTH([512])
- FIRST_SECTOR_ID([0]))
-LEGACY_FLOPPY_OPTIONS_END
-
-static const floppy_interface adam_floppy_interface =
-{
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- DEVCB_NULL,
- FLOPPY_STANDARD_5_25_SSDD,
- LEGACY_FLOPPY_OPTIONS_NAME(adam),
- "floppy_5_25",
- NULL
-};
-
-static const wd17xx_interface fdc_intf =
-{
- DEVCB_NULL,
- DEVCB_CPU_INPUT_LINE(M6801_FDC_TAG, INPUT_LINE_NMI),
- DEVCB_NULL,
- { FLOPPY_0, NULL, NULL, NULL }
+ DEVCB_DRIVER_LINE_MEMBER(adam_state, vdc_int_w)
};
@@ -1687,12 +797,12 @@ static const wd17xx_interface fdc_intf =
static const sn76496_config psg_intf =
{
- DEVCB_NULL
+ DEVCB_NULL // TODO Z80 RDY
};
//-------------------------------------------------
-// M6801_INTERFACE( master6801_intf )
+// M6801_INTERFACE( m6801_intf )
//-------------------------------------------------
WRITE_LINE_MEMBER( adam_state::os3_w )
@@ -1717,7 +827,7 @@ WRITE_LINE_MEMBER( adam_state::os3_w )
}
}
-static M6801_INTERFACE( master6801_intf )
+static M6801_INTERFACE( m6801_intf )
{
DEVCB_DRIVER_LINE_MEMBER(adam_state, os3_w)
};
@@ -1737,23 +847,16 @@ void adam_state::machine_start()
// state saving
save_item(NAME(m_mioc));
save_item(NAME(m_game));
- save_item(NAME(m_adamnet));
- save_item(NAME(m_txd));
- save_item(NAME(m_rxd));
- save_item(NAME(m_reset));
+ save_item(NAME(m_an));
save_item(NAME(m_ba));
save_item(NAME(m_dma));
save_item(NAME(m_bwr));
save_item(NAME(m_data_in));
save_item(NAME(m_data_out));
- save_item(NAME(m_key_y));
save_item(NAME(m_joy_mode));
save_item(NAME(m_joy_status0));
save_item(NAME(m_joy_status1));
save_item(NAME(m_vdp_nmi));
- save_item(NAME(m_wr0));
- save_item(NAME(m_wr1));
- save_item(NAME(m_track));
}
@@ -1765,7 +868,7 @@ void adam_state::machine_reset()
{
device_image_interface *image = dynamic_cast<device_image_interface *>(machine().device("cart"));
- if (image->exists())
+ if (image->exists())
{
// game reset
m_game = 1;
@@ -1778,9 +881,12 @@ void adam_state::machine_reset()
m_mioc = 0;
}
- m_adamnet = 0;
+ m_an = 0;
bankswitch();
+
+ m_maincpu->reset();
+ m_netcpu->reset();
}
@@ -1799,42 +905,14 @@ static MACHINE_CONFIG_START( adam, adam_state )
MCFG_CPU_PROGRAM_MAP(adam_mem)
MCFG_CPU_IO_MAP(adam_io)
- MCFG_CPU_ADD(M6801_MAIN_TAG, M6801, XTAL_4MHz)
- MCFG_CPU_PROGRAM_MAP(master6801_mem)
- MCFG_CPU_IO_MAP(master6801_io)
- MCFG_CPU_CONFIG(master6801_intf)
-
- // keyboard
- MCFG_CPU_ADD(M6801_KB_TAG, M6801, XTAL_4MHz)
- MCFG_CPU_PROGRAM_MAP(kb6801_mem)
- MCFG_CPU_IO_MAP(kb6801_io)
-
- // digital data pack
- MCFG_CPU_ADD(M6801_DDP_TAG, M6801, XTAL_4MHz)
- MCFG_CPU_PROGRAM_MAP(ddp6801_mem)
- MCFG_CPU_IO_MAP(ddp6801_io)
- MCFG_CASSETTE_ADD(CASSETTE_TAG, adam_cassette_interface)
- MCFG_CASSETTE_ADD(CASSETTE2_TAG, adam_cassette_interface)
-
- // printer
- MCFG_CPU_ADD(M6801_PRN_TAG, M6801, XTAL_4MHz)
- MCFG_CPU_PROGRAM_MAP(printer6801_mem)
- MCFG_CPU_IO_MAP(printer6801_io)
- MCFG_DEVICE_DISABLE()
-
- // floppy
- MCFG_CPU_ADD(M6801_FDC_TAG, M6801, XTAL_4MHz)
- MCFG_CPU_PROGRAM_MAP(fdc6801_mem)
- MCFG_CPU_IO_MAP(fdc6801_io)
- MCFG_WD2793_ADD(WD2793_TAG, fdc_intf)
- MCFG_LEGACY_FLOPPY_DRIVE_ADD(FLOPPY_0, adam_floppy_interface)
-
- // serial port interface
- MCFG_CPU_ADD(M6801_SPI_TAG, M6801, XTAL_4MHz)
- MCFG_DEVICE_DISABLE()
+ MCFG_CPU_ADD(M6801_TAG, M6801, XTAL_4MHz)
+ MCFG_CPU_PROGRAM_MAP(m6801_mem)
+ MCFG_CPU_IO_MAP(m6801_io)
+ MCFG_CPU_CONFIG(m6801_intf)
+ MCFG_QUANTUM_PERFECT_CPU(M6801_TAG)
// video hardware
- MCFG_TMS9928A_ADD(TMS9928A_TAG, TMS9928A, vcd_intf)
+ MCFG_TMS9928A_ADD(TMS9928A_TAG, TMS9928A, vdc_intf)
MCFG_TMS9928A_SCREEN_ADD_NTSC(SCREEN_TAG)
MCFG_SCREEN_UPDATE_DEVICE(TMS9928A_TAG, tms9928a_device, screen_update)
@@ -1842,9 +920,26 @@ static MACHINE_CONFIG_START( adam, adam_state )
MCFG_SPEAKER_STANDARD_MONO("mono")
MCFG_SOUND_ADD(SN76489A_TAG, SN76489A, XTAL_7_15909MHz/2)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00)
- MCFG_SOUND_CONFIG(psg_intf)
+ MCFG_SOUND_CONFIG(psg_intf)
// devices
+ MCFG_ADAMNET_BUS_ADD()
+ MCFG_ADAMNET_SLOT_ADD("an1", adamnet_devices, "kb", NULL)
+ MCFG_ADAMNET_SLOT_ADD("an2", adamnet_devices, "prn", NULL)
+ MCFG_ADAMNET_SLOT_ADD("an3", adamnet_devices, "ddp", NULL)
+ MCFG_ADAMNET_SLOT_ADD("an4", adamnet_devices, "fdc", NULL)
+ MCFG_ADAMNET_SLOT_ADD("an5", adamnet_devices, NULL, NULL)
+ MCFG_ADAMNET_SLOT_ADD("an6", adamnet_devices, NULL, NULL)
+ MCFG_ADAMNET_SLOT_ADD("an7", adamnet_devices, NULL, NULL)
+ MCFG_ADAMNET_SLOT_ADD("an8", adamnet_devices, NULL, NULL)
+ MCFG_ADAMNET_SLOT_ADD("an9", adamnet_devices, NULL, NULL)
+ MCFG_ADAMNET_SLOT_ADD("an10", adamnet_devices, NULL, NULL)
+ MCFG_ADAMNET_SLOT_ADD("an11", adamnet_devices, NULL, NULL)
+ MCFG_ADAMNET_SLOT_ADD("an12", adamnet_devices, NULL, NULL)
+ MCFG_ADAMNET_SLOT_ADD("an13", adamnet_devices, NULL, NULL)
+ MCFG_ADAMNET_SLOT_ADD("an14", adamnet_devices, NULL, NULL)
+ MCFG_ADAMNET_SLOT_ADD("an15", adamnet_devices, NULL, NULL)
+
MCFG_TIMER_DRIVER_ADD_PERIODIC("paddles", adam_state, paddle_tick, attotime::from_msec(20))
// cartridge
@@ -1892,33 +987,16 @@ ROM_START( adam )
ROM_LOAD( "alf #3 rev 57 8534.u21", 0x4000, 0x2000, CRC(77657b90) SHA1(d25d32ab6c8fafbc21b4b925b3e644fa26d111f7) )
ROM_LOAD( "eos 6 rev 57 08dd.u22", 0x8000, 0x2000, CRC(ef6403c5) SHA1(28c7616cd02e4286f9b4c1c4a8b8850832b49fcb) )
ROM_CONTINUE( 0x6000, 0x2000 )
- ROM_LOAD( "wp_r80.rom", 0x0000, 0x8000, BAD_DUMP CRC(58d86a2a) SHA1(d4aec4efe1431e56fe52d83baf9118542c525255) ) // should be separate 8/16K ROMs
+ ROM_LOAD( "wp_r80.rom", 0x0000, 0x8000, BAD_DUMP CRC(58d86a2a) SHA1(d4aec4efe1431e56fe52d83baf9118542c525255) ) // should be separate 8/16K ROMs
+
+ ROM_REGION( 0x800, M6801_TAG, 0 )
+ ROM_LOAD( "master rev a 174b.u6", 0x000, 0x800, CRC(035a7a3d) SHA1(0426e6eaf18c2be9fe08066570c214ab5951ee14) )
ROM_REGION( 0x8000, "xrom", ROMREGION_ERASE00 )
ROM_CART_LOAD( "xrom", 0x0000, 0x8000, ROM_NOMIRROR | ROM_OPTIONAL )
ROM_REGION( 0x8000, "cart", 0 )
ROM_CART_LOAD( "cart", 0x0000, 0x8000, ROM_NOMIRROR | ROM_OPTIONAL )
-
- ROM_REGION( 0x800, M6801_MAIN_TAG, 0 )
- ROM_LOAD( "master rev a 174b.u6", 0x000, 0x800, CRC(035a7a3d) SHA1(0426e6eaf18c2be9fe08066570c214ab5951ee14) )
-
- ROM_REGION( 0x800, M6801_KB_TAG, 0 )
- ROM_LOAD( "keyboard.u2", 0x000, 0x800, CRC(ef204746) SHA1(83162ffc75847328a05429135b728a63efb05b93) )
-
- ROM_REGION( 0x800, M6801_DDP_TAG, 0 )
- ROM_LOAD( "tape rev a 8865.u24", 0x000, 0x800, CRC(6b9ea1cf) SHA1(b970f11e8f443fa130fba02ad1f60da51bf89673) )
-
- ROM_REGION( 0x800, M6801_PRN_TAG, 0 )
- ROM_LOAD( "printer.u2", 0x000, 0x800, CRC(e8db783b) SHA1(32b40679749ad0317c2c9ee9ca619fad6d850ce7) )
-
- ROM_REGION( 0x1000, M6801_FDC_TAG, 0 )
- ROM_LOAD( "320ta.u10", 0x0000, 0x1000, CRC(dcd865b3) SHA1(dde583e0d18ce4406e9ea44ab34d083e73ee30e2) ) // 320KB DSDD
- ROM_LOAD( "pmhdfdc.u10", 0x0000, 0x1000, CRC(fed4006c) SHA1(bc8dd00dd5cde9500a4cd7dc1e4d74330184472a) ) // PowerMate High-Density
- ROM_LOAD( "ad31_reva.u10", 0x0000, 0x1000, CRC(4b0b7143) SHA1(1cb68891c3af80e99efad7e309136ca37244f060) ) // Coleco original 160KB SSDD
-
- ROM_REGION( 0x800, M6801_SPI_TAG, 0 )
- ROM_LOAD( "spi.bin", 0x000, 0x800, CRC(4ba30352) SHA1(99fe5aebd505a208bea6beec5d7322b15426e9c1) )
ROM_END
@@ -1928,4 +1006,4 @@ ROM_END
//**************************************************************************
// YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS
-COMP( 1982, adam, 0, coleco, adam, adam, driver_device, 0, "Coleco", "Adam", GAME_NOT_WORKING )
+COMP( 1982, adam, 0, coleco, adam, coleco, driver_device, 0, "Coleco", "Adam", GAME_SUPPORTS_SAVE )
diff --git a/src/mess/includes/adam.h b/src/mess/includes/adam.h
index 1a9fdd295a0..fdb31c58594 100644
--- a/src/mess/includes/adam.h
+++ b/src/mess/includes/adam.h
@@ -6,64 +6,41 @@
#include "emu.h"
#include "cpu/z80/z80.h"
#include "cpu/m6800/m6800.h"
-#include "formats/basicdsk.h"
-#include "formats/adam_cas.h"
#include "imagedev/cartslot.h"
-#include "imagedev/cassette.h"
-#include "imagedev/flopdrv.h"
+#include "machine/adamnet.h"
#include "machine/coleco.h"
#include "machine/ram.h"
-#include "machine/wd17xx.h"
#include "sound/sn76496.h"
#include "video/tms9928a.h"
-#define Z80_TAG "u1"
-#define SN76489A_TAG "u20"
-#define TMS9928A_TAG "tms9928a"
-#define WD2793_TAG "u11"
-#define M6801_MAIN_TAG "cpu1"
-#define M6801_KB_TAG "cpu2"
-#define M6801_DDP_TAG "cpu3"
-#define M6801_PRN_TAG "cpu4"
-#define M6801_FDC_TAG "cpu5"
-#define M6801_SPI_TAG "cpu6"
-#define SCREEN_TAG "screen"
+#define Z80_TAG "u1"
+#define M6801_TAG "u6"
+#define SN76489A_TAG "u20"
+#define TMS9928A_TAG "tms9928a"
+#define SCREEN_TAG "screen"
class adam_state : public driver_device
{
public:
adam_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
- m_maincpu(*this, Z80_TAG),
- m_netcpu(*this, M6801_MAIN_TAG),
- m_fdc(*this, WD2793_TAG),
- m_ram(*this, RAM_TAG),
- m_ddp0(*this, CASSETTE_TAG),
- m_ddp1(*this, CASSETTE2_TAG),
- m_floppy0(*this, FLOPPY_0),
- m_rxd(1),
- m_reset(0),
- m_dma(1),
- m_bwr(1),
- m_fdc_ram(*this, "fdc_ram")
- {
- for (int i = 0; i < 6; i++)
- m_txd[i] = 1;
- }
+ m_maincpu(*this, Z80_TAG),
+ m_netcpu(*this, M6801_TAG),
+ m_ram(*this, RAM_TAG),
+ m_adamnet(*this, ADAMNET_TAG),
+ m_dma(1),
+ m_bwr(1)
+ { }
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_netcpu;
- required_device<wd2793_device> m_fdc;
required_device<ram_device> m_ram;
- required_device<cassette_image_device> m_ddp0;
- required_device<cassette_image_device> m_ddp1;
- required_device<legacy_floppy_image_device> m_floppy0;
+ required_device<adamnet_device> m_adamnet;
virtual void machine_start();
virtual void machine_reset();
void bankswitch();
- void adamnet_txd_w(int device, int state);
DECLARE_WRITE_LINE_MEMBER( os3_w );
@@ -76,48 +53,21 @@ public:
DECLARE_READ8_MEMBER( input1_r );
DECLARE_READ8_MEMBER( input2_r );
- DECLARE_WRITE8_MEMBER( master6801_p1_w );
- DECLARE_READ8_MEMBER( master6801_p2_r );
- DECLARE_WRITE8_MEMBER( master6801_p2_w );
- DECLARE_READ8_MEMBER( master6801_p3_r );
- DECLARE_WRITE8_MEMBER( master6801_p3_w );
- DECLARE_WRITE8_MEMBER( master6801_p4_w );
-
- DECLARE_READ8_MEMBER( kb6801_p1_r );
- DECLARE_READ8_MEMBER( kb6801_p2_r );
- DECLARE_WRITE8_MEMBER( kb6801_p2_w );
- DECLARE_READ8_MEMBER( kb6801_p3_r );
- DECLARE_WRITE8_MEMBER( kb6801_p3_w );
- DECLARE_READ8_MEMBER( kb6801_p4_r );
- DECLARE_WRITE8_MEMBER( kb6801_p4_w );
-
- DECLARE_WRITE8_MEMBER( ddp6801_p1_w );
- DECLARE_READ8_MEMBER( ddp6801_p2_r );
- DECLARE_WRITE8_MEMBER( ddp6801_p2_w );
- DECLARE_READ8_MEMBER( ddp6801_p4_r );
-
- DECLARE_WRITE8_MEMBER( printer6801_p1_w );
- DECLARE_READ8_MEMBER( printer6801_p2_r );
- DECLARE_WRITE8_MEMBER( printer6801_p2_w );
- DECLARE_READ8_MEMBER( printer6801_p3_r );
- DECLARE_READ8_MEMBER( printer6801_p4_r );
- DECLARE_WRITE8_MEMBER( printer6801_p4_w );
-
- DECLARE_READ8_MEMBER( fdc6801_p1_r );
- DECLARE_WRITE8_MEMBER( fdc6801_p1_w );
- DECLARE_READ8_MEMBER( fdc6801_p2_r );
- DECLARE_WRITE8_MEMBER( fdc6801_p2_w );
- DECLARE_WRITE8_MEMBER( fdc6801_p4_w );
+ DECLARE_WRITE8_MEMBER( m6801_p1_w );
+ DECLARE_READ8_MEMBER( m6801_p2_r );
+ DECLARE_WRITE8_MEMBER( m6801_p2_w );
+ DECLARE_READ8_MEMBER( m6801_p3_r );
+ DECLARE_WRITE8_MEMBER( m6801_p3_w );
+ DECLARE_WRITE8_MEMBER( m6801_p4_w );
+
+ DECLARE_WRITE_LINE_MEMBER( vdc_int_w );
// memory state
UINT8 m_mioc;
int m_game;
// ADAMnet state
- UINT8 m_adamnet;
- int m_txd[6];
- int m_rxd;
- int m_reset;
+ UINT8 m_an;
// DMA state
UINT16 m_ba;
@@ -126,9 +76,6 @@ public:
UINT8 m_data_in;
UINT8 m_data_out;
- // keyboard state
- UINT16 m_key_y;
-
// paddle state
int m_joy_mode;
UINT8 m_joy_status0;
@@ -137,15 +84,7 @@ public:
// video state
int m_vdp_nmi;
- // cassette state
- int m_wr0;
- int m_wr1;
- int m_track;
TIMER_DEVICE_CALLBACK_MEMBER(paddle_tick);
- DECLARE_WRITE_LINE_MEMBER(adam_vdp_interrupt);
-
- // floppy state
- required_shared_ptr<UINT8> m_fdc_ram;
};
#endif
diff --git a/src/mess/machine/adam_ddp.c b/src/mess/machine/adam_ddp.c
new file mode 100644
index 00000000000..e46cf3d31de
--- /dev/null
+++ b/src/mess/machine/adam_ddp.c
@@ -0,0 +1,315 @@
+/**********************************************************************
+
+ Coleco Adam Digital Data Pack emulation
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************/
+
+#include "adam_ddp.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define M6801_TAG "m6801"
+
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type ADAM_DDP = &device_creator<adam_digital_data_pack_device>;
+
+
+//-------------------------------------------------
+// ROM( adam_ddp )
+//-------------------------------------------------
+
+ROM_START( adam_ddp )
+ ROM_REGION( 0x800, M6801_TAG, 0 )
+ ROM_LOAD( "tape rev a 8865.u24", 0x000, 0x800, CRC(6b9ea1cf) SHA1(b970f11e8f443fa130fba02ad1f60da51bf89673) )
+ROM_END
+
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const rom_entry *adam_digital_data_pack_device::device_rom_region() const
+{
+ return ROM_NAME( adam_ddp );
+}
+
+
+//-------------------------------------------------
+// ADDRESS_MAP( adam_ddp_mem )
+//-------------------------------------------------
+
+static ADDRESS_MAP_START( adam_ddp_mem, AS_PROGRAM, 8, adam_digital_data_pack_device )
+ AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(m6801_io_r, m6801_io_w)
+ AM_RANGE(0x0080, 0x00ff) AM_RAM
+ AM_RANGE(0x0400, 0x07ff) AM_RAM
+ AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION(M6801_TAG, 0)
+ADDRESS_MAP_END
+
+
+//-------------------------------------------------
+// ADDRESS_MAP( adam_ddp_io )
+//-------------------------------------------------
+
+static ADDRESS_MAP_START( adam_ddp_io, AS_IO, 8, adam_digital_data_pack_device )
+ AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE(p1_w)
+ AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(p2_r, p2_w)
+ AM_RANGE(M6801_PORT3, M6801_PORT3) AM_NOP // Multiplexed Address/Data
+ AM_RANGE(M6801_PORT4, M6801_PORT4) AM_READ(p4_r) AM_WRITENOP
+ADDRESS_MAP_END
+
+
+//-------------------------------------------------
+// cassette_interface adam_cassette_interface
+//-------------------------------------------------
+
+static const struct CassetteOptions adam_cassette_options =
+{
+ 2, /* channels */
+ 16, /* bits per sample */
+ 44100 /* sample frequency */
+};
+
+static const cassette_interface adam_cassette_interface =
+{
+ coleco_adam_cassette_formats,
+ &adam_cassette_options,
+ (cassette_state)(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED),
+ "adam_cass",
+ NULL
+};
+
+
+//-------------------------------------------------
+// MACHINE_DRIVER( adam_ddp )
+//-------------------------------------------------
+
+static MACHINE_CONFIG_FRAGMENT( adam_ddp )
+ MCFG_CPU_ADD(M6801_TAG, M6801, XTAL_4MHz)
+ MCFG_CPU_PROGRAM_MAP(adam_ddp_mem)
+ MCFG_CPU_IO_MAP(adam_ddp_io)
+
+ MCFG_CASSETTE_ADD(CASSETTE_TAG, adam_cassette_interface)
+ MCFG_CASSETTE_ADD(CASSETTE2_TAG, adam_cassette_interface)
+MACHINE_CONFIG_END
+
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor adam_digital_data_pack_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( adam_ddp );
+}
+
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// adam_digital_data_pack_device - constructor
+//-------------------------------------------------
+
+adam_digital_data_pack_device::adam_digital_data_pack_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ADAM_DDP, "Adam DDP", tag, owner, clock),
+ device_adamnet_card_interface(mconfig, *this),
+ m_maincpu(*this, M6801_TAG),
+ m_ddp0(*this, CASSETTE_TAG),
+ m_ddp1(*this, CASSETTE2_TAG)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void adam_digital_data_pack_device::device_start()
+{
+ // state saving
+ save_item(NAME(m_wr0));
+ save_item(NAME(m_wr1));
+ save_item(NAME(m_track));
+}
+
+
+//-------------------------------------------------
+// adamnet_reset_w -
+//-------------------------------------------------
+
+void adam_digital_data_pack_device::adamnet_reset_w(int state)
+{
+ m_maincpu->set_input_line(INPUT_LINE_RESET, state);
+}
+
+
+//-------------------------------------------------
+// p1_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( adam_digital_data_pack_device::p1_w )
+{
+ /*
+
+ bit description
+
+ 0 SPD SEL (0=20 ips, 1=80ips)
+ 1 STOP0
+ 2 STOP1
+ 3 _GO FWD
+ 4 _GO REV
+ 5 BRAKE
+ 6 _WR0
+ 7 _WR1
+
+ */
+
+ if (m_ddp0->exists())
+ {
+ m_ddp0->set_speed(BIT(data, 0) ? (double) 80/1.875 : 20/1.875); // speed select
+ if(!(data & 0x08)) m_ddp0->go_forward();
+ if(!(data & 0x10)) m_ddp0->go_reverse();
+ m_ddp0->change_state(BIT(data, 1) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); // motor control
+ }
+
+ if (m_ddp1->exists())
+ {
+ m_ddp1->set_speed(BIT(data, 0) ? (double) 80/1.875 : 20/1.875); // speed select
+ if(!(data & 0x08)) m_ddp1->go_forward();
+ if(!(data & 0x10)) m_ddp1->go_reverse();
+ m_ddp1->change_state(BIT(data, 2) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR); // motor control
+ }
+
+ // data write 0
+ m_wr0 = BIT(data, 6);
+
+ // data write 1
+ m_wr1 = BIT(data, 7);
+}
+
+
+//-------------------------------------------------
+// p2_r -
+//-------------------------------------------------
+
+READ8_MEMBER( adam_digital_data_pack_device::p2_r )
+{
+ /*
+
+ bit description
+
+ 0 mode bit 0
+ 1 mode bit 1 / CIP1
+ 2 mode bit 2
+ 3 NET RXD
+ 4
+
+ */
+
+ UINT8 data = 0;
+
+ if (m_bus->reset_r())
+ data |= M6801_MODE_6;
+ else
+ data |= m_ddp1->exists() << 1; // Cassette in place 1
+
+ // NET RXD
+ data |= m_bus->rxd_r(this) << 3;
+
+ return data;
+}
+
+
+//-------------------------------------------------
+// p2_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( adam_digital_data_pack_device::p2_w )
+{
+ /*
+
+ bit description
+
+ 0 WRT DATA
+ 1
+ 2 TRACK A/B (0=B, 1=A)
+ 3
+ 4 NET TXD
+
+ */
+
+ if (m_ddp0->exists())
+ {
+ m_ddp0->set_channel(!BIT(data, 2)); // Track select
+ if (!m_wr0) m_ddp0->output(BIT(data, 0) ? 1.0 : -1.0); // write data
+ }
+
+ if (m_ddp1->exists())
+ {
+ m_ddp1->set_channel(!BIT(data, 2));
+ if (!m_wr1) m_ddp1->output(BIT(data, 0) ? 1.0 : -1.0);
+ }
+
+ // NET TXD
+ m_bus->txd_w(this, BIT(data, 4));
+}
+
+
+//-------------------------------------------------
+// p4_r -
+//-------------------------------------------------
+
+READ8_MEMBER( adam_digital_data_pack_device::p4_r )
+{
+ /*
+
+ bit description
+
+ 0 A8
+ 1 A9
+ 2 A10 (2114 _S)
+ 3 MSENSE 0
+ 4 MSENSE 1
+ 5 CIP0
+ 6 RD DATA 0 (always 1)
+ 7 RD DATA 1 (data from drives ORed together)
+
+ */
+
+ UINT8 data = 0;
+
+ // drive 0
+ if (m_ddp0->exists())
+ {
+ data |= ((m_ddp0->get_state() & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED) << 3; // motion sense
+ data |= 1 << 5; // cassette in place
+ data |= (m_ddp0->input() < 0) << 7; // read data
+ }
+
+ // drive 1
+ if (m_ddp1->exists())
+ {
+ data |= ((m_ddp1->get_state() & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED) << 4; // motion sense
+ data |= (m_ddp1->input() < 0) << 7; // read data
+ }
+
+ // read data 0 (always 1)
+ data |= 0x40;
+
+ return data;
+}
diff --git a/src/mess/machine/adam_ddp.h b/src/mess/machine/adam_ddp.h
new file mode 100644
index 00000000000..9431b021ba5
--- /dev/null
+++ b/src/mess/machine/adam_ddp.h
@@ -0,0 +1,69 @@
+/**********************************************************************
+
+ Coleco Adam Digital Data Pack emulation
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************/
+
+#pragma once
+
+#ifndef __ADAM_DDP__
+#define __ADAM_DDP__
+
+#include "emu.h"
+#include "cpu/m6800/m6800.h"
+#include "formats/adam_cas.h"
+#include "imagedev/cassette.h"
+#include "machine/adamnet.h"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> adam_digital_data_pack_device
+
+class adam_digital_data_pack_device : public device_t,
+ public device_adamnet_card_interface
+{
+public:
+ // construction/destruction
+ adam_digital_data_pack_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual const rom_entry *device_rom_region() const;
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ // not really public
+ DECLARE_WRITE8_MEMBER( p1_w );
+ DECLARE_READ8_MEMBER( p2_r );
+ DECLARE_WRITE8_MEMBER( p2_w );
+ DECLARE_READ8_MEMBER( p4_r );
+
+protected:
+ // device-level overrides
+ virtual void device_config_complete() { m_shortname = "adam_ddp"; }
+ virtual void device_start();
+
+ // device_adamnet_card_interface overrides
+ virtual void adamnet_reset_w(int state);
+
+ required_device<cpu_device> m_maincpu;
+ required_device<cassette_image_device> m_ddp0;
+ required_device<cassette_image_device> m_ddp1;
+
+ int m_wr0;
+ int m_wr1;
+ int m_track;
+};
+
+
+// device type definition
+extern const device_type ADAM_DDP;
+
+
+
+#endif
diff --git a/src/mess/machine/adam_fdc.c b/src/mess/machine/adam_fdc.c
new file mode 100644
index 00000000000..345c6414072
--- /dev/null
+++ b/src/mess/machine/adam_fdc.c
@@ -0,0 +1,324 @@
+/**********************************************************************
+
+ Coleco Adam floppy disk controller emulation
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************/
+
+#include "adam_fdc.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define M6801_TAG "u6"
+#define WD2793_TAG "u11"
+
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type ADAM_FDC = &device_creator<adam_fdc_device>;
+
+
+//-------------------------------------------------
+// ROM( adam_fdc )
+//-------------------------------------------------
+
+ROM_START( adam_fdc )
+ ROM_REGION( 0x1000, M6801_TAG, 0 )
+ ROM_DEFAULT_BIOS("ssdd")
+ ROM_SYSTEM_BIOS( 0, "ssdd", "Coleco 160KB SSDD" )
+ ROMX_LOAD( "ad31_reva.u10", 0x0000, 0x1000, CRC(4b0b7143) SHA1(1cb68891c3af80e99efad7e309136ca37244f060), ROM_BIOS(1) )
+ ROM_SYSTEM_BIOS( 1, "dsdd", "320KB DSDD" )
+ ROMX_LOAD( "320ta.u10", 0x0000, 0x1000, CRC(dcd865b3) SHA1(dde583e0d18ce4406e9ea44ab34d083e73ee30e2), ROM_BIOS(2) )
+ ROM_SYSTEM_BIOS( 2, "pmhd", "Powermate High Density" )
+ ROMX_LOAD( "pmhdfdc.u10", 0x0000, 0x1000, CRC(fed4006c) SHA1(bc8dd00dd5cde9500a4cd7dc1e4d74330184472a), ROM_BIOS(3) )
+ROM_END
+
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const rom_entry *adam_fdc_device::device_rom_region() const
+{
+ return ROM_NAME( adam_fdc );
+}
+
+
+//-------------------------------------------------
+// ADDRESS_MAP( fdc6801_mem )
+//-------------------------------------------------
+
+static ADDRESS_MAP_START( adam_fdc_mem, AS_PROGRAM, 8, adam_fdc_device )
+ AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(m6801_io_r, m6801_io_w)
+ AM_RANGE(0x0080, 0x00ff) AM_RAM
+ AM_RANGE(0x0400, 0x07ff) AM_RAM AM_WRITEONLY AM_SHARE("ram")
+ AM_RANGE(0x0800, 0x0800) AM_MIRROR(0xff) AM_DEVREAD(WD2793_TAG, wd2793_t, status_r)
+ AM_RANGE(0x1400, 0x17ff) AM_RAM AM_READONLY AM_SHARE("ram")
+ AM_RANGE(0x1800, 0x1800) AM_MIRROR(0xff) AM_DEVWRITE(WD2793_TAG, wd2793_t, cmd_w)
+ AM_RANGE(0x2800, 0x2800) AM_MIRROR(0xff) AM_DEVREAD(WD2793_TAG, wd2793_t, track_r)
+ AM_RANGE(0x3800, 0x3800) AM_MIRROR(0xff) AM_DEVWRITE(WD2793_TAG, wd2793_t, track_w)
+ AM_RANGE(0x4800, 0x4800) AM_MIRROR(0xff) AM_DEVREAD(WD2793_TAG, wd2793_t, sector_r)
+ AM_RANGE(0x5800, 0x5800) AM_MIRROR(0xff) AM_DEVWRITE(WD2793_TAG, wd2793_t, sector_w)
+ AM_RANGE(0x6800, 0x6800) AM_MIRROR(0xff) AM_DEVREAD(WD2793_TAG, wd2793_t, data_r)
+ AM_RANGE(0x7800, 0x7800) AM_MIRROR(0xff) AM_DEVWRITE(WD2793_TAG, wd2793_t, data_w)
+ AM_RANGE(0x8000, 0x8fff) AM_MIRROR(0x7000) AM_ROM AM_REGION(M6801_TAG, 0)
+ADDRESS_MAP_END
+
+
+//-------------------------------------------------
+// ADDRESS_MAP( fdc6801_io )
+//-------------------------------------------------
+
+static ADDRESS_MAP_START( adam_fdc_io, AS_IO, 8, adam_fdc_device )
+ AM_RANGE(M6801_PORT1, M6801_PORT1) AM_READWRITE(p1_r, p1_w)
+ AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(p2_r, p2_w)
+ AM_RANGE(M6801_PORT3, M6801_PORT3) AM_WRITENOP
+ AM_RANGE(M6801_PORT4, M6801_PORT4) AM_WRITENOP
+ADDRESS_MAP_END
+
+
+//-------------------------------------------------
+// floppy_format_type floppy_formats
+//-------------------------------------------------
+
+void adam_fdc_device::fdc_intrq_w(bool state)
+{
+ m_maincpu->set_input_line(INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
+}
+
+const floppy_format_type adam_fdc_device::floppy_formats[] = {
+ FLOPPY_ADAM_FORMAT, FLOPPY_MFM_FORMAT, FLOPPY_MFI_FORMAT,
+ NULL
+};
+
+static SLOT_INTERFACE_START( adam_fdc_floppies )
+ SLOT_INTERFACE( "525dd", FLOPPY_525_DD )
+SLOT_INTERFACE_END
+
+
+//-------------------------------------------------
+// MACHINE_DRIVER( adam_fdc )
+//-------------------------------------------------
+
+static MACHINE_CONFIG_FRAGMENT( adam_fdc )
+ MCFG_CPU_ADD(M6801_TAG, M6801, XTAL_4MHz)
+ MCFG_CPU_PROGRAM_MAP(adam_fdc_mem)
+ MCFG_CPU_IO_MAP(adam_fdc_io)
+ MCFG_DEVICE_DISABLE() // TODO
+
+ MCFG_WD2793x_ADD(WD2793_TAG, XTAL_4MHz/4)
+
+ MCFG_FLOPPY_DRIVE_ADD(WD2793_TAG":0", adam_fdc_floppies, "525dd", 0, adam_fdc_device::floppy_formats)
+MACHINE_CONFIG_END
+
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor adam_fdc_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( adam_fdc );
+}
+
+
+//-------------------------------------------------
+// INPUT_PORTS( adam_fdc )
+//-------------------------------------------------
+
+static INPUT_PORTS_START( adam_fdc )
+ PORT_START("SW3")
+ PORT_DIPNAME( 0x01, 0x00, "Drive Select" ) PORT_DIPLOCATION("SW3:1")
+ PORT_DIPSETTING( 0x00, "DS1" )
+ PORT_DIPSETTING( 0x01, "DS2" )
+INPUT_PORTS_END
+
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor adam_fdc_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( adam_fdc );
+}
+
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// adam_fdc_device - constructor
+//-------------------------------------------------
+
+adam_fdc_device::adam_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ADAM_FDC, "Adam FDC", tag, owner, clock),
+ device_adamnet_card_interface(mconfig, *this),
+ m_maincpu(*this, M6801_TAG),
+ m_fdc(*this, WD2793_TAG),
+ m_floppy0(*this, WD2793_TAG":0"),
+ m_ram(*this, "ram"),
+ m_image0(NULL)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void adam_fdc_device::device_start()
+{
+ m_fdc->setup_intrq_cb(wd2793_t::line_cb(FUNC(adam_fdc_device::fdc_intrq_w), this));
+}
+
+
+//-------------------------------------------------
+// adamnet_reset_w -
+//-------------------------------------------------
+
+void adam_fdc_device::adamnet_reset_w(int state)
+{
+ m_maincpu->set_input_line(INPUT_LINE_RESET, state);
+
+ if (state == ASSERT_LINE) m_fdc->reset();
+}
+
+
+//-------------------------------------------------
+// p1_r -
+//-------------------------------------------------
+
+READ8_MEMBER( adam_fdc_device::p1_r )
+{
+ /*
+
+ bit description
+
+ 0 disk in place
+ 1
+ 2 FDC DRQ
+ 3
+ 4
+ 5
+ 6
+ 7 SW3 (0=DS1, 1=DS2)
+
+ */
+
+ UINT8 data = 0;
+
+ // disk in place
+ data |= m_floppy0->get_device()->exists();
+
+ // floppy data request
+ data |= m_fdc->drq_r() ? 0x04 : 0;
+
+ // drive select
+ data |= ioport("SW3")->read() << 7;
+
+ return data;
+}
+
+
+//-------------------------------------------------
+// p1_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( adam_fdc_device::p1_w )
+{
+ /*
+
+ bit description
+
+ 0
+ 1 FDC ENP
+ 2
+ 3 FDC _DDEN
+ 4
+ 5 DRIVE SELECT
+ 6 MOTOR ON
+ 7
+
+ */
+
+ // write precompensation
+ //m_fdc->enp_w(BIT(data, 1));
+
+ // density select
+ m_fdc->dden_w(BIT(data, 3));
+
+ // drive select
+ m_image0 = NULL;
+
+ if (BIT(data, 5))
+ {
+ m_image0 = m_floppy0->get_device();
+ }
+
+ m_fdc->set_floppy(m_image0);
+
+ // motor enable
+ if (m_image0) m_image0->mon_w(!BIT(data, 6));
+}
+
+
+//-------------------------------------------------
+// p2_r -
+//-------------------------------------------------
+
+READ8_MEMBER( adam_fdc_device::p2_r )
+{
+ /*
+
+ bit description
+
+ 0 mode bit 0
+ 1 mode bit 1
+ 2 mode bit 2
+ 3 NET RXD
+ 4
+
+ */
+
+ UINT8 data = M6801_MODE_2;
+
+ // NET RXD
+ data |= m_bus->rxd_r(this) << 3;
+
+ return data;
+}
+
+
+//-------------------------------------------------
+// p2_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( adam_fdc_device::p2_w )
+{
+ /*
+
+ bit description
+
+ 0
+ 1
+ 2
+ 3
+ 4 NET TXD
+
+ */
+
+ m_bus->txd_w(this, BIT(data, 4));
+}
diff --git a/src/mess/machine/adam_fdc.h b/src/mess/machine/adam_fdc.h
new file mode 100644
index 00000000000..98b26ac0c9a
--- /dev/null
+++ b/src/mess/machine/adam_fdc.h
@@ -0,0 +1,76 @@
+/**********************************************************************
+
+ Coleco Adam floppy disk controller emulation
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************/
+
+#pragma once
+
+#ifndef __ADAM_FDC__
+#define __ADAM_FDC__
+
+#include "emu.h"
+#include "cpu/m6800/m6800.h"
+#include "formats/adam_dsk.h"
+#include "formats/hxcmfm_dsk.h"
+#include "formats/mfi_dsk.h"
+#include "imagedev/floppy.h"
+#include "machine/adamnet.h"
+#include "machine/wd1772.h"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> adam_fdc_device
+
+class adam_fdc_device : public device_t,
+ public device_adamnet_card_interface
+{
+public:
+ // construction/destruction
+ adam_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual const rom_entry *device_rom_region() const;
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual ioport_constructor device_input_ports() const;
+
+ // not really public
+ DECLARE_READ8_MEMBER( p1_r );
+ DECLARE_WRITE8_MEMBER( p1_w );
+ DECLARE_READ8_MEMBER( p2_r );
+ DECLARE_WRITE8_MEMBER( p2_w );
+
+ void fdc_intrq_w(bool state);
+
+ static const floppy_format_type floppy_formats[];
+
+protected:
+ // device-level overrides
+ virtual void device_config_complete() { m_shortname = "adam_fdc"; }
+ virtual void device_start();
+
+ // device_adamnet_card_interface overrides
+ virtual void adamnet_reset_w(int state);
+
+ required_device<cpu_device> m_maincpu;
+ required_device<wd2793_t> m_fdc;
+ required_device<floppy_connector> m_floppy0;
+ required_shared_ptr<UINT8> m_ram;
+
+ floppy_image_device *m_image0;
+};
+
+
+// device type definition
+extern const device_type ADAM_FDC;
+
+
+
+#endif
diff --git a/src/mess/machine/adam_kb.c b/src/mess/machine/adam_kb.c
new file mode 100644
index 00000000000..509f3ab1a55
--- /dev/null
+++ b/src/mess/machine/adam_kb.c
@@ -0,0 +1,413 @@
+/**********************************************************************
+
+ Coleco Adam keyboard emulation
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************/
+
+#include "adam_kb.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define M6801_TAG "u2"
+
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type ADAM_KB = &device_creator<adam_keyboard_device>;
+
+
+//-------------------------------------------------
+// ROM( adam_kb )
+//-------------------------------------------------
+
+ROM_START( adam_kb )
+ ROM_REGION( 0x800, M6801_TAG, 0 )
+ ROM_LOAD( "keyboard.u2", 0x000, 0x800, CRC(ef204746) SHA1(83162ffc75847328a05429135b728a63efb05b93) )
+ROM_END
+
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const rom_entry *adam_keyboard_device::device_rom_region() const
+{
+ return ROM_NAME( adam_kb );
+}
+
+
+//-------------------------------------------------
+// ADDRESS_MAP( adam_kb_mem )
+//-------------------------------------------------
+
+static ADDRESS_MAP_START( adam_kb_mem, AS_PROGRAM, 8, adam_keyboard_device )
+ AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(m6801_io_r, m6801_io_w)
+ AM_RANGE(0x0080, 0x00ff) AM_RAM
+ AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION(M6801_TAG, 0)
+ADDRESS_MAP_END
+
+
+//-------------------------------------------------
+// ADDRESS_MAP( adam_kb_io )
+//-------------------------------------------------
+
+static ADDRESS_MAP_START( adam_kb_io, AS_IO, 8, adam_keyboard_device )
+ AM_RANGE(M6801_PORT1, M6801_PORT1) AM_READ(p1_r)
+ AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(p2_r, p2_w)
+ AM_RANGE(M6801_PORT3, M6801_PORT3) AM_READWRITE(p3_r, p3_w)
+ AM_RANGE(M6801_PORT4, M6801_PORT4) AM_READWRITE(p4_r, p4_w)
+ADDRESS_MAP_END
+
+
+//-------------------------------------------------
+// MACHINE_DRIVER( adam_kb )
+//-------------------------------------------------
+
+static MACHINE_CONFIG_FRAGMENT( adam_kb )
+ MCFG_CPU_ADD(M6801_TAG, M6801, XTAL_4MHz)
+ MCFG_CPU_PROGRAM_MAP(adam_kb_mem)
+ MCFG_CPU_IO_MAP(adam_kb_io)
+MACHINE_CONFIG_END
+
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor adam_keyboard_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( adam_kb );
+}
+
+
+//-------------------------------------------------
+// INPUT_PORTS( adam_kb )
+//-------------------------------------------------
+
+static INPUT_PORTS_START( adam_kb )
+ PORT_START("Y0")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("WILD CARD") PORT_CODE(KEYCODE_F7)
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("I") PORT_CODE(KEYCODE_F1)
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("II") PORT_CODE(KEYCODE_F2)
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("III") PORT_CODE(KEYCODE_F3)
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("IV") PORT_CODE(KEYCODE_F4)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("V") PORT_CODE(KEYCODE_F5)
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("VI") PORT_CODE(KEYCODE_F6)
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("UNDO") PORT_CODE(KEYCODE_F8)
+
+ PORT_START("Y1")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!')
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@')
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#')
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$')
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%')
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('_')
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&')
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*')
+
+ PORT_START("Y2")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t')
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q')
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W')
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E')
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R')
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T')
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y')
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U')
+
+ PORT_START("Y3")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A')
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S')
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D')
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F')
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G')
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H')
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J')
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K')
+
+ PORT_START("Y4")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z')
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X')
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C')
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V')
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B')
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N')
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M')
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
+
+ PORT_START("Y5")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(')
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')')
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('\'')
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('+') PORT_CHAR('=')
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('^') PORT_CHAR('~')
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L')
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':')
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('\'') PORT_CHAR('\"')
+
+ PORT_START("Y6")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I')
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O')
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P')
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') PORT_CHAR('{')
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') PORT_CHAR('}')
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR('>')
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?')
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("RETURN") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13)
+
+ PORT_START("Y7")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') PORT_CHAR('|')
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("ESCAPE/WP") PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC))
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED )
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("Space") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ')
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("MOVE/COPY") PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT))
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("STORE/GET") PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME))
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CLEAR") PORT_CODE(KEYCODE_PGUP) PORT_CHAR(UCHAR_MAMEKEY(PGUP))
+
+ PORT_START("Y8")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_UP) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP))
+ PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_RIGHT) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT))
+ PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_DOWN) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN))
+ PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME(UTF8_LEFT) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT))
+ PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("BACKSPACE") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8)
+ PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("INSERT") PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL))
+ PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("PRINT") PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(END))
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("DELETE") PORT_CODE(KEYCODE_PGDN) PORT_CHAR(UCHAR_MAMEKEY(PGDN))
+
+ PORT_START("Y9")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("CONTROL") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_MAMEKEY(LCONTROL))
+ PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("Y10")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("SHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_1)
+ PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("Y11")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("LOCK") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK))
+ PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
+
+ PORT_START("Y12")
+ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_NAME("HOME") PORT_CODE(KEYCODE_F9)
+ PORT_BIT( 0xfe, IP_ACTIVE_LOW, IPT_UNUSED )
+INPUT_PORTS_END
+
+
+//-------------------------------------------------
+// input_ports - device-specific input ports
+//-------------------------------------------------
+
+ioport_constructor adam_keyboard_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME( adam_kb );
+}
+
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// adam_keyboard_device - constructor
+//-------------------------------------------------
+
+adam_keyboard_device::adam_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ADAM_KB, "Adam keyboard", tag, owner, clock),
+ device_adamnet_card_interface(mconfig, *this),
+ m_maincpu(*this, M6801_TAG),
+ m_key_y(0x1ff)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void adam_keyboard_device::device_start()
+{
+ // state saving
+ save_item(NAME(m_key_y));
+}
+
+
+//-------------------------------------------------
+// adamnet_reset_w -
+//-------------------------------------------------
+
+void adam_keyboard_device::adamnet_reset_w(int state)
+{
+ m_maincpu->set_input_line(INPUT_LINE_RESET, state);
+}
+
+
+//-------------------------------------------------
+// p1_r -
+//-------------------------------------------------
+
+READ8_MEMBER( adam_keyboard_device::p1_r )
+{
+ /*
+
+ bit description
+
+ 0 X0
+ 1 X1
+ 2 X2
+ 3 X3
+ 4 X4
+ 5 X5
+ 6 X6
+ 7 X7
+
+ */
+
+ UINT8 data = 0xff;
+
+ if (!BIT(m_key_y, 0)) data &= ioport("Y0")->read();
+ if (!BIT(m_key_y, 1)) data &= ioport("Y1")->read();
+ if (!BIT(m_key_y, 2)) data &= ioport("Y2")->read();
+ if (!BIT(m_key_y, 3)) data &= ioport("Y3")->read();
+ if (!BIT(m_key_y, 4)) data &= ioport("Y4")->read();
+ if (!BIT(m_key_y, 5)) data &= ioport("Y5")->read();
+ if (!BIT(m_key_y, 6)) data &= ioport("Y6")->read();
+ if (!BIT(m_key_y, 7)) data &= ioport("Y7")->read();
+ if (!BIT(m_key_y, 8)) data &= ioport("Y8")->read();
+ if (!BIT(m_key_y, 9)) data &= ioport("Y9")->read();
+ if (!BIT(m_key_y, 10)) data &= ioport("Y10")->read();
+ if (!BIT(m_key_y, 11)) data &= ioport("Y11")->read();
+ if (!BIT(m_key_y, 12)) data &= ioport("Y12")->read();
+
+ return data;
+}
+
+
+//-------------------------------------------------
+// p2_r -
+//-------------------------------------------------
+
+READ8_MEMBER( adam_keyboard_device::p2_r )
+{
+ /*
+
+ bit description
+
+ 0 mode bit 0
+ 1 mode bit 1
+ 2 mode bit 2
+ 3 NET RXD
+ 4
+
+ */
+
+ UINT8 data = M6801_MODE_7;
+
+ // NET RXD
+ data |= m_bus->rxd_r(this) << 3;
+
+ return data;
+}
+
+
+//-------------------------------------------------
+// p2_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( adam_keyboard_device::p2_w )
+{
+ /*
+
+ bit description
+
+ 0
+ 1
+ 2
+ 3
+ 4 NET TXD
+
+ */
+
+ m_bus->txd_w(this, BIT(data, 4));
+}
+
+
+//-------------------------------------------------
+// p3_r -
+//-------------------------------------------------
+
+READ8_MEMBER( adam_keyboard_device::p3_r )
+{
+ return 0xff;
+}
+
+
+//-------------------------------------------------
+// p3_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( adam_keyboard_device::p3_w )
+{
+ /*
+
+ bit description
+
+ 0 Y0
+ 1 Y1
+ 2 Y2
+ 3 Y3
+ 4 Y4
+ 5 Y5
+ 6 Y6
+ 7 Y7
+
+ */
+
+ m_key_y = (m_key_y & 0x1f00) | data;
+}
+
+
+//-------------------------------------------------
+// p4_r -
+//-------------------------------------------------
+
+READ8_MEMBER( adam_keyboard_device::p4_r )
+{
+ return 0xff;
+}
+
+
+//-------------------------------------------------
+// p4_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( adam_keyboard_device::p4_w )
+{
+ /*
+
+ bit description
+
+ 0 Y8
+ 1 Y9
+ 2 Y10
+ 3 Y11
+ 4 Y12
+ 5
+ 6
+ 7
+
+ */
+
+ m_key_y = ((data & 0x1f) << 8) | (m_key_y & 0xff);
+}
diff --git a/src/mess/machine/adam_kb.h b/src/mess/machine/adam_kb.h
new file mode 100644
index 00000000000..209be1cb056
--- /dev/null
+++ b/src/mess/machine/adam_kb.h
@@ -0,0 +1,67 @@
+/**********************************************************************
+
+ Coleco Adam keyboard emulation
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************/
+
+#pragma once
+
+#ifndef __ADAM_KB__
+#define __ADAM_KB__
+
+#include "emu.h"
+#include "cpu/m6800/m6800.h"
+#include "machine/adamnet.h"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> adam_keyboard_device
+
+class adam_keyboard_device : public device_t,
+ public device_adamnet_card_interface
+{
+public:
+ // construction/destruction
+ adam_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual const rom_entry *device_rom_region() const;
+ virtual machine_config_constructor device_mconfig_additions() const;
+ virtual ioport_constructor device_input_ports() const;
+
+ // not really public
+ DECLARE_READ8_MEMBER( p1_r );
+ DECLARE_READ8_MEMBER( p2_r );
+ DECLARE_WRITE8_MEMBER( p2_w );
+ DECLARE_READ8_MEMBER( p3_r );
+ DECLARE_WRITE8_MEMBER( p3_w );
+ DECLARE_READ8_MEMBER( p4_r );
+ DECLARE_WRITE8_MEMBER( p4_w );
+
+protected:
+ // device-level overrides
+ virtual void device_config_complete() { m_shortname = "adam_kb"; }
+ virtual void device_start();
+
+ // device_adamnet_card_interface overrides
+ virtual void adamnet_reset_w(int state);
+
+ required_device<cpu_device> m_maincpu;
+
+ UINT16 m_key_y;
+};
+
+
+// device type definition
+extern const device_type ADAM_KB;
+
+
+
+#endif
diff --git a/src/mess/machine/adam_prn.c b/src/mess/machine/adam_prn.c
new file mode 100644
index 00000000000..84abf050eac
--- /dev/null
+++ b/src/mess/machine/adam_prn.c
@@ -0,0 +1,258 @@
+/**********************************************************************
+
+ Coleco Adam printer emulation
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************/
+
+#include "adam_prn.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define M6801_TAG "u2"
+
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type ADAM_PRN = &device_creator<adam_printer_device>;
+
+
+//-------------------------------------------------
+// ROM( adam_prn )
+//-------------------------------------------------
+
+ROM_START( adam_prn )
+ ROM_REGION( 0x800, M6801_TAG, 0 )
+ ROM_LOAD( "printer.u2", 0x000, 0x800, CRC(e8db783b) SHA1(32b40679749ad0317c2c9ee9ca619fad6d850ce7) )
+ROM_END
+
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const rom_entry *adam_printer_device::device_rom_region() const
+{
+ return ROM_NAME( adam_prn );
+}
+
+
+//-------------------------------------------------
+// ADDRESS_MAP( adam_prn_mem )
+//-------------------------------------------------
+
+static ADDRESS_MAP_START( adam_prn_mem, AS_PROGRAM, 8, adam_printer_device )
+ AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(m6801_io_r, m6801_io_w)
+ AM_RANGE(0x0080, 0x00ff) AM_RAM
+ AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION(M6801_TAG, 0)
+ADDRESS_MAP_END
+
+
+//-------------------------------------------------
+// ADDRESS_MAP( adam_prn_io )
+//-------------------------------------------------
+
+static ADDRESS_MAP_START( adam_prn_io, AS_IO, 8, adam_printer_device )
+ AM_RANGE(M6801_PORT1, M6801_PORT1) AM_WRITE(p1_w)
+ AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(p2_r, p2_w)
+ AM_RANGE(M6801_PORT3, M6801_PORT3) AM_READ(p3_r)
+ AM_RANGE(M6801_PORT4, M6801_PORT4) AM_READWRITE(p4_r, p4_w)
+ADDRESS_MAP_END
+
+
+//-------------------------------------------------
+// MACHINE_DRIVER( adam_prn )
+//-------------------------------------------------
+
+static MACHINE_CONFIG_FRAGMENT( adam_prn )
+ MCFG_CPU_ADD(M6801_TAG, M6801, XTAL_4MHz)
+ MCFG_CPU_PROGRAM_MAP(adam_prn_mem)
+ MCFG_CPU_IO_MAP(adam_prn_io)
+ MCFG_DEVICE_DISABLE() // TODO
+MACHINE_CONFIG_END
+
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor adam_printer_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( adam_prn );
+}
+
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// adam_printer_device - constructor
+//-------------------------------------------------
+
+adam_printer_device::adam_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ADAM_PRN, "Adam printer", tag, owner, clock),
+ device_adamnet_card_interface(mconfig, *this),
+ m_maincpu(*this, M6801_TAG)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void adam_printer_device::device_start()
+{
+}
+
+
+//-------------------------------------------------
+// adamnet_reset_w -
+//-------------------------------------------------
+
+void adam_printer_device::adamnet_reset_w(int state)
+{
+ m_maincpu->set_input_line(INPUT_LINE_RESET, state);
+}
+
+
+//-------------------------------------------------
+// p1_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( adam_printer_device::p1_w )
+{
+ /*
+
+ bit description
+
+ 0 M2 phase D
+ 1 M2 phase B
+ 2 M2 phase C
+ 3 M2 phase A
+ 4 M3 phase B
+ 5 M3 phase D
+ 6 M3 phase A
+ 7 M3 phase C
+
+ */
+}
+
+
+//-------------------------------------------------
+// p2_r -
+//-------------------------------------------------
+
+READ8_MEMBER( adam_printer_device::p2_r )
+{
+ /*
+
+ bit description
+
+ 0 mode bit 0
+ 1 mode bit 1
+ 2 mode bit 2
+ 3 NET RXD
+ 4 NET TXD
+
+ */
+
+ UINT8 data = M6801_MODE_7;
+
+ // NET RXD
+ data |= m_bus->rxd_r(this) << 3;
+
+ return data;
+}
+
+
+//-------------------------------------------------
+// p2_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( adam_printer_device::p2_w )
+{
+ /*
+
+ bit description
+
+ 0 mode bit 0
+ 1 mode bit 1
+ 2 mode bit 2
+ 3 NET RXD
+ 4 NET TXD
+
+ */
+
+ m_bus->txd_w(this, BIT(data, 4));
+}
+
+
+//-------------------------------------------------
+// p3_r -
+//-------------------------------------------------
+
+READ8_MEMBER( adam_printer_device::p3_r )
+{
+ return 0xff;
+}
+
+
+//-------------------------------------------------
+// p4_r -
+//-------------------------------------------------
+
+READ8_MEMBER( adam_printer_device::p4_r )
+{
+ /*
+
+ bit description
+
+ 0
+ 1
+ 2
+ 3
+ 4 left margin
+ 5 platen detent
+ 6 wheel home
+ 7 self-test
+
+ */
+
+ return 0x80;
+}
+
+
+//-------------------------------------------------
+// p4_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( adam_printer_device::p4_w )
+{
+ /*
+
+ bit description
+
+ 0 print hammer solenoid
+ 1 ribbon advance solenoid
+ 2 platen motor advance
+ 3 platen motor break
+ 4
+ 5
+ 6
+ 7
+
+ */
+}
diff --git a/src/mess/machine/adam_prn.h b/src/mess/machine/adam_prn.h
new file mode 100644
index 00000000000..f3841d8c906
--- /dev/null
+++ b/src/mess/machine/adam_prn.h
@@ -0,0 +1,63 @@
+/**********************************************************************
+
+ Coleco Adam floppy disk controller emulation
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************/
+
+#pragma once
+
+#ifndef __ADAM_PRN__
+#define __ADAM_PRN__
+
+#include "emu.h"
+#include "cpu/m6800/m6800.h"
+#include "machine/adamnet.h"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> adam_printer_device
+
+class adam_printer_device : public device_t,
+ public device_adamnet_card_interface
+{
+public:
+ // construction/destruction
+ adam_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual const rom_entry *device_rom_region() const;
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ // not really public
+ DECLARE_WRITE8_MEMBER( p1_w );
+ DECLARE_READ8_MEMBER( p2_r );
+ DECLARE_WRITE8_MEMBER( p2_w );
+ DECLARE_READ8_MEMBER( p3_r );
+ DECLARE_READ8_MEMBER( p4_r );
+ DECLARE_WRITE8_MEMBER( p4_w );
+
+protected:
+ // device-level overrides
+ virtual void device_config_complete() { m_shortname = "adam_prn"; }
+ virtual void device_start();
+
+ // device_adamnet_card_interface overrides
+ virtual void adamnet_reset_w(int state);
+
+ required_device<cpu_device> m_maincpu;
+};
+
+
+// device type definition
+extern const device_type ADAM_PRN;
+
+
+
+#endif
diff --git a/src/mess/machine/adam_spi.c b/src/mess/machine/adam_spi.c
new file mode 100644
index 00000000000..0e004e000cc
--- /dev/null
+++ b/src/mess/machine/adam_spi.c
@@ -0,0 +1,175 @@
+/**********************************************************************
+
+ Coleco Adam serial port interface emulation
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************/
+
+#include "adam_spi.h"
+
+
+
+//**************************************************************************
+// MACROS / CONSTANTS
+//**************************************************************************
+
+#define M6801_TAG "m6801"
+
+
+
+//**************************************************************************
+// DEVICE DEFINITIONS
+//**************************************************************************
+
+const device_type ADAM_SPI = &device_creator<adam_spi_device>;
+
+
+//-------------------------------------------------
+// ROM( adam_spi )
+//-------------------------------------------------
+
+ROM_START( adam_spi )
+ ROM_REGION( 0x800, M6801_TAG, 0 )
+ ROM_LOAD( "spi.bin", 0x000, 0x800, CRC(4ba30352) SHA1(99fe5aebd505a208bea6beec5d7322b15426e9c1) )
+ROM_END
+
+
+//-------------------------------------------------
+// rom_region - device-specific ROM region
+//-------------------------------------------------
+
+const rom_entry *adam_spi_device::device_rom_region() const
+{
+ return ROM_NAME( adam_spi );
+}
+
+
+//-------------------------------------------------
+// ADDRESS_MAP( adam_spi_mem )
+//-------------------------------------------------
+
+static ADDRESS_MAP_START( adam_spi_mem, AS_PROGRAM, 8, adam_spi_device )
+ AM_RANGE(0x0000, 0x001f) AM_READWRITE_LEGACY(m6801_io_r, m6801_io_w)
+ AM_RANGE(0x0080, 0x00ff) AM_RAM
+ AM_RANGE(0xf800, 0xffff) AM_ROM AM_REGION(M6801_TAG, 0)
+ADDRESS_MAP_END
+
+
+//-------------------------------------------------
+// ADDRESS_MAP( adam_spi_io )
+//-------------------------------------------------
+
+static ADDRESS_MAP_START( adam_spi_io, AS_IO, 8, adam_spi_device )
+ AM_RANGE(M6801_PORT2, M6801_PORT2) AM_READWRITE(p2_r, p2_w)
+ADDRESS_MAP_END
+
+
+//-------------------------------------------------
+// MACHINE_DRIVER( adam_spi )
+//-------------------------------------------------
+
+static MACHINE_CONFIG_FRAGMENT( adam_spi )
+ MCFG_CPU_ADD(M6801_TAG, M6801, XTAL_4MHz)
+ MCFG_CPU_PROGRAM_MAP(adam_spi_mem)
+ MCFG_CPU_IO_MAP(adam_spi_io)
+
+ MCFG_DEVICE_DISABLE()
+MACHINE_CONFIG_END
+
+
+//-------------------------------------------------
+// machine_config_additions - device-specific
+// machine configurations
+//-------------------------------------------------
+
+machine_config_constructor adam_spi_device::device_mconfig_additions() const
+{
+ return MACHINE_CONFIG_NAME( adam_spi );
+}
+
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// adam_spi_device - constructor
+//-------------------------------------------------
+
+adam_spi_device::adam_spi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
+ : device_t(mconfig, ADAM_SPI, "Adam SPI", tag, owner, clock),
+ device_adamnet_card_interface(mconfig, *this),
+ m_maincpu(*this, M6801_TAG)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void adam_spi_device::device_start()
+{
+}
+
+
+//-------------------------------------------------
+// adamnet_reset_w -
+//-------------------------------------------------
+
+void adam_spi_device::adamnet_reset_w(int state)
+{
+ m_maincpu->set_input_line(INPUT_LINE_RESET, state);
+}
+
+
+//-------------------------------------------------
+// p2_r -
+//-------------------------------------------------
+
+READ8_MEMBER( adam_spi_device::p2_r )
+{
+ /*
+
+ bit description
+
+ 0 mode bit 0
+ 1 mode bit 1
+ 2 mode bit 2
+ 3 NET RXD
+ 4
+
+ */
+
+ UINT8 data = M6801_MODE_7;
+
+ // NET RXD
+ data |= m_bus->rxd_r(this) << 3;
+
+ return data;
+}
+
+
+//-------------------------------------------------
+// p2_w -
+//-------------------------------------------------
+
+WRITE8_MEMBER( adam_spi_device::p2_w )
+{
+ /*
+
+ bit description
+
+ 0
+ 1
+ 2
+ 3
+ 4 NET TXD
+
+ */
+
+ m_bus->txd_w(this, BIT(data, 4));
+}
diff --git a/src/mess/machine/adam_spi.h b/src/mess/machine/adam_spi.h
new file mode 100644
index 00000000000..e99450c281c
--- /dev/null
+++ b/src/mess/machine/adam_spi.h
@@ -0,0 +1,59 @@
+/**********************************************************************
+
+ Coleco Adam floppy disk controller emulation
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************/
+
+#pragma once
+
+#ifndef __ADAM_SPI__
+#define __ADAM_SPI__
+
+#include "emu.h"
+#include "cpu/m6800/m6800.h"
+#include "machine/adamnet.h"
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+// ======================> adam_spi_device
+
+class adam_spi_device : public device_t,
+ public device_adamnet_card_interface
+{
+public:
+ // construction/destruction
+ adam_spi_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // optional information overrides
+ virtual const rom_entry *device_rom_region() const;
+ virtual machine_config_constructor device_mconfig_additions() const;
+
+ // not really public
+ DECLARE_READ8_MEMBER( p2_r );
+ DECLARE_WRITE8_MEMBER( p2_w );
+
+protected:
+ // device-level overrides
+ virtual void device_config_complete() { m_shortname = "adam_spi"; }
+ virtual void device_start();
+
+ // device_adamnet_card_interface overrides
+ virtual void adamnet_reset_w(int state);
+
+ required_device<cpu_device> m_maincpu;
+};
+
+
+// device type definition
+extern const device_type ADAM_SPI;
+
+
+
+#endif
diff --git a/src/mess/machine/adamnet.c b/src/mess/machine/adamnet.c
new file mode 100644
index 00000000000..b0aa7822fd2
--- /dev/null
+++ b/src/mess/machine/adamnet.c
@@ -0,0 +1,258 @@
+/**********************************************************************
+
+ Coleco ADAMnet bus emulation
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************/
+
+#include "machine/adamnet.h"
+
+
+
+//**************************************************************************
+// GLOBAL VARIABLES
+//**************************************************************************
+
+const device_type ADAMNET = &device_creator<adamnet_device>;
+const device_type ADAMNET_SLOT = &device_creator<adamnet_slot_device>;
+
+
+
+//**************************************************************************
+// DEVICE ADAMNET CARD INTERFACE
+//**************************************************************************
+
+//-------------------------------------------------
+// device_adamnet_card_interface - constructor
+//-------------------------------------------------
+
+device_adamnet_card_interface::device_adamnet_card_interface(const machine_config &mconfig, device_t &device)
+ : device_slot_card_interface(mconfig, device)
+{
+}
+
+
+//-------------------------------------------------
+// ~device_adamnet_card_interface - destructor
+//-------------------------------------------------
+
+device_adamnet_card_interface::~device_adamnet_card_interface()
+{
+}
+
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// adamnet_slot_device - constructor
+//-------------------------------------------------
+adamnet_slot_device::adamnet_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, ADAMNET_SLOT, "ADAMnet slot", tag, owner, clock),
+ device_slot_interface(mconfig, *this)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void adamnet_slot_device::device_start()
+{
+ m_bus = machine().device<adamnet_device>(ADAMNET_TAG);
+ device_adamnet_card_interface *dev = dynamic_cast<device_adamnet_card_interface *>(get_card_device());
+ if (dev) m_bus->add_device(get_card_device());
+}
+
+
+
+//**************************************************************************
+// LIVE DEVICE
+//**************************************************************************
+
+//-------------------------------------------------
+// adamnet_device - constructor
+//-------------------------------------------------
+
+adamnet_device::adamnet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
+ device_t(mconfig, ADAMNET, "ADAMnet bus", tag, owner, clock),
+ m_txd(1),
+ m_reset(CLEAR_LINE)
+{
+}
+
+
+//-------------------------------------------------
+// device_start - device-specific startup
+//-------------------------------------------------
+
+void adamnet_device::device_start()
+{
+}
+
+
+//-------------------------------------------------
+// device_stop - device-specific stop
+//-------------------------------------------------
+
+void adamnet_device::device_stop()
+{
+ m_device_list.reset();
+}
+
+
+//-------------------------------------------------
+// add_adamnet_card - add ADAMNET card
+//-------------------------------------------------
+
+void adamnet_device::add_device(device_t *target)
+{
+ daisy_entry *entry = auto_alloc(machine(), daisy_entry(target));
+
+ entry->m_interface->m_bus = this;
+
+ m_device_list.append(*entry);
+}
+
+
+//-------------------------------------------------
+// daisy_entry - constructor
+//-------------------------------------------------
+
+adamnet_device::daisy_entry::daisy_entry(device_t *device)
+ : m_next(NULL),
+ m_device(device),
+ m_interface(NULL),
+ m_txd(1)
+{
+ device->interface(m_interface);
+}
+
+
+//-------------------------------------------------
+// rxd_r - receive data
+//-------------------------------------------------
+
+READ_LINE_MEMBER( adamnet_device::rxd_r )
+{
+ int state = m_txd;//1;
+
+ daisy_entry *entry = m_device_list.first();
+
+ while (entry)
+ {
+ state &= entry->m_txd;
+
+ entry = entry->next();
+ }
+
+ return state;
+}
+
+
+//-------------------------------------------------
+// rxd_r - receive data
+//-------------------------------------------------
+
+int adamnet_device::rxd_r(device_t *device)
+{
+ int state = m_txd;
+
+ daisy_entry *entry = m_device_list.first();
+
+ while (entry)
+ {
+ //if (strcmp(entry->m_device->tag(), device->tag()))
+ {
+ state &= entry->m_txd;
+ }
+
+ entry = entry->next();
+ }
+
+ return state;
+}
+
+
+//-------------------------------------------------
+// txd_w - transmit data
+//-------------------------------------------------
+
+WRITE_LINE_MEMBER( adamnet_device::txd_w )
+{
+ if (m_txd != state)
+ {
+ m_txd = state;
+ }
+}
+
+
+//-------------------------------------------------
+// txd_w - transmit data
+//-------------------------------------------------
+
+void adamnet_device::txd_w(device_t *device, int state)
+{
+ daisy_entry *entry = m_device_list.first();
+
+ while (entry)
+ {
+ if (!strcmp(entry->m_device->tag(), device->tag()))
+ {
+ if (entry->m_txd != state)
+ {
+ entry->m_txd = state;
+ }
+ break;
+ }
+
+ entry = entry->next();
+ }
+}
+
+
+//-------------------------------------------------
+// reset_r - bus reset
+//-------------------------------------------------
+
+READ_LINE_MEMBER( adamnet_device::reset_r )
+{
+ return m_reset;
+}
+
+
+//-------------------------------------------------
+// reset_w - bus reset
+//-------------------------------------------------
+
+WRITE_LINE_MEMBER( adamnet_device::reset_w )
+{
+ m_reset = state;
+
+ daisy_entry *entry = m_device_list.first();
+
+ while (entry)
+ {
+ entry->m_interface->adamnet_reset_w(state);
+
+ entry = entry->next();
+ }
+}
+
+
+//-------------------------------------------------
+// SLOT_INTERFACE( adamnet_devices )
+//-------------------------------------------------
+
+SLOT_INTERFACE_START( adamnet_devices )
+ SLOT_INTERFACE("ddp", ADAM_DDP)
+ SLOT_INTERFACE("fdc", ADAM_FDC)
+ SLOT_INTERFACE("kb", ADAM_KB)
+ SLOT_INTERFACE("prn", ADAM_PRN)
+ SLOT_INTERFACE("spi", ADAM_SPI)
+SLOT_INTERFACE_END
diff --git a/src/mess/machine/adamnet.h b/src/mess/machine/adamnet.h
new file mode 100644
index 00000000000..e791ccbbc84
--- /dev/null
+++ b/src/mess/machine/adamnet.h
@@ -0,0 +1,139 @@
+/**********************************************************************
+
+ Coleco ADAMnet bus emulation
+
+ Copyright MESS Team.
+ Visit http://mamedev.org for licensing and usage restrictions.
+
+**********************************************************************/
+
+#pragma once
+
+#ifndef __ADAMNET__
+#define __ADAMNET__
+
+#include "emu.h"
+
+
+
+//**************************************************************************
+// CONSTANTS
+//**************************************************************************
+
+#define ADAMNET_TAG "adamnet"
+
+
+
+//**************************************************************************
+// INTERFACE CONFIGURATION MACROS
+//**************************************************************************
+
+#define MCFG_ADAMNET_BUS_ADD() \
+ MCFG_DEVICE_ADD(ADAMNET_TAG, ADAMNET, 0)
+
+#define MCFG_ADAMNET_SLOT_ADD(_tag, _slot_intf, _def_slot, _def_inp) \
+ MCFG_DEVICE_ADD(_tag, ADAMNET_SLOT, 0) \
+ MCFG_DEVICE_SLOT_INTERFACE(_slot_intf, _def_slot, _def_inp, false)
+
+
+
+//**************************************************************************
+// TYPE DEFINITIONS
+//**************************************************************************
+
+class device_adamnet_card_interface;
+
+// ======================> adamnet_device
+
+class adamnet_device : public device_t
+{
+public:
+ // construction/destruction
+ adamnet_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ void add_device(device_t *target);
+
+ DECLARE_READ_LINE_MEMBER( rxd_r );
+ int rxd_r(device_t *device);
+ DECLARE_WRITE_LINE_MEMBER( txd_w );
+ void txd_w(device_t *device, int state);
+
+ DECLARE_READ_LINE_MEMBER( reset_r );
+ DECLARE_WRITE_LINE_MEMBER( reset_w );
+
+protected:
+ // device-level overrides
+ virtual void device_start();
+ virtual void device_stop();
+
+private:
+ class daisy_entry
+ {
+ public:
+ daisy_entry(device_t *device);
+ daisy_entry *next() const { return m_next; }
+
+ daisy_entry * m_next; // next device
+ device_t * m_device; // associated device
+ device_adamnet_card_interface * m_interface; // associated device's daisy interface
+
+ int m_txd;
+ };
+
+ simple_list<daisy_entry> m_device_list;
+
+ int m_txd;
+ int m_reset;
+};
+
+
+// ======================> adamnet_slot_device
+
+class adamnet_slot_device : public device_t,
+ public device_slot_interface
+{
+public:
+ // construction/destruction
+ adamnet_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
+
+ // device-level overrides
+ virtual void device_start();
+
+protected:
+ // configuration
+ adamnet_device *m_bus;
+};
+
+
+// ======================> device_adamnet_card_interface
+
+class device_adamnet_card_interface : public device_slot_card_interface
+{
+public:
+ // construction/destruction
+ device_adamnet_card_interface(const machine_config &mconfig, device_t &device);
+ virtual ~device_adamnet_card_interface();
+
+ virtual void adamnet_reset_w(int state) = 0;
+
+ adamnet_device *m_bus;
+};
+
+
+// device type definitions
+extern const device_type ADAMNET;
+extern const device_type ADAMNET_SLOT;
+
+
+// slot devices
+#include "machine/adam_ddp.h"
+#include "machine/adam_fdc.h"
+#include "machine/adam_kb.h"
+#include "machine/adam_prn.h"
+#include "machine/adam_spi.h"
+
+SLOT_INTERFACE_EXTERN( adamnet_devices );
+
+
+
+#endif
diff --git a/src/mess/mess.mak b/src/mess/mess.mak
index fd7ddd5d874..dc8816b67ea 100644
--- a/src/mess/mess.mak
+++ b/src/mess/mess.mak
@@ -970,6 +970,12 @@ $(MESSOBJ)/coleco.a: \
$(MESS_DRIVERS)/coleco.o \
$(MESS_MACHINE)/coleco.o \
$(MESS_DRIVERS)/adam.o \
+ $(MESS_MACHINE)/adamnet.o \
+ $(MESS_MACHINE)/adam_ddp.o \
+ $(MESS_MACHINE)/adam_fdc.o \
+ $(MESS_MACHINE)/adam_kb.o \
+ $(MESS_MACHINE)/adam_prn.o \
+ $(MESS_MACHINE)/adam_spi.o \
$(MESSOBJ)/cromemco.a: \
$(MESS_DRIVERS)/c10.o \