macpci.cpp: Reworked to modern Mac PCI standards. [R. Belmont]

bandit.cpp: First attempt at the "Bandit" 60x/PCI host bridge. [R. Belmont]

heathrow.cpp: Added extremely preliminary support for the predecessor "Grand Central" and "O'Hare" devices. [R. Belmont]
This commit is contained in:
arbee 2023-02-18 21:22:49 -05:00
parent 46c0de4f55
commit 72aa301b9c
6 changed files with 350 additions and 229 deletions

144
src/mame/apple/bandit.cpp Normal file
View File

@ -0,0 +1,144 @@
// license:BSD-3-Clause
// copyright-holders:R. Belmont
/**********************************************************************
bandit.cpp - Apple "Bandit" 60x bus/PCI bridge
**********************************************************************/
#include "emu.h"
#include "bandit.h"
#define LOG_GENERAL (1U << 0)
#define VERBOSE (0)
#include "logmacro.h"
enum
{
AS_PCI_MEM = 1,
AS_PCI_IO = 2
};
DEFINE_DEVICE_TYPE(BANDIT, bandit_host_device, "bandit", "Apple Bandit PowerPC-to-PCI Bridge")
void bandit_host_device::config_map(address_map &map)
{
pci_host_device::config_map(map);
}
bandit_host_device::bandit_host_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: pci_host_device(mconfig, BANDIT, tag, owner, clock)
, m_mem_config("memory_space", ENDIANNESS_LITTLE, 32, 32)
, m_io_config("io_space", ENDIANNESS_LITTLE, 32, 32)
, m_cpu(*this, finder_base::DUMMY_TAG)
, m_dev_offset(0)
{
set_ids_host(0x106b0001, 0x00, 0x00000000);
}
void bandit_host_device::device_start()
{
pci_host_device::device_start();
m_cpu_space = &m_cpu->space(AS_PCI_CONFIG);
memory_space = &space(AS_PCI_MEM);
io_space = &space(AS_PCI_IO);
memory_window_start = 0;
memory_window_end = 0xffffffff;
memory_offset = 0;
io_window_start = 0;
io_window_end = 0xffffffff;
io_offset = 0;
command = 0x0006;
status = 0x0080;
revision = 0;
// don't know the actual mappings yet, just guess
m_cpu_space->install_read_handler(0xf3000000, 0xf7ffffff, read32s_delegate(*this, FUNC(bandit_host_device::pci_memory_r<0xf3000000>)));
m_cpu_space->install_write_handler(0xf3000000, 0xf7ffffff, write32s_delegate(*this, FUNC(bandit_host_device::pci_memory_w<0xf3000000>)));
}
device_memory_interface::space_config_vector bandit_host_device::memory_space_config() const
{
auto r = pci_bridge_device::memory_space_config();
r.emplace_back(std::make_pair(AS_PCI_MEM, &m_mem_config));
r.emplace_back(std::make_pair(AS_PCI_IO, &m_io_config));
return r;
}
void bandit_host_device::reset_all_mappings()
{
pci_host_device::reset_all_mappings();
}
void bandit_host_device::device_reset()
{
pci_host_device::device_reset();
}
void bandit_host_device::map(address_map &map)
{
map(0x00800000, 0x00bfffff).rw(FUNC(bandit_host_device::be_config_address_r), FUNC(bandit_host_device::be_config_address_w));
map(0x00c00000, 0x00ffffff).rw(FUNC(bandit_host_device::be_config_data_r), FUNC(bandit_host_device::be_config_data_w));
}
u32 bandit_host_device::be_config_address_r()
{
u32 temp = pci_host_device::config_address_r();
return (temp >> 24) | (temp << 24) | ((temp & 0xff00) << 8) | ((temp & 0xff0000) >> 8);
}
void bandit_host_device::be_config_address_w(offs_t offset, u32 data, u32 mem_mask)
{
pci_host_device::config_address_w(offset, data|0x80000000, mem_mask);
}
u32 bandit_host_device::be_config_data_r(offs_t offset, u32 mem_mask)
{
return pci_host_device::config_data_r(offset, mem_mask);
}
void bandit_host_device::be_config_data_w(offs_t offset, u32 data, u32 mem_mask)
{
u32 tempdata;
// printf("config_data_w: %08x @ %08x mask %08x\n", data, offset, mem_mask);
tempdata = (data >> 24) | (data << 24) | ((data & 0xff00) << 8) | ((data & 0xff0000) >> 8);
pci_host_device::config_data_w(offset, tempdata, mem_mask);
}
template <u32 Base>
u32 bandit_host_device::pci_memory_r(offs_t offset, u32 mem_mask)
{
u32 result = this->space(AS_PCI_MEM).read_dword(Base + (offset * 4), mem_mask);
return result;
}
template <u32 Base>
void bandit_host_device::pci_memory_w(offs_t offset, u32 data, u32 mem_mask)
{
this->space(AS_PCI_MEM).write_dword(Base + (offset * 4), data, mem_mask);
}
template u32 bandit_host_device::pci_memory_r<0xf3000000>(offs_t offset, u32 mem_mask);
template void bandit_host_device::pci_memory_w<0xf3000000>(offs_t offset, u32 data, u32 mem_mask);
template <u32 Base>
u32 bandit_host_device::pci_io_r(offs_t offset, u32 mem_mask)
{
u32 result = this->space(AS_PCI_IO).read_dword(Base + (offset * 4), mem_mask);
return result;
}
template <u32 Base>
void bandit_host_device::pci_io_w(offs_t offset, u32 data, u32 mem_mask)
{
this->space(AS_PCI_IO).write_dword(Base + (offset * 4), data, mem_mask);
}
// map PCI memory and I/O space stuff here
void bandit_host_device::map_extra(u64 memory_window_start, u64 memory_window_end, u64 memory_offset, address_space *memory_space,
u64 io_window_start, u64 io_window_end, u64 io_offset, address_space *io_space)
{
}

62
src/mame/apple/bandit.h Normal file
View File

@ -0,0 +1,62 @@
// license:BSD-3-Clause
// copyright-holders:R. Belmont
/**********************************************************************
bandit.h - Apple "Bandit" 60x bus/PCI bridge
**********************************************************************/
#ifndef MAME_APPLE_BANDIT_H
#define MAME_APPLE_BANDIT_H
#pragma once
#include "machine/pci.h"
class bandit_host_device : public pci_host_device {
public:
template <typename T>
bandit_host_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, T &&cpu_tag)
: bandit_host_device(mconfig, tag, owner, clock)
{
set_cpu_tag(std::forward<T>(cpu_tag));
}
bandit_host_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
template <typename T> void set_cpu_tag(T &&tag) { m_cpu.set_tag(std::forward<T>(tag)); }
void set_dev_offset(int devOffset) { m_dev_offset = devOffset; }
void map(address_map &map);
protected:
virtual void device_start() override;
virtual void device_reset() override;
virtual void reset_all_mappings() override;
virtual void map_extra(u64 memory_window_start, u64 memory_window_end, u64 memory_offset, address_space *memory_space,
u64 io_window_start, u64 io_window_end, u64 io_offset, address_space *io_space) override;
virtual void config_map(address_map &map) override;
virtual space_config_vector memory_space_config() const override;
private:
u32 be_config_address_r();
void be_config_address_w(offs_t offset, u32 data, u32 mem_mask = ~0);
u32 be_config_data_r(offs_t offset, u32 mem_mask = ~0);
void be_config_data_w(offs_t offset, u32 data, u32 mem_mask = ~0);
template <u32 Base> u32 pci_memory_r(offs_t offset, u32 mem_mask);
template <u32 Base> void pci_memory_w(offs_t offset, u32 data, u32 mem_mask);
template <u32 Base> u32 pci_io_r(offs_t offset, u32 mem_mask);
template <u32 Base> void pci_io_w(offs_t offset, u32 data, u32 mem_mask);
address_space_config m_mem_config, m_io_config;
required_device<device_memory_interface> m_cpu;
address_space *m_cpu_space;
int m_dev_offset;
};
DECLARE_DEVICE_TYPE(BANDIT, bandit_host_device)
#endif // MAME_APPLE_BANDIT_H

View File

@ -1,10 +1,10 @@
// license:BSD-3-Clause
// copyright-holders:R. Belmont
/*
Apple "Heathrow" and "Paddington" PCI ASICs
Apple "Grand Central", "O'Hare", "Heathrow" and "Paddington" PCI ASICs
Emulation by R. Belmont
These ASICs sit on the PCI bus and provide "legacy" Mac I/O,
These ASICs sit on the PCI bus and provide what came to be known as "Mac I/O",
including:
- A VIA to interface with Cuda
- Serial
@ -13,7 +13,7 @@
- ATA
- Ethernet (10 Mbps for Heathrow, 10/100 for Paddington)
- Audio
- Descriptor-based DMA engine, as originally seen in the "PDM" Power Macs
- Descriptor-based DMA engine, as described in "Macintosh Technology in the Common Hardware Reference Platform"
*/
#include "emu.h"
@ -31,18 +31,21 @@ static constexpr u32 C15M = (C7M * 2);
DEFINE_DEVICE_TYPE(HEATHROW, heathrow_device, "heathrow", "Apple Heathrow PCI I/O ASIC")
DEFINE_DEVICE_TYPE(PADDINGTON, paddington_device, "paddington", "Apple Paddington PCI I/O ASIC")
DEFINE_DEVICE_TYPE(OHARE, ohare_device, "ohare", "Apple O'Hare PCI I/O ASIC")
DEFINE_DEVICE_TYPE(GRAND_CENTRAL, grandcentral_device, "grndctrl", "Apple Grand Central PCI I/O ASIC")
//-------------------------------------------------
// ADDRESS_MAP
//-------------------------------------------------
/*
A "Kanga" G3 PowerBook says:
F3016000 : VIA
F3012000 : SCC Rd
F3012000 : SCC Wr
F3015000 : IWM/SWIM
F3010000 : SCSI
16000 : VIA
12000 : SCC Rd
12000 : SCC Wr
15000 : IWM/SWIM
10000 : SCSI
DMA is at 8xxx (audio DMA at 88xx)
ATA is at 20000
*/
void heathrow_device::map(address_map &map)
@ -71,6 +74,8 @@ void heathrow_device::device_add_mconfig(machine_config &config)
m_via1->irq_handler().set(FUNC(heathrow_device::via1_irq));
AWACS(config, m_awacs, 45.1584_MHz_XTAL / 2);
m_awacs->dma_output().set(FUNC(heathrow_device::sound_dma_output));
m_awacs->dma_input().set(FUNC(heathrow_device::sound_dma_input));
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
@ -124,7 +129,6 @@ heathrow_device::heathrow_device(const machine_config &mconfig, device_type type
m_cur_floppy(nullptr),
m_hdsel(0)
{
set_ids(0x106b0010, 0x01, 0xff000001, 0x000000);
m_toggle = 0;
}
@ -138,6 +142,16 @@ paddington_device::paddington_device(const machine_config &mconfig, const char *
{
}
grandcentral_device::grandcentral_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: heathrow_device(mconfig, GRAND_CENTRAL, tag, owner, clock)
{
}
ohare_device::ohare_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: heathrow_device(mconfig, OHARE, tag, owner, clock)
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
@ -161,11 +175,25 @@ void heathrow_device::common_init()
void heathrow_device::device_start()
{
common_init();
set_ids(0x106b0010, 0x01, 0xff000001, 0x000000);
}
void paddington_device::device_start()
{
common_init();
set_ids(0x106b0017, 0x01, 0xff000001, 0x000000);
}
void grandcentral_device::device_start()
{
common_init();
set_ids(0x106b0002, 0x01, 0xff000001, 0x000000);
}
void ohare_device::device_start()
{
common_init();
set_ids(0x106b0007, 0x01, 0xff000001, 0x000000);
}
//-------------------------------------------------
@ -408,3 +436,15 @@ u32 heathrow_device::unk_r(offs_t offset)
return m_toggle;
}
// *****************************************************
// DMA
// *****************************************************
u32 heathrow_device::sound_dma_output(offs_t offset)
{
return 0;
}
void heathrow_device::sound_dma_input(offs_t offset, u32 value)
{
}

View File

@ -100,6 +100,10 @@ private:
u32 m_toggle;
u32 unk_r(offs_t offset);
// DMA
u32 sound_dma_output(offs_t offset);
void sound_dma_input(offs_t offset, u32 value);
};
class paddington_device : public heathrow_device
@ -113,8 +117,32 @@ protected:
virtual void device_start() override;
};
class grandcentral_device : public heathrow_device
{
public:
// construction/destruction
grandcentral_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
protected:
// device-level overrides
virtual void device_start() override;
};
class ohare_device : public heathrow_device
{
public:
// construction/destruction
ohare_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
protected:
// device-level overrides
virtual void device_start() override;
};
// device type definition
DECLARE_DEVICE_TYPE(GRAND_CENTRAL, grandcentral_device)
DECLARE_DEVICE_TYPE(HEATHROW, heathrow_device)
DECLARE_DEVICE_TYPE(PADDINGTON, paddington_device)
DECLARE_DEVICE_TYPE(OHARE, ohare_device)
#endif // MAME_APPLE_HEATHROW_H

View File

@ -37,32 +37,68 @@
****************************************************************************/
#include "emu.h"
#include "macpci.h"
#include "cpu/powerpc/ppc.h"
#include "cpu/mn1880/mn1880.h"
#include "imagedev/chd_cd.h"
#include "machine/ram.h"
#include "sound/cdda.h"
#include "emupal.h"
#include "screen.h"
#include "bandit.h"
#include "cuda.h"
#include "heathrow.h"
#include "macadb.h"
#include "softlist.h"
#include "speaker.h"
uint64_t macpci_state::unk1_r()
class macpci_state : public driver_device
{
m_unk1_test ^= 0x0400; //PC=ff808760
public:
void pippin(machine_config &config);
return m_unk1_test << 16;
macpci_state(const machine_config &mconfig, device_type type, const char *tag);
required_device<cpu_device> m_maincpu;
required_device<bandit_host_device> m_bandit;
required_device<cuda_device> m_cuda;
required_device<macadb_device> m_macadb;
required_device<ram_device> m_ram;
private:
void pippin_map(address_map &map);
void cdmcu_mem(address_map &map);
void cdmcu_data(address_map &map);
virtual void machine_start() override;
virtual void machine_reset() override;
WRITE_LINE_MEMBER(cuda_reset_w)
{
m_maincpu->set_input_line(INPUT_LINE_HALT, state);
m_maincpu->set_input_line(INPUT_LINE_RESET, state);
}
};
macpci_state::macpci_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_bandit(*this, "pci:00.0"),
m_cuda(*this, "cuda"),
m_macadb(*this, "macadb"),
m_ram(*this, RAM_TAG)
{
}
uint64_t macpci_state::unk2_r(offs_t offset, uint64_t mem_mask)
void macpci_state::machine_start()
{
if (ACCESSING_BITS_32_47)
return (uint64_t)0xe1 << 32; //PC=fff04810
return 0;
}
void macpci_state::pippin_mem(address_map &map)
void macpci_state::machine_reset()
{
// the PPC can't run until Cuda's ready
m_maincpu->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
}
void macpci_state::pippin_map(address_map &map)
{
map(0x00000000, 0x005fffff).ram();
@ -74,10 +110,7 @@ void macpci_state::pippin_mem(address_map &map)
map(0x40000000, 0x403fffff).rom().region("bootrom", 0).mirror(0x0fc00000); // mirror of ROM for 680x0 emulation
map(0xf00dfff8, 0xf00dffff).r(FUNC(macpci_state::unk2_r));
map(0xf3008800, 0xf3008807).r(FUNC(macpci_state::unk1_r));
map(0xf3016000, 0xf3017fff).rw(FUNC(macpci_state::mac_via_r), FUNC(macpci_state::mac_via_w));
map(0xf2000000, 0xf2ffffff).m(m_bandit, FUNC(bandit_host_device::map));
map(0xffc00000, 0xffffffff).rom().region("bootrom", 0);
}
@ -112,32 +145,14 @@ void macpci_state::cdmcu_data(address_map &map)
static INPUT_PORTS_START( pippin )
INPUT_PORTS_END
uint32_t macpci_state::screen_update_pippin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
return 0;
}
void macpci_state::pippin(machine_config &config)
{
/* basic machine hardware */
PPC603(config, m_maincpu, 66000000);
m_maincpu->set_addrmap(AS_PROGRAM, &macpci_state::pippin_mem);
m_maincpu->set_addrmap(AS_PROGRAM, &macpci_state::pippin_map);
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(2500)); /* not accurate */
screen.set_size(640, 480);
screen.set_visarea(0, 640-1, 0, 480-1);
screen.set_screen_update(FUNC(macpci_state::screen_update_pippin));
screen.set_palette("palette");
PALETTE(config, "palette", palette_device::MONOCHROME);
/* sound hardware */
SPEAKER(config, "lspeaker").front_left();
SPEAKER(config, "rspeaker").front_right();
PCI_ROOT(config, "pci", 0);
BANDIT(config, m_bandit, 66000000, "maincpu").set_dev_offset(1);
cdda_device &cdda(CDDA(config, "cdda"));
cdda.add_route(0, "lspeaker", 1.00);
@ -150,27 +165,28 @@ void macpci_state::pippin(machine_config &config)
RAM(config, m_ram);
m_ram->set_default_size("32M");
R65NC22(config, m_via1, C7M/10);
m_via1->readpa_handler().set(FUNC(macpci_state::mac_via_in_a));
m_via1->readpb_handler().set(FUNC(macpci_state::mac_via_in_b));
m_via1->writepa_handler().set(FUNC(macpci_state::mac_via_out_a));
m_via1->writepb_handler().set(FUNC(macpci_state::mac_via_out_b));
m_via1->cb2_handler().set(FUNC(macpci_state::mac_adb_via_out_cb2));
m_via1->irq_handler().set(FUNC(macpci_state::mac_via_irq));
grandcentral_device &grandcentral(GRAND_CENTRAL(config, "pci:05.0", 0));
grandcentral.set_maincpu_tag("maincpu");
//scc8530_t &scc(SCC8530(config, "scc", C7M));
//scc.intrq_callback().set(FUNC(macpci_state::set_scc_interrupt));
CUDA(config, m_cuda, 0);
m_cuda->set_type(CUDA_341S0060);
MACADB(config, m_macadb, 15.6672_MHz_XTAL);
CUDA(config, m_cuda, CUDA_341S0060);
m_cuda->reset_callback().set(FUNC(macpci_state::cuda_reset_w));
m_cuda->linechange_callback().set(FUNC(macpci_state::cuda_adb_linechange_w));
m_cuda->via_clock_callback().set(m_via1, FUNC(via6522_device::write_cb1));
m_cuda->via_data_callback().set(m_via1, FUNC(via6522_device::write_cb2));
m_cuda->linechange_callback().set(m_macadb, FUNC(macadb_device::adb_linechange_w));
m_cuda->via_clock_callback().set(grandcentral, FUNC(heathrow_device::cb1_w));
m_cuda->via_data_callback().set(grandcentral, FUNC(heathrow_device::cb2_w));
m_macadb->adb_data_callback().set(m_cuda, FUNC(cuda_device::set_adb_line));
config.set_perfect_quantum(m_maincpu);
grandcentral.pb3_callback().set(m_cuda, FUNC(cuda_device::get_treq));
grandcentral.pb4_callback().set(m_cuda, FUNC(cuda_device::set_byteack));
grandcentral.pb5_callback().set(m_cuda, FUNC(cuda_device::set_tip));
grandcentral.cb2_callback().set(m_cuda, FUNC(cuda_device::set_via_data));
mn1880_device &cdmcu(MN1880(config, "cdmcu", 8388608)); // type and clock unknown
cdmcu.set_addrmap(AS_PROGRAM, &macpci_state::cdmcu_mem);
cdmcu.set_addrmap(AS_DATA, &macpci_state::cdmcu_data);
cdmcu.set_disable();
}
/* ROM definition */

View File

@ -1,169 +0,0 @@
// license:BSD-3-Clause
// copyright-holders:R. Belmont
/*****************************************************************************
*
* includes/macpci.h
*
* PCI-based Power Macintosh driver declarations
*
****************************************************************************/
#ifndef MAME_APPLE_MACPCI_H
#define MAME_APPLE_MACPCI_H
#include "machine/8530scc.h"
#include "machine/6522via.h"
#include "machine/ram.h"
#include "cuda.h"
#include "machine/ncr539x.h"
#include "sound/awacs.h"
#define C7M (7833600)
#define C15M (C7M*2)
#define MAC_SCREEN_NAME "screen"
#define MAC_539X_1_TAG "539x_1"
#define MAC_539X_2_TAG "539x_2"
/* Mac driver data */
class macpci_state : public driver_device
{
public:
macpci_state(const machine_config &mconfig, device_type type, const char *tag) :
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_via1(*this, "via6522_0"),
m_awacs(*this, "awacs"),
m_cuda(*this, CUDA_TAG),
m_ram(*this, RAM_TAG),
m_scc(*this, "scc"),
m_539x_1(*this, MAC_539X_1_TAG),
m_539x_2(*this, MAC_539X_2_TAG)
{ }
void pippin(machine_config &config);
private:
required_device<cpu_device> m_maincpu;
required_device<via6522_device> m_via1;
optional_device<awacs_device> m_awacs;
required_device<cuda_device> m_cuda;
required_device<ram_device> m_ram;
optional_device<scc8530_legacy_device> m_scc;
optional_device<ncr539x_device> m_539x_1;
optional_device<ncr539x_device> m_539x_2;
virtual void machine_start() override;
virtual void machine_reset() override;
/* tells which model is being emulated (set by macxxx_init) */
enum model_t
{
PCIMODEL_MAC_PM5200,
PCIMODEL_MAC_PM6200,
PCIMODEL_MAC_PM5300,
PCIMODEL_MAC_PM7200,
PCIMODEL_MAC_PM7500,
PCIMODEL_MAC_PM8500,
PCIMODEL_MAC_PM9500,
PCIMODEL_MAC_PM7215,
PCIMODEL_MAC_PM5260,
PCIMODEL_MAC_PM5400,
PCIMODEL_MAC_PM7600,
PCIMODEL_MAC_PM8200,
PCIMODEL_MAC_PM6300,
PCIMODEL_MAC_PM6400,
PCIMODEL_MAC_PM4400,
PCIMODEL_MAC_PM5500,
PCIMODEL_MAC_PM7220,
PCIMODEL_MAC_PM7300,
PCIMODEL_MAC_PM6500,
PCIMODEL_MAC_PM8600,
PCIMODEL_MAC_PM9600,
PCIMODEL_MAC_20TH,
PCIMODEL_MAC_G3_GOSSAMER,
PCIMODEL_MAC_G3_ALLINONE,
PCIMODEL_MAC_PB5x0PPC,
PCIMODEL_MAC_PB1400,
PCIMODEL_MAC_PB2300,
PCIMODEL_MAC_PB2400,
PCIMODEL_MAC_PB3400,
PCIMODEL_MAC_PB5300,
PCIMODEL_MAC_PBG3KANGA,
PCIMODEL_MAC_PBG3WALLST1,
PCIMODEL_MAC_PBG3WALLST2,
PCIMODEL_MAC_PIPPIN // Apple/Bandai Pippin
};
model_t m_model{};
// 60.15 Hz timer for RBV/V8/Sonora/Eagle/VASP/etc.
emu_timer *m_6015_timer = nullptr;
// RBV and friends (V8, etc)
uint8_t m_rbv_regs[256]{}, m_rbv_ier = 0, m_rbv_ifr = 0, m_rbv_type = 0, m_rbv_montype = 0, m_rbv_vbltime = 0;
uint32_t m_rbv_colors[3]{}, m_rbv_count = 0, m_rbv_clutoffs = 0, m_rbv_immed10wr = 0;
uint32_t m_rbv_palette[256]{};
uint8_t m_sonora_vctl[8]{};
emu_timer *m_vbl_timer = nullptr, *m_cursor_timer = nullptr;
uint16_t m_cursor_line = 0;
uint16_t m_dafb_int_status = 0;
int m_dafb_scsi1_drq = 0, m_dafb_scsi2_drq = 0;
uint8_t m_dafb_mode = 0;
uint32_t m_dafb_base = 0, m_dafb_stride = 0;
// this is shared among all video setups with vram
uint32_t *m_vram = nullptr;
uint16_t mac_via_r(offs_t offset);
void mac_via_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0);
uint16_t mac_scc_r(offs_t offset);
void mac_scc_w(offs_t offset, uint16_t data);
void mac_scc_2_w(offs_t offset, uint16_t data);
uint32_t mac_read_id();
uint8_t mac_5396_r(offs_t offset);
void mac_5396_w(offs_t offset, uint8_t data);
DECLARE_WRITE_LINE_MEMBER(irq_539x_1_w);
DECLARE_WRITE_LINE_MEMBER(drq_539x_1_w);
DECLARE_WRITE_LINE_MEMBER(cuda_reset_w);
DECLARE_WRITE_LINE_MEMBER(cuda_adb_linechange_w);
// hack functions
uint64_t unk1_r();
uint64_t unk2_r(offs_t offset, uint64_t mem_mask = ~0);
void init_pippin();
void pippin_mem(address_map &map);
void cdmcu_mem(address_map &map);
void cdmcu_data(address_map &map);
// wait states for accessing the VIA
int m_via_cycles = 0;
// hack
uint16_t m_unk1_test = 0;
emu_timer *m_scanline_timer = nullptr;
uint32_t screen_update_pippin(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(mac_6015_tick);
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);
DECLARE_READ_LINE_MEMBER(mac_adb_via_in_cb2);
DECLARE_WRITE_LINE_MEMBER(mac_adb_via_out_cb2);
DECLARE_WRITE_LINE_MEMBER(mac_via_irq);
void mac_driver_init(model_t model);
};
#endif // MAME_APPLE_MACPCI_H