summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--src/devices/machine/applepic.cpp104
-rw-r--r--src/devices/machine/applepic.h4
-rw-r--r--src/devices/machine/swim1.cpp82
-rw-r--r--src/devices/machine/swim1.h4
-rw-r--r--src/devices/machine/swim2.cpp44
-rw-r--r--src/devices/machine/swim2.h2
-rw-r--r--src/mame/apple/dafb.cpp113
-rw-r--r--src/mame/apple/dafb.h21
-rw-r--r--src/mame/apple/macadb.cpp853
-rw-r--r--src/mame/apple/macadb.h65
-rw-r--r--src/mame/apple/maciifx.cpp119
-rw-r--r--src/mame/apple/macquadra700.cpp796
-rw-r--r--src/mame/mame.lst2
13 files changed, 1259 insertions, 950 deletions
diff --git a/src/devices/machine/applepic.cpp b/src/devices/machine/applepic.cpp
index feb122140d4..a523b690e34 100644
--- a/src/devices/machine/applepic.cpp
+++ b/src/devices/machine/applepic.cpp
@@ -19,6 +19,18 @@ DEFINE_DEVICE_TYPE(APPLEPIC, applepic_device, "applepic", "Apple 343S1021 PIC")
const std::string_view applepic_device::s_interrupt_names[8] = { "0", "DMA 1", "DMA 2", "peripheral", "host", "timer", "6", "7" };
+static constexpr int IRQ_DMA1 = 1;
+static constexpr int IRQ_DMA2 = 2;
+static constexpr int IRQ_PERIPHERAL = 3;
+static constexpr int IRQ_HOST = 4;
+static constexpr int IRQ_TIMER = 5;
+
+static constexpr u8 DMAEN = 0x01; // 1 = channel enabled
+static constexpr u8 DREQ = 0x02; // 1 = DREQ line for this channel is active
+static constexpr u8 DMADIR = 0x04; // 1 = I/O to RAM, 0 = RAM to I/O
+static constexpr u8 DENxONx = 0x08; // 1 = enable this channel when the other channel completes a transfer
+static constexpr int DIOASHIFT = 0x04; // right shift amount for I/O offset bits
+
applepic_device::applepic_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, APPLEPIC, tag, owner, clock)
, m_iopcpu(*this, "iopcpu")
@@ -28,6 +40,7 @@ applepic_device::applepic_device(const machine_config &mconfig, const char *tag,
, m_gpin_callback(*this, 0)
, m_gpout_callback(*this)
, m_timer1(nullptr)
+ , m_dma_timer(nullptr)
, m_timer_last_expired(attotime::zero)
, m_ram_address(0)
, m_status_reg(0x80)
@@ -43,6 +56,7 @@ applepic_device::applepic_device(const machine_config &mconfig, const char *tag,
channel.control = 0;
channel.map = 0;
channel.tc = 0;
+ channel.req = false;
}
}
@@ -73,6 +87,9 @@ void applepic_device::device_start()
// Initialize timer
m_timer1 = timer_alloc(FUNC(applepic_device::timer1_callback), this);
+ // get a timer for the DMA
+ m_dma_timer = timer_alloc(FUNC(applepic_device::dma_timer_callback), this);
+
// Save internal state
save_item(NAME(m_timer_last_expired));
save_item(NAME(m_ram_address));
@@ -96,6 +113,13 @@ void applepic_device::device_reset()
m_iopcpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
m_iopcpu->set_input_line(r65c02_device::IRQ_LINE, CLEAR_LINE);
m_hint_callback(CLEAR_LINE);
+
+ for (dma_channel &channel : m_dma_channel)
+ {
+ channel.control = 0;
+ }
+
+ m_dma_timer->adjust(attotime::zero, 0, clocks_to_attotime(8));
}
u8 applepic_device::host_r(offs_t offset)
@@ -154,7 +178,7 @@ void applepic_device::host_w(offs_t offset, u8 data)
m_iopcpu->set_input_line(INPUT_LINE_RESET, BIT(data, 2) ? CLEAR_LINE : ASSERT_LINE);
}
if (BIT(data, 3))
- set_interrupt(4);
+ set_interrupt(IRQ_HOST);
if ((m_status_reg & data & 0x30) != 0)
{
m_status_reg &= ~(data & 0x30);
@@ -178,30 +202,40 @@ void applepic_device::pint_w(int state)
{
m_status_reg |= 0x40;
if (!BIT(m_scc_control, 0))
- set_interrupt(3);
+ set_interrupt(IRQ_PERIPHERAL);
}
else
{
m_status_reg &= 0xbf;
if (!BIT(m_scc_control, 0))
- reset_interrupt(3);
+ reset_interrupt(IRQ_PERIPHERAL);
}
}
void applepic_device::reqa_w(int state)
{
- if (state == ASSERT_LINE)
- m_dma_channel[0].control |= 0x02;
+ m_dma_channel[0].req = state;
+ if (state)
+ {
+ m_dma_channel[0].control |= DREQ;
+ }
else
- m_dma_channel[0].control &= 0xfd;
+ {
+ m_dma_channel[0].control &= ~DREQ;
+ }
}
void applepic_device::reqb_w(int state)
{
- if (state == ASSERT_LINE)
- m_dma_channel[1].control |= 0x02;
+ m_dma_channel[1].req = state;
+ if (state)
+ {
+ m_dma_channel[1].control |= DREQ;
+ }
else
- m_dma_channel[1].control &= 0xfd;
+ {
+ m_dma_channel[1].control &= ~DREQ;
+ }
}
u8 applepic_device::timer_r(offs_t offset)
@@ -212,7 +246,7 @@ u8 applepic_device::timer_r(offs_t offset)
else
{
if (offset == 0 && !machine().side_effects_disabled())
- reset_interrupt(5);
+ reset_interrupt(IRQ_TIMER);
return reg & 0x00ff;
}
}
@@ -224,7 +258,7 @@ void applepic_device::timer_w(offs_t offset, u8 data)
m_timer_latch = u16(data) << 8 | (m_timer_latch & 0x00ff);
if (offset == 1)
{
- reset_interrupt(5);
+ reset_interrupt(IRQ_TIMER);
m_timer1->adjust(clocks_to_attotime(m_timer_latch * 8 + 12));
}
}
@@ -242,7 +276,7 @@ u16 applepic_device::get_timer_count() const
TIMER_CALLBACK_MEMBER(applepic_device::timer1_callback)
{
- set_interrupt(5);
+ set_interrupt(IRQ_TIMER);
if (BIT(m_timer_dpll_control, 0))
m_timer1->adjust(clocks_to_attotime((m_timer_latch + 2) * 8));
else
@@ -284,7 +318,7 @@ void applepic_device::dma_channel_w(offs_t offset, u8 data)
switch (offset & 7)
{
case 0:
- channel.control = (data & 0xfd) | (channel.control & 0x02);
+ channel.control = ((data & ~DREQ) | (channel.control & DREQ));
break;
case 1:
@@ -300,7 +334,7 @@ void applepic_device::dma_channel_w(offs_t offset, u8 data)
break;
case 4:
- channel.tc = (data & 0x07) | (channel.tc & 0x0ff);
+ channel.tc = ((data & 0x07) << 8) | (channel.tc & 0x0ff);
break;
default:
@@ -309,6 +343,44 @@ void applepic_device::dma_channel_w(offs_t offset, u8 data)
}
}
+TIMER_CALLBACK_MEMBER(applepic_device::dma_timer_callback)
+{
+ for (int ch = 0; ch < 2; ch++)
+ {
+ auto &channel = m_dma_channel[ch];
+ auto other_channel = m_dma_channel[ch ^ 1];
+
+ if ((channel.control & DMAEN) && (channel.req) && (channel.tc > 0))
+ {
+ if (channel.control & DMADIR)
+ {
+ const u8 xfer = m_prd_callback(channel.control >> DIOASHIFT);
+ m_iopcpu->space(AS_PROGRAM).write_byte(channel.map, xfer);
+ }
+ else
+ {
+ const u8 xfer = m_iopcpu->space(AS_PROGRAM).read_byte(channel.map);
+ m_pwr_callback(channel.control >> DIOASHIFT, xfer);
+ }
+
+ channel.map++;
+ channel.tc--;
+
+ // if this channel completed, handle the DEN1ON2/DEN2ON1 alternating transfer bits and IRQ
+ if (channel.tc == 0)
+ {
+ channel.control &= ~DMAEN;
+ if (other_channel.control & DENxONx)
+ {
+ other_channel.control |= DMAEN;
+ }
+
+ set_interrupt(IRQ_DMA1 + ch);
+ }
+ }
+ }
+}
+
u8 applepic_device::scc_control_r()
{
return m_scc_control;
@@ -318,9 +390,9 @@ void applepic_device::scc_control_w(u8 data)
{
m_scc_control = data;
if (!BIT(data, 0) && BIT(m_status_reg, 6))
- set_interrupt(3);
+ set_interrupt(IRQ_PERIPHERAL);
else
- reset_interrupt(3);
+ reset_interrupt(IRQ_PERIPHERAL);
m_gpout_callback[1](BIT(data, 7));
}
diff --git a/src/devices/machine/applepic.h b/src/devices/machine/applepic.h
index 37956492d76..52ff4df78d3 100644
--- a/src/devices/machine/applepic.h
+++ b/src/devices/machine/applepic.h
@@ -51,12 +51,14 @@ private:
u8 control;
u16 map;
u16 tc;
+ bool req;
};
u8 timer_r(offs_t offset);
void timer_w(offs_t offset, u8 data);
u16 get_timer_count() const;
TIMER_CALLBACK_MEMBER(timer1_callback);
+ TIMER_CALLBACK_MEMBER(dma_timer_callback);
u8 dma_channel_r(offs_t offset);
void dma_channel_w(offs_t offset, u8 data);
u8 scc_control_r();
@@ -89,7 +91,7 @@ private:
devcb_write_line::array<2> m_gpout_callback;
// internal state
- emu_timer *m_timer1;
+ emu_timer *m_timer1, *m_dma_timer;
attotime m_timer_last_expired;
u16 m_ram_address;
u8 m_status_reg;
diff --git a/src/devices/machine/swim1.cpp b/src/devices/machine/swim1.cpp
index 2a54d1d613e..f8450f45bef 100644
--- a/src/devices/machine/swim1.cpp
+++ b/src/devices/machine/swim1.cpp
@@ -9,7 +9,7 @@
#include "emu.h"
#include "swim1.h"
-#define VERBOSE 0
+#define VERBOSE (0)
#include "logmacro.h"
DEFINE_DEVICE_TYPE(SWIM1, swim1_device, "swim1", "Apple SWIM1 (Sander/Wozniak Integrated Machine) version 1 floppy controller")
@@ -26,6 +26,8 @@ void swim1_device::device_start()
applefdintf_device::device_start();
m_timer = timer_alloc(FUNC(swim1_device::update), this);
+ m_sync_timer = timer_alloc(FUNC(swim1_device::ism_periodic_sync), this);
+
save_item(NAME(m_last_sync));
save_item(NAME(m_flux_write_start));
save_item(NAME(m_flux_write));
@@ -104,7 +106,7 @@ void swim1_device::device_reset()
m_devsel_cb(0);
m_sel35_cb(true);
m_hdsel_cb(false);
- m_dat1byte_cb(0);
+ m_dat1byte_cb(CLEAR_LINE);
}
void swim1_device::set_floppy(floppy_image_device *floppy)
@@ -174,11 +176,11 @@ u8 swim1_device::ism_read(offs_t offset)
{
ism_sync();
- // static const char *const names[] = {
- // "data", "mark", "crc", "param", "phases", "setup", "status", "handshake"
- // };
+ static const char *const names[] = {
+ "data", "mark", "crc", "param", "phases", "setup", "status", "handshake"
+ };
- // LOG("read ism %s\n", names[offset & 7]);
+ LOG("read ism %s\n", names[offset & 7]);
switch(offset & 7) {
case 0x0: { // data
u16 r = ism_fifo_pop();
@@ -227,9 +229,9 @@ u8 swim1_device::ism_read(offs_t offset)
if(!(m_ism_fifo[m_ism_fifo_pos - 1] & M_CRC0))
h |= 0x02;
}
- // rddata on 4
+ // rddata on 3
if(!m_floppy || m_floppy->wpt_r())
- h |= 0x08;
+ h |= 0x0c;
if(m_ism_error)
h |= 0x20;
if(m_ism_mode & 0x10) {
@@ -249,7 +251,7 @@ u8 swim1_device::ism_read(offs_t offset)
}
default:
- // logerror("read %s\n", names[offset & 7]);
+ logerror("read %s\n", names[offset & 7]);
break;
}
return 0xff;
@@ -315,8 +317,7 @@ void swim1_device::ism_write(offs_t offset, u8 data)
m_ism_mode &= ~data;
m_ism_param_idx = 0;
ism_show_mode();
- if(data & 0x10)
- m_dat1byte_cb((m_ism_fifo_pos != 0) ? 1 : 0);
+ ism_update_dat1byte();
if(!(m_ism_mode & 0x40)) {
LOG("switch to iwm\n");
u8 ism_devsel = m_ism_mode & 0x80 ? (m_ism_mode >> 1) & 3 : 0;
@@ -328,8 +329,7 @@ void swim1_device::ism_write(offs_t offset, u8 data)
case 0x7:
m_ism_mode |= data;
ism_show_mode();
- if(data & 0x10)
- m_dat1byte_cb((m_ism_fifo_pos != 2) ? 1 : 0);
+ ism_update_dat1byte();
break;
default:
@@ -345,6 +345,13 @@ void swim1_device::ism_write(offs_t offset, u8 data)
if((m_ism_mode ^ prev_mode) & 0x20)
m_hdsel_cb((m_ism_mode >> 5) & 1);
+ if ((m_ism_mode ^ prev_mode) & 0x40) {
+ if (m_ism_mode & 0x40)
+ m_sync_timer->adjust(attotime::zero, 0, attotime::from_hz(clock()/16));
+ else
+ m_sync_timer->adjust(attotime::never);
+ }
+
if((m_ism_mode & 0x18) == 0x18 && ((prev_mode & 0x18) != 0x18)) {
// Entering write mode
m_ism_current_bit = 0;
@@ -558,9 +565,12 @@ void swim1_device::iwm_control(int offset, u8 data)
if(data & 0x40) {
m_ism_mode |= 0x40;
LOG("switch to ism\n");
+
u8 ism_devsel = m_ism_mode & 0x80 ? (m_ism_mode >> 1) & 3 : 0;
if(ism_devsel != m_iwm_devsel)
m_devsel_cb(ism_devsel);
+
+ m_sync_timer->adjust(attotime::zero, 0, attotime::from_hz(clock()/16));
}
break;
}
@@ -607,24 +617,18 @@ attotime swim1_device::cycles_to_time(u64 cycles) const
void swim1_device::ism_fifo_clear()
{
m_ism_fifo_pos = 0;
- m_dat1byte_cb((m_ism_mode & 0x10) ? 1 : 0);
+ ism_update_dat1byte();
ism_crc_clear();
}
bool swim1_device::ism_fifo_push(u16 data)
{
if(m_ism_fifo_pos == 2)
+ {
return true;
- m_ism_fifo[m_ism_fifo_pos ++] = data;
- if(m_ism_mode & 0x10) {
- // write
- if(m_ism_fifo_pos == 2)
- m_dat1byte_cb(0);
- } else {
- // read
- if(m_ism_fifo_pos == 1)
- m_dat1byte_cb(1);
}
+ m_ism_fifo[m_ism_fifo_pos ++] = data;
+ ism_update_dat1byte();
return false;
}
@@ -635,15 +639,7 @@ u16 swim1_device::ism_fifo_pop()
u16 r = m_ism_fifo[0];
m_ism_fifo[0] = m_ism_fifo[1];
m_ism_fifo_pos --;
- if(m_ism_mode & 0x10) {
- // write
- if(m_ism_fifo_pos == 1)
- m_dat1byte_cb(1);
- } else {
- // read
- if(m_ism_fifo_pos == 0)
- m_dat1byte_cb(0);
- }
+ ism_update_dat1byte();
return r;
}
@@ -861,6 +857,14 @@ void swim1_device::iwm_sync()
}
}
+TIMER_CALLBACK_MEMBER(swim1_device::ism_periodic_sync)
+{
+ if (m_ism_mode & 0x40)
+ {
+ ism_sync();
+ }
+}
+
void swim1_device::ism_sync()
{
u64 next_sync = time_to_cycles(machine().time());
@@ -1210,3 +1214,17 @@ void swim1_device::sync()
else
return iwm_sync();
}
+
+void swim1_device::ism_update_dat1byte()
+{
+ if (m_ism_mode & 0x10)
+ {
+ // write: Does FIFO have room?
+ m_dat1byte_cb((m_ism_fifo_pos < 2) ? ASSERT_LINE : CLEAR_LINE);
+ }
+ else
+ {
+ // read: is FIFO not empty?
+ m_dat1byte_cb((m_ism_fifo_pos > 0) ? ASSERT_LINE : CLEAR_LINE);
+ }
+}
diff --git a/src/devices/machine/swim1.h b/src/devices/machine/swim1.h
index dd0b372d54f..f3a1074b3b7 100644
--- a/src/devices/machine/swim1.h
+++ b/src/devices/machine/swim1.h
@@ -112,6 +112,9 @@ private:
u8 m_iwm_to_ism_counter;
u8 m_iwm_devsel;
+ emu_timer *m_sync_timer;
+ TIMER_CALLBACK_MEMBER(ism_periodic_sync);
+
u64 time_to_cycles(const attotime &tm) const;
attotime cycles_to_time(u64 cycles) const;
void flush_write(u64 when = 0);
@@ -134,6 +137,7 @@ private:
u8 ism_read(offs_t offset);
void ism_write(offs_t offset, u8 data);
void ism_sync();
+ void ism_update_dat1byte();
};
DECLARE_DEVICE_TYPE(SWIM1, swim1_device)
diff --git a/src/devices/machine/swim2.cpp b/src/devices/machine/swim2.cpp
index 70a1950bbbd..5d51dba66ad 100644
--- a/src/devices/machine/swim2.cpp
+++ b/src/devices/machine/swim2.cpp
@@ -71,7 +71,7 @@ void swim2_device::device_reset()
m_devsel_cb(0);
m_sel35_cb(true);
m_hdsel_cb(false);
- m_dat1byte_cb(0);
+ m_dat1byte_cb(CLEAR_LINE);
m_flux_write_start = 0;
m_flux_write_count = 0;
std::fill(m_flux_write.begin(), m_flux_write.end(), 0);
@@ -280,15 +280,13 @@ void swim2_device::write(offs_t offset, u8 data)
m_mode |= 0x40;
m_param_idx = 0;
show_mode();
- if(data & 0x10)
- m_dat1byte_cb((m_fifo_pos != 0) ? 1 : 0);
+ update_dat1byte();
break;
case 7: // mode set
m_mode |= data;
show_mode();
- if(data & 0x10)
- m_dat1byte_cb((m_fifo_pos != 2) ? 1 : 0);
+ update_dat1byte();
break;
default:
@@ -369,7 +367,7 @@ attotime swim2_device::cycles_to_time(u64 cycles) const
void swim2_device::fifo_clear()
{
m_fifo_pos = 0;
- m_dat1byte_cb((m_mode & 0x10) ? 1 : 0);
+ update_dat1byte();
crc_clear();
}
@@ -378,15 +376,7 @@ bool swim2_device::fifo_push(u16 data)
if(m_fifo_pos == 2)
return true;
m_fifo[m_fifo_pos ++] = data;
- if(m_mode & 0x10) {
- // write
- if(m_fifo_pos == 2)
- m_dat1byte_cb(0);
- } else {
- // read
- if(m_fifo_pos == 1)
- m_dat1byte_cb(1);
- }
+ update_dat1byte();
return false;
}
@@ -397,15 +387,7 @@ u16 swim2_device::fifo_pop()
u16 r = m_fifo[0];
m_fifo[0] = m_fifo[1];
m_fifo_pos --;
- if(m_mode & 0x10) {
- // write
- if(m_fifo_pos == 1)
- m_dat1byte_cb(1);
- } else {
- // read
- if(m_fifo_pos == 0)
- m_dat1byte_cb(0);
- }
+ update_dat1byte();
return r;
}
@@ -567,3 +549,17 @@ void swim2_device::sync()
m_last_sync = next_sync;
}
+
+void swim2_device::update_dat1byte()
+{
+ if (m_mode & 0x10)
+ {
+ // write: Does FIFO have room?
+ m_dat1byte_cb((m_fifo_pos < 2) ? ASSERT_LINE : CLEAR_LINE);
+ }
+ else
+ {
+ // read: is FIFO not empty?
+ m_dat1byte_cb((m_fifo_pos > 0) ? ASSERT_LINE : CLEAR_LINE);
+ }
+}
diff --git a/src/devices/machine/swim2.h b/src/devices/machine/swim2.h
index bab440e4ec9..ef600c0a0a9 100644
--- a/src/devices/machine/swim2.h
+++ b/src/devices/machine/swim2.h
@@ -69,6 +69,8 @@ private:
void crc_update(int bit);
void crc_clear();
+
+ void update_dat1byte();
};
DECLARE_DEVICE_TYPE(SWIM2, swim2_device)
diff --git a/src/mame/apple/dafb.cpp b/src/mame/apple/dafb.cpp
index 2fb56da79c1..25ff56c2f4d 100644
--- a/src/mame/apple/dafb.cpp
+++ b/src/mame/apple/dafb.cpp
@@ -11,16 +11,20 @@
off /DTACK on pseudo-DMA reads and writes.
Shipping configurations:
- DAFB - original standalone chip, Quadra 700 and 900 (returns versions 0 and 1)
- DAFB II - revised standalone chip with 15 bpp support added (uses AC842a CODEC instead of AC842) (returns version 2)
+ DAFB - original standalone chip, Quadra 700 and 900 (returns versions 0, 1, and 2)
+ DAFB II - revised standalone chip with 15 bpp support added (uses AC842a CODEC instead of AC842) (returns version 3)
Used in Quadra 950.
MEMC - DAFB II without the Turbo SCSI logic, in the djMEMC and MEMCjr memory controllers. (returns version 3)
Used in LC 475, LC 575, Quadra 605, Quadra 610, Quadra 650, and Quadra 800.
This version uses a DP8534 timing generator instead of the DP8531 and an AC842a DAC instead of AC842.
- Valkyrie - This video used in the LC/Performa/Quadra 630 and LC580 is stated by the developer note to be very similar to DAFB.
DaMFB - DAFB II with a PowerPC bus interface instead of 68040. Used in the HPV card for the PowerMac 6100/7100/8100.
Platinum - DAFB II with 4 MB VRAM support and a blitter bolted on.
+ The "Valkyrie" chip used in the LC/Performa/Quadra 630 and 580 and the Power Macintosh 5200/6200 is stated by
+ Apple's developer note to be "very similar" to DAFB but its register interface is entirely different.
+ Valkyrie implements a small set of fixed video modes that are selected by number rather than a fully programmable
+ CRTC as is found in DAFB.
+
The Turbo SCSI block moved into the IOSB and PrimeTime I/O ASICs for the machines where DAFB moved into the
memory controller. It was enhanced slightly to allow longword pseudo-DMA transfers.
@@ -52,9 +56,11 @@
#define LOG_TURBOSCSI (1U << 5)
#define VERBOSE (0)
+
#include "logmacro.h"
DEFINE_DEVICE_TYPE(DAFB, dafb_device, "macdafb", "Apple DAFB video")
+DEFINE_DEVICE_TYPE(DAFB_Q950, dafb_q950_device, "macdafb_q950", "Apple DAFB II video")
DEFINE_DEVICE_TYPE(DAFB_MEMC, dafb_memc_device, "macdafb_djmemc", "Apple DAFB II video (djMEMC integrated)")
DEFINE_DEVICE_TYPE(DAFB_MEMCJR, dafb_memcjr_device, "macdafb_memcjr", "Apple DAFB II video (MEMCjr integrated)")
@@ -94,13 +100,25 @@ dafb_base::dafb_base(const machine_config &mconfig, device_type type, const char
}
dafb_device::dafb_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
- dafb_base(mconfig, DAFB, tag, owner, clock),
+ dafb_device(mconfig, DAFB, tag, owner, clock)
+{
+}
+
+dafb_device::dafb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) :
+ dafb_base(mconfig, type, tag, owner, clock),
m_maincpu(*this, finder_base::DUMMY_TAG)
{
m_drq[0] = m_drq[1] = 0;
m_ncr[0] = m_ncr[1] = nullptr;
}
+
+dafb_q950_device::dafb_q950_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
+ dafb_device(mconfig, DAFB_Q950, tag, owner, clock),
+ m_pcbr1(0)
+{
+}
+
dafb_memc_device::dafb_memc_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) :
dafb_base(mconfig, DAFB_MEMC, tag, owner, clock),
m_pcbr1(0),
@@ -216,6 +234,11 @@ ioport_constructor dafb_base::device_input_ports() const
return INPUT_PORTS_NAME(monitor_config);
}
+ioport_constructor dafb_q950_device::device_input_ports() const
+{
+ return INPUT_PORTS_NAME(monitor_config_noconv);
+}
+
ioport_constructor dafb_memc_device::device_input_ports() const
{
return INPUT_PORTS_NAME(monitor_config_noconv);
@@ -1065,6 +1088,88 @@ template void dafb_device::turboscsi_drq_w<0>(int state);
template void dafb_device::turboscsi_drq_w<1>(int state);
// ************************************************************************
+// dafb_q950_device overrides/additions
+// ************************************************************************
+void dafb_q950_device::device_start()
+{
+ m_dafb_version = 3;
+ dafb_base::device_start();
+}
+
+u32 dafb_q950_device::ramdac_r(offs_t offset)
+{
+ switch (offset << 2)
+ {
+ case 0x20:
+ if ((m_pal_address == 1) && ((m_ac842_pbctrl & 0x06) == 0x06))
+ {
+ LOGMASKED(LOG_RAMDAC, "Read %02x from PCBR1\n", m_pcbr1);
+ return m_pcbr1;
+ }
+ else
+ {
+ return dafb_base::ramdac_r(offset);
+ }
+
+ default:
+ return dafb_base::ramdac_r(offset);
+ }
+}
+
+void dafb_q950_device::ramdac_w(offs_t offset, u32 data)
+{
+ switch (offset << 2)
+ {
+ case 0x20:
+ if ((m_pal_address == 1) && ((m_ac842_pbctrl & 0x06) == 0x06))
+ {
+ LOGMASKED(LOG_RAMDAC, "%02x to AC842a PCBR1\n", data);
+ m_pcbr1 = (data & 0xf0) | 0x01; // AC842a version ID
+ }
+ else
+ {
+ LOGMASKED(LOG_RAMDAC, "%02x to AC842a PCBR0, & 0x1c = %02x\n", data, data & 0x1c);
+ m_ac842_pbctrl = data;
+ if (((m_pcbr1 & 0xc0) == 0xc0) && ((data & 0x06) == 0x06))
+ {
+ m_mode = 5; // 16 bpp (x555)
+ }
+ else
+ {
+ switch (data & 0x1c)
+ {
+ case 0x00:
+ m_mode = 0; // 1bpp
+ break;
+
+ case 0x08:
+ m_mode = 1; // 2bpp
+ break;
+
+ case 0x10:
+ m_mode = 2; // 4bpp
+ break;
+
+ case 0x18:
+ m_mode = 3; // 8bpp
+ break;
+
+ case 0x1c:
+ m_mode = 4; // 24bpp
+ break;
+ }
+ }
+ recalc_mode();
+ }
+ break;
+
+ default:
+ dafb_base::ramdac_w(offset, data);
+ break;
+ }
+}
+
+// ************************************************************************
// dafb_memc_device overrides/additions
// ************************************************************************
void dafb_memc_device::device_start()
diff --git a/src/mame/apple/dafb.h b/src/mame/apple/dafb.h
index 744582a36d1..46979588194 100644
--- a/src/mame/apple/dafb.h
+++ b/src/mame/apple/dafb.h
@@ -101,7 +101,7 @@ private:
TIMER_CALLBACK_MEMBER(cursor_tick);
};
-// Discrete DAFB: Quadra 700 & 900, includes "TurboSCSI"
+// Discrete DAFB II: Quadra 950, includes "TurboSCSI"
class dafb_device: public dafb_base
{
public:
@@ -120,6 +120,8 @@ public:
template <int bus> void turboscsi_dma_w(offs_t offset, u16 data, u16 mem_mask);
protected:
+ dafb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
+
virtual void device_start() override;
private:
@@ -127,6 +129,22 @@ private:
ncr53c94_device *m_ncr[2];
};
+class dafb_q950_device : public dafb_device
+{
+public:
+ dafb_q950_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
+
+protected:
+ virtual void device_start() override;
+ virtual ioport_constructor device_input_ports() const override;
+
+ virtual u32 ramdac_r(offs_t offset) override;
+ virtual void ramdac_w(offs_t offset, u32 data) override;
+
+private:
+ u8 m_pcbr1;
+};
+
class dafb_memc_device: public dafb_base
{
public:
@@ -171,6 +189,7 @@ private:
};
DECLARE_DEVICE_TYPE(DAFB, dafb_device)
+DECLARE_DEVICE_TYPE(DAFB_Q950, dafb_q950_device)
DECLARE_DEVICE_TYPE(DAFB_MEMC, dafb_memc_device)
DECLARE_DEVICE_TYPE(DAFB_MEMCJR, dafb_memcjr_device)
diff --git a/src/mame/apple/macadb.cpp b/src/mame/apple/macadb.cpp
index 250211f36d7..d5e4797a7ab 100644
--- a/src/mame/apple/macadb.cpp
+++ b/src/mame/apple/macadb.cpp
@@ -2,7 +2,7 @@
// copyright-holders:R. Belmont
/***************************************************************************
- macadb.cpp - handles various aspects of ADB on the Mac.
+ macadb.cpp - HLE bit-serial emulation of an ADB mouse and keyboard.
***************************************************************************/
@@ -17,15 +17,15 @@
#include "logmacro.h"
// ADB states
-static constexpr int32_t ADB_STATE_NEW_COMMAND = 0;
-static constexpr int32_t ADB_STATE_XFER_EVEN = 1;
-static constexpr int32_t ADB_STATE_XFER_ODD = 2;
-static constexpr int32_t ADB_STATE_IDLE = 3;
-static constexpr int32_t ADB_STATE_NOTINIT = 4;
+static constexpr s32 ADB_STATE_NEW_COMMAND = 0;
+static constexpr s32 ADB_STATE_XFER_EVEN = 1;
+static constexpr s32 ADB_STATE_XFER_ODD = 2;
+static constexpr s32 ADB_STATE_IDLE = 3;
+static constexpr s32 ADB_STATE_NOTINIT = 4;
// ADB commands
-static constexpr int ADB_CMD_RESET = 0;
-static constexpr int ADB_CMD_FLUSH = 1;
+static constexpr u8 ADB_CMD_RESET = 0;
+static constexpr u8 ADB_CMD_FLUSH = 1;
// use 1 MHz base to get microseconds (hack: *2 to get old wrong HC05 numbers to all realign to reality)
static constexpr int adb_timebase = 2000000;
@@ -230,20 +230,38 @@ static INPUT_PORTS_START( macadb )
PORT_BIT(0xf800, IP_ACTIVE_HIGH, IPT_UNUSED) // 7b-7f are unused
INPUT_PORTS_END
-macadb_device::macadb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+macadb_device::macadb_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: device_t(mconfig, MACADB, tag, owner, clock),
m_mouse0(*this, "MOUSE0"),
m_mouse1(*this, "MOUSE1"),
m_mouse2(*this, "MOUSE2"),
m_keys(*this, "KEY%u", 0),
- write_via_clock(*this),
- write_via_data(*this),
write_adb_data(*this),
write_adb_irq(*this),
- m_bIsMCUMode(true),
+ m_waiting_cmd(false),
+ m_datasize(0),
+ m_command(0),
+ m_direction(0),
+ m_listenreg(0), m_listenaddr(0),
+ m_srq_switch(0),
+ m_stream_ptr(0),
+ m_linestate(0),
m_last_kbd{0, 0},
- m_last_mouse{0, 0}
+ m_last_mouse{0, 0},
+ m_keyboard_handler(0),
+ m_mouse_handler(0),
+ m_srqflag(false),
+ m_linein(0),
+ m_keybuf_start(0),
+ m_keybuf_end(0),
+ m_mouseaddr(3),
+ m_lastmousex(0), m_lastmousey(0), m_lastbutton(0),
+ m_keybaddr(2),
+ m_currentkeys{0, 0},
+ m_modifiers(0)
{
+ std::fill(std::begin(m_buffer), std::end(m_buffer), 0);
+ std::fill(std::begin(m_keybuf), std::end(m_keybuf), 0);
}
ioport_constructor macadb_device::device_input_ports() const
@@ -253,66 +271,37 @@ ioport_constructor macadb_device::device_input_ports() const
void macadb_device::device_start()
{
- this->m_adb_timer = timer_alloc(FUNC(macadb_device::mac_adb_tick), this);
- this->m_adb_timer->adjust(attotime::never);
-
- std::fill(std::begin(m_adb_buffer), std::end(m_adb_buffer), 0);
- m_adb_listenreg = 0;
- m_adb_listenaddr = 0;
- m_adb_stream_ptr = 0;
- m_adb_linein = 0;
- std::fill(std::begin(m_adb_keybuf), std::end(m_adb_keybuf), 0);
+ this->m_timer = timer_alloc(FUNC(macadb_device::timer_tick), this);
+ this->m_timer->adjust(attotime::never);
save_item(NAME(m_last_adb_time));
save_item(NAME(m_key_matrix));
- save_item(NAME(m_adb_waiting_cmd));
- save_item(NAME(m_adb_datasize));
- save_item(NAME(m_adb_buffer));
- save_item(NAME(m_adb_command));
- save_item(NAME(m_adb_send));
- save_item(NAME(m_adb_timer_ticks));
- save_item(NAME(m_adb_extclock));
- save_item(NAME(m_adb_direction));
- save_item(NAME(m_adb_listenreg));
- save_item(NAME(m_adb_listenaddr));
- save_item(NAME(m_adb_last_talk));
- save_item(NAME(m_adb_srq_switch));
- save_item(NAME(m_adb_stream_ptr));
- save_item(NAME(m_adb_linestate));
- save_item(NAME(m_adb_srqflag));
- save_item(NAME(m_adb_keybuf));
- save_item(NAME(m_adb_keybuf_start));
- save_item(NAME(m_adb_keybuf_end));
- save_item(NAME(m_adb_mouseaddr));
- save_item(NAME(m_adb_lastmousex));
- save_item(NAME(m_adb_lastmousey));
- save_item(NAME(m_adb_lastbutton));
- save_item(NAME(m_adb_mouse_initialized));
- save_item(NAME(m_adb_keybaddr));
- save_item(NAME(m_adb_keybinitialized));
- save_item(NAME(m_adb_currentkeys));
- save_item(NAME(m_adb_modifiers));
- save_item(NAME(m_adb_linein));
+ save_item(NAME(m_waiting_cmd));
+ save_item(NAME(m_datasize));
+ save_item(NAME(m_command));
+ save_item(NAME(m_direction));
+ save_item(NAME(m_listenreg));
+ save_item(NAME(m_listenaddr));
+ save_item(NAME(m_srq_switch));
+ save_item(NAME(m_stream_ptr));
+ save_item(NAME(m_linestate));
+ save_item(NAME(m_buffer));
save_item(NAME(m_last_kbd));
save_item(NAME(m_last_mouse));
- save_item(NAME(m_mouse_handler));
save_item(NAME(m_keyboard_handler));
-}
-
-void macadb_device::adb_data_w(int state)
-{
- if (m_adb_timer_ticks > 0)
- {
- m_adb_command <<= 1;
- if (state)
- {
- m_adb_command |= 1;
- }
- else
- {
- m_adb_command &= ~1;
- }
- }
+ save_item(NAME(m_mouse_handler));
+ save_item(NAME(m_srqflag));
+ save_item(NAME(m_linein));
+ save_item(NAME(m_keybuf));
+ save_item(NAME(m_keybuf_start));
+ save_item(NAME(m_keybuf_end));
+ save_item(NAME(m_mouseaddr));
+ save_item(NAME(m_lastmousex));
+ save_item(NAME(m_lastmousey));
+ save_item(NAME(m_lastbutton));
+ save_item(NAME(m_keybaddr));
+ save_item(NAME(m_currentkeys));
+ save_item(NAME(m_modifiers));
}
/* *************************************************************************
@@ -321,12 +310,14 @@ void macadb_device::adb_data_w(int state)
static char const *const adb_statenames[4] = { "NEW", "EVEN", "ODD", "IDLE" };
-int macadb_device::adb_pollkbd(int update)
+bool macadb_device::adb_pollkbd(int update)
{
- int report, codes[2], result;
+ int report, codes[2];
+ bool result;
codes[0] = codes[1] = 0xff; // key up
- report = result = 0;
+ report = 0;
+ result = false;
for (int i = 0; i < 8; i++)
{
@@ -361,55 +352,55 @@ int macadb_device::adb_pollkbd(int update)
{
if (codes[report] & 0x80)
{
- m_adb_modifiers &= ~0x20;
+ m_modifiers &= ~0x20;
}
else
{
- m_adb_modifiers |= 0x20;
+ m_modifiers |= 0x20;
}
}
if (((i<<4)|j) == 0x36)
{
if (codes[report] & 0x80)
{
- m_adb_modifiers &= ~0x8;
+ m_modifiers &= ~0x8;
}
else
{
- m_adb_modifiers |= 0x08;
+ m_modifiers |= 0x08;
}
}
if (((i<<4)|j) == 0x38)
{
if (codes[report] & 0x80)
{
- m_adb_modifiers &= ~0x4;
+ m_modifiers &= ~0x4;
}
else
{
- m_adb_modifiers |= 0x04;
+ m_modifiers |= 0x04;
}
}
if (((i<<4)|j) == 0x3a)
{
if (codes[report] & 0x80)
{
- m_adb_modifiers &= ~0x2;
+ m_modifiers &= ~0x2;
}
else
{
- m_adb_modifiers |= 0x02;
+ m_modifiers |= 0x02;
}
}
if (((i<<4)|j) == 0x37)
{
if (codes[report] & 0x80)
{
- m_adb_modifiers &= ~0x1;
+ m_modifiers &= ~0x1;
}
else
{
- m_adb_modifiers |= 0x01;
+ m_modifiers |= 0x01;
}
}
}
@@ -442,51 +433,46 @@ int macadb_device::adb_pollkbd(int update)
}
// figure out if there was a change
- if ((m_adb_currentkeys[0] != codes[0]) || (m_adb_currentkeys[1] != codes[1]))
+ if ((m_currentkeys[0] != codes[0]) || (m_currentkeys[1] != codes[1]))
{
- result = 1;
+ result = true;
// if we want to update the current read, do so
if (update)
{
- if(m_adb_currentkeys[0] != codes[0]) {
- m_adb_keybuf[m_adb_keybuf_end] = codes[0];
- m_adb_keybuf_end = (m_adb_keybuf_end+1) % kADBKeyBufSize;
+ if(m_currentkeys[0] != codes[0]) {
+ m_keybuf[m_keybuf_end] = codes[0];
+ m_keybuf_end = (m_keybuf_end+1) % kADBKeyBufSize;
}
- if(m_adb_currentkeys[1] != codes[1]) {
- m_adb_keybuf[m_adb_keybuf_end] = codes[1];
- m_adb_keybuf_end = (m_adb_keybuf_end+1) % kADBKeyBufSize;
+ if(m_currentkeys[1] != codes[1]) {
+ m_keybuf[m_keybuf_end] = codes[1];
+ m_keybuf_end = (m_keybuf_end+1) % kADBKeyBufSize;
}
- m_adb_currentkeys[0] = codes[0];
- m_adb_currentkeys[1] = codes[1];
+ m_currentkeys[0] = codes[0];
+ m_currentkeys[1] = codes[1];
}
}
return result;
}
-int macadb_device::adb_pollmouse()
+bool macadb_device::adb_pollmouse()
{
- int NewX, NewY, NewButton;
-
- if (!m_adb_mouse_initialized)
- {
- return 0;
- }
+ s32 NewX, NewY, NewButton;
NewButton = m_mouse0->read() & 0x01;
NewX = m_mouse1->read();
NewY = m_mouse2->read();
- if ((NewX != m_adb_lastmousex) || (NewY != m_adb_lastmousey) || (NewButton != m_adb_lastbutton))
+ if ((NewX != m_lastmousex) || (NewY != m_lastmousey) || (NewButton != m_lastbutton))
{
- return 1;
+ return true;
}
- return 0;
+ return false;
}
-void macadb_device::adb_accummouse( uint8_t *MouseX, uint8_t *MouseY )
+void macadb_device::adb_accummouse(u8 *MouseX, u8 *MouseY )
{
int MouseCountX = 0, MouseCountY = 0;
int NewX, NewY;
@@ -497,9 +483,9 @@ void macadb_device::adb_accummouse( uint8_t *MouseX, uint8_t *MouseY )
// printf("pollmouse: X %d Y %d\n", NewX, NewY);
/* see if it moved in the x coord */
- if (NewX != m_adb_lastmousex)
+ if (NewX != m_lastmousex)
{
- int diff = NewX - m_adb_lastmousex;
+ int diff = NewX - m_lastmousex;
/* check for wrap */
if (diff > 0x80)
@@ -508,13 +494,13 @@ void macadb_device::adb_accummouse( uint8_t *MouseX, uint8_t *MouseY )
diff = -0x100-diff;
MouseCountX += diff;
- m_adb_lastmousex = NewX;
+ m_lastmousex = NewX;
}
/* see if it moved in the y coord */
- if (NewY != m_adb_lastmousey)
+ if (NewY != m_lastmousey)
{
- int diff = NewY - m_adb_lastmousey;
+ int diff = NewY - m_lastmousey;
/* check for wrap */
if (diff > 0x80)
@@ -523,27 +509,27 @@ void macadb_device::adb_accummouse( uint8_t *MouseX, uint8_t *MouseY )
diff = -0x100-diff;
MouseCountY += diff;
- m_adb_lastmousey = NewY;
+ m_lastmousey = NewY;
}
- m_adb_lastbutton = m_mouse0->read() & 0x01;
+ m_lastbutton = m_mouse0->read() & 0x01;
- *MouseX = (uint8_t)MouseCountX;
- *MouseY = (uint8_t)MouseCountY;
+ *MouseX = (u8)MouseCountX;
+ *MouseY = (u8)MouseCountY;
}
void macadb_device::adb_talk()
{
int addr, reg;
- addr = (m_adb_command>>4);
- reg = (m_adb_command & 3);
+ addr = (m_command>>4);
+ reg = (m_command & 3);
-// printf("Mac sent %x (cmd %d addr %d reg %d mr %d kr %d)\n", m_adb_command, (m_adb_command>>2)&3, addr, reg, m_adb_mouseaddr, m_adb_keybaddr);
+// printf("Mac sent %x (cmd %d addr %d reg %d mr %d kr %d)\n", m_command, (m_command>>2)&3, addr, reg, m_mouseaddr, m_keybaddr);
- if (m_adb_waiting_cmd)
+ if (m_waiting_cmd)
{
- switch ((m_adb_command>>2)&3)
+ switch ((m_command>>2)&3)
{
case 0:
case 1:
@@ -551,15 +537,13 @@ void macadb_device::adb_talk()
{
case ADB_CMD_RESET:
LOGMASKED(LOG_TALK_LISTEN, "ADB RESET: reg %x address %x\n", reg, addr);
- m_adb_direction = 0;
- m_adb_send = 0;
+ m_direction = 0;
break;
case ADB_CMD_FLUSH:
LOGMASKED(LOG_TALK_LISTEN, "ADB FLUSH: reg %x address %x\n", reg, addr);
- m_adb_direction = 0;
- m_adb_send = 0;
+ m_direction = 0;
break;
default: // reserved/unused
@@ -568,34 +552,31 @@ void macadb_device::adb_talk()
break;
case 2: // listen
- m_adb_datasize = 0;
- if ((addr == m_adb_keybaddr) || (addr == m_adb_mouseaddr))
+ m_datasize = 0;
+ if ((addr == m_keybaddr) || (addr == m_mouseaddr))
{
LOGMASKED(LOG_TALK_LISTEN, "ADB LISTEN: reg %x address %x\n", reg, addr);
- m_adb_direction = 1; // input from Mac
- m_adb_command = 0;
- m_adb_listenreg = reg;
- m_adb_listenaddr = addr;
- m_adb_stream_ptr = 0;
- memset(m_adb_buffer, 0, sizeof(m_adb_buffer));
+ m_direction = 1; // input from Mac
+ m_command = 0;
+ m_listenreg = reg;
+ m_listenaddr = addr;
+ m_stream_ptr = 0;
+ memset(m_buffer, 0, sizeof(m_buffer));
}
else
{
LOGMASKED(LOG_TALK_LISTEN, "ADB LISTEN to unknown device %d, timing out\n", addr);
- m_adb_direction = 0;
+ m_direction = 0;
}
break;
case 3: // talk
- LOGMASKED(LOG_TALK_LISTEN, "ADB TALK: reg %x address %x (K %x M %x)\n", reg, addr, m_adb_keybaddr, m_adb_mouseaddr);
-
- // keep track of what device the Mac last TALKed to
- m_adb_last_talk = addr;
+ LOGMASKED(LOG_TALK_LISTEN, "ADB TALK: reg %x address %x (K %x M %x)\n", reg, addr, m_keybaddr, m_mouseaddr);
- m_adb_direction = 0; // output to Mac
- if (addr == m_adb_mouseaddr)
+ m_direction = 0; // output to Mac
+ if (addr == m_mouseaddr)
{
- uint8_t mouseX, mouseY;
+ u8 mouseX, mouseY;
LOGMASKED(LOG_TALK_LISTEN, "Talking to mouse, register %x\n", reg);
@@ -603,9 +584,9 @@ void macadb_device::adb_talk()
{
// read mouse
case 0:
- if (m_adb_srq_switch)
+ if (m_srq_switch)
{
- m_adb_srq_switch = 0;
+ m_srq_switch = 0;
mouseX = mouseY = 0;
}
else
@@ -613,42 +594,40 @@ void macadb_device::adb_talk()
this->adb_accummouse(&mouseX, &mouseY);
}
//printf("X %x Y %x\n", mouseX, mouseY);
- m_adb_buffer[0] = (m_adb_lastbutton & 0x01) ? 0x00 : 0x80;
- m_adb_buffer[0] |= mouseY & 0x7f;
- m_adb_buffer[1] = (mouseX & 0x7f) | 0x80;
+ m_buffer[0] = (m_lastbutton & 0x01) ? 0x00 : 0x80;
+ m_buffer[0] |= mouseY & 0x7f;
+ m_buffer[1] = (mouseX & 0x7f) | 0x80;
- if ((m_adb_buffer[0] != m_last_mouse[0]) || (m_adb_buffer[1] != m_last_mouse[1]))
+ if ((m_buffer[0] != m_last_mouse[0]) || (m_buffer[1] != m_last_mouse[1]))
{
- m_adb_datasize = 2;
- m_last_mouse[0] = m_adb_buffer[0];
- m_last_mouse[1] = m_adb_buffer[1];
+ m_datasize = 2;
+ m_last_mouse[0] = m_buffer[0];
+ m_last_mouse[1] = m_buffer[1];
}
else
{
- m_adb_datasize = 0;
+ m_datasize = 0;
if ((adb_pollkbd(0)) && (m_keyboard_handler & 0x20))
{
LOGMASKED(LOG_TALK_LISTEN, "Keyboard requesting service\n");
- m_adb_srqflag = true;
+ m_srqflag = true;
}
}
break;
// get ID/handler
case 3:
- m_adb_buffer[0] = m_mouse_handler;
- m_adb_buffer[1] = 0x01; // handler 1
- m_adb_datasize = 2;
-
- m_adb_mouse_initialized = 1;
+ m_buffer[0] = m_mouse_handler;
+ m_buffer[1] = 0x01; // handler 1
+ m_datasize = 2;
break;
default:
break;
}
}
- else if (addr == m_adb_keybaddr)
+ else if (addr == m_keybaddr)
{
LOGMASKED(LOG_TALK_LISTEN, "Talking to keyboard, register %x\n", reg);
@@ -656,50 +635,50 @@ void macadb_device::adb_talk()
{
// read keyboard
case 0:
- if (m_adb_srq_switch)
+ if (m_srq_switch)
{
- m_adb_srq_switch = 0;
+ m_srq_switch = 0;
}
else
{
adb_pollkbd(1);
}
- if (m_adb_keybuf_start == m_adb_keybuf_end)
+ if (m_keybuf_start == m_keybuf_end)
{
// printf("%s: buffer empty\n", __func__);
- m_adb_buffer[0] = 0xff;
- m_adb_buffer[1] = 0xff;
+ m_buffer[0] = 0xff;
+ m_buffer[1] = 0xff;
}
else
{
- m_adb_buffer[1] = m_adb_keybuf[m_adb_keybuf_start];
- m_adb_keybuf_start = (m_adb_keybuf_start+1) % kADBKeyBufSize;
- if(m_adb_keybuf_start != m_adb_keybuf_end)
+ m_buffer[1] = m_keybuf[m_keybuf_start];
+ m_keybuf_start = (m_keybuf_start+1) % kADBKeyBufSize;
+ if(m_keybuf_start != m_keybuf_end)
{
- m_adb_buffer[0] = m_adb_keybuf[m_adb_keybuf_start];
- m_adb_keybuf_start = (m_adb_keybuf_start+1) % kADBKeyBufSize;
+ m_buffer[0] = m_keybuf[m_keybuf_start];
+ m_keybuf_start = (m_keybuf_start+1) % kADBKeyBufSize;
}
else
{
- m_adb_buffer[0] = 0xff;
+ m_buffer[0] = 0xff;
}
}
- if ((m_adb_buffer[0] != m_last_kbd[0]) || (m_adb_buffer[1] != m_last_kbd[1]))
+ if ((m_buffer[0] != m_last_kbd[0]) || (m_buffer[1] != m_last_kbd[1]))
{
- m_adb_datasize = 2;
- m_last_kbd[0] = m_adb_buffer[0];
- m_last_kbd[1] = m_adb_buffer[1];
+ m_datasize = 2;
+ m_last_kbd[0] = m_buffer[0];
+ m_last_kbd[1] = m_buffer[1];
}
else
{
- m_adb_datasize = 0;
+ m_datasize = 0;
if ((adb_pollmouse()) && (m_mouse_handler & 0x20))
{
LOGMASKED(LOG_TALK_LISTEN, "Mouse requesting service\n");
- m_adb_srqflag = true;
+ m_srqflag = true;
}
}
break;
@@ -708,19 +687,17 @@ void macadb_device::adb_talk()
case 2:
{
this->adb_pollkbd(1);
- m_adb_buffer[0] = m_adb_modifiers;
- m_adb_buffer[1] = 0xff;
- m_adb_datasize = 2;
+ m_buffer[0] = m_modifiers;
+ m_buffer[1] = 0xff;
+ m_datasize = 2;
}
break;
// get ID/handler
case 3:
- m_adb_buffer[0] = m_keyboard_handler;
- m_adb_buffer[1] = 0x01; // handler 1
- m_adb_datasize = 2;
-
- m_adb_keybinitialized = 1;
+ m_buffer[0] = m_keyboard_handler;
+ m_buffer[1] = 0x01; // handler 1
+ m_datasize = 2;
break;
default:
@@ -729,65 +706,64 @@ void macadb_device::adb_talk()
}
else
{
- LOGMASKED(LOG_TALK_LISTEN, "ADB: talking to unconnected device %d (K %d M %d)\n", addr, m_adb_keybaddr, m_adb_mouseaddr);
- m_adb_buffer[0] = m_adb_buffer[1] = 0;
- m_adb_datasize = 0;
+ LOGMASKED(LOG_TALK_LISTEN, "ADB: talking to unconnected device %d (K %d M %d)\n", addr, m_keybaddr, m_mouseaddr);
+ m_buffer[0] = m_buffer[1] = 0;
+ m_datasize = 0;
if ((adb_pollmouse()) && (m_mouse_handler & 0x20))
{
LOGMASKED(LOG_TALK_LISTEN, "Mouse requesting service\n");
- m_adb_srqflag = true;
+ m_srqflag = true;
}
}
break;
}
- m_adb_waiting_cmd = 0;
+ m_waiting_cmd = false;
}
else
{
- LOGMASKED(LOG_TALK_LISTEN, "Got LISTEN data %02x %02x for device %x reg %x\n", m_adb_command, m_adb_buffer[1], m_adb_listenaddr, m_adb_listenreg);
- m_adb_direction = 0;
+ LOGMASKED(LOG_TALK_LISTEN, "Got LISTEN data %02x %02x for device %x reg %x\n", m_command, m_buffer[1], m_listenaddr, m_listenreg);
+ m_direction = 0;
- if (m_adb_listenaddr == m_adb_mouseaddr)
+ if (m_listenaddr == m_mouseaddr)
{
- if (m_adb_listenreg == 3)
+ if (m_listenreg == 3)
{
- switch (m_adb_buffer[1])
+ switch (m_buffer[1])
{
case 0x00: // unconditional set handler & address to value
- LOGMASKED(LOG_TALK_LISTEN, "MOUSE: moving to address & setting handler bits to %02x\n", m_adb_command);
- m_mouse_handler = m_adb_command & 0x7f;
- m_adb_mouseaddr = m_adb_command & 0x0f;
+ LOGMASKED(LOG_TALK_LISTEN, "MOUSE: moving to address & setting handler bits to %02x\n", m_command);
+ m_mouse_handler = m_command & 0x7f;
+ m_mouseaddr = m_command & 0x0f;
break;
case 0xfe: // unconditional address change
- LOGMASKED(LOG_TALK_LISTEN, "MOUSE: moving to address %x\n", m_adb_command);
- m_adb_mouseaddr = m_adb_command & 0x0f;
+ LOGMASKED(LOG_TALK_LISTEN, "MOUSE: moving to address %x\n", m_command);
+ m_mouseaddr = m_command & 0x0f;
m_mouse_handler &= 0xf0;
- m_mouse_handler |= m_adb_mouseaddr;
- m_adb_mouse_initialized = 1;
+ m_mouse_handler |= m_mouseaddr;
break;
}
}
}
- else if (m_adb_listenaddr == m_adb_keybaddr)
+ else if (m_listenaddr == m_keybaddr)
{
- if (m_adb_listenreg == 3)
+ if (m_listenreg == 3)
{
- switch (m_adb_buffer[1])
+ switch (m_buffer[1])
{
case 0x00: // unconditional set handler & address to value
- LOGMASKED(LOG_TALK_LISTEN, "KEYBOARD: moving to address & setting handler bits to %02x\n", m_adb_command);
- m_keyboard_handler = m_adb_command & 0x7f;
- m_adb_keybaddr = m_adb_command & 0x0f;
+ LOGMASKED(LOG_TALK_LISTEN, "KEYBOARD: moving to address & setting handler bits to %02x\n", m_command);
+ m_keyboard_handler = m_command & 0x7f;
+ m_keybaddr = m_command & 0x0f;
break;
case 0xfe: // unconditional address change
- LOGMASKED(LOG_TALK_LISTEN, "KEYBOARD: moving to address %x\n", m_adb_command);
- m_adb_keybaddr = m_adb_command & 0x0f;
+ LOGMASKED(LOG_TALK_LISTEN, "KEYBOARD: moving to address %x\n", m_command);
+ m_keybaddr = m_command & 0x0f;
m_keyboard_handler &= 0xf0;
- m_keyboard_handler |= m_adb_keybaddr;
+ m_keyboard_handler |= m_keybaddr;
break;
}
}
@@ -795,272 +771,115 @@ void macadb_device::adb_talk()
}
}
-TIMER_CALLBACK_MEMBER(macadb_device::mac_adb_tick)
+TIMER_CALLBACK_MEMBER(macadb_device::timer_tick)
{
- if (m_bIsMCUMode)
+ switch (m_linestate)
{
- switch (m_adb_linestate)
- {
- case LST_SRQNODATA:
- set_adb_line(ASSERT_LINE);
- m_adb_linestate = LST_IDLE;
- break;
-
- case LST_TSTOPSTART:
- LOGMASKED(LOG_LINESTATE, "Send: TStopStart begin\n");
- set_adb_line(ASSERT_LINE);
- m_adb_timer->adjust(attotime::from_ticks(adb_short, adb_timebase));
- m_adb_linestate++;
- break;
-
- case LST_TSTOPSTARTa:
- LOGMASKED(LOG_LINESTATE, "Send: TStopStart end\n");
- set_adb_line(CLEAR_LINE);
- m_adb_timer->adjust(attotime::from_ticks(adb_short, adb_timebase));
- m_adb_linestate++;
- break;
-
- case LST_STARTBIT:
- LOGMASKED(LOG_LINESTATE, "Send: Start bit\n");
- set_adb_line(ASSERT_LINE);
- m_adb_timer->adjust(attotime::from_ticks(adb_long, adb_timebase));
- m_adb_linestate++;
- break;
-
- case LST_SENDBIT0:
- case LST_SENDBIT1:
- case LST_SENDBIT2:
- case LST_SENDBIT3:
- case LST_SENDBIT4:
- case LST_SENDBIT5:
- case LST_SENDBIT6:
- case LST_SENDBIT7:
- set_adb_line(CLEAR_LINE);
- if (m_adb_buffer[m_adb_stream_ptr] & 0x80)
- {
- LOGMASKED(LOG_LINESTATE, "Send: 1\n");
- m_adb_timer->adjust(attotime::from_ticks(adb_short, adb_timebase));
- }
- else
- {
- LOGMASKED(LOG_LINESTATE, "Send: 0\n");
- m_adb_timer->adjust(attotime::from_ticks(adb_long, adb_timebase));
- }
- m_adb_linestate++;
- break;
-
- case LST_SENDBIT0a:
- case LST_SENDBIT1a:
- case LST_SENDBIT2a:
- case LST_SENDBIT3a:
- case LST_SENDBIT4a:
- case LST_SENDBIT5a:
- case LST_SENDBIT6a:
- set_adb_line(ASSERT_LINE);
- if (m_adb_buffer[m_adb_stream_ptr] & 0x80)
- {
- m_adb_timer->adjust(attotime::from_ticks(adb_long, adb_timebase));
- }
- else
- {
- m_adb_timer->adjust(attotime::from_ticks(adb_short, adb_timebase));
- }
- m_adb_buffer[m_adb_stream_ptr] <<= 1;
- m_adb_linestate++;
- break;
-
- case LST_SENDBIT7a:
- set_adb_line(ASSERT_LINE);
- if (m_adb_buffer[m_adb_stream_ptr] & 0x80)
- {
-// printf(" ");
- m_adb_timer->adjust(attotime::from_ticks(adb_long, adb_timebase));
- }
- else
- {
-// printf(" ");
- m_adb_timer->adjust(attotime::from_ticks(adb_short, adb_timebase));
- }
-
- m_adb_stream_ptr++;
- if (m_adb_stream_ptr == m_adb_datasize)
- {
- m_adb_linestate++;
- }
- else
- {
- m_adb_linestate = LST_SENDBIT0;
- }
- break;
-
- case LST_SENDSTOP:
- LOGMASKED(LOG_LINESTATE, "Send: Stop bit begin\n");
- set_adb_line(CLEAR_LINE);
- m_adb_timer->adjust(attotime::from_ticks((adb_short*2), adb_timebase));
- m_adb_linestate++;
- break;
+ case LST_SRQNODATA:
+ write_adb_data(ASSERT_LINE);
+ m_linestate = LST_IDLE;
+ break;
- case LST_SENDSTOPa:
- LOGMASKED(LOG_LINESTATE, "Send: Stop bit end\n");
- set_adb_line(ASSERT_LINE);
- m_adb_timer->adjust(attotime::never);
- m_adb_linestate = LST_IDLE;
- break;
- }
- }
- else
- {
- // for input to Mac, the VIA reads on the *other* clock edge, so update this here
- if (!m_adb_direction)
- {
- write_via_data((m_adb_send & 0x80)>>7);
- m_adb_send <<= 1;
- }
+ case LST_TSTOPSTART:
+ LOGMASKED(LOG_LINESTATE, "Send: TStopStart begin\n");
+ write_adb_data(ASSERT_LINE);
+ m_timer->adjust(attotime::from_ticks(adb_short, adb_timebase));
+ m_linestate++;
+ break;
- // do one clock transition on CB1 to advance the VIA shifter
- //printf("ADB transition (%d)\n", m_adb_timer_ticks);
- if (m_adb_direction)
- {
- write_via_clock(m_adb_extclock ^ 1);
- write_via_clock(m_adb_extclock);
- }
- else
- {
- write_via_clock(m_adb_extclock);
- write_via_clock(m_adb_extclock ^ 1);
- }
+ case LST_TSTOPSTARTa:
+ LOGMASKED(LOG_LINESTATE, "Send: TStopStart end\n");
+ write_adb_data(CLEAR_LINE);
+ m_timer->adjust(attotime::from_ticks(adb_short, adb_timebase));
+ m_linestate++;
+ break;
- m_adb_timer_ticks--;
- if (!m_adb_timer_ticks)
- {
- m_adb_timer->adjust(attotime::never);
+ case LST_STARTBIT:
+ LOGMASKED(LOG_LINESTATE, "Send: Start bit\n");
+ write_adb_data(ASSERT_LINE);
+ m_timer->adjust(attotime::from_ticks(adb_long, adb_timebase));
+ m_linestate++;
+ break;
- if ((m_adb_direction) && (!m_bIsMCUMode))
+ case LST_SENDBIT0:
+ case LST_SENDBIT1:
+ case LST_SENDBIT2:
+ case LST_SENDBIT3:
+ case LST_SENDBIT4:
+ case LST_SENDBIT5:
+ case LST_SENDBIT6:
+ case LST_SENDBIT7:
+ write_adb_data(CLEAR_LINE);
+ if (m_buffer[m_stream_ptr] & 0x80)
{
- adb_talk();
- if((m_adb_last_talk == 2) && m_adb_datasize) {
- m_adb_timer_ticks = 8;
- m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
- }
+ LOGMASKED(LOG_LINESTATE, "Send: 1\n");
+ m_timer->adjust(attotime::from_ticks(adb_short, adb_timebase));
}
-
- if (!(m_adb_direction) && !(m_bIsMCUMode))
+ else
{
- // write_via_clock(m_adb_extclock);
- write_via_clock(m_adb_extclock ^ 1);
+ LOGMASKED(LOG_LINESTATE, "Send: 0\n");
+ m_timer->adjust(attotime::from_ticks(adb_long, adb_timebase));
}
- }
- else
- {
- m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(200)));
- }
- }
-}
-
-void macadb_device::mac_adb_newaction(int state)
-{
- if (state != m_adb_state)
- {
- LOGMASKED(LOG_STATE, "New ADB state: %s\n", adb_statenames[state]);
-
- m_adb_state = state;
- m_adb_timer_ticks = 8;
-
- switch (state)
- {
- case ADB_STATE_NEW_COMMAND:
- m_adb_command = m_adb_send = 0;
- m_adb_direction = 1; // Mac is shifting us a command
- m_adb_waiting_cmd = 1; // we're going to get a command
- write_adb_irq(CLEAR_LINE);
- m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
- break;
-
- case ADB_STATE_XFER_EVEN:
- case ADB_STATE_XFER_ODD:
- //printf("EVEN/ODD: adb datasize %d\n", m_adb_datasize);
- if (m_adb_datasize > 0)
- {
- int i;
-
- // is something trying to send to the Mac?
- if (m_adb_direction == 0)
- {
- // set up the byte
- m_adb_send = m_adb_buffer[0];
- //printf("ADB sending %02x\n", m_adb_send);
- m_adb_datasize--;
-
- // move down the rest of the buffer, if any
- for (i = 0; i < m_adb_datasize; i++)
- {
- m_adb_buffer[i] = m_adb_buffer[i+1];
- }
- }
-
- }
- else
- {
- m_adb_send = 0;
- write_adb_irq(ASSERT_LINE);
- }
-
- m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
- break;
-
- case ADB_STATE_IDLE:
- write_adb_irq(CLEAR_LINE);
- break;
- }
- }
-}
+ m_linestate++;
+ break;
-void macadb_device::adb_vblank()
-{
- if (m_adb_state == ADB_STATE_IDLE)
- {
- if (this->adb_pollmouse())
- {
- // if the mouse was the last TALK, we can just send the new data
- // otherwise we need to pull SRQ
- if (m_adb_last_talk == m_adb_mouseaddr)
+ case LST_SENDBIT0a:
+ case LST_SENDBIT1a:
+ case LST_SENDBIT2a:
+ case LST_SENDBIT3a:
+ case LST_SENDBIT4a:
+ case LST_SENDBIT5a:
+ case LST_SENDBIT6a:
+ write_adb_data(ASSERT_LINE);
+ if (m_buffer[m_stream_ptr] & 0x80)
{
- // repeat last TALK to get updated data
- m_adb_waiting_cmd = 1;
- this->adb_talk();
-
- m_adb_timer_ticks = 8;
- this->m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
+ m_timer->adjust(attotime::from_ticks(adb_long, adb_timebase));
}
else
{
- write_adb_irq(ASSERT_LINE);
- m_adb_command = m_adb_send = 0;
- m_adb_timer_ticks = 1; // one tick should be sufficient to make it see the IRQ
- this->m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
- m_adb_srq_switch = 1;
+ m_timer->adjust(attotime::from_ticks(adb_short, adb_timebase));
}
- }
- else if (this->adb_pollkbd(0))
- {
- if (m_adb_last_talk == m_adb_keybaddr)
+ m_buffer[m_stream_ptr] <<= 1;
+ m_linestate++;
+ break;
+
+ case LST_SENDBIT7a:
+ write_adb_data(ASSERT_LINE);
+ if (m_buffer[m_stream_ptr] & 0x80)
{
- // repeat last TALK to get updated data
- m_adb_waiting_cmd = 1;
- this->adb_talk();
+// printf(" ");
+ m_timer->adjust(attotime::from_ticks(adb_long, adb_timebase));
+ }
+ else
+ {
+// printf(" ");
+ m_timer->adjust(attotime::from_ticks(adb_short, adb_timebase));
+ }
- m_adb_timer_ticks = 8;
- this->m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
+ m_stream_ptr++;
+ if (m_stream_ptr == m_datasize)
+ {
+ m_linestate++;
}
else
{
- write_adb_irq(ASSERT_LINE);
- m_adb_command = m_adb_send = 0;
- m_adb_timer_ticks = 1; // one tick should be sufficient to make it see the IRQ
- this->m_adb_timer->adjust(attotime(0, ATTOSECONDS_IN_USEC(100)));
- m_adb_srq_switch = 1;
+ m_linestate = LST_SENDBIT0;
}
- }
+ break;
+
+ case LST_SENDSTOP:
+ LOGMASKED(LOG_LINESTATE, "Send: Stop bit begin\n");
+ write_adb_data(CLEAR_LINE);
+ m_timer->adjust(attotime::from_ticks((adb_short*2), adb_timebase));
+ m_linestate++;
+ break;
+
+ case LST_SENDSTOPa:
+ LOGMASKED(LOG_LINESTATE, "Send: Stop bit end\n");
+ write_adb_data(ASSERT_LINE);
+ m_timer->adjust(attotime::never);
+ m_linestate = LST_IDLE;
+ break;
}
}
@@ -1068,40 +887,32 @@ void macadb_device::device_reset()
{
int i;
- m_adb_srq_switch = 0;
+ m_srq_switch = 0;
write_adb_irq(CLEAR_LINE); // no interrupt
- m_adb_timer_ticks = 0;
- m_adb_command = 0;
- m_adb_extclock = 0;
- m_adb_send = 0;
- m_adb_waiting_cmd = 0;
- m_adb_state = 0;
- m_adb_srqflag = false;
- m_adb_state = ADB_STATE_NOTINIT;
- m_adb_direction = 0;
- m_adb_datasize = 0;
- m_adb_last_talk = -1;
-
- m_adb_linestate = 0;
+ m_command = 0;
+ m_waiting_cmd = false;
+ m_srqflag = false;
+ m_direction = 0;
+ m_datasize = 0;
+
+ m_linestate = 0;
// mouse
- m_adb_mouseaddr = 3;
+ m_mouseaddr = 3;
m_mouse_handler = 0x23;
- m_adb_lastmousex = m_adb_lastmousey = m_adb_lastbutton = 0;
- m_adb_mouse_initialized = 0;
+ m_lastmousex = m_lastmousey = m_lastbutton = 0;
// keyboard
- m_adb_keybaddr = 2;
+ m_keybaddr = 2;
m_keyboard_handler = 0x22;
- m_adb_keybinitialized = 0;
- m_adb_currentkeys[0] = m_adb_currentkeys[1] = 0xff;
- m_adb_modifiers = 0xff;
+ m_currentkeys[0] = m_currentkeys[1] = 0xff;
+ m_modifiers = 0xff;
for (i=0; i<9; i++)
{
m_key_matrix[i] = 0;
}
- m_adb_keybuf_start = 0;
- m_adb_keybuf_end = 0;
+ m_keybuf_start = 0;
+ m_keybuf_end = 0;
m_last_adb_time = 0;
}
@@ -1126,42 +937,46 @@ void macadb_device::adb_linechange_w(int state)
"srqnodata"
};*/
- if (state == m_adb_linein)
+ if (state == m_linein)
{
return;
}
- m_adb_linein = state;
+ m_linein = state;
+
+ // Because we use a push model primarily for the ADB line, echo the new value back.
+ // This fixes the IOP 65c02 program not seeing the right line state and going nuts.
+ write_adb_data(m_linein);
int dtime = (int)(machine().time().as_ticks(adb_timebase) - m_last_adb_time);
m_last_adb_time = machine().time().as_ticks(adb_timebase);
-/* if (m_adb_linestate <= 12)
+/* if (m_linestate <= 12)
{
- printf("linechange: %d -> %d, time %d (state %d = %s)\n", state^1, state, dtime, m_adb_linestate, states[m_adb_linestate]);
+ printf("linechange: %d -> %d, time %d (state %d = %s)\n", state^1, state, dtime, m_linestate, states[m_linestate]);
}
else
{
- printf("linechange: %d -> %d, time %d (state %d)\n", state^1, state, dtime, m_adb_linestate);
+ printf("linechange: %d -> %d, time %d (state %d)\n", state^1, state, dtime, m_linestate);
}*/
- if ((m_adb_direction) && (m_adb_linestate == LST_TSTOP))
+ if ((m_direction) && (m_linestate == LST_TSTOP))
{
- if (m_adb_stream_ptr & 1) // odd byte, can't end here
+ if (m_stream_ptr & 1) // odd byte, can't end here
{
// printf("critical linechange: odd, cont\n");
- m_adb_linestate = LST_BIT0;
+ m_linestate = LST_BIT0;
}
else
{
if (dtime < 90)
{
// printf("critical linechange: even, and it's another bit\n");
- m_adb_linestate = LST_BIT0;
+ m_linestate = LST_BIT0;
}
}
}
- switch (m_adb_linestate)
+ switch (m_linestate)
{
case LST_IDLE:
if ((state) && (dtime >= 4500)) // reset
@@ -1171,9 +986,9 @@ void macadb_device::adb_linechange_w(int state)
else if ((state) && (dtime >= 1200)) // attention
{
//printf("ADB ATTENTION\n");
- m_adb_waiting_cmd = 1;
- m_adb_direction = 0;
- m_adb_linestate++;
+ m_waiting_cmd = true;
+ m_direction = 0;
+ m_linestate++;
}
break;
@@ -1181,8 +996,8 @@ void macadb_device::adb_linechange_w(int state)
if ((!state) && (dtime >= 90)) // Tsync
{
//printf("ADB Tsync\n");
- m_adb_command = 0;
- m_adb_linestate++;
+ m_command = 0;
+ m_linestate++;
}
break;
@@ -1198,77 +1013,77 @@ void macadb_device::adb_linechange_w(int state)
{
if (dtime >= 90) // "1" bit
{
- m_adb_command |= 1;
+ m_command |= 1;
}
- LOGMASKED(LOG_LINESTATE, "ADB bit %d (dtime = %d)\n", m_adb_command & 1, dtime);
+ LOGMASKED(LOG_LINESTATE, "ADB bit %d (dtime = %d)\n", m_command & 1, dtime);
- if (m_adb_linestate != LST_BIT7)
+ if (m_linestate != LST_BIT7)
{
- m_adb_command <<= 1;
+ m_command <<= 1;
}
else
{
- if (m_adb_direction)
+ if (m_direction)
{
- LOGMASKED(LOG_LINESTATE, "listen byte[%d] = %02x\n", m_adb_stream_ptr, m_adb_command);
- m_adb_buffer[m_adb_stream_ptr++] = m_adb_command;
- m_adb_command = 0;
+ LOGMASKED(LOG_LINESTATE, "listen byte[%d] = %02x\n", m_stream_ptr, m_command);
+ m_buffer[m_stream_ptr++] = m_command;
+ m_command = 0;
}
}
- m_adb_linestate++;
+ m_linestate++;
}
break;
case LST_TSTOP:
if (state)
{
- LOGMASKED(LOG_LINESTATE, "ADB TSTOP, command byte %02x\n", m_adb_command);
+ LOGMASKED(LOG_LINESTATE, "ADB TSTOP, command byte %02x\n", m_command);
- if (m_adb_direction)
+ if (m_direction)
{
- m_adb_command = m_adb_buffer[0];
+ m_command = m_buffer[0];
}
- m_adb_srqflag = false;
+ m_srqflag = false;
adb_talk();
- if (m_adb_srqflag)
+ if (m_srqflag)
{
- set_adb_line(CLEAR_LINE);
- m_adb_linestate = LST_SRQNODATA;
- m_adb_timer->adjust(attotime::from_ticks(adb_srq, adb_timebase)); // SRQ time
+ write_adb_data(CLEAR_LINE);
+ m_linestate = LST_SRQNODATA;
+ m_timer->adjust(attotime::from_ticks(adb_srq, adb_timebase)); // SRQ time
}
else
{
- set_adb_line(ASSERT_LINE);
+ write_adb_data(ASSERT_LINE);
- if (m_adb_datasize > 0)
+ if (m_datasize > 0)
{
- LOGMASKED(LOG_TALK_LISTEN, "Device has %d bytes of data:\n", m_adb_datasize);
- for (int i = 0; i < m_adb_datasize; i++)
+ LOGMASKED(LOG_TALK_LISTEN, "Device has %d bytes of data:\n", m_datasize);
+ for (int i = 0; i < m_datasize; i++)
{
- LOGMASKED(LOG_TALK_LISTEN, " %02x", m_adb_buffer[i]);
+ LOGMASKED(LOG_TALK_LISTEN, " %02x", m_buffer[i]);
}
LOGMASKED(LOG_TALK_LISTEN, "\n");
- m_adb_linestate = LST_TSTOPSTART; // T1t
- m_adb_timer->adjust(attotime::from_ticks(324 / 4, adb_timebase));
- m_adb_stream_ptr = 0;
+ m_linestate = LST_TSTOPSTART; // T1t
+ m_timer->adjust(attotime::from_ticks(324 / 4, adb_timebase));
+ m_stream_ptr = 0;
}
- else if (m_adb_direction) // if direction is set, we LISTENed to a valid device
+ else if (m_direction) // if direction is set, we LISTENed to a valid device
{
- m_adb_linestate = LST_WAITT1T;
+ m_linestate = LST_WAITT1T;
}
else // no valid device targetted, time out
{
- if (m_adb_srqflag)
+ if (m_srqflag)
{
- m_adb_linestate = LST_SRQNODATA;
- m_adb_timer->adjust(attotime::from_ticks(adb_srq, adb_timebase)); // SRQ time
+ m_linestate = LST_SRQNODATA;
+ m_timer->adjust(attotime::from_ticks(adb_srq, adb_timebase)); // SRQ time
}
else
{
- m_adb_linestate = LST_IDLE;
+ m_linestate = LST_IDLE;
}
}
}
@@ -1279,7 +1094,7 @@ void macadb_device::adb_linechange_w(int state)
if ((!state) && (dtime >= 300)) // T1t
{
LOGMASKED(LOG_LINESTATE, "ADB T1t\n");
- m_adb_linestate++;
+ m_linestate++;
}
break;
@@ -1287,8 +1102,8 @@ void macadb_device::adb_linechange_w(int state)
if ((!state) && (dtime >= 90)) // start
{
LOGMASKED(LOG_LINESTATE, "ADB start\n");
- m_adb_linestate = LST_BIT0;
- m_adb_command = 0;
+ m_linestate = LST_BIT0;
+ m_command = 0;
}
break;
}
diff --git a/src/mame/apple/macadb.h b/src/mame/apple/macadb.h
index e55e72dac5e..bca8c785e77 100644
--- a/src/mame/apple/macadb.h
+++ b/src/mame/apple/macadb.h
@@ -17,25 +17,18 @@ class macadb_device : public device_t
{
public:
// construction/destruction
- macadb_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ macadb_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
- void set_mcu_mode(bool bMCUMode) { m_bIsMCUMode = bMCUMode; }
-
- auto via_clock_callback() { return write_via_clock.bind(); }
- auto via_data_callback() { return write_via_data.bind(); }
auto adb_data_callback() { return write_adb_data.bind(); }
auto adb_irq_callback() { return write_adb_irq.bind(); }
required_ioport m_mouse0, m_mouse1, m_mouse2;
required_ioport_array<8> m_keys;
- devcb_write_line write_via_clock, write_via_data, write_adb_data, write_adb_irq;
+ devcb_write_line write_adb_data, write_adb_irq;
- void adb_data_w(int state);
void adb_linechange_w(int state);
- void adb_vblank();
- void mac_adb_newaction(int state);
- int32_t get_adb_state(void) { return m_adb_state; }
+ void adb_vblank() {}
protected:
// device-level overrides
@@ -44,46 +37,42 @@ protected:
virtual void device_reset() override;
private:
- bool m_bIsMCUMode;
-
- uint64_t m_last_adb_time;
-
- emu_timer *m_adb_timer;
+ u64 m_last_adb_time;
+ emu_timer *m_timer;
/* keyboard matrix to detect transition */
u16 m_key_matrix[9];
// ADB HLE state
- int32_t m_adb_state, m_adb_waiting_cmd, m_adb_datasize;
- int32_t m_adb_command, m_adb_send, m_adb_timer_ticks, m_adb_extclock, m_adb_direction;
- int32_t m_adb_listenreg, m_adb_listenaddr, m_adb_last_talk, m_adb_srq_switch;
- int32_t m_adb_stream_ptr;
- int32_t m_adb_linestate;
- u8 m_adb_buffer[257], m_last_kbd[2], m_last_mouse[2], m_keyboard_handler, m_mouse_handler;
- bool m_adb_srqflag;
- int m_adb_linein;
-
- #define kADBKeyBufSize 32
- uint8_t m_adb_keybuf[kADBKeyBufSize];
- uint8_t m_adb_keybuf_start;
- uint8_t m_adb_keybuf_end;
+ bool m_waiting_cmd;
+ s32 m_datasize;
+ s32 m_command, m_direction;
+ u8 m_listenreg, m_listenaddr;
+ s32 m_srq_switch, m_stream_ptr, m_linestate;
+ u8 m_buffer[16], m_last_kbd[2], m_last_mouse[2];
+ u8 m_keyboard_handler, m_mouse_handler;
+ bool m_srqflag;
+ s32 m_linein;
+
+ static constexpr int kADBKeyBufSize = 32;
+ u8 m_keybuf[kADBKeyBufSize];
+ u8 m_keybuf_start;
+ u8 m_keybuf_end;
// ADB mouse state
- int m_adb_mouseaddr;
- int m_adb_lastmousex, m_adb_lastmousey, m_adb_lastbutton, m_adb_mouse_initialized;
+ u8 m_mouseaddr;
+ s32 m_lastmousex, m_lastmousey, m_lastbutton;
// ADB keyboard state
- int m_adb_keybaddr;
- int m_adb_keybinitialized, m_adb_currentkeys[2], m_adb_modifiers;
+ u8 m_keybaddr;
+ s32 m_currentkeys[2], m_modifiers;
- int adb_pollkbd(int update);
- int adb_pollmouse();
- void adb_accummouse( uint8_t *MouseX, uint8_t *MouseY );
+ bool adb_pollkbd(int update);
+ bool adb_pollmouse();
+ void adb_accummouse(u8 *MouseX, u8 *MouseY );
void adb_talk();
- inline void set_adb_line(int linestate) { write_adb_data(linestate); }
-
- TIMER_CALLBACK_MEMBER(mac_adb_tick);
+ TIMER_CALLBACK_MEMBER(timer_tick);
};
// device type definition
diff --git a/src/mame/apple/maciifx.cpp b/src/mame/apple/maciifx.cpp
index c3ad6b9d83f..443da50dde4 100644
--- a/src/mame/apple/maciifx.cpp
+++ b/src/mame/apple/maciifx.cpp
@@ -67,7 +67,12 @@ public:
m_scc(*this, "scc"),
m_asc(*this, "asc"),
m_cur_floppy(nullptr),
- m_hdsel(0)
+ m_hdsel(0),
+ m_last_taken_interrupt(-1),
+ m_overlay(true),
+ m_rom_ptr(nullptr),
+ m_rom_size(0),
+ m_adb_in(0)
{
}
@@ -100,8 +105,8 @@ private:
emu_timer *m_6015_timer;
bool m_overlay;
- u32 *m_rom_ptr = nullptr;
- u32 m_rom_size = 0;
+ u32 *m_rom_ptr;
+ u32 m_rom_size;
int m_adb_in;
@@ -117,6 +122,7 @@ private:
void phases_w(uint8_t phases);
void devsel_w(uint8_t devsel);
+ void fdc_hdsel(int state);
uint32_t biu_r(offs_t offset, uint32_t mem_mask = ~0);
void biu_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0);
@@ -129,13 +135,13 @@ private:
uint8_t maciifx_8010_r();
uint8_t maciifx_8040_r();
- uint16_t mac_via_r(offs_t offset);
- void mac_via_w(offs_t offset, uint16_t data, uint16_t mem_mask);
- uint8_t mac_via_in_a();
- uint8_t mac_via_in_b();
- void mac_via_out_a(uint8_t data);
- void mac_via_out_b(uint8_t data);
- void mac_via_sync();
+ uint16_t via_r(offs_t offset);
+ void via_w(offs_t offset, uint16_t data, uint16_t mem_mask);
+ uint8_t via_in_a();
+ uint8_t via_in_b();
+ void via_out_a(uint8_t data);
+ void via_out_b(uint8_t data);
+ void via_sync();
uint32_t rom_switch_r(offs_t offset);
@@ -200,7 +206,7 @@ void maciifx_state::maciifx_map(address_map &map)
{
map(0x40000000, 0x4007ffff).r(FUNC(maciifx_state::rom_switch_r)).mirror(0x0ff80000);
- map(0x50000000, 0x50001fff).rw(FUNC(maciifx_state::mac_via_r), FUNC(maciifx_state::mac_via_w)).mirror(0x00f00000);
+ map(0x50000000, 0x50001fff).rw(FUNC(maciifx_state::via_r), FUNC(maciifx_state::via_w)).mirror(0x00f00000);
map(0x50004000, 0x50005fff).rw("sccpic", FUNC(applepic_device::host_r), FUNC(applepic_device::host_w)).mirror(0x00f00000).umask32(0xff00ff00);
map(0x50004000, 0x50005fff).rw("sccpic", FUNC(applepic_device::host_r), FUNC(applepic_device::host_w)).mirror(0x00f00000).umask32(0x00ff00ff);
map(0x50008010, 0x50008010).r(FUNC(maciifx_state::maciifx_8010_r)).mirror(0x00f00000);
@@ -215,10 +221,10 @@ void maciifx_state::maciifx_map(address_map &map)
map(0x50018000, 0x50019fff).rw(FUNC(maciifx_state::biu_r), FUNC(maciifx_state::biu_w)).mirror(0x00f00000);
map(0x5001a000, 0x5001bfff).rw(FUNC(maciifx_state::oss_r), FUNC(maciifx_state::oss_w)).mirror(0x00f00000);
map(0x50024000, 0x50027fff).r(FUNC(maciifx_state::buserror_r)).mirror(0x00f00000); // must bus error on access here so ROM can determine we're an FMC
- map(0x50040000, 0x50041fff).rw(FUNC(maciifx_state::mac_via_r), FUNC(maciifx_state::mac_via_w)).mirror(0x00f00000);
+ map(0x50040000, 0x50041fff).rw(FUNC(maciifx_state::via_r), FUNC(maciifx_state::via_w)).mirror(0x00f00000);
}
-void maciifx_state::mac_via_sync()
+void maciifx_state::via_sync()
{
// The via runs at 783.36KHz while the main cpu runs at 15MHz or
// more, so we need to sync the access with the via clock. Plus
@@ -241,7 +247,7 @@ void maciifx_state::mac_via_sync()
m_maincpu->adjust_icount(-int(main_cycle - cycle));
}
-uint16_t maciifx_state::mac_via_r(offs_t offset)
+uint16_t maciifx_state::via_r(offs_t offset)
{
uint16_t data;
@@ -249,19 +255,19 @@ uint16_t maciifx_state::mac_via_r(offs_t offset)
offset &= 0x0f;
if (!machine().side_effects_disabled())
- mac_via_sync();
+ via_sync();
data = m_via1->read(offset);
return (data & 0xff) | (data << 8);
}
-void maciifx_state::mac_via_w(offs_t offset, uint16_t data, uint16_t mem_mask)
+void maciifx_state::via_w(offs_t offset, uint16_t data, uint16_t mem_mask)
{
offset >>= 8;
offset &= 0x0f;
- mac_via_sync();
+ via_sync();
if (ACCESSING_BITS_0_7)
m_via1->write(offset, data & 0xff);
@@ -269,37 +275,22 @@ void maciifx_state::mac_via_w(offs_t offset, uint16_t data, uint16_t mem_mask)
m_via1->write(offset, (data >> 8) & 0xff);
}
-uint8_t maciifx_state::mac_via_in_a()
+uint8_t maciifx_state::via_in_a()
{
return 0xd3; // PA6 | PA4 | PA1
}
-uint8_t maciifx_state::mac_via_in_b()
+uint8_t maciifx_state::via_in_b()
{
- int val = m_rtc->data_r();
-
- // printf("%s VIA1 IN_B = %02x\n", machine().describe_context().c_str(), val);
-
- return val;
+ return m_rtc->data_r();
}
-void maciifx_state::mac_via_out_a(uint8_t data)
+void maciifx_state::via_out_a(uint8_t data)
{
- int hdsel = BIT(data, 5);
- if (hdsel != m_hdsel)
- {
- if (m_cur_floppy)
- {
- m_cur_floppy->ss_w(hdsel);
- }
- }
- m_hdsel = hdsel;
}
-void maciifx_state::mac_via_out_b(uint8_t data)
+void maciifx_state::via_out_b(uint8_t data)
{
- // printf("%s VIA1 OUT B: %02x\n", machine().describe_context().c_str(), data);
-
m_rtc->ce_w((data & 0x04) >> 2);
m_rtc->data_w(data & 0x01);
m_rtc->clk_w((data >> 1) & 0x01);
@@ -376,43 +367,69 @@ void maciifx_state::phases_w(uint8_t phases)
void maciifx_state::devsel_w(uint8_t devsel)
{
if (devsel == 1)
+ {
m_cur_floppy = m_floppy[0]->get_device();
+ }
else if (devsel == 2)
+ {
m_cur_floppy = m_floppy[1]->get_device();
+ }
else
+ {
m_cur_floppy = nullptr;
+ }
m_fdc->set_floppy(m_cur_floppy);
if (m_cur_floppy)
+ {
m_cur_floppy->ss_w(m_hdsel);
+ }
+}
+
+void maciifx_state::fdc_hdsel(int state)
+{
+ if (state != m_hdsel)
+ {
+ if (m_cur_floppy)
+ {
+ m_cur_floppy->ss_w(state);
+ }
+ }
+ m_hdsel = state;
}
uint32_t maciifx_state::biu_r(offs_t offset, uint32_t mem_mask)
{
- // printf("biu_r @ %x, mask %08x\n", offset, mem_mask);
return 0;
}
void maciifx_state::biu_w(offs_t offset, uint32_t data, uint32_t mem_mask)
{
- // printf("biu_w %x @ %x, mask %08x\n", data, offset, mem_mask);
}
template <int N>
void maciifx_state::oss_interrupt(int state)
{
if (state == ASSERT_LINE)
+ {
m_oss_regs[N >= 8 ? 0x202 : 0x203] |= 1 << (N & 7);
+ }
else
+ {
m_oss_regs[N >= 8 ? 0x202 : 0x203] &= ~(1 << (N & 7));
+ }
int take_interrupt = 0;
for (int n = 0; n < 8; n++)
{
if (BIT(m_oss_regs[0x203], n) && take_interrupt < m_oss_regs[n])
+ {
take_interrupt = m_oss_regs[n];
+ }
if (BIT(m_oss_regs[0x202], n) && take_interrupt < m_oss_regs[8 + n])
+ {
take_interrupt = m_oss_regs[8 + n];
+ }
}
if (m_last_taken_interrupt > -1)
@@ -439,25 +456,26 @@ TIMER_CALLBACK_MEMBER(maciifx_state::oss_6015_tick)
uint8_t maciifx_state::oss_r(offs_t offset)
{
- // printf("oss_r @ %x\n", offset);
- // if (offset <= 0xe) // for interrupt mask registers, we're intended to return something different than is written in the low 3 bits (?)
- // {
- // return m_oss_regs[offset]<<4;
- // }
-
if (offset < std::size(m_oss_regs))
+ {
return m_oss_regs[offset];
+ }
else
+ {
return 0;
+ }
}
void maciifx_state::oss_w(offs_t offset, uint8_t data)
{
- // printf("oss_w %x @ %x\n", data, offset);
if (offset == 0x207)
+ {
oss_interrupt<10>(CLEAR_LINE);
+ }
else if (offset < std::size(m_oss_regs))
+ {
m_oss_regs[offset] = data;
+ }
}
uint32_t maciifx_state::buserror_r()
@@ -500,6 +518,7 @@ void maciifx_state::maciifx(machine_config &config)
SWIM1(config, m_fdc, C15M);
m_fdc->devsel_cb().set(FUNC(maciifx_state::devsel_w));
m_fdc->phases_cb().set(FUNC(maciifx_state::phases_w));
+ m_fdc->hdsel_cb().set(FUNC(maciifx_state::fdc_hdsel));
applefdintf_device::add_35_hd(config, m_floppy[0]);
applefdintf_device::add_35_nc(config, m_floppy[1]);
@@ -560,10 +579,10 @@ void maciifx_state::maciifx(machine_config &config)
m_asc->irqf_callback().set(FUNC(maciifx_state::oss_interrupt<8>));
R65NC22(config, m_via1, C7M / 10);
- m_via1->readpa_handler().set(FUNC(maciifx_state::mac_via_in_a));
- m_via1->readpb_handler().set(FUNC(maciifx_state::mac_via_in_b));
- m_via1->writepa_handler().set(FUNC(maciifx_state::mac_via_out_a));
- m_via1->writepb_handler().set(FUNC(maciifx_state::mac_via_out_b));
+ m_via1->readpa_handler().set(FUNC(maciifx_state::via_in_a));
+ m_via1->readpb_handler().set(FUNC(maciifx_state::via_in_b));
+ m_via1->writepa_handler().set(FUNC(maciifx_state::via_out_a));
+ m_via1->writepb_handler().set(FUNC(maciifx_state::via_out_b));
m_via1->irq_handler().set(FUNC(maciifx_state::oss_interrupt<11>));
MACADB(config, m_macadb, C15M);
diff --git a/src/mame/apple/macquadra700.cpp b/src/mame/apple/macquadra700.cpp
index 058b158f9d2..a919e44f231 100644
--- a/src/mame/apple/macquadra700.cpp
+++ b/src/mame/apple/macquadra700.cpp
@@ -3,10 +3,19 @@
/****************************************************************************
drivers/macquadra700.cpp
- Mac Quadra 700 emulation. (900/950 are IOP-based and closer to the IIfx)
+ Mac Quadra 700, 900, and 950 emulation
By R. Belmont
+ TODO:
+ - SWIM PIC won't send the first several ADB requests sent to it; it wakes
+ up when the ROM's bus scan to enumerate ADB devices hits 0xA out of 0xF.
+ Mac OS re-does the scan when it boots so this ends up harmless for normal
+ usage, but it does mean if there's no boot media you can't move the cursor.
+ (Also it clearly indicates a bug of some sort).
+ - The SWIM doesn't actually work. Floppies are not recognized and the drive
+ motor isn't turned on.
+
****************************************************************************/
#include "emu.h"
@@ -14,6 +23,7 @@
#include "adbmodem.h"
#include "dafb.h"
#include "dfac.h"
+#include "egret.h"
#include "macadb.h"
#include "macrtc.h"
#include "mactoolbox.h"
@@ -26,6 +36,7 @@
#include "cpu/m68000/m68040.h"
#include "machine/6522via.h"
#include "machine/applefdintf.h"
+#include "machine/applepic.h"
#include "machine/dp83932c.h"
#include "machine/ncr53c90.h"
#include "machine/nscsi_bus.h"
@@ -45,20 +56,18 @@
#define C7M (C32M/4)
namespace {
-class macquadra_state : public driver_device
+class quadrax00_state : public driver_device
{
public:
- macquadra_state(const machine_config &mconfig, device_type type, const char *tag) :
+ quadrax00_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_via1(*this, "via1"),
m_via2(*this, "via2"),
m_macadb(*this, "macadb"),
- m_adbmodem(*this, "adbmodem"),
m_ram(*this, RAM_TAG),
m_swim(*this, "fdc"),
m_floppy(*this, "fdc:%d", 0U),
- m_rtc(*this,"rtc"),
m_scsibus1(*this, "scsi1"),
m_ncr1(*this, "scsi1:7:ncr53c96"),
m_sonic(*this, "sonic"),
@@ -67,24 +76,44 @@ public:
m_dfac(*this, "dfac"),
m_scc(*this, "scc"),
m_cur_floppy(nullptr),
- m_hdsel(0)
+ m_hdsel(0),
+ m_adb_irq_pending(0),
+ m_ram_ptr(nullptr), m_rom_ptr(nullptr),
+ m_ram_mask(0), m_ram_size(0), m_rom_size(0),
+ m_overlay(0),
+ m_6015_timer(nullptr),
+ m_via2_ca1_hack(0),
+ m_nubus_irq_state(0),
+ m_via_interrupt(0), m_via2_interrupt(0), m_scc_interrupt(0), m_last_taken_interrupt(0)
{
}
- void macqd700(machine_config &config);
- void quadra700_map(address_map &map);
+ void quadra_base(machine_config &config);
- void init_macqd700();
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
+ u32 rom_switch_r(offs_t offset);
+ u16 via_r(offs_t offset);
+ void via_w(offs_t offset, u16 data, u16 mem_mask);
+ u16 via2_r(offs_t offset);
+ void via2_w(offs_t offset, u16 data, u16 mem_mask);
+ u8 ethernet_mac_r(offs_t offset);
+ u16 scc_r(offs_t offset);
+ void scc_w(offs_t offset, u16 data);
+ u16 swim_r(offs_t offset, u16 mem_mask);
+ void swim_w(offs_t offset, u16 data, u16 mem_mask);
+ void adb_irq_w(int state) { m_adb_irq_pending = state; }
+ void nubus_slot_interrupt(u8 slot, u32 state);
+ void dafb_irq_w(int state) { nubus_slot_interrupt(0xf, state); }
-private:
required_device<m68040_device> m_maincpu;
required_device<via6522_device> m_via1, m_via2;
required_device<macadb_device> m_macadb;
- required_device<adbmodem_device> m_adbmodem;
required_device<ram_device> m_ram;
required_device<applefdintf_device> m_swim;
required_device_array<floppy_connector, 2> m_floppy;
- required_device<rtc3430042_device> m_rtc;
required_device<nscsi_bus_device> m_scsibus1;
required_device<ncr53c96_device> m_ncr1;
required_device<dp83932c_device> m_sonic;
@@ -93,89 +122,110 @@ private:
required_device<dfac_device> m_dfac;
required_device<z80scc_device> m_scc;
- virtual void machine_start() override;
- virtual void machine_reset() override;
-
- u32 *m_ram_ptr = nullptr, *m_rom_ptr = nullptr;
- u32 m_ram_mask = 0, m_ram_size = 0, m_rom_size = 0;
- u8 m_mac[6];
+ floppy_image_device *m_cur_floppy;
+ int m_hdsel;
+ int m_adb_irq_pending;
+ u32 *m_ram_ptr, *m_rom_ptr;
+ u32 m_ram_mask, m_ram_size, m_rom_size;
+ bool m_overlay;
- emu_timer *m_6015_timer = nullptr;
+ void scc_irq_w(int state);
+private:
void nubus_irq_9_w(int state);
void nubus_irq_a_w(int state);
void nubus_irq_b_w(int state);
void nubus_irq_c_w(int state);
void nubus_irq_d_w(int state);
void nubus_irq_e_w(int state);
- void nubus_slot_interrupt(u8 slot, u32 state);
- int m_via2_ca1_hack = 0, m_nubus_irq_state = 0;
- void adb_irq_w(int state) { m_adb_irq_pending = state; }
- int m_adb_irq_pending = 0;
-
- void dafb_irq_w(int state) { nubus_slot_interrupt(0xf, state);}
-
- void irq_539x_1_w(int state);
-
- floppy_image_device *m_cur_floppy = nullptr;
- int m_hdsel = 0;
-
- u16 mac_via_r(offs_t offset);
- void mac_via_w(offs_t offset, u16 data, u16 mem_mask);
- u16 mac_via2_r(offs_t offset);
- void mac_via2_w(offs_t offset, u16 data, u16 mem_mask);
- u8 mac_via_in_a();
- u8 mac_via_in_b();
- void mac_via_out_a(u8 data);
- void mac_via_out_b(u8 data);
- u8 mac_via2_in_a();
- u8 mac_via2_in_b();
- void mac_via2_out_a(u8 data);
- void mac_via2_out_b(u8 data);
- void mac_via_sync();
+ u8 via2_in_a();
+ u8 via2_in_b();
+ void via2_out_a(u8 data);
+ void via2_out_b(u8 data);
+ void via_sync();
void field_interrupts();
- void mac_via_irq(int state);
- void mac_via2_irq(int state);
- TIMER_CALLBACK_MEMBER(mac_6015_tick);
- int m_via_interrupt = 0, m_via2_interrupt = 0, m_scc_interrupt = 0, m_last_taken_interrupt = 0;
+ void via_irq(int state);
+ void via2_irq(int state);
+ void phases_w(u8 phases);
+ void devsel_w(u8 devsel);
- u32 rom_switch_r(offs_t offset);
- bool m_overlay = 0;
+ u8 m_mac[6];
+ emu_timer *m_6015_timer;
+ int m_via2_ca1_hack, m_nubus_irq_state;
+ int m_via_interrupt, m_via2_interrupt, m_scc_interrupt, m_last_taken_interrupt;
- u16 mac_scc_r(offs_t offset)
+ TIMER_CALLBACK_MEMBER(mac_6015_tick);
+};
+
+class spike_state : public quadrax00_state
+{
+public:
+ spike_state(const machine_config &mconfig, device_type type, const char *tag) :
+ quadrax00_state(mconfig, type, tag),
+ m_adbmodem(*this, "adbmodem"),
+ m_rtc(*this,"rtc")
{
- mac_via_sync();
- u16 result = m_scc->dc_ab_r(offset);
- return (result << 8) | result;
}
- void mac_scc_2_w(offs_t offset, u16 data) { mac_via_sync(); m_scc->dc_ab_w(offset, data >> 8); }
- void phases_w(u8 phases);
- void devsel_w(u8 devsel);
+ void quadra700_map(address_map &map);
+ void macqd700(machine_config &config);
- u16 swim_r(offs_t offset, u16 mem_mask)
- {
- if (!machine().side_effects_disabled())
- {
- m_maincpu->adjust_icount(-5);
- }
+private:
+ u8 via_in_a();
+ u8 via_in_b();
+ void via_out_a(u8 data);
+ void via_out_b(u8 data);
- u16 result = m_swim->read((offset >> 8) & 0xf);
- return result << 8;
- }
- void swim_w(offs_t offset, u16 data, u16 mem_mask)
+ required_device<adbmodem_device> m_adbmodem;
+ required_device<rtc3430042_device> m_rtc;
+};
+
+class eclipse_state : public quadrax00_state
+{
+public:
+ eclipse_state(const machine_config &mconfig, device_type type, const char *tag) :
+ quadrax00_state(mconfig, type, tag),
+ m_sccpic(*this, "sccpic"),
+ m_swimpic(*this, "swimpic"),
+ m_egret(*this, "egret"),
+ m_scsibus2(*this, "scsi2"),
+ m_ncr2(*this, "scsi2:7:ncr53c96"),
+ m_adb_in(0)
{
- if (ACCESSING_BITS_0_7)
- m_swim->write((offset >> 8) & 0xf, data & 0xff);
- else
- m_swim->write((offset >> 8) & 0xf, data>>8);
}
- u8 ethernet_mac_r(offs_t offset);
+ void quadra900_map(address_map &map);
+ void macqd900(machine_config &config);
+ void macqd950(machine_config &config);
+
+protected:
+ virtual void machine_start() override;
+ virtual void machine_reset() override;
+
+ void egret_reset_w(int state);
+ void fdc_hdsel(int state);
+
+ void set_adb_line(int linestate) { m_adb_in = (linestate == ASSERT_LINE) ? true : false; }
+ int adbin_r() { return m_adb_in; }
+
+ required_device<applepic_device> m_sccpic, m_swimpic;
+ required_device<egret_device> m_egret;
+ required_device<nscsi_bus_device> m_scsibus2;
+ required_device<ncr53c96_device> m_ncr2;
+
+ int m_adb_in;
+
+private:
+ u8 via_in_a();
+ u8 via_in_a_q950();
+ u8 via_in_b();
+ void via_out_a(u8 data);
+ void via_out_b(u8 data);
+ void via2_out_b_q900(u8 data);
};
-void macquadra_state::field_interrupts()
+void quadrax00_state::field_interrupts()
{
int take_interrupt = -1;
@@ -205,7 +255,7 @@ void macquadra_state::field_interrupts()
}
}
-void macquadra_state::machine_start()
+void quadrax00_state::machine_start()
{
m_dafb->set_turboscsi1_device(m_ncr1);
m_dafb->set_turboscsi2_device(nullptr);
@@ -229,7 +279,7 @@ void macquadra_state::machine_start()
m_via_interrupt = m_via2_interrupt = m_scc_interrupt = 0;
m_last_taken_interrupt = -1;
- m_6015_timer = timer_alloc(FUNC(macquadra_state::mac_6015_tick), this);
+ m_6015_timer = timer_alloc(FUNC(quadrax00_state::mac_6015_tick), this);
m_6015_timer->adjust(attotime::never);
save_item(NAME(m_via2_ca1_hack));
@@ -243,7 +293,7 @@ void macquadra_state::machine_start()
save_item(NAME(m_overlay));
}
-void macquadra_state::machine_reset()
+void quadrax00_state::machine_reset()
{
m_nubus_irq_state = 0xff;
m_via2_ca1_hack = 1;
@@ -266,11 +316,24 @@ void macquadra_state::machine_reset()
m_6015_timer->adjust(attotime::from_hz(60.15), 0, attotime::from_hz(60.15));
}
-void macquadra_state::init_macqd700()
+void eclipse_state::machine_start()
{
+ quadrax00_state::machine_start();
+
+ m_dafb->set_turboscsi2_device(m_ncr2);
+
+ save_item(NAME(m_adb_in));
}
-void macquadra_state::nubus_slot_interrupt(u8 slot, u32 state)
+void eclipse_state::machine_reset()
+{
+ quadrax00_state::machine_reset();
+
+ // halt 680x0 until Caboose wakes us up
+ m_maincpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
+}
+
+void quadrax00_state::nubus_slot_interrupt(u8 slot, u32 state)
{
static const u8 masks[8] = { 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 };
u8 mask = 0xff;
@@ -303,23 +366,66 @@ void macquadra_state::nubus_slot_interrupt(u8 slot, u32 state)
}
}
-void macquadra_state::nubus_irq_9_w(int state) { nubus_slot_interrupt(9, state); }
-void macquadra_state::nubus_irq_a_w(int state) { nubus_slot_interrupt(0xa, state); }
-void macquadra_state::nubus_irq_b_w(int state) { nubus_slot_interrupt(0xb, state); }
-void macquadra_state::nubus_irq_c_w(int state) { nubus_slot_interrupt(0xc, state); }
-void macquadra_state::nubus_irq_d_w(int state) { nubus_slot_interrupt(0xd, state); }
-void macquadra_state::nubus_irq_e_w(int state) { nubus_slot_interrupt(0xe, state); }
+void quadrax00_state::nubus_irq_9_w(int state) { nubus_slot_interrupt(9, state); }
+void quadrax00_state::nubus_irq_a_w(int state) { nubus_slot_interrupt(0xa, state); }
+void quadrax00_state::nubus_irq_b_w(int state) { nubus_slot_interrupt(0xb, state); }
+void quadrax00_state::nubus_irq_c_w(int state) { nubus_slot_interrupt(0xc, state); }
+void quadrax00_state::nubus_irq_d_w(int state) { nubus_slot_interrupt(0xd, state); }
+void quadrax00_state::nubus_irq_e_w(int state) { nubus_slot_interrupt(0xe, state); }
+
+void quadrax00_state::scc_irq_w(int state)
+{
+ m_scc_interrupt = state;
+ field_interrupts();
+}
+
+u16 quadrax00_state::scc_r(offs_t offset)
+{
+ via_sync();
+ return m_scc->dc_ab_r(offset) << 8;
+}
+
+void quadrax00_state::scc_w(offs_t offset, u16 data)
+{
+ via_sync();
+ m_scc->dc_ab_w(offset, data >> 8);
+}
-void macquadra_state::irq_539x_1_w(int state)
+u16 quadrax00_state::swim_r(offs_t offset, u16 mem_mask)
{
- if (state) // make sure a CB1 transition occurs
+ if (!machine().side_effects_disabled())
{
- m_via2->write_cb2(0);
- m_via2->write_cb2(1);
+ m_maincpu->adjust_icount(-5);
}
+
+ u16 result = m_swim->read((offset >> 8) & 0xf);
+ return result << 8;
+}
+
+void quadrax00_state::swim_w(offs_t offset, u16 data, u16 mem_mask)
+{
+ m_swim->write((offset >> 8) & 0xf, data >> 8);
}
-u16 macquadra_state::mac_via_r(offs_t offset)
+void eclipse_state::fdc_hdsel(int state)
+{
+ if (state != m_hdsel)
+ {
+ if (m_cur_floppy)
+ {
+ m_cur_floppy->ss_w(state);
+ }
+ }
+ m_hdsel = state;
+}
+
+void eclipse_state::egret_reset_w(int state)
+{
+ m_maincpu->set_input_line(INPUT_LINE_HALT, state);
+ m_maincpu->set_input_line(INPUT_LINE_RESET, state);
+}
+
+u16 quadrax00_state::via_r(offs_t offset)
{
u16 data;
@@ -327,19 +433,19 @@ u16 macquadra_state::mac_via_r(offs_t offset)
offset &= 0x0f;
if (!machine().side_effects_disabled())
- mac_via_sync();
+ via_sync();
data = m_via1->read(offset);
return (data & 0xff) | (data << 8);
}
-void macquadra_state::mac_via_w(offs_t offset, u16 data, u16 mem_mask)
+void quadrax00_state::via_w(offs_t offset, u16 data, u16 mem_mask)
{
offset >>= 8;
offset &= 0x0f;
- mac_via_sync();
+ via_sync();
if (ACCESSING_BITS_0_7)
m_via1->write(offset, data & 0xff);
@@ -347,19 +453,19 @@ void macquadra_state::mac_via_w(offs_t offset, u16 data, u16 mem_mask)
m_via1->write(offset, (data >> 8) & 0xff);
}
-void macquadra_state::mac_via_irq(int state)
+void quadrax00_state::via_irq(int state)
{
m_via_interrupt = state;
field_interrupts();
}
-void macquadra_state::mac_via2_irq(int state)
+void quadrax00_state::via2_irq(int state)
{
m_via2_interrupt = state;
field_interrupts();
}
-u16 macquadra_state::mac_via2_r(offs_t offset)
+u16 quadrax00_state::via2_r(offs_t offset)
{
int data;
@@ -367,18 +473,18 @@ u16 macquadra_state::mac_via2_r(offs_t offset)
offset &= 0x0f;
if (!machine().side_effects_disabled())
- mac_via_sync();
+ via_sync();
data = m_via2->read(offset);
return (data & 0xff) | (data << 8);
}
-void macquadra_state::mac_via2_w(offs_t offset, u16 data, u16 mem_mask)
+void quadrax00_state::via2_w(offs_t offset, u16 data, u16 mem_mask)
{
offset >>= 8;
offset &= 0x0f;
- mac_via_sync();
+ via_sync();
if (ACCESSING_BITS_0_7)
m_via2->write(offset, data & 0xff);
@@ -386,7 +492,7 @@ void macquadra_state::mac_via2_w(offs_t offset, u16 data, u16 mem_mask)
m_via2->write(offset, (data >> 8) & 0xff);
}
-void macquadra_state::mac_via_sync()
+void quadrax00_state::via_sync()
{
// The via runs at 783.36KHz while the main cpu runs at 15MHz or
// more, so we need to sync the access with the via clock. Plus
@@ -409,7 +515,7 @@ void macquadra_state::mac_via_sync()
m_maincpu->adjust_icount(-int(main_cycle - cycle));
}
-u32 macquadra_state::rom_switch_r(offs_t offset)
+u32 quadrax00_state::rom_switch_r(offs_t offset)
{
// disable the overlay
if (m_overlay && !machine().side_effects_disabled())
@@ -423,12 +529,10 @@ u32 macquadra_state::rom_switch_r(offs_t offset)
m_overlay = false;
}
- //printf("rom_switch_r: offset %08x ROM_size -1 = %08x, masked = %08x\n", offset, m_rom_size-1, offset & ((m_rom_size - 1)>>2));
-
return m_rom_ptr[offset & ((m_rom_size - 1)>>2)];
}
-u8 macquadra_state::ethernet_mac_r(offs_t offset)
+u8 quadrax00_state::ethernet_mac_r(offs_t offset)
{
if (offset < 6)
{
@@ -449,7 +553,7 @@ u8 macquadra_state::ethernet_mac_r(offs_t offset)
return 0;
}
-TIMER_CALLBACK_MEMBER(macquadra_state::mac_6015_tick)
+TIMER_CALLBACK_MEMBER(quadrax00_state::mac_6015_tick)
{
/* handle ADB keyboard/mouse */
m_macadb->adb_vblank();
@@ -458,31 +562,54 @@ TIMER_CALLBACK_MEMBER(macquadra_state::mac_6015_tick)
/***************************************************************************
ADDRESS MAPS
***************************************************************************/
-void macquadra_state::quadra700_map(address_map &map)
+void spike_state::quadra700_map(address_map &map)
{
- map(0x40000000, 0x400fffff).r(FUNC(macquadra_state::rom_switch_r)).mirror(0x0ff00000);
+ map(0x40000000, 0x400fffff).r(FUNC(spike_state::rom_switch_r)).mirror(0x0ff00000);
- map(0x50000000, 0x50001fff).rw(FUNC(macquadra_state::mac_via_r), FUNC(macquadra_state::mac_via_w)).mirror(0x00fc0000);
- map(0x50002000, 0x50003fff).rw(FUNC(macquadra_state::mac_via2_r), FUNC(macquadra_state::mac_via2_w)).mirror(0x00fc0000);
- map(0x50008000, 0x50008007).r(FUNC(macquadra_state::ethernet_mac_r)).mirror(0x00fc0000);
+ map(0x50000000, 0x50001fff).rw(FUNC(spike_state::via_r), FUNC(spike_state::via_w)).mirror(0x00fc0000);
+ map(0x50002000, 0x50003fff).rw(FUNC(spike_state::via2_r), FUNC(spike_state::via2_w)).mirror(0x00fc0000);
+ map(0x50008000, 0x50008007).r(FUNC(spike_state::ethernet_mac_r)).mirror(0x00fc0000);
map(0x5000a000, 0x5000b0ff).m(m_sonic, FUNC(dp83932c_device::map)).umask32(0x0000ffff).mirror(0x00fc0000);
// 5000e000 = Orwell controls
map(0x5000f000, 0x5000f0ff).rw(m_dafb, FUNC(dafb_device::turboscsi_r<0>), FUNC(dafb_device::turboscsi_w<0>)).mirror(0x00fc0000);
map(0x5000f100, 0x5000f101).rw(m_dafb, FUNC(dafb_device::turboscsi_dma_r<0>), FUNC(dafb_device::turboscsi_dma_w<0>)).select(0x00fc0000);
- map(0x5000c000, 0x5000dfff).rw(FUNC(macquadra_state::mac_scc_r), FUNC(macquadra_state::mac_scc_2_w)).mirror(0x00fc0000);
+ map(0x5000c000, 0x5000dfff).rw(FUNC(spike_state::scc_r), FUNC(spike_state::scc_w)).mirror(0x00fc0000);
+ map(0x50014000, 0x50015fff).rw(m_easc, FUNC(asc_device::read), FUNC(asc_device::write)).mirror(0x00fc0000);
+ map(0x5001e000, 0x5001ffff).rw(FUNC(spike_state::swim_r), FUNC(spike_state::swim_w)).mirror(0x00fc0000);
+
+ map(0xf9000000, 0xf91fffff).rw(m_dafb, FUNC(dafb_device::vram_r), FUNC(dafb_device::vram_w));
+ map(0xf9800000, 0xf98003ff).m(m_dafb, FUNC(dafb_device::map));
+}
+
+void eclipse_state::quadra900_map(address_map &map)
+{
+ map(0x40000000, 0x400fffff).r(FUNC(eclipse_state::rom_switch_r)).mirror(0x0ff00000);
+
+ map(0x50000000, 0x50001fff).rw(FUNC(eclipse_state::via_r), FUNC(eclipse_state::via_w)).mirror(0x00fc0000);
+ map(0x50002000, 0x50003fff).rw(FUNC(eclipse_state::via2_r), FUNC(eclipse_state::via2_w)).mirror(0x00fc0000);
+ map(0x50008000, 0x50008007).r(FUNC(eclipse_state::ethernet_mac_r)).mirror(0x00fc0000);
+ map(0x5000a000, 0x5000b0ff).m(m_sonic, FUNC(dp83932c_device::map)).umask32(0x0000ffff).mirror(0x00fc0000);
+ map(0x5000c000, 0x5000cfff).rw(m_sccpic, FUNC(applepic_device::host_r), FUNC(applepic_device::host_w)).mirror(0x00f00000).umask32(0xff00ff00);
+ map(0x5000c000, 0x5000cfff).rw(m_sccpic, FUNC(applepic_device::host_r), FUNC(applepic_device::host_w)).mirror(0x00f00000).umask32(0x00ff00ff);
+ map(0x5000f000, 0x5000f0ff).rw(m_dafb, FUNC(dafb_device::turboscsi_r<0>), FUNC(dafb_device::turboscsi_w<0>)).mirror(0x00fc0000);
+ map(0x5000f100, 0x5000f101).rw(m_dafb, FUNC(dafb_device::turboscsi_dma_r<0>), FUNC(dafb_device::turboscsi_dma_w<0>)).select(0x00fc0000);
+ map(0x5000f400, 0x5000f4ff).rw(m_dafb, FUNC(dafb_device::turboscsi_r<1>), FUNC(dafb_device::turboscsi_w<1>)).mirror(0x00fc0000);
+ map(0x5000f502, 0x5000f503).rw(m_dafb, FUNC(dafb_device::turboscsi_dma_r<1>), FUNC(dafb_device::turboscsi_dma_w<1>)).select(0x00fc0000);
+
map(0x50014000, 0x50015fff).rw(m_easc, FUNC(asc_device::read), FUNC(asc_device::write)).mirror(0x00fc0000);
- map(0x5001e000, 0x5001ffff).rw(FUNC(macquadra_state::swim_r), FUNC(macquadra_state::swim_w)).mirror(0x00fc0000);
+ map(0x5001e000, 0x5001efff).rw(m_swimpic, FUNC(applepic_device::host_r), FUNC(applepic_device::host_w)).mirror(0x00f00000).umask32(0xff00ff00);
+ map(0x5001e000, 0x5001efff).rw(m_swimpic, FUNC(applepic_device::host_r), FUNC(applepic_device::host_w)).mirror(0x00f00000).umask32(0x00ff00ff);
map(0xf9000000, 0xf91fffff).rw(m_dafb, FUNC(dafb_device::vram_r), FUNC(dafb_device::vram_w));
map(0xf9800000, 0xf98003ff).m(m_dafb, FUNC(dafb_device::map));
}
-u8 macquadra_state::mac_via_in_a()
+u8 spike_state::via_in_a()
{
return 0xc1;
}
-u8 macquadra_state::mac_via_in_b()
+u8 spike_state::via_in_b()
{
u8 val = m_rtc->data_r();
@@ -491,12 +618,10 @@ u8 macquadra_state::mac_via_in_b()
val |= 0x08;
}
-// printf("%s VIA1 IN_B = %02x\n", machine().describe_context().c_str(), val);
-
return val;
}
-void macquadra_state::mac_via_out_a(u8 data)
+void spike_state::via_out_a(u8 data)
{
int hdsel = BIT(data, 5);
if (hdsel != m_hdsel)
@@ -509,9 +634,8 @@ void macquadra_state::mac_via_out_a(u8 data)
m_hdsel = hdsel;
}
-void macquadra_state::mac_via_out_b(u8 data)
+void spike_state::via_out_b(u8 data)
{
-// printf("%s VIA1 OUT B: %02x\n", machine().describe_context().c_str(), data);
m_adbmodem->set_via_state((data & 0x30) >> 4);
m_rtc->ce_w((data & 0x04)>>2);
@@ -519,21 +643,21 @@ void macquadra_state::mac_via_out_b(u8 data)
m_rtc->clk_w((data >> 1) & 0x01);
}
-u8 macquadra_state::mac_via2_in_a()
+u8 quadrax00_state::via2_in_a()
{
return 0x80 | m_nubus_irq_state;
}
-u8 macquadra_state::mac_via2_in_b()
+u8 quadrax00_state::via2_in_b()
{
return 0xcf; // indicate no NuBus transaction error
}
-void macquadra_state::mac_via2_out_a(u8 data)
+void quadrax00_state::via2_out_a(u8 data)
{
}
-void macquadra_state::mac_via2_out_b(u8 data)
+void quadrax00_state::via2_out_b(u8 data)
{
// chain 60.15 Hz to VIA1
m_via1->write_ca1(data>>7);
@@ -543,165 +667,307 @@ void macquadra_state::mac_via2_out_b(u8 data)
m_dfac->latch_write(BIT(data, 0));
}
-void macquadra_state::phases_w(u8 phases)
+void eclipse_state::via2_out_b_q900(u8 data)
{
- if (m_cur_floppy)
- m_cur_floppy->seek_phase_w(phases);
+ // chain 60.15 Hz to VIA1
+ m_via1->write_ca1(data >> 7);
}
-void macquadra_state::devsel_w(u8 devsel)
-{
- if (devsel == 1)
- m_cur_floppy = m_floppy[0]->get_device();
- else if (devsel == 2)
- m_cur_floppy = m_floppy[1]->get_device();
- else
- m_cur_floppy = nullptr;
+ u8 eclipse_state::via_in_a()
+ {
+ return 0xd1;
+ }
- m_swim->set_floppy(m_cur_floppy);
- if (m_cur_floppy)
- m_cur_floppy->ss_w(m_hdsel);
-}
+ u8 eclipse_state::via_in_a_q950()
+ {
+ return 0x91;
+ }
-/***************************************************************************
- DEVICE CONFIG
-***************************************************************************/
+ u8 eclipse_state::via_in_b()
+ {
+ return m_egret->get_xcvr_session() << 3;
+ }
-static INPUT_PORTS_START( macadb )
-INPUT_PORTS_END
+ void eclipse_state::via_out_a(u8 data)
+ {
+ }
-/***************************************************************************
- MACHINE DRIVERS
-***************************************************************************/
+ void eclipse_state::via_out_b(u8 data)
+ {
+ m_egret->set_via_full(BIT(data, 4));
+ m_egret->set_sys_session(BIT(data, 5));
+ }
-void macquadra_state::macqd700(machine_config &config)
-{
- /* basic machine hardware */
- M68040(config, m_maincpu, 50_MHz_XTAL / 2);
- m_maincpu->set_addrmap(AS_PROGRAM, &macquadra_state::quadra700_map);
- m_maincpu->set_dasm_override(std::function(&mac68k_dasm_override), "mac68k_dasm_override");
-
- DAFB(config, m_dafb, 50_MHz_XTAL / 2);
- m_dafb->set_maincpu_tag("maincpu");
- m_dafb->dafb_irq().set(FUNC(macquadra_state::dafb_irq_w));
-
- RTC3430042(config, m_rtc, XTAL(32'768));
- m_rtc->cko_cb().set(m_via1, FUNC(via6522_device::write_ca2));
-
- SWIM1(config, m_swim, C15M);
- m_swim->phases_cb().set(FUNC(macquadra_state::phases_w));
- m_swim->devsel_cb().set(FUNC(macquadra_state::devsel_w));
-
- applefdintf_device::add_35_hd(config, m_floppy[0]);
- applefdintf_device::add_35_nc(config, m_floppy[1]);
-
- SCC8530N(config, m_scc, C7M);
- m_scc->configure_channels(3'686'400, 3'686'400, 3'686'400, 3'686'400);
- m_scc->out_txda_callback().set("printer", FUNC(rs232_port_device::write_txd));
- m_scc->out_txdb_callback().set("modem", FUNC(rs232_port_device::write_txd));
-
- rs232_port_device &rs232a(RS232_PORT(config, "printer", default_rs232_devices, nullptr));
- rs232a.rxd_handler().set(m_scc, FUNC(z80scc_device::rxa_w));
- rs232a.dcd_handler().set(m_scc, FUNC(z80scc_device::dcda_w));
- rs232a.cts_handler().set(m_scc, FUNC(z80scc_device::ctsa_w));
-
- rs232_port_device &rs232b(RS232_PORT(config, "modem", default_rs232_devices, nullptr));
- rs232b.rxd_handler().set(m_scc, FUNC(z80scc_device::rxb_w));
- rs232b.dcd_handler().set(m_scc, FUNC(z80scc_device::dcdb_w));
- rs232b.cts_handler().set(m_scc, FUNC(z80scc_device::ctsb_w));
-
- // SCSI bus and devices
- NSCSI_BUS(config, m_scsibus1);
- NSCSI_CONNECTOR(config, "scsi1:0", mac_scsi_devices, nullptr);
- NSCSI_CONNECTOR(config, "scsi1:1", mac_scsi_devices, nullptr);
- NSCSI_CONNECTOR(config, "scsi1:2", mac_scsi_devices, nullptr);
- NSCSI_CONNECTOR(config, "scsi1:3").option_set("cdrom", NSCSI_CDROM_APPLE).machine_config(
- [](device_t *device)
+ void quadrax00_state::phases_w(u8 phases)
+ {
+ if (m_cur_floppy)
{
- device->subdevice<cdda_device>("cdda")->add_route(0, "^^lspeaker", 1.0);
- device->subdevice<cdda_device>("cdda")->add_route(1, "^^rspeaker", 1.0);
- });
- NSCSI_CONNECTOR(config, "scsi1:4", mac_scsi_devices, nullptr);
- NSCSI_CONNECTOR(config, "scsi1:5", mac_scsi_devices, nullptr);
- NSCSI_CONNECTOR(config, "scsi1:6", mac_scsi_devices, "harddisk");
- NSCSI_CONNECTOR(config, "scsi1:7").option_set("ncr53c96", NCR53C96).clock(50_MHz_XTAL / 2).machine_config(
- [this] (device_t *device)
+ m_cur_floppy->seek_phase_w(phases);
+ }
+ }
+
+ void quadrax00_state::devsel_w(u8 devsel)
+ {
+ if (devsel == 1)
+ {
+ m_cur_floppy = m_floppy[0]->get_device();
+ }
+ else if (devsel == 2)
+ {
+ m_cur_floppy = m_floppy[1]->get_device();
+ }
+ else
{
+ m_cur_floppy = nullptr;
+ }
+ m_swim->set_floppy(m_cur_floppy);
+ if (m_cur_floppy)
+ {
+ m_cur_floppy->ss_w(m_hdsel);
+ }
+ }
+
+ /***************************************************************************
+ DEVICE CONFIG
+ ***************************************************************************/
+
+ static INPUT_PORTS_START(macadb)
+ INPUT_PORTS_END
+
+ /***************************************************************************
+ MACHINE DRIVERS
+ ***************************************************************************/
+
+ void
+ quadrax00_state::quadra_base(machine_config & config)
+ {
+ DAFB(config, m_dafb, 50_MHz_XTAL / 2);
+ m_dafb->set_maincpu_tag("maincpu");
+ m_dafb->dafb_irq().set(FUNC(quadrax00_state::dafb_irq_w));
+
+ SWIM1(config, m_swim, C15M);
+ m_swim->phases_cb().set(FUNC(quadrax00_state::phases_w));
+ m_swim->devsel_cb().set(FUNC(quadrax00_state::devsel_w));
+
+ applefdintf_device::add_35_hd(config, m_floppy[0]);
+ applefdintf_device::add_35_nc(config, m_floppy[1]);
+
+ SCC8530N(config, m_scc, C7M);
+ m_scc->configure_channels(3'686'400, 3'686'400, 3'686'400, 3'686'400);
+ m_scc->out_txda_callback().set("printer", FUNC(rs232_port_device::write_txd));
+ m_scc->out_txdb_callback().set("modem", FUNC(rs232_port_device::write_txd));
+
+ rs232_port_device &rs232a(RS232_PORT(config, "printer", default_rs232_devices, nullptr));
+ rs232a.rxd_handler().set(m_scc, FUNC(z80scc_device::rxa_w));
+ rs232a.dcd_handler().set(m_scc, FUNC(z80scc_device::dcda_w));
+ rs232a.cts_handler().set(m_scc, FUNC(z80scc_device::ctsa_w));
+
+ rs232_port_device &rs232b(RS232_PORT(config, "modem", default_rs232_devices, nullptr));
+ rs232b.rxd_handler().set(m_scc, FUNC(z80scc_device::rxb_w));
+ rs232b.dcd_handler().set(m_scc, FUNC(z80scc_device::dcdb_w));
+ rs232b.cts_handler().set(m_scc, FUNC(z80scc_device::ctsb_w));
+
+ // SCSI bus and devices
+ NSCSI_BUS(config, m_scsibus1);
+ NSCSI_CONNECTOR(config, "scsi1:0", mac_scsi_devices, nullptr);
+ NSCSI_CONNECTOR(config, "scsi1:1", mac_scsi_devices, nullptr);
+ NSCSI_CONNECTOR(config, "scsi1:2", mac_scsi_devices, nullptr);
+ NSCSI_CONNECTOR(config, "scsi1:3").option_set("cdrom", NSCSI_CDROM_APPLE).machine_config([](device_t *device)
+ {
+ device->subdevice<cdda_device>("cdda")->add_route(0, "^^lspeaker", 1.0);
+ device->subdevice<cdda_device>("cdda")->add_route(1, "^^rspeaker", 1.0); });
+ NSCSI_CONNECTOR(config, "scsi1:4", mac_scsi_devices, nullptr);
+ NSCSI_CONNECTOR(config, "scsi1:5", mac_scsi_devices, nullptr);
+ NSCSI_CONNECTOR(config, "scsi1:6", mac_scsi_devices, "harddisk");
+ NSCSI_CONNECTOR(config, "scsi1:7").option_set("ncr53c96", NCR53C96).clock(50_MHz_XTAL / 2).machine_config([this](device_t *device)
+ {
ncr53c96_device &adapter = downcast<ncr53c96_device &>(*device);
adapter.set_busmd(ncr53c96_device::BUSMD_1);
- adapter.irq_handler_cb().set(*this, FUNC(macquadra_state::irq_539x_1_w));
- adapter.drq_handler_cb().set(m_dafb, FUNC(dafb_device::turboscsi_drq_w<0>));
- });
-
- DP83932C(config, m_sonic, 40_MHz_XTAL / 2); // clock is C20M on the schematics
- m_sonic->set_bus(m_maincpu, 0);
- m_sonic->out_int_cb().set(m_via2, FUNC(via6522_device::write_pa0)).invert(); // IRQ is active low
-
- nubus_device &nubus(NUBUS(config, "nubus", 40_MHz_XTAL / 4));
- nubus.set_space(m_maincpu, AS_PROGRAM);
- nubus.out_irq9_callback().set(FUNC(macquadra_state::nubus_irq_9_w));
- nubus.out_irqa_callback().set(FUNC(macquadra_state::nubus_irq_a_w));
- nubus.out_irqb_callback().set(FUNC(macquadra_state::nubus_irq_b_w));
- nubus.out_irqc_callback().set(FUNC(macquadra_state::nubus_irq_c_w));
- nubus.out_irqd_callback().set(FUNC(macquadra_state::nubus_irq_d_w));
- nubus.out_irqe_callback().set(FUNC(macquadra_state::nubus_irq_e_w));
- NUBUS_SLOT(config, "nbd", "nubus", mac_nubus_cards, nullptr);
- NUBUS_SLOT(config, "nbe", "nubus", mac_nubus_cards, nullptr);
-
- R65NC22(config, m_via1, C7M/10);
- m_via1->readpa_handler().set(FUNC(macquadra_state::mac_via_in_a));
- m_via1->readpb_handler().set(FUNC(macquadra_state::mac_via_in_b));
- m_via1->writepa_handler().set(FUNC(macquadra_state::mac_via_out_a));
- m_via1->writepb_handler().set(FUNC(macquadra_state::mac_via_out_b));
- m_via1->irq_handler().set(FUNC(macquadra_state::mac_via_irq));
-
- R65NC22(config, m_via2, C7M/10);
- m_via2->readpa_handler().set(FUNC(macquadra_state::mac_via2_in_a));
- m_via2->readpb_handler().set(FUNC(macquadra_state::mac_via2_in_b));
- m_via2->writepa_handler().set(FUNC(macquadra_state::mac_via2_out_a));
- m_via2->writepb_handler().set(FUNC(macquadra_state::mac_via2_out_b));
- m_via2->irq_handler().set(FUNC(macquadra_state::mac_via2_irq));
-
- ADBMODEM(config, m_adbmodem, C7M);
- m_adbmodem->via_clock_callback().set(m_via1, FUNC(via6522_device::write_cb1));
- m_adbmodem->via_data_callback().set(m_via1, FUNC(via6522_device::write_cb2));
- m_adbmodem->linechange_callback().set(m_macadb, FUNC(macadb_device::adb_linechange_w));
- m_adbmodem->irq_callback().set(FUNC(macquadra_state::adb_irq_w));
- m_via1->cb2_handler().set(m_adbmodem, FUNC(adbmodem_device::set_via_data));
- config.set_perfect_quantum(m_maincpu);
-
- MACADB(config, m_macadb, C15M);
- m_macadb->adb_data_callback().set(m_adbmodem, FUNC(adbmodem_device::set_adb_line));
-
- SPEAKER(config, "lspeaker").front_left();
- SPEAKER(config, "rspeaker").front_right();
- ASC(config, m_easc, 22.5792_MHz_XTAL, asc_device::asc_type::EASC);
- m_easc->irqf_callback().set(m_via2, FUNC(via6522_device::write_cb1)).invert();
- m_easc->add_route(0, "lspeaker", 1.0);
- m_easc->add_route(1, "rspeaker", 1.0);
-
- // DFAC is only for audio input on Q700/Q800
- APPLE_DFAC(config, m_dfac, 22257);
-
- /* internal ram */
- RAM(config, m_ram);
- m_ram->set_default_size("4M");
- m_ram->set_extra_options("8M,16M,32M,64M,68M,72M,80M,96M,128M");
-
- SOFTWARE_LIST(config, "hdd_list").set_original("mac_hdd");
- SOFTWARE_LIST(config, "cd_list").set_original("mac_cdrom").set_filter("MC68040");
- SOFTWARE_LIST(config, "flop_mac35_orig").set_original("mac_flop_orig");
- SOFTWARE_LIST(config, "flop_mac35_clean").set_original("mac_flop_clcracked");
- SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop");
- SOFTWARE_LIST(config, "flop35hd_list").set_original("mac_hdflop");
-}
-
-ROM_START( macqd700 )
+ adapter.irq_handler_cb().set(m_via2, FUNC(via6522_device::write_cb2)).invert();
+ adapter.drq_handler_cb().set(m_dafb, FUNC(dafb_device::turboscsi_drq_w<0>)); });
+
+ DP83932C(config, m_sonic, 40_MHz_XTAL / 2); // clock is C20M on the schematics
+ m_sonic->set_bus(m_maincpu, 0);
+ m_sonic->out_int_cb().set(m_via2, FUNC(via6522_device::write_pa0)).invert(); // IRQ is active low
+
+ nubus_device &nubus(NUBUS(config, "nubus", 40_MHz_XTAL / 4));
+ nubus.set_space(m_maincpu, AS_PROGRAM);
+ nubus.out_irq9_callback().set(FUNC(quadrax00_state::nubus_irq_9_w));
+ nubus.out_irqa_callback().set(FUNC(quadrax00_state::nubus_irq_a_w));
+ nubus.out_irqb_callback().set(FUNC(quadrax00_state::nubus_irq_b_w));
+ nubus.out_irqc_callback().set(FUNC(quadrax00_state::nubus_irq_c_w));
+ nubus.out_irqd_callback().set(FUNC(quadrax00_state::nubus_irq_d_w));
+ nubus.out_irqe_callback().set(FUNC(quadrax00_state::nubus_irq_e_w));
+ NUBUS_SLOT(config, "nbd", "nubus", mac_nubus_cards, nullptr);
+ NUBUS_SLOT(config, "nbe", "nubus", mac_nubus_cards, nullptr);
+
+ R65NC22(config, m_via1, C7M / 10);
+ m_via1->irq_handler().set(FUNC(quadrax00_state::via_irq));
+
+ R65NC22(config, m_via2, C7M / 10);
+ m_via2->readpa_handler().set(FUNC(quadrax00_state::via2_in_a));
+ m_via2->readpb_handler().set(FUNC(quadrax00_state::via2_in_b));
+ m_via2->writepa_handler().set(FUNC(quadrax00_state::via2_out_a));
+ m_via2->writepb_handler().set(FUNC(quadrax00_state::via2_out_b));
+ m_via2->irq_handler().set(FUNC(quadrax00_state::via2_irq));
+
+ MACADB(config, m_macadb, C15M);
+
+ SPEAKER(config, "lspeaker").front_left();
+ SPEAKER(config, "rspeaker").front_right();
+ ASC(config, m_easc, 22.5792_MHz_XTAL, asc_device::asc_type::EASC);
+ m_easc->irqf_callback().set(m_via2, FUNC(via6522_device::write_cb1)).invert();
+ m_easc->add_route(0, "lspeaker", 1.0);
+ m_easc->add_route(1, "rspeaker", 1.0);
+
+ // DFAC is only for audio input on Q700/Q800
+ APPLE_DFAC(config, m_dfac, 22257);
+
+ /* internal ram */
+ RAM(config, m_ram);
+
+ SOFTWARE_LIST(config, "hdd_list").set_original("mac_hdd");
+ SOFTWARE_LIST(config, "cd_list").set_original("mac_cdrom").set_filter("MC68040");
+ SOFTWARE_LIST(config, "flop_mac35_orig").set_original("mac_flop_orig");
+ SOFTWARE_LIST(config, "flop_mac35_clean").set_original("mac_flop_clcracked");
+ SOFTWARE_LIST(config, "flop35_list").set_original("mac_flop");
+ SOFTWARE_LIST(config, "flop35hd_list").set_original("mac_hdflop");
+ }
+
+ void spike_state::macqd700(machine_config & config)
+ {
+ quadra_base(config);
+
+ M68040(config, m_maincpu, 50_MHz_XTAL / 2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &spike_state::quadra700_map);
+ m_maincpu->set_dasm_override(std::function(&mac68k_dasm_override), "mac68k_dasm_override");
+
+ RTC3430042(config, m_rtc, XTAL(32'768));
+ m_rtc->cko_cb().set(m_via1, FUNC(via6522_device::write_ca2));
+
+ ADBMODEM(config, m_adbmodem, C7M);
+ m_adbmodem->via_clock_callback().set(m_via1, FUNC(via6522_device::write_cb1));
+ m_adbmodem->via_data_callback().set(m_via1, FUNC(via6522_device::write_cb2));
+ m_adbmodem->linechange_callback().set(m_macadb, FUNC(macadb_device::adb_linechange_w));
+ m_adbmodem->irq_callback().set(FUNC(spike_state::adb_irq_w));
+ m_via1->cb2_handler().set(m_adbmodem, FUNC(adbmodem_device::set_via_data));
+ m_macadb->adb_data_callback().set(m_adbmodem, FUNC(adbmodem_device::set_adb_line));
+ config.set_perfect_quantum(m_maincpu);
+
+ m_via1->readpa_handler().set(FUNC(spike_state::via_in_a));
+ m_via1->readpb_handler().set(FUNC(spike_state::via_in_b));
+ m_via1->writepa_handler().set(FUNC(spike_state::via_out_a));
+ m_via1->writepb_handler().set(FUNC(spike_state::via_out_b));
+
+ // Q700 has 4 MB soldered in and 4 SIMM slots which can accept 1, 4, 8, or 16 MB SIMMs
+ m_ram->set_default_size("4M");
+ m_ram->set_extra_options("8M,20M,36M,68M"); // 4M + (4x1M SIMMs), (4x4M), (4x8M), (4x16M)
+ }
+
+ void eclipse_state::macqd900(machine_config & config)
+ {
+ quadra_base(config);
+
+ M68040(config, m_maincpu, 50_MHz_XTAL / 2);
+ m_maincpu->set_addrmap(AS_PROGRAM, &eclipse_state::quadra900_map);
+ m_maincpu->set_dasm_override(std::function(&mac68k_dasm_override), "mac68k_dasm_override");
+
+ APPLEPIC(config, m_sccpic, C15M);
+ m_sccpic->prd_callback().set(m_scc, FUNC(z80scc_device::dc_ab_r));
+ m_sccpic->pwr_callback().set(m_scc, FUNC(z80scc_device::dc_ab_w));
+ m_sccpic->hint_callback().set(FUNC(eclipse_state::scc_irq_w));
+
+ m_scc->out_int_callback().set(m_sccpic, FUNC(applepic_device::pint_w));
+ m_scc->out_wreqa_callback().set(m_sccpic, FUNC(applepic_device::reqa_w));
+ m_scc->out_wreqb_callback().set(m_sccpic, FUNC(applepic_device::reqb_w));
+
+ APPLEPIC(config, m_swimpic, C15M);
+ m_swimpic->prd_callback().set(m_swim, FUNC(applefdintf_device::read));
+ m_swimpic->pwr_callback().set(m_swim, FUNC(applefdintf_device::write));
+ m_swimpic->hint_callback().set(m_via2, FUNC(via6522_device::write_ca2)).invert();
+ m_swimpic->gpout0_callback().set(m_macadb, FUNC(macadb_device::adb_linechange_w)).invert();
+ m_swimpic->gpin_callback().set(FUNC(eclipse_state::adbin_r));
+
+ m_swim->dat1byte_cb().set(m_swimpic, FUNC(applepic_device::reqa_w));
+ m_swim->dat1byte_cb().append(m_swimpic, FUNC(applepic_device::reqb_w));
+ m_swim->hdsel_cb().set(FUNC(eclipse_state::fdc_hdsel));
+
+ EGRET(config, m_egret, XTAL(32'768));
+ m_egret->set_default_bios_tag("341s0851");
+ m_egret->reset_callback().set(FUNC(eclipse_state::egret_reset_w));
+ m_egret->via_clock_callback().set(m_via1, FUNC(via6522_device::write_cb1));
+ m_egret->via_data_callback().set(m_via1, FUNC(via6522_device::write_cb2));
+ m_egret->dfac_scl_callback().set(m_dfac, FUNC(dfac_device::clock_write));
+ m_egret->dfac_sda_callback().set(m_dfac, FUNC(dfac_device::data_write));
+ m_egret->dfac_latch_callback().set(m_dfac, FUNC(dfac_device::latch_write));
+ m_via1->cb2_handler().set(m_egret, FUNC(egret_device::set_via_data));
+ config.set_perfect_quantum(m_maincpu);
+
+ NSCSI_BUS(config, m_scsibus2);
+ NSCSI_CONNECTOR(config, "scsi2:0", mac_scsi_devices, nullptr);
+ NSCSI_CONNECTOR(config, "scsi2:1", mac_scsi_devices, nullptr);
+ NSCSI_CONNECTOR(config, "scsi2:2", mac_scsi_devices, nullptr);
+ NSCSI_CONNECTOR(config, "scsi2:3", mac_scsi_devices, nullptr);
+ NSCSI_CONNECTOR(config, "scsi2:4", mac_scsi_devices, nullptr);
+ NSCSI_CONNECTOR(config, "scsi2:5", mac_scsi_devices, nullptr);
+ NSCSI_CONNECTOR(config, "scsi2:6", mac_scsi_devices, nullptr);
+ NSCSI_CONNECTOR(config, "scsi2:7").option_set("ncr53c96", NCR53C96).clock(50_MHz_XTAL / 2).machine_config([this](device_t *device)
+ {
+ ncr53c96_device &adapter = downcast<ncr53c96_device &>(*device);
+
+ adapter.set_busmd(ncr53c96_device::BUSMD_1);
+ adapter.irq_handler_cb().append(m_via2, FUNC(via6522_device::write_cb2)).invert();
+ adapter.drq_handler_cb().set(m_dafb, FUNC(dafb_device::turboscsi_drq_w<1>)); });
+
+ // 900 and 950 are 5-slot machines, so add the other 3
+ NUBUS_SLOT(config, "nba", "nubus", mac_nubus_cards, nullptr);
+ NUBUS_SLOT(config, "nbb", "nubus", mac_nubus_cards, nullptr);
+ NUBUS_SLOT(config, "nbc", "nubus", mac_nubus_cards, nullptr);
+
+ m_macadb->adb_data_callback().set(FUNC(eclipse_state::set_adb_line));
+ m_macadb->adb_data_callback().append(m_egret, FUNC(egret_device::set_adb_line));
+
+ m_via1->readpa_handler().set(FUNC(eclipse_state::via_in_a));
+ m_via1->readpb_handler().set(FUNC(eclipse_state::via_in_b));
+ m_via1->writepa_handler().set(FUNC(eclipse_state::via_out_a));
+ m_via1->writepb_handler().set(FUNC(eclipse_state::via_out_b));
+ m_via2->writepb_handler().set(FUNC(eclipse_state::via2_out_b_q900));
+
+ // Q900/Q950 have no soldered RAM and 16 SIMM slots which can accept 1, 4, 8, or 16 MB SIMMs 4 at a time
+ m_ram->set_default_size("4M");
+ m_ram->set_extra_options("8M,16M,32M,64M,80M,96M,128M,192M,256M");
+ }
+
+ void eclipse_state::macqd950(machine_config & config)
+ {
+ macqd900(config);
+
+ M68040(config.replace(), m_maincpu, 33.333_MHz_XTAL);
+ m_maincpu->set_addrmap(AS_PROGRAM, &eclipse_state::quadra900_map);
+ m_maincpu->set_dasm_override(std::function(&mac68k_dasm_override), "mac68k_dasm_override");
+
+ DAFB_Q950(config.replace(), m_dafb, 50_MHz_XTAL / 2);
+ m_dafb->set_maincpu_tag("maincpu");
+ m_dafb->dafb_irq().set(FUNC(eclipse_state::dafb_irq_w));
+
+ m_via1->readpa_handler().set(FUNC(eclipse_state::via_in_a_q950));
+ }
+
+ ROM_START(macqd700)
ROM_REGION32_BE(0x100000, "bootrom", 0)
ROM_LOAD( "420dbff3.rom", 0x000000, 0x100000, CRC(88ea2081) SHA1(7a8ee468d16e64f2ad10cb8d1a45e6f07cc9e212) )
ROM_END
+ROM_START( macqd950 )
+ ROM_REGION32_BE(0x100000, "bootrom", 0)
+ ROM_LOAD("3dc27823.rom", 0x000000, 0x100000, CRC(0e11206e) SHA1(d61dba4a2d2cf9048244b713eaa294100063658d))
+ROM_END
+
+#define rom_macqd900 rom_macqd700
+
} // anonymous namespace
-COMP( 1991, macqd700, 0, 0, macqd700, macadb, macquadra_state, init_macqd700, "Apple Computer", "Macintosh Quadra 700", MACHINE_SUPPORTS_SAVE)
+COMP( 1991, macqd700, 0, 0, macqd700, macadb, spike_state, empty_init, "Apple Computer", "Macintosh Quadra 700", MACHINE_SUPPORTS_SAVE)
+COMP( 1991, macqd900, 0, 0, macqd900, macadb, eclipse_state, empty_init, "Apple Computer", "Macintosh Quadra 900", MACHINE_SUPPORTS_SAVE)
+COMP( 1992, macqd950, 0, 0, macqd950, macadb, eclipse_state, empty_init, "Apple Computer", "Macintosh Quadra 950", MACHINE_SUPPORTS_SAVE)
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index 0da309ac9f2..34016725691 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -936,6 +936,8 @@ maclc580 // April 3, 1995 Apple Macintosh LC/Performa 580
@source:apple/macquadra700.cpp
macqd700 // 1991 Apple Macintosh Quadra 700
+macqd900 // 1991 Apple Macintosh Quadra 900
+macqd950 // 1992 Apple Macintosh Quadra 950
@source:apple/macquadra800.cpp
macqd800 // 1993 Apple Macintosh Quadra 800