diff options
author | 2017-05-07 23:18:47 +1000 | |
---|---|---|
committer | 2017-05-14 21:44:11 +1000 | |
commit | 0f0d39ef81562c75e79176dd3bebb1e491ca39d5 (patch) | |
tree | 201cee7fdf55ee800f83859a92efd2cfe66cf2b3 /src/devices/bus/isa/sblaster.cpp | |
parent | e6c4be2b4d71c7a6c95be0bae111eb416ff0f9e7 (diff) |
Move static data out of devices into the device types. This is a significant change, so please pay attention.
The core changes are:
* Short name, full name and source file are no longer members of device_t, they are part of the device type
* MACHINE_COFIG_START no longer needs a driver class
* MACHINE_CONFIG_DERIVED_CLASS is no longer necessary
* Specify the state class you want in the GAME/COMP/CONS line
* The compiler will work out the base class where the driver init member is declared
* There is one static device type object per driver rather than one per machine configuration
Use DECLARE_DEVICE_TYPE or DECLARE_DEVICE_TYPE_NS to declare device type.
* DECLARE_DEVICE_TYPE forward-declares teh device type and class, and declares extern object finders.
* DECLARE_DEVICE_TYPE_NS is for devices classes in namespaces - it doesn't forward-declare the device type.
Use DEFINE_DEVICE_TYPE or DEFINE_DEVICE_TYPE_NS to define device types.
* These macros declare storage for the static data, and instantiate the device type and device finder templates.
The rest of the changes are mostly just moving stuff out of headers that shouldn't be there, renaming stuff for consistency, and scoping stuff down where appropriate.
Things I've actually messed with substantially:
* More descriptive names for a lot of devices
* Untangled the fantasy sound from the driver state, which necessitates breaking up sound/flip writes
* Changed DECO BSMT2000 ready callback into a device delegate
* Untangled Microprose 3D noise from driver state
* Used object finders for CoCo multipak, KC85 D002, and Irem sound subdevices
* Started to get TI-99 stuff out of the TI-990 directory and arrange bus devices properly
* Started to break out common parts of Samsung ARM SoC devices
* Turned some of FM, SID, SCSP DSP, EPIC12 and Voodoo cores into something resmbling C++
* Tried to make Z180 table allocation/setup a bit safer
* Converted generic keyboard/terminal to not use WRITE8 - space/offset aren't relevant
* Dynamically allocate generic terminal buffer so derived devices (e.g. teleprinter) can specify size
* Imporved encapsulation of Z80DART channels
* Refactored the SPC7110 bit table generator loop to make it more readable
* Added wrappers for SNES PPU operations so members can be made protected
* Factored out some boilerplate for YM chips with PSG
* toaplan2 gfx
* stic/intv resolution
* Video System video
* Out Run/Y-board sprite alignment
* GIC video hookup
* Amstrad CPC ROM box members
* IQ151 ROM cart region
* MSX cart IRQ callback resolution time
* SMS passthrough control devices starting subslots
I've smoke-tested several drivers, but I've probably missed something. Things I've missed will likely blow up spectacularly with failure to bind errors and the like. Let me know if there's more subtle breakage (could have happened in FM or Voodoo).
And can everyone please, please try to keep stuff clean. In particular, please stop polluting the global namespace. Keep things out of headers that don't need to be there, and use things that can be scoped down rather than macros.
It feels like an uphill battle trying to get this stuff under control while more of it's added.
Diffstat (limited to 'src/devices/bus/isa/sblaster.cpp')
-rw-r--r-- | src/devices/bus/isa/sblaster.cpp | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/src/devices/bus/isa/sblaster.cpp b/src/devices/bus/isa/sblaster.cpp index 54a861a6526..235c9d92de7 100644 --- a/src/devices/bus/isa/sblaster.cpp +++ b/src/devices/bus/isa/sblaster.cpp @@ -21,6 +21,18 @@ #include "speaker.h" +#define SIXTEENBIT 0x01 +#define STEREO 0x02 +#define SIGNED 0x04 +#define ADPCM2 0x08 +#define ADPCM3 0x10 +#define ADPCM4 0x20 + +#define IRQ_DMA8 0x01 +#define IRQ_DMA16 0x02 +#define IRQ_MPU 0x04 +#define IRQ_ALL 0xff + /* adlib (YM3812/OPL2 chip), part of many many soundcards (soundblaster) @@ -1194,9 +1206,9 @@ ioport_constructor sb16_device::device_input_ports() const // GLOBAL VARIABLES //************************************************************************** -const device_type ISA8_SOUND_BLASTER_1_0 = device_creator<isa8_sblaster1_0_device>; -const device_type ISA8_SOUND_BLASTER_1_5 = device_creator<isa8_sblaster1_5_device>; -const device_type ISA16_SOUND_BLASTER_16 = device_creator<isa16_sblaster16_device>; +DEFINE_DEVICE_TYPE(ISA8_SOUND_BLASTER_1_0, isa8_sblaster1_0_device, "isa_sblaster1_0", "Sound Blaster 1.0") +DEFINE_DEVICE_TYPE(ISA8_SOUND_BLASTER_1_5, isa8_sblaster1_5_device, "isa_sblaster1_5", "Sound Blaster 1.5") +DEFINE_DEVICE_TYPE(ISA16_SOUND_BLASTER_16, isa16_sblaster16_device, "isa_sblaster_16", "Sound Blaster 16") //------------------------------------------------- // machine_config_additions - device-specific @@ -1222,8 +1234,8 @@ machine_config_constructor isa16_sblaster16_device::device_mconfig_additions() c // LIVE DEVICE //************************************************************************** -sb_device::sb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const char *name, const char *shortname, const char *source) : - device_t(mconfig, type, name, tag, owner, clock, shortname, source), +sb_device::sb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + device_t(mconfig, type, tag, owner, clock), device_serial_interface(mconfig, *this), m_ldac(*this, "ldac"), m_rdac(*this, "rdac"), @@ -1233,15 +1245,15 @@ 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_t clock, const char *name, const char *shortname, const char *source) : - sb_device(mconfig, type, tag, owner, clock, name, shortname, source), +sb8_device::sb8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + sb_device(mconfig, type, tag, owner, clock), device_isa8_card_interface(mconfig, *this), m_ym3812(*this, "ym3812") { } -sb16_device::sb16_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, const char *name, const char *shortname, const char *source) : - sb_device(mconfig, type, tag, owner, clock, name, shortname, source), +sb16_device::sb16_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : + sb_device(mconfig, type, tag, owner, clock), device_isa16_card_interface(mconfig, *this) { } @@ -1251,19 +1263,19 @@ 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_t 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), m_saa1099_1(*this, "saa1099.1"), m_saa1099_2(*this, "saa1099.2") { } isa8_sblaster1_5_device::isa8_sblaster1_5_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - sb8_device(mconfig, ISA8_SOUND_BLASTER_1_5, tag, owner, clock, "Sound Blaster 1.5", "isa_sblaster1_5", __FILE__) + sb8_device(mconfig, ISA8_SOUND_BLASTER_1_5, tag, owner, clock) { } isa16_sblaster16_device::isa16_sblaster16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : - sb16_device(mconfig, ISA16_SOUND_BLASTER_16, tag, owner, clock, "Sound Blaster 16", "isa_sblaster_16", __FILE__) + sb16_device(mconfig, ISA16_SOUND_BLASTER_16, tag, owner, clock) { } |