mirror of
https://github.com/holub/mame
synced 2025-06-27 06:39:03 +03:00
-sun4.cpp: Hooked up FDC. [MooglyGuy]
This commit is contained in:
parent
ce0162de56
commit
fe5852677c
@ -500,6 +500,7 @@ public:
|
|||||||
, m_maincpu(*this, "maincpu")
|
, m_maincpu(*this, "maincpu")
|
||||||
, m_scc1(*this, SCC1_TAG)
|
, m_scc1(*this, SCC1_TAG)
|
||||||
, m_scc2(*this, SCC2_TAG)
|
, m_scc2(*this, SCC2_TAG)
|
||||||
|
, m_fdc(*this, FDC_TAG)
|
||||||
, m_type0space(*this, "type0")
|
, m_type0space(*this, "type0")
|
||||||
, m_type1space(*this, "type1")
|
, m_type1space(*this, "type1")
|
||||||
, m_ram(*this, RAM_TAG)
|
, m_ram(*this, RAM_TAG)
|
||||||
@ -528,7 +529,8 @@ public:
|
|||||||
DECLARE_WRITE32_MEMBER( timer_w );
|
DECLARE_WRITE32_MEMBER( timer_w );
|
||||||
DECLARE_READ8_MEMBER( irq_r );
|
DECLARE_READ8_MEMBER( irq_r );
|
||||||
DECLARE_WRITE8_MEMBER( irq_w );
|
DECLARE_WRITE8_MEMBER( irq_w );
|
||||||
DECLARE_READ8_MEMBER( fake_fdc_r );
|
DECLARE_READ8_MEMBER( fdc_r );
|
||||||
|
DECLARE_WRITE8_MEMBER( fdc_w );
|
||||||
|
|
||||||
DECLARE_DRIVER_INIT(sun4);
|
DECLARE_DRIVER_INIT(sun4);
|
||||||
DECLARE_DRIVER_INIT(sun4c);
|
DECLARE_DRIVER_INIT(sun4c);
|
||||||
@ -540,6 +542,7 @@ protected:
|
|||||||
required_device<mb86901_device> m_maincpu;
|
required_device<mb86901_device> m_maincpu;
|
||||||
required_device<z80scc_device> m_scc1;
|
required_device<z80scc_device> m_scc1;
|
||||||
required_device<z80scc_device> m_scc2;
|
required_device<z80scc_device> m_scc2;
|
||||||
|
required_device<n82077aa_device> m_fdc;
|
||||||
optional_device<address_map_bank_device> m_type0space, m_type1space;
|
optional_device<address_map_bank_device> m_type0space, m_type1space;
|
||||||
required_device<ram_device> m_ram;
|
required_device<ram_device> m_ram;
|
||||||
required_memory_region m_rom;
|
required_memory_region m_rom;
|
||||||
@ -1284,7 +1287,7 @@ static ADDRESS_MAP_START(type1space_map, AS_PROGRAM, 32, sun4_state)
|
|||||||
AM_RANGE(0x05000000, 0x05000003) AM_READWRITE8(irq_r, irq_w, 0xffffffff)
|
AM_RANGE(0x05000000, 0x05000003) AM_READWRITE8(irq_r, irq_w, 0xffffffff)
|
||||||
AM_RANGE(0x06000000, 0x0607ffff) AM_ROM AM_REGION("user1", 0)
|
AM_RANGE(0x06000000, 0x0607ffff) AM_ROM AM_REGION("user1", 0)
|
||||||
// AM_RANGE(0x07200000, 0x07200007) AM_DEVICE8(FDC_TAG, n82077aa_device, map, 0xffffffff)
|
// AM_RANGE(0x07200000, 0x07200007) AM_DEVICE8(FDC_TAG, n82077aa_device, map, 0xffffffff)
|
||||||
AM_RANGE(0x07200000, 0x07200003) AM_READ8(fake_fdc_r, 0xffffffff)
|
AM_RANGE(0x07200000, 0x07200003) AM_READWRITE8(fdc_r, fdc_w, 0xffffffff)
|
||||||
AM_RANGE(0x08000000, 0x08000003) AM_READ(ss1_sl0_id) // slot 0 contains SCSI/DMA/Ethernet
|
AM_RANGE(0x08000000, 0x08000003) AM_READ(ss1_sl0_id) // slot 0 contains SCSI/DMA/Ethernet
|
||||||
AM_RANGE(0x0e000000, 0x0e000003) AM_READ(ss1_sl3_id) // slot 3 contains video board
|
AM_RANGE(0x0e000000, 0x0e000003) AM_READ(ss1_sl3_id) // slot 3 contains video board
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
@ -1294,9 +1297,43 @@ static ADDRESS_MAP_START(type1space_s4_map, AS_PROGRAM, 32, sun4_state)
|
|||||||
AM_RANGE(0x01000000, 0x0100000f) AM_DEVREADWRITE8(SCC2_TAG, z80scc_device, ba_cd_inv_r, ba_cd_inv_w, 0xff00ff00)
|
AM_RANGE(0x01000000, 0x0100000f) AM_DEVREADWRITE8(SCC2_TAG, z80scc_device, ba_cd_inv_r, ba_cd_inv_w, 0xff00ff00)
|
||||||
ADDRESS_MAP_END
|
ADDRESS_MAP_END
|
||||||
|
|
||||||
READ8_MEMBER( sun4_state::fake_fdc_r )
|
READ8_MEMBER( sun4_state::fdc_r )
|
||||||
{
|
{
|
||||||
return 0x80; // always ready
|
if (space.debugger_access())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
switch(offset)
|
||||||
|
{
|
||||||
|
case 0: // Main Status (R)
|
||||||
|
return m_fdc->msr_r(space, 0, 0xff);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1: // FIFO Data Port (R)
|
||||||
|
return m_fdc->fifo_r(space, 0, 0xff);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
WRITE8_MEMBER( sun4_state::fdc_w )
|
||||||
|
{
|
||||||
|
switch(offset)
|
||||||
|
{
|
||||||
|
case 0: // Data Rate Select Register (W)
|
||||||
|
m_fdc->dsr_w(space, 0, data, 0xff);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1: // FIFO Data Port (W)
|
||||||
|
m_fdc->fifo_w(space, 0, data, 0xff);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
READ8_MEMBER( sun4_state::irq_r )
|
READ8_MEMBER( sun4_state::irq_r )
|
||||||
|
Loading…
Reference in New Issue
Block a user