finished modernizing isa nw)

This commit is contained in:
Miodrag Milanovic 2014-03-15 19:52:34 +00:00
parent c10d3029a1
commit e3fdfd72fc
14 changed files with 111 additions and 198 deletions

View File

@ -7,7 +7,6 @@
#include "emu.h"
#include "adlib.h"
#include "sound/speaker.h"
#include "sound/3812intf.h"
#define ym3812_StdClock 3579545
@ -17,26 +16,22 @@ static MACHINE_CONFIG_FRAGMENT( adlib_config )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 3.00)
MACHINE_CONFIG_END
static READ8_DEVICE_HANDLER( ym3812_16_r )
READ8_MEMBER( isa8_adlib_device::ym3812_16_r )
{
ym3812_device *ym3812 = (ym3812_device *) device;
UINT8 retVal = 0xff;
switch(offset)
{
case 0 : retVal = ym3812->status_port_r( space, offset ); break;
case 0 : retVal = m_ym3812->status_port_r( space, offset ); break;
}
return retVal;
}
static WRITE8_DEVICE_HANDLER( ym3812_16_w )
WRITE8_MEMBER( isa8_adlib_device::ym3812_16_w )
{
ym3812_device *ym3812 = (ym3812_device *) device;
switch(offset)
{
case 0 : ym3812->control_port_w( space, offset, data ); break;
case 1 : ym3812->write_port_w( space, offset, data ); break;
case 0 : m_ym3812->control_port_w( space, offset, data ); break;
case 1 : m_ym3812->write_port_w( space, offset, data ); break;
}
}
@ -66,7 +61,8 @@ machine_config_constructor isa8_adlib_device::device_mconfig_additions() const
isa8_adlib_device::isa8_adlib_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, ISA8_ADLIB, "Ad Lib Sound Card", tag, owner, clock, "isa_adlib", __FILE__),
device_isa8_card_interface( mconfig, *this )
device_isa8_card_interface( mconfig, *this ),
m_ym3812(*this, "ym3812")
{
}
@ -77,7 +73,7 @@ isa8_adlib_device::isa8_adlib_device(const machine_config &mconfig, const char *
void isa8_adlib_device::device_start()
{
set_isa_device();
m_isa->install_device(subdevice("ym3812"), 0x0388, 0x0389, 0, 0, FUNC(ym3812_16_r), FUNC(ym3812_16_w) );
m_isa->install_device(0x0388, 0x0389, 0, 0, read8_delegate( FUNC(isa8_adlib_device::ym3812_16_r), this ), write8_delegate( FUNC(isa8_adlib_device::ym3812_16_w), this ) );
}
//-------------------------------------------------

View File

@ -5,6 +5,7 @@
#include "emu.h"
#include "isa.h"
#include "sound/3812intf.h"
//**************************************************************************
// TYPE DEFINITIONS
@ -22,12 +23,16 @@ public:
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const;
DECLARE_READ8_MEMBER(ym3812_16_r);
DECLARE_WRITE8_MEMBER(ym3812_16_w);
protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
private:
// internal state
required_device<ym3812_device> m_ym3812;
};

View File

@ -7,7 +7,6 @@
#include "emu.h"
#include "gblaster.h"
#include "sound/speaker.h"
#include "sound/saa1099.h"
/*
creative labs game blaster (CMS creative music system)
@ -25,17 +24,26 @@ static MACHINE_CONFIG_FRAGMENT( game_blaster_config )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END
static READ8_DEVICE_HANDLER( saa1099_16_r )
READ8_MEMBER( isa8_gblaster_device::saa1099_16_r )
{
return 0xff;
}
static WRITE8_DEVICE_HANDLER( saa1099_16_w )
WRITE8_MEMBER( isa8_gblaster_device::saa1099_1_16_w )
{
switch(offset)
{
case 0 : dynamic_cast<saa1099_device*>(device)->saa1099_control_w( space, offset, data ); break;
case 1 : dynamic_cast<saa1099_device*>(device)->saa1099_data_w( space, offset, data ); break;
case 0 : m_saa1099_1->saa1099_control_w( space, offset, data ); break;
case 1 : m_saa1099_1->saa1099_data_w( space, offset, data ); break;
}
}
WRITE8_MEMBER( isa8_gblaster_device::saa1099_2_16_w )
{
switch(offset)
{
case 0 : m_saa1099_2->saa1099_control_w( space, offset, data ); break;
case 1 : m_saa1099_2->saa1099_data_w( space, offset, data ); break;
}
}
@ -65,7 +73,9 @@ machine_config_constructor isa8_gblaster_device::device_mconfig_additions() cons
isa8_gblaster_device::isa8_gblaster_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
device_t(mconfig, ISA8_GAME_BLASTER, "Game Blaster Sound Card", tag, owner, clock, "isa_gblaster", __FILE__),
device_isa8_card_interface(mconfig, *this)
device_isa8_card_interface(mconfig, *this),
m_saa1099_1(*this, "saa1099.1"),
m_saa1099_2(*this, "saa1099.2")
{
}
@ -76,8 +86,8 @@ isa8_gblaster_device::isa8_gblaster_device(const machine_config &mconfig, const
void isa8_gblaster_device::device_start()
{
set_isa_device();
m_isa->install_device(subdevice("saa1099.1"), 0x0220, 0x0221, 0, 0, FUNC(saa1099_16_r), FUNC(saa1099_16_w) );
m_isa->install_device(subdevice("saa1099.2"), 0x0222, 0x0223, 0, 0, FUNC(saa1099_16_r), FUNC(saa1099_16_w) );
m_isa->install_device(0x0220, 0x0221, 0, 0, read8_delegate( FUNC(isa8_gblaster_device::saa1099_16_r), this ), write8_delegate( FUNC(isa8_gblaster_device::saa1099_1_16_w), this ) );
m_isa->install_device(0x0222, 0x0223, 0, 0, read8_delegate( FUNC(isa8_gblaster_device::saa1099_16_r), this ), write8_delegate( FUNC(isa8_gblaster_device::saa1099_2_16_w), this ) );
}
//-------------------------------------------------

View File

@ -5,6 +5,7 @@
#include "emu.h"
#include "isa.h"
#include "sound/saa1099.h"
//**************************************************************************
// TYPE DEFINITIONS
@ -22,12 +23,18 @@ public:
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const;
DECLARE_READ8_MEMBER(saa1099_16_r);
DECLARE_WRITE8_MEMBER(saa1099_1_16_w);
DECLARE_WRITE8_MEMBER(saa1099_2_16_w);
protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
private:
// internal state
required_device<saa1099_device> m_saa1099_1;
required_device<saa1099_device> m_saa1099_2;
};

View File

@ -110,9 +110,6 @@ static const char *const hdc_command_names[] =
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL /* 0xF8-0xFF */
};
static DECLARE_READ8_DEVICE_HANDLER(pc_HDC_r);
static DECLARE_WRITE8_DEVICE_HANDLER(pc_HDC_w);
static MACHINE_CONFIG_FRAGMENT( hdc_config )
MCFG_HARDDISK_ADD("primary")
MCFG_HARDDISK_ADD("slave")
@ -171,7 +168,7 @@ void isa8_hdc_device::device_start()
{
set_isa_device();
m_isa->install_rom(this, 0xc8000, 0xc9fff, 0, 0, "hdc", "hdc");
m_isa->install_device(this, 0x0320, 0x0323, 0, 0, FUNC(pc_HDC_r), FUNC(pc_HDC_w) );
m_isa->install_device(0x0320, 0x0323, 0, 0, read8_delegate( FUNC(isa8_hdc_device::pc_hdc_r), this ), write8_delegate( FUNC(isa8_hdc_device::pc_hdc_w), this ) );
m_isa->set_dma_channel(3, this, FALSE);
buffer = auto_alloc_array(machine(), UINT8, 17*4*512);
timer = machine().scheduler().timer_alloc(FUNC(pc_hdc_command), this);
@ -781,37 +778,35 @@ UINT8 isa8_hdc_device::pc_hdc_dipswitch_r()
* hard disk controller
*
*************************************************************************/
static READ8_DEVICE_HANDLER(pc_HDC_r )
READ8_MEMBER( isa8_hdc_device::pc_hdc_r )
{
UINT8 data = 0xff;
isa8_hdc_device *hdc = downcast<isa8_hdc_device *>(device);
switch( offset )
{
case 0: data = hdc->pc_hdc_data_r(); break;
case 1: data = hdc->pc_hdc_status_r(); break;
case 2: data = hdc->pc_hdc_dipswitch_r(); break;
case 0: data = pc_hdc_data_r(); break;
case 1: data = pc_hdc_status_r(); break;
case 2: data = pc_hdc_dipswitch_r(); break;
case 3: break;
}
if (LOG_HDC_CALL)
logerror("%s pc_HDC_r(): offs=%d result=0x%02x\n", space.machine().describe_context(), offset, data);
logerror("%s pc_hdc_r(): offs=%d result=0x%02x\n", machine().describe_context(), offset, data);
return data;
}
static WRITE8_DEVICE_HANDLER( pc_HDC_w )
WRITE8_MEMBER( isa8_hdc_device::pc_hdc_w )
{
isa8_hdc_device *hdc = downcast<isa8_hdc_device *>(device);
if (LOG_HDC_CALL)
logerror("%s pc_HDC_w(): offs=%d data=0x%02x\n", space.machine().describe_context(), offset, data);
logerror("%s pc_hdc_w(): offs=%d data=0x%02x\n", machine().describe_context(), offset, data);
switch( offset )
{
case 0: hdc->pc_hdc_data_w(data); break;
case 1: hdc->pc_hdc_reset_w(data); break;
case 2: hdc->pc_hdc_select_w(data); break;
case 3: hdc->pc_hdc_control_w(data); break;
case 0: pc_hdc_data_w(data); break;
case 1: pc_hdc_reset_w(data); break;
case 2: pc_hdc_select_w(data); break;
case 3: pc_hdc_control_w(data); break;
}
}

View File

@ -29,7 +29,8 @@ public:
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const;
virtual const rom_entry *device_rom_region() const;
DECLARE_READ8_MEMBER(pc_hdc_r);
DECLARE_WRITE8_MEMBER(pc_hdc_w);
protected:
// device-level overrides
virtual void device_start();

View File

@ -261,53 +261,6 @@ void isa8_device::device_reset()
}
void isa8_device::install_space(address_spacenum spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_space_func rhandler, const char* rhandler_name, write8_space_func whandler, const char *whandler_name)
{
int buswidth;
address_space *space;
if (spacenum == AS_IO)
{
space = m_iospace;
buswidth = m_iowidth;
}
else if (spacenum == AS_PROGRAM)
{
space = m_prgspace;
buswidth = m_prgwidth;
}
else
{
fatalerror("Unknown space passed to isa8_device::install_space!\n");
}
switch(buswidth)
{
case 8:
space->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0);
break;
case 16:
space->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff);
break;
case 32:
if ((start % 4) == 0) {
if ((end-start)==1) {
space->install_legacy_readwrite_handler(start, end+2, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0x0000ffff);
} else {
space->install_legacy_readwrite_handler(start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffffffff);
}
} else {
// we handle just misalligned by 2
space->install_legacy_readwrite_handler(start-2, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff0000);
}
break;
default:
fatalerror("ISA8: Bus width %d not supported\n", buswidth);
break;
}
}
void isa8_device::install_space(address_spacenum spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_delegate rhandler, write8_delegate whandler)
{
int buswidth;
@ -355,71 +308,11 @@ void isa8_device::install_space(address_spacenum spacenum, offs_t start, offs_t
}
void isa8_device::install_space(address_spacenum spacenum, device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_device_func rhandler, const char* rhandler_name, write8_device_func whandler, const char *whandler_name)
{
int buswidth;
address_space *space;
if (spacenum == AS_IO)
{
space = m_iospace;
buswidth = m_iowidth;
}
else if (spacenum == AS_PROGRAM)
{
space = m_prgspace;
buswidth = m_prgwidth;
}
else
{
fatalerror("Unknown space passed to isa8_device::install_space!\n");
}
switch(buswidth)
{
case 8:
space->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0);
break;
case 16:
space->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff);
break;
case 32:
if ((start % 4) == 0) {
if ((end-start)==1) {
space->install_legacy_readwrite_handler(*dev, start, end+2, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0x0000ffff);
} else {
space->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffffffff);
}
} else {
// we handle just misalligned by 2
space->install_legacy_readwrite_handler(*dev, start-2, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff0000);
}
break;
default:
fatalerror("ISA8: Bus width %d not supported\n", buswidth);
break;
}
}
void isa8_device::install_memory(offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_delegate rhandler, write8_delegate whandler)
{
install_space(AS_PROGRAM, start, end, mask, mirror, rhandler, whandler);
}
void isa8_device::install_device(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_device_func rhandler, const char* rhandler_name, write8_device_func whandler, const char *whandler_name)
{
install_space(AS_IO, dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name);
}
void isa8_device::install_device(offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_space_func rhandler, const char* rhandler_name, write8_space_func whandler, const char *whandler_name)
{
install_space(AS_IO, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name);
}
void isa8_device::install_device(offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_delegate rhandler, write8_delegate whandler)
{
install_space(AS_IO, start, end, mask, mirror, rhandler, whandler);

View File

@ -168,9 +168,7 @@ public:
}
}
ATTR_DEPRECATED void install_device(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_device_func rhandler, const char* rhandler_name, write8_device_func whandler, const char *whandler_name);
void install_device(offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_delegate rhandler, write8_delegate whandler);
ATTR_DEPRECATED void install_device(offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_space_func rhandler, const char* rhandler_name, write8_space_func whandler, const char *whandler_name);
template<typename T> void install_device(offs_t addrstart, offs_t addrend, T &device, void (T::*map)(class address_map &map, device_t &device), int bits = 8, UINT64 unitmask = U64(0xffffffffffffffff))
{
m_iospace->install_device(addrstart, addrend, device, map, bits, unitmask);
@ -212,8 +210,6 @@ public:
const address_space_config m_program_config, m_io_config, m_program16_config, m_io16_config;
protected:
ATTR_DEPRECATED void install_space(address_spacenum spacenum, device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_device_func rhandler, const char* rhandler_name, write8_device_func whandler, const char *whandler_name);
ATTR_DEPRECATED void install_space(address_spacenum spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_space_func rhandler, const char* rhandler_name, write8_space_func whandler, const char *whandler_name);
void install_space(address_spacenum spacenum, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_delegate rhandler, write8_delegate whandler);
// device-level overrides

View File

@ -34,9 +34,6 @@
const device_type MC1502_FDC = &device_creator<mc1502_fdc_device>;
static DECLARE_READ8_DEVICE_HANDLER(mc1502_FDC_r);
static DECLARE_WRITE8_DEVICE_HANDLER(mc1502_FDC_w);
FLOPPY_FORMATS_MEMBER( mc1502_fdc_device::floppy_formats )
FLOPPY_PC_FORMAT,
FLOPPY_DSK_FORMAT
@ -155,28 +152,25 @@ void mc1502_fdc_device::mc1502_fdc_irq_drq(bool state)
maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
}
static READ8_DEVICE_HANDLER( mc1502_FDC_r )
READ8_MEMBER( mc1502_fdc_device::mc1502_fdc_r )
{
UINT8 data = 0xff;
mc1502_fdc_device *fdc = downcast<mc1502_fdc_device *>(device);
switch( offset )
{
case 0: data = fdc->mc1502_wd17xx_aux_r(); break;
case 8: data = fdc->mc1502_wd17xx_drq_r(); break;
case 10: data = fdc->mc1502_wd17xx_motor_r(); break;
case 0: data = mc1502_wd17xx_aux_r(); break;
case 8: data = mc1502_wd17xx_drq_r(); break;
case 10: data = mc1502_wd17xx_motor_r(); break;
}
return data;
}
static WRITE8_DEVICE_HANDLER( mc1502_FDC_w )
WRITE8_MEMBER( mc1502_fdc_device::mc1502_fdc_w )
{
mc1502_fdc_device *fdc = downcast<mc1502_fdc_device *>(device);
switch( offset )
{
case 0: fdc->mc1502_wd17xx_aux_w(data); break;
case 0: mc1502_wd17xx_aux_w(data); break;
}
}
@ -215,13 +209,13 @@ void mc1502_fdc_device::device_start()
m_isa->install_device(0x010c, 0x010f, 0, 0,
READ8_DEVICE_DELEGATE(m_fdc, fd1793_t, read),
WRITE8_DEVICE_DELEGATE(m_fdc, fd1793_t, write) );
m_isa->install_device(this, 0x0100, 0x010b, 0, 0, FUNC(mc1502_FDC_r), FUNC(mc1502_FDC_w) );
m_isa->install_device(0x0100, 0x010b, 0, 0, read8_delegate( FUNC(mc1502_fdc_device::mc1502_fdc_r), this ), write8_delegate( FUNC(mc1502_fdc_device::mc1502_fdc_w), this ) );
// BIOS 5.31, 5.33
/*
m_isa->install_device(0x010c, 0x010f, 0, 0,
READ8_DEVICE_DELEGATE(m_fdc, fd1793_t, read),
WRITE8_DEVICE_DELEGATE(m_fdc, fd1793_t, write) );
m_isa->install_device(this, 0x0100, 0x010b, 0, 0, FUNC(mc1502_FDC_r), FUNC(mc1502_FDC_w) );
m_isa->install_device(0x0100, 0x010b, 0, 0, read8_delegate( FUNC(mc1502_fdc_device::mc1502_fdc_r), this ), write8_delegate( FUNC(mc1502_fdc_device::mc1502_fdc_w), this ) );
*/
m_fdc->setup_drq_cb(fd1793_t::line_cb(FUNC(mc1502_fdc_device::mc1502_fdc_irq_drq), this));
m_fdc->setup_intrq_cb(fd1793_t::line_cb(FUNC(mc1502_fdc_device::mc1502_fdc_irq_drq), this));

View File

@ -38,7 +38,8 @@ public:
DECLARE_FLOPPY_FORMATS( floppy_formats );
TIMER_CALLBACK_MEMBER( motor_callback );
DECLARE_READ8_MEMBER(mc1502_fdc_r);
DECLARE_WRITE8_MEMBER(mc1502_fdc_w);
protected:
// device-level overrides
virtual void device_start();

View File

@ -34,9 +34,6 @@
const device_type P1_FDC = &device_creator<p1_fdc_device>;
static DECLARE_READ8_DEVICE_HANDLER(p1_FDC_r);
static DECLARE_WRITE8_DEVICE_HANDLER(p1_FDC_w);
FLOPPY_FORMATS_MEMBER( p1_fdc_device::floppy_formats )
FLOPPY_PC_FORMAT,
FLOPPY_DSK_FORMAT
@ -152,27 +149,24 @@ void p1_fdc_device::p1_fdc_irq_drq(bool state)
maincpu->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
}
static READ8_DEVICE_HANDLER( p1_FDC_r )
READ8_MEMBER( p1_fdc_device::p1_fdc_r )
{
UINT8 data = 0xff;
p1_fdc_device *fdc = downcast<p1_fdc_device *>(device);
switch( offset )
{
case 0: data = fdc->p1_wd17xx_aux_r(); break;
case 2: data = fdc->p1_wd17xx_motor_r(); break;
case 0: data = p1_wd17xx_aux_r(); break;
case 2: data = p1_wd17xx_motor_r(); break;
}
return data;
}
static WRITE8_DEVICE_HANDLER( p1_FDC_w )
WRITE8_MEMBER( p1_fdc_device::p1_fdc_w )
{
p1_fdc_device *fdc = downcast<p1_fdc_device *>(device);
switch( offset )
{
case 0: fdc->p1_wd17xx_aux_w(data); break;
case 0: p1_wd17xx_aux_w(data); break;
}
}
@ -199,7 +193,7 @@ void p1_fdc_device::device_start()
m_isa->install_device(0x00c0, 0x00c3, 0, 0,
READ8_DEVICE_DELEGATE(m_fdc, fd1793_t, read),
WRITE8_DEVICE_DELEGATE(m_fdc, fd1793_t, write) );
m_isa->install_device(this, 0x00c4, 0x00c7, 0, 0, FUNC(p1_FDC_r), FUNC(p1_FDC_w) );
m_isa->install_device(0x00c4, 0x00c7, 0, 0, read8_delegate( FUNC(p1_fdc_device::p1_fdc_r), this ), write8_delegate( FUNC(p1_fdc_device::p1_fdc_w), this ) );
m_fdc->setup_drq_cb(fd1793_t::line_cb(FUNC(p1_fdc_device::p1_fdc_irq_drq), this));
m_fdc->setup_intrq_cb(fd1793_t::line_cb(FUNC(p1_fdc_device::p1_fdc_irq_drq), this));
}

View File

@ -36,7 +36,8 @@ public:
virtual const rom_entry *device_rom_region() const;
DECLARE_FLOPPY_FORMATS( floppy_formats );
DECLARE_READ8_MEMBER(p1_fdc_r);
DECLARE_WRITE8_MEMBER(p1_fdc_w);
protected:
// device-level overrides
virtual void device_start();

View File

@ -11,9 +11,7 @@
#include "sblaster.h"
#include "sound/speaker.h"
#include "sound/3812intf.h"
#include "sound/262intf.h"
#include "sound/saa1099.h"
#include "sound/dac.h"
#include "machine/pic8259.h"
@ -122,40 +120,45 @@ static MACHINE_CONFIG_FRAGMENT( sblaster_16_config )
MCFG_MIDI_PORT_ADD("mdout", midiout_slot, "midiout")
MACHINE_CONFIG_END
static READ8_DEVICE_HANDLER( ym3812_16_r )
READ8_MEMBER( sb8_device::ym3812_16_r )
{
ym3812_device *ym3812 = (ym3812_device *) device;
UINT8 retVal = 0xff;
switch(offset)
{
case 0 : retVal = ym3812->status_port_r( space, offset ); break;
case 0 : retVal = m_ym3812->status_port_r( space, offset ); break;
}
return retVal;
}
static WRITE8_DEVICE_HANDLER( ym3812_16_w )
WRITE8_MEMBER( sb8_device::ym3812_16_w )
{
ym3812_device *ym3812 = (ym3812_device *) device;
switch(offset)
{
case 0 : ym3812->control_port_w( space, offset, data ); break;
case 1 : ym3812->write_port_w( space, offset, data ); break;
case 0 : m_ym3812->control_port_w( space, offset, data ); break;
case 1 : m_ym3812->write_port_w( space, offset, data ); break;
}
}
static READ8_DEVICE_HANDLER( saa1099_16_r )
READ8_MEMBER( isa8_sblaster1_0_device::saa1099_16_r )
{
return 0xff;
}
static WRITE8_DEVICE_HANDLER( saa1099_16_w )
WRITE8_MEMBER( isa8_sblaster1_0_device::saa1099_1_16_w )
{
switch(offset)
{
case 0 : dynamic_cast<saa1099_device*>(device)->saa1099_control_w( space, offset, data ); break;
case 1 : dynamic_cast<saa1099_device*>(device)->saa1099_data_w( space, offset, data ); break;
case 0 : m_saa1099_1->saa1099_control_w( space, offset, data ); break;
case 1 : m_saa1099_1->saa1099_data_w( space, offset, data ); break;
}
}
WRITE8_MEMBER( isa8_sblaster1_0_device::saa1099_2_16_w )
{
switch(offset)
{
case 0 : m_saa1099_2->saa1099_control_w( space, offset, data ); break;
case 1 : m_saa1099_2->saa1099_data_w( space, offset, data ); break;
}
}
@ -1107,7 +1110,8 @@ sb_device::sb_device(const machine_config &mconfig, device_type type, const char
sb8_device::sb8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, const char *name, const char *shortname, const char *source) :
sb_device(mconfig, type, tag, owner, clock, name, shortname, source),
device_isa8_card_interface(mconfig, *this)
device_isa8_card_interface(mconfig, *this),
m_ym3812(*this, "ym3812")
{
}
@ -1122,7 +1126,9 @@ sb16_device::sb16_device(const machine_config &mconfig, device_type type, const
//-------------------------------------------------
isa8_sblaster1_0_device::isa8_sblaster1_0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
sb8_device(mconfig, ISA8_SOUND_BLASTER_1_0, tag, owner, clock, "Sound Blaster 1.0", "isa_sblaster1_0", __FILE__)
sb8_device(mconfig, ISA8_SOUND_BLASTER_1_0, tag, owner, clock, "Sound Blaster 1.0", "isa_sblaster1_0", __FILE__),
m_saa1099_1(*this, "saa1099.1"),
m_saa1099_2(*this, "saa1099.2")
{
}
@ -1157,8 +1163,8 @@ void sb8_device::device_start()
}
else
{
m_isa->install_device(subdevice("ym3812"), 0x0388, 0x0389, 0, 0, FUNC(ym3812_16_r), FUNC(ym3812_16_w) );
m_isa->install_device(subdevice("ym3812"), 0x0228, 0x0229, 0, 0, FUNC(ym3812_16_r), FUNC(ym3812_16_w) );
m_isa->install_device(0x0388, 0x0389, 0, 0, read8_delegate( FUNC(sb8_device::ym3812_16_r), this ), write8_delegate( FUNC(sb8_device::ym3812_16_w), this ) );
m_isa->install_device(0x0228, 0x0229, 0, 0, read8_delegate( FUNC(sb8_device::ym3812_16_r), this ), write8_delegate( FUNC(sb8_device::ym3812_16_w), this ) );
}
m_timer = timer_alloc(0, NULL);
@ -1183,8 +1189,8 @@ void isa8_sblaster1_0_device::device_start()
{
set_isa_device();
// 1.0 always has the SAA1099s for CMS back-compatibility
m_isa->install_device(subdevice("saa1099.1"), 0x0220, 0x0221, 0, 0, FUNC(saa1099_16_r), FUNC(saa1099_16_w) );
m_isa->install_device(subdevice("saa1099.2"), 0x0222, 0x0223, 0, 0, FUNC(saa1099_16_r), FUNC(saa1099_16_w) );
m_isa->install_device(0x0220, 0x0221, 0, 0, read8_delegate( FUNC(isa8_sblaster1_0_device::saa1099_16_r), this ), write8_delegate( FUNC(isa8_sblaster1_0_device::saa1099_1_16_w), this ) );
m_isa->install_device(0x0222, 0x0223, 0, 0, read8_delegate( FUNC(isa8_sblaster1_0_device::saa1099_16_r), this ), write8_delegate( FUNC(isa8_sblaster1_0_device::saa1099_2_16_w), this ) );
m_isa->set_dma_channel(1, this, FALSE);
m_dsp.version = 0x0105;
sb8_device::device_start();

View File

@ -7,6 +7,8 @@
#include "isa.h"
#include "sound/dac.h"
#include "bus/pc_joy/pc_joy.h"
#include "sound/3812intf.h"
#include "sound/saa1099.h"
#define SIXTEENBIT 0x01
#define STEREO 0x02
@ -155,12 +157,17 @@ class sb8_device : public sb_device,
public:
// construction/destruction
sb8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, const char *name, const char *shortname, const char *source);
DECLARE_READ8_MEMBER(ym3812_16_r);
DECLARE_WRITE8_MEMBER(ym3812_16_w);
protected:
virtual void device_start();
virtual void drq_w(int state) { m_isa->drq1_w(state); }
virtual void irq_w(int state, int source) { m_isa->irq5_w(state); }
virtual UINT8 dack_r(int line) { return sb_device::dack_r(line); }
virtual void dack_w(int line, UINT8 data) { sb_device::dack_w(line, data); }
private:
required_device<ym3812_device> m_ym3812;
};
class isa8_sblaster1_0_device : public sb8_device
@ -171,11 +178,18 @@ public:
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const;
DECLARE_READ8_MEMBER(saa1099_16_r);
DECLARE_WRITE8_MEMBER(saa1099_1_16_w);
DECLARE_WRITE8_MEMBER(saa1099_2_16_w);
protected:
// device-level overrides
virtual void device_start();
private:
// internal state
required_device<saa1099_device> m_saa1099_1;
required_device<saa1099_device> m_saa1099_2;
};
class isa8_sblaster1_5_device : public sb8_device