Changed driver_data objects to be devices. Replaced the driver_data_t

class with a new driver_device class, which is the base class for all 
driver_data objects now. The new driver devices are added as the
first device in the device list, with a tag of "root"; all other
devices are now owned by the driver device.

Moved core callbacks (machine_start/_reset, sound_start/_reset, 
video_start/_reset/_eof/_update, and palette_init) into device 
configuration parameters on these new devices. The driver_device
base class overrides device_start(), ensures all other devices have
been started, and then calls, in order, the following overridable 
methods:

  find_devices() - new, used to locate devices prior to DRIVER_INIT
  DRIVER_INIT function from the game driver
  palette_init() - by default calls the MDRV_PALETTE_INIT function
  driver_start() - new
  machine_start() - by default calls the MDRV_MACHINE_START function
  sound_start() - by default calls the MDRV_SOUND_START function
  video_start() - by default calls the MDRV_VIDEO_START function

Similarly, the driver_device class overrides device_reset() and then
calls these methods in order:

  driver_reset() - new
  machine_reset() - by default calls the MDRV_MACHINE_RESET function
  sound_reset() - by default calls the MDRV_SOUND_RESET function
  video_reset() - by default calls the MDRV_VIDEO_RESET function

To accommodate these changes, initialization order is slightly
altered from before. The tilemap, video, sound, and debug systems 
are now initialized prior to the devices' start. And the user
callbacks for DRIVER_INIT, PALETTE_INIT, MACHINE_START, SOUND_START, 
and VIDEO_START are all called back-to-back. The net effect should 
be similar, however.

Added methods (optional_device and required_device) to the new 
driver_device class to find devices, intended to be used from the 
find_devices() callback. See harddriv.h and beathead.h for examples 
of usage.

Changed device_t::subtag to only prepend a prefix if the device is
not the 'root' device, in order to keep compatibility with existing
tag searching.

Changed device startup to actively reorder devices when they report
missing dependencies. This ensures that the reset functions get
called in the same order that the start functions did.

Bulk updated drivers as follows:

First removed the old static alloc function from the driver_data_t:
S: [ \t]*static driver_device \*alloc *\( *running_machine *\&machine *\) *\{ *return auto_alloc_clear *\( *\&machine *, *[a-zA-Z0-9_]+_state *\( *machine *\) *\); *\}[\r\n]*
R: 

Then switched from driver_data_t to driver_device:
S: driver_data_t
R: driver_device

Then changed the constructors to pass the correct parameters:
S: ([a-zA-Z0-9_]+)_state *\( *running_machine *\&machine *\)([\r\n\t ]+): *driver_device *\( *machine *\)
R: \1_state\(running_machine \&machine, const driver_device_config_base \&config\)\2: driver_device\(machine, config\)
This commit is contained in:
Aaron Giles 2010-09-02 07:57:50 +00:00
parent 1d194df33a
commit 066e54b69f
1019 changed files with 2609 additions and 3383 deletions

View File

@ -136,30 +136,28 @@ void device_list::start_all()
state_save_register_presave(m_machine, static_pre_save, this); state_save_register_presave(m_machine, static_pre_save, this);
state_save_register_postload(m_machine, static_post_load, this); state_save_register_postload(m_machine, static_post_load, this);
// iterate until we've started everything // iterate over devices to start them
int devcount = count(); device_t *nextdevice;
int numstarted = 0; for (device_t *device = first(); device != NULL; device = nextdevice)
while (numstarted < devcount)
{
// iterate over devices and start them
int prevstarted = numstarted;
for (device_t *device = first(); device != NULL; device = device->next())
if (!device->started())
{ {
// attempt to start the device, catching any expected exceptions // attempt to start the device, catching any expected exceptions
nextdevice = device->next();
try try
{ {
mame_printf_verbose("Starting %s '%s'\n", device->name(), device->tag());
device->start(); device->start();
numstarted++;
}
catch (device_missing_dependencies &)
{
}
} }
// if we didn't start anything new, we're in trouble // handle missing dependencies by moving the device to the end
if (numstarted == prevstarted) catch (device_missing_dependencies &)
fatalerror("Circular dependency in device startup; unable to start %d/%d devices\n", devcount - numstarted, devcount); {
// if we're the end, fail
mame_printf_verbose(" (missing dependencies; rescheduling)\n");
if (nextdevice == NULL)
throw emu_fatalerror("Circular dependency in device startup; unable to start %s '%s'\n", device->name(), device->tag());
detach(device);
append(device->tag(), device);
}
} }
} }

View File

@ -509,7 +509,8 @@ inline device_config *device_config::typenext() const
// create a tag for an object that is owned by this device // create a tag for an object that is owned by this device
inline astring &device_config::subtag(astring &dest, const char *_tag) const inline astring &device_config::subtag(astring &dest, const char *_tag) const
{ {
return (this != NULL) ? dest.cpy(m_tag).cat(":").cat(_tag) : dest.cpy(_tag); // temp. for now: don't include the root tag in the full tag name
return (this != NULL && m_owner != NULL) ? dest.cpy(m_tag).cat(":").cat(_tag) : dest.cpy(_tag);
} }
// create a tag for an object that a sibling to this device // create a tag for an object that a sibling to this device

View File

@ -122,7 +122,7 @@ bool device_config_sound_interface::interface_validity_check(const game_driver &
// if it's not a speaker or a sound device, error // if it's not a speaker or a sound device, error
const device_config_sound_interface *sound; const device_config_sound_interface *sound;
if (target->type() != SPEAKER && !target->interface(sound)) if (target != NULL && target->type() != SPEAKER && !target->interface(sound))
{ {
mame_printf_error("%s: %s attempting to route sound to a non-sound device '%s' (%s)\n", driver.source_file, driver.name, route->m_target, target->name()); mame_printf_error("%s: %s attempting to route sound to a non-sound device '%s' (%s)\n", driver.source_file, driver.name, route->m_target, target->name());
error = true; error = true;

View File

@ -34,7 +34,7 @@ static MACHINE_START( empty )
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( empty, driver_data_t ) static MACHINE_CONFIG_START( empty, driver_device )
MDRV_MACHINE_START(empty) MDRV_MACHINE_START(empty)

View File

@ -73,7 +73,7 @@
// between devices and the machine config // between devices and the machine config
class machine_config; class machine_config;
class device_config; class device_config;
typedef void (*machine_config_constructor)(machine_config &config, device_config *owner); typedef device_config * (*machine_config_constructor)(machine_config &config, device_config *owner);
// devices and callbacks // devices and callbacks
#include "devintrf.h" #include "devintrf.h"

View File

@ -535,7 +535,7 @@ public:
return object; return object;
} }
void remove(T *object) void detach(T *object)
{ {
for (T **objectptr = &m_head; *objectptr != NULL; objectptr = &(*objectptr)->m_next) for (T **objectptr = &m_head; *objectptr != NULL; objectptr = &(*objectptr)->m_next)
if (*objectptr == object) if (*objectptr == object)
@ -544,11 +544,16 @@ public:
if (m_tailptr == &object->m_next) if (m_tailptr == &object->m_next)
m_tailptr = objectptr; m_tailptr = objectptr;
m_map.remove(object); m_map.remove(object);
pool_free(m_pool, object);
return; return;
} }
} }
void remove(T *object)
{
detach(object);
pool_free(m_pool, object);
}
void remove(const char *tag) void remove(const char *tag)
{ {
T *object = find(tag); T *object = find(tag);

View File

@ -197,14 +197,16 @@ running_machine::running_machine(const game_driver &driver, const machine_config
memset(m_notifier_list, 0, sizeof(m_notifier_list)); memset(m_notifier_list, 0, sizeof(m_notifier_list));
memset(&m_base_time, 0, sizeof(m_base_time)); memset(&m_base_time, 0, sizeof(m_base_time));
// find the driver device config and tell it which game
device_config *config = m_config.m_devicelist.find("root");
if (config == NULL)
throw emu_fatalerror("Machine configuration missing driver_device");
driver_device_config_base::static_set_game(config, &driver);
// attach this machine to all the devices in the configuration // attach this machine to all the devices in the configuration
m_devicelist.import_config_list(m_config.m_devicelist, *this); m_devicelist.import_config_list(m_config.m_devicelist, *this);
m_driver_data = device<driver_device>("root");
// allocate the driver data (after devices) assert(m_driver_data != NULL);
if (m_config.m_driver_data_alloc != NULL)
m_driver_data = (*m_config.m_driver_data_alloc)(*this);
else
m_driver_data = auto_alloc(this, driver_data_t(*this));
// find devices // find devices
primary_screen = screen_first(*this); primary_screen = screen_first(*this);
@ -269,8 +271,6 @@ void running_machine::start()
output_init(this); output_init(this);
state_init(this); state_init(this);
state_save_allow_registration(this, true); state_save_allow_registration(this, true);
state_save_register_presave(this, pre_save_static, NULL);
state_save_register_postload(this, post_load_static, NULL);
palette_init(this); palette_init(this);
render_init(this); render_init(this);
ui_init(this); ui_init(this);
@ -316,35 +316,25 @@ void running_machine::start()
// initialize image devices // initialize image devices
image_init(this); image_init(this);
// start up the devices
m_devicelist.start_all();
// call the game driver's init function
// this is where decryption is done and memory maps are altered
// so this location in the init order is important
ui_set_startup_text(this, "Initializing...", true);
if (m_game.driver_init != NULL)
(*m_game.driver_init)(this);
// finish image devices init process
image_postdevice_init(this);
// start the video and audio hardware
video_init(this);
tilemap_init(this); tilemap_init(this);
crosshair_init(this); crosshair_init(this);
sound_init(this); sound_init(this);
video_init(this);
// initialize the debugger // initialize the debugger
if ((debug_flags & DEBUG_FLAG_ENABLED) != 0) if ((debug_flags & DEBUG_FLAG_ENABLED) != 0)
debugger_init(this); debugger_init(this);
// call the driver's _START callbacks // call the game driver's init function
m_driver_data->machine_start(); // this is where decryption is done and memory maps are altered
m_driver_data->sound_start(); // so this location in the init order is important
m_driver_data->video_start(); ui_set_startup_text(this, "Initializing...", true);
// start up the devices
m_devicelist.start_all();
// finish image devices init process
image_postdevice_init(this);
// if we're coming in with a savegame request, process it now // if we're coming in with a savegame request, process it now
const char *savegame = options_get_string(&m_options, OPTION_STATE); const char *savegame = options_get_string(&m_options, OPTION_STATE);
@ -863,28 +853,6 @@ cancel:
} }
//-------------------------------------------------
// pre_save_static - callback to prepare for
// state saving
//-------------------------------------------------
STATE_PRESAVE( running_machine::pre_save_static )
{
machine->m_driver_data->pre_save();
}
//-------------------------------------------------
// post_load_static - callback to update after
// static loading
//-------------------------------------------------
STATE_POSTLOAD( running_machine::post_load_static )
{
machine->m_driver_data->post_load();
}
//------------------------------------------------- //-------------------------------------------------
// soft_reset - actually perform a soft-reset // soft_reset - actually perform a soft-reset
// of the system // of the system
@ -902,11 +870,6 @@ void running_machine::soft_reset()
// call all registered reset callbacks // call all registered reset callbacks
call_notifiers(MACHINE_NOTIFY_RESET); call_notifiers(MACHINE_NOTIFY_RESET);
// run the driver's reset callbacks
m_driver_data->machine_reset();
m_driver_data->sound_reset();
m_driver_data->video_reset();
// now we're running // now we're running
m_current_phase = MACHINE_PHASE_RUNNING; m_current_phase = MACHINE_PHASE_RUNNING;
@ -986,35 +949,112 @@ running_machine::logerror_callback_item::logerror_callback_item(logerror_callbac
//************************************************************************** //**************************************************************************
// DRIVER DATA // DRIVER DEVICE
//************************************************************************** //**************************************************************************
//------------------------------------------------- //-------------------------------------------------
// driver_data_t - constructor // driver_device_config_base - constructor
//------------------------------------------------- //-------------------------------------------------
driver_data_t::driver_data_t(running_machine &machine) driver_device_config_base::driver_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner)
: m_machine(machine) : device_config(mconfig, type, "Driver Device", tag, owner, 0),
m_game(NULL),
m_palette_init(NULL),
m_video_update(NULL)
{
memset(m_callbacks, 0, sizeof(m_callbacks));
}
//-------------------------------------------------
// static_set_game - set the game in the device
// configuration
//-------------------------------------------------
void driver_device_config_base::static_set_game(device_config *device, const game_driver *game)
{
downcast<driver_device_config_base *>(device)->m_game = game;
}
//-------------------------------------------------
// static_set_machine_start - set the legacy
// machine start callback in the device
// configuration
//-------------------------------------------------
void driver_device_config_base::static_set_callback(device_config *device, callback_type type, legacy_callback_func callback)
{
downcast<driver_device_config_base *>(device)->m_callbacks[type] = callback;
}
//-------------------------------------------------
// static_set_palette_init - set the legacy
// palette init callback in the device
// configuration
//-------------------------------------------------
void driver_device_config_base::static_set_palette_init(device_config *device, palette_init_func callback)
{
downcast<driver_device_config_base *>(device)->m_palette_init = callback;
}
//-------------------------------------------------
// static_set_video_update - set the legacy
// video update callback in the device
// configuration
//-------------------------------------------------
void driver_device_config_base::static_set_video_update(device_config *device, video_update_func callback)
{
downcast<driver_device_config_base *>(device)->m_video_update = callback;
}
//**************************************************************************
// DRIVER DEVICE
//**************************************************************************
//-------------------------------------------------
// driver_device - constructor
//-------------------------------------------------
driver_device::driver_device(running_machine &machine, const driver_device_config_base &config)
: device_t(machine, config),
m_config(config)
{ {
} }
//------------------------------------------------- //-------------------------------------------------
// driver_data_t - destructor // driver_device - destructor
//------------------------------------------------- //-------------------------------------------------
driver_data_t::~driver_data_t() driver_device::~driver_device()
{ {
} }
//------------------------------------------------- //-------------------------------------------------
// alloc - static allocator for this class // find_devices - default implementation which
// does nothing
//------------------------------------------------- //-------------------------------------------------
driver_data_t *driver_data_t::alloc(running_machine &machine) void driver_device::find_devices()
{
}
//-------------------------------------------------
// driver_start - default implementation which
// does nothing
//-------------------------------------------------
void driver_device::driver_start()
{ {
return auto_alloc_clear(&machine, driver_data_t(machine));
} }
@ -1023,22 +1063,10 @@ driver_data_t *driver_data_t::alloc(running_machine &machine)
// calls to the legacy machine_start function // calls to the legacy machine_start function
//------------------------------------------------- //-------------------------------------------------
void driver_data_t::machine_start() void driver_device::machine_start()
{ {
if (m_machine.m_config.m_machine_start != NULL) if (m_config.m_callbacks[driver_device_config_base::CB_MACHINE_START] != NULL)
(*m_machine.m_config.m_machine_start)(&m_machine); (*m_config.m_callbacks[driver_device_config_base::CB_MACHINE_START])(&m_machine);
}
//-------------------------------------------------
// machine_reset - default implementation which
// calls to the legacy machine_reset function
//-------------------------------------------------
void driver_data_t::machine_reset()
{
if (m_machine.m_config.m_machine_reset != NULL)
(*m_machine.m_config.m_machine_reset)(&m_machine);
} }
@ -1047,34 +1075,10 @@ void driver_data_t::machine_reset()
// calls to the legacy sound_start function // calls to the legacy sound_start function
//------------------------------------------------- //-------------------------------------------------
void driver_data_t::sound_start() void driver_device::sound_start()
{ {
if (m_machine.m_config.m_sound_start != NULL) if (m_config.m_callbacks[driver_device_config_base::CB_SOUND_START] != NULL)
(*m_machine.m_config.m_sound_start)(&m_machine); (*m_config.m_callbacks[driver_device_config_base::CB_SOUND_START])(&m_machine);
}
//-------------------------------------------------
// sound_reset - default implementation which
// calls to the legacy sound_reset function
//-------------------------------------------------
void driver_data_t::sound_reset()
{
if (m_machine.m_config.m_sound_reset != NULL)
(*m_machine.m_config.m_sound_reset)(&m_machine);
}
//-------------------------------------------------
// palette_init - default implementation which
// calls to the legacy palette_init function
//-------------------------------------------------
void driver_data_t::palette_init(const UINT8 *color_prom)
{
if (m_machine.m_config.m_init_palette != NULL)
(*m_machine.m_config.m_init_palette)(&m_machine, color_prom);
} }
@ -1083,10 +1087,44 @@ void driver_data_t::palette_init(const UINT8 *color_prom)
// calls to the legacy video_start function // calls to the legacy video_start function
//------------------------------------------------- //-------------------------------------------------
void driver_data_t::video_start() void driver_device::video_start()
{ {
if (m_machine.m_config.m_video_start != NULL) if (m_config.m_callbacks[driver_device_config_base::CB_VIDEO_START] != NULL)
(*m_machine.m_config.m_video_start)(&m_machine); (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_START])(&m_machine);
}
//-------------------------------------------------
// driver_reset - default implementation which
// does nothing
//-------------------------------------------------
void driver_device::driver_reset()
{
}
//-------------------------------------------------
// machine_reset - default implementation which
// calls to the legacy machine_reset function
//-------------------------------------------------
void driver_device::machine_reset()
{
if (m_config.m_callbacks[driver_device_config_base::CB_MACHINE_RESET] != NULL)
(*m_config.m_callbacks[driver_device_config_base::CB_MACHINE_RESET])(&m_machine);
}
//-------------------------------------------------
// sound_reset - default implementation which
// calls to the legacy sound_reset function
//-------------------------------------------------
void driver_device::sound_reset()
{
if (m_config.m_callbacks[driver_device_config_base::CB_SOUND_RESET] != NULL)
(*m_config.m_callbacks[driver_device_config_base::CB_SOUND_RESET])(&m_machine);
} }
@ -1095,10 +1133,10 @@ void driver_data_t::video_start()
// calls to the legacy video_reset function // calls to the legacy video_reset function
//------------------------------------------------- //-------------------------------------------------
void driver_data_t::video_reset() void driver_device::video_reset()
{ {
if (m_machine.m_config.m_video_reset != NULL) if (m_config.m_callbacks[driver_device_config_base::CB_VIDEO_RESET] != NULL)
(*m_machine.m_config.m_video_reset)(&m_machine); (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_RESET])(&m_machine);
} }
@ -1107,10 +1145,10 @@ void driver_data_t::video_reset()
// calls to the legacy video_update function // calls to the legacy video_update function
//------------------------------------------------- //-------------------------------------------------
bool driver_data_t::video_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect) bool driver_device::video_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect)
{ {
if (m_machine.m_config.m_video_update != NULL) if (m_config.m_video_update != NULL)
return (*m_machine.m_config.m_video_update)(&screen, &bitmap, &cliprect); return (*m_config.m_video_update)(&screen, &bitmap, &cliprect);
return 0; return 0;
} }
@ -1120,30 +1158,55 @@ bool driver_data_t::video_update(screen_device &screen, bitmap_t &bitmap, const
// calls to the legacy video_eof function // calls to the legacy video_eof function
//------------------------------------------------- //-------------------------------------------------
void driver_data_t::video_eof() void driver_device::video_eof()
{ {
if (m_machine.m_config.m_video_eof != NULL) if (m_config.m_callbacks[driver_device_config_base::CB_VIDEO_EOF] != NULL)
(*m_machine.m_config.m_video_eof)(&m_machine); (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_EOF])(&m_machine);
} }
//------------------------------------------------- //-------------------------------------------------
// pre_save - default implementation which // device_start - device override which calls
// does nothing // the various helpers
//------------------------------------------------- //-------------------------------------------------
void driver_data_t::pre_save() void driver_device::device_start()
{ {
// reschedule ourselves to be last
if (next() != NULL)
throw device_missing_dependencies();
// first find devices
find_devices();
// call the game-specific init
if (m_config.m_game->driver_init != NULL)
(*m_config.m_game->driver_init)(&m_machine);
// call palette_init if present
if (m_config.m_palette_init != NULL)
(*m_config.m_palette_init)(&m_machine, memory_region(machine, "proms"));
// start the various pieces
driver_start();
machine_start();
sound_start();
video_start();
} }
//------------------------------------------------- //-------------------------------------------------
// post_load - default implementation which // device_reset - device override which calls
// does nothing // the various helpers
//------------------------------------------------- //-------------------------------------------------
void driver_data_t::post_load() void driver_device::device_reset()
{ {
// reset each piece
driver_reset();
machine_reset();
sound_reset();
video_reset();
} }

View File

@ -110,6 +110,57 @@ const int DEBUG_FLAG_OSD_ENABLED = 0x00001000; // The OSD debugger is enabled
// MACROS // MACROS
//************************************************************************** //**************************************************************************
// macros to wrap legacy callbacks
#define MACHINE_START_NAME(name) machine_start_##name
#define MACHINE_START(name) void MACHINE_START_NAME(name)(running_machine *machine)
#define MACHINE_START_CALL(name) MACHINE_START_NAME(name)(machine)
#define MACHINE_RESET_NAME(name) machine_reset_##name
#define MACHINE_RESET(name) void MACHINE_RESET_NAME(name)(running_machine *machine)
#define MACHINE_RESET_CALL(name) MACHINE_RESET_NAME(name)(machine)
#define SOUND_START_NAME(name) sound_start_##name
#define SOUND_START(name) void SOUND_START_NAME(name)(running_machine *machine)
#define SOUND_START_CALL(name) SOUND_START_NAME(name)(machine)
#define SOUND_RESET_NAME(name) sound_reset_##name
#define SOUND_RESET(name) void SOUND_RESET_NAME(name)(running_machine *machine)
#define SOUND_RESET_CALL(name) SOUND_RESET_NAME(name)(machine)
#define VIDEO_START_NAME(name) video_start_##name
#define VIDEO_START(name) void VIDEO_START_NAME(name)(running_machine *machine)
#define VIDEO_START_CALL(name) VIDEO_START_NAME(name)(machine)
#define VIDEO_RESET_NAME(name) video_reset_##name
#define VIDEO_RESET(name) void VIDEO_RESET_NAME(name)(running_machine *machine)
#define VIDEO_RESET_CALL(name) VIDEO_RESET_NAME(name)(machine)
#define PALETTE_INIT_NAME(name) palette_init_##name
#define PALETTE_INIT(name) void PALETTE_INIT_NAME(name)(running_machine *machine, const UINT8 *color_prom)
#define PALETTE_INIT_CALL(name) PALETTE_INIT_NAME(name)(machine, color_prom)
#define VIDEO_EOF_NAME(name) video_eof_##name
#define VIDEO_EOF(name) void VIDEO_EOF_NAME(name)(running_machine *machine)
#define VIDEO_EOF_CALL(name) VIDEO_EOF_NAME(name)(machine)
#define VIDEO_UPDATE_NAME(name) video_update_##name
#define VIDEO_UPDATE(name) UINT32 VIDEO_UPDATE_NAME(name)(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect)
#define VIDEO_UPDATE_CALL(name) VIDEO_UPDATE_NAME(name)(screen, bitmap, cliprect)
// NULL versions
#define machine_start_0 NULL
#define machine_reset_0 NULL
#define sound_start_0 NULL
#define sound_reset_0 NULL
#define video_start_0 NULL
#define video_reset_0 NULL
#define palette_init_0 NULL
#define video_eof_0 NULL
#define video_update_0 NULL
// global allocation helpers // global allocation helpers
#define auto_alloc(m, t) pool_alloc(static_cast<running_machine *>(m)->m_respool, t) #define auto_alloc(m, t) pool_alloc(static_cast<running_machine *>(m)->m_respool, t)
#define auto_alloc_clear(m, t) pool_alloc_clear(static_cast<running_machine *>(m)->m_respool, t) #define auto_alloc_clear(m, t) pool_alloc_clear(static_cast<running_machine *>(m)->m_respool, t)
@ -157,35 +208,16 @@ typedef struct _generic_audio_private generic_audio_private;
typedef tagged_list<region_info> region_list; typedef tagged_list<region_info> region_list;
// base class for all driver data structures // legacy callback functions
class driver_data_t : public bindable_object typedef void (*legacy_callback_func)(running_machine *machine);
{ typedef void (*palette_init_func)(running_machine *machine, const UINT8 *color_prom);
public: typedef UINT32 (*video_update_func)(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect);
driver_data_t(running_machine &machine);
virtual ~driver_data_t();
static driver_data_t *alloc(running_machine &machine);
virtual void machine_start();
virtual void machine_reset();
virtual void sound_start();
virtual void sound_reset();
virtual void palette_init(const UINT8 *color_prom);
virtual void video_start();
virtual void video_reset();
virtual bool video_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect);
virtual void video_eof();
virtual void pre_save();
virtual void post_load();
running_machine & m_machine;
};
// memory region
// ======================> region_info
// memory region object; should eventually be renamed memory_region
class region_info class region_info
{ {
DISABLE_COPYING(region_info); DISABLE_COPYING(region_info);
@ -240,7 +272,10 @@ private:
}; };
// this structure holds generic pointers that are commonly used
// ======================> generic_pointers
// holds generic pointers that are commonly used
struct generic_pointers struct generic_pointers
{ {
generic_ptr nvram; // generic NVRAM generic_ptr nvram; // generic NVRAM
@ -259,6 +294,9 @@ struct generic_pointers
}; };
// ======================> system_time
// system time description, both local and UTC // system time description, both local and UTC
class system_time class system_time
{ {
@ -287,6 +325,9 @@ public:
}; };
// ======================> running_machine
// description of the currently-running machine // description of the currently-running machine
class running_machine : public bindable_object class running_machine : public bindable_object
{ {
@ -423,8 +464,6 @@ private:
void set_saveload_filename(const char *filename); void set_saveload_filename(const char *filename);
void fill_systime(system_time &systime, time_t t); void fill_systime(system_time &systime, time_t t);
void handle_saveload(); void handle_saveload();
static STATE_PRESAVE( pre_save_static );
static STATE_POSTLOAD( post_load_static );
static TIMER_CALLBACK( static_soft_reset ); static TIMER_CALLBACK( static_soft_reset );
void soft_reset(); void soft_reset();
@ -482,7 +521,130 @@ private:
// base time // base time
time_t m_base_time; time_t m_base_time;
driver_data_t * m_driver_data; // drivers can hang data off of here instead of using globals driver_device * m_driver_data; // drivers can hang data off of here instead of using globals
};
// ======================> driver_device_config_base
// a base class with common functionality for the (mostly stub) driver_device_configs
class driver_device_config_base : public device_config
{
friend class driver_device;
protected:
// construction/destruction
driver_device_config_base(const machine_config &mconfig, device_type type, const char *tag, const device_config *owner);
public:
// indexes into our generic callbacks
enum callback_type
{
CB_MACHINE_START,
CB_MACHINE_RESET,
CB_SOUND_START,
CB_SOUND_RESET,
CB_VIDEO_START,
CB_VIDEO_RESET,
CB_VIDEO_EOF,
CB_COUNT
};
// inline configuration helpers
static void static_set_game(device_config *device, const game_driver *game);
static void static_set_callback(device_config *device, callback_type type, legacy_callback_func callback);
static void static_set_palette_init(device_config *device, palette_init_func callback);
static void static_set_video_update(device_config *device, video_update_func callback);
protected:
// internal state
const game_driver * m_game; // pointer to the game driver
legacy_callback_func m_callbacks[CB_COUNT]; // generic legacy callbacks
palette_init_func m_palette_init; // one-time palette init callback
video_update_func m_video_update; // video update callback
};
// ======================> driver_device_config
// this provides a minimal config class for driver devices, which don't
// explicitly declare their own
template<class _DeviceClass>
class driver_device_config : public driver_device_config_base
{
// construction/destruction
driver_device_config(const machine_config &mconfig, const char *tag, const device_config *owner)
: driver_device_config_base(mconfig, static_alloc_device_config, tag, owner) { }
public:
// allocators
static device_config *static_alloc_device_config(const machine_config &mconfig, const char *tag, const device_config *owner, UINT32 clock)
{
return global_alloc(driver_device_config(mconfig, tag, owner));
}
virtual device_t *alloc_device(running_machine &machine) const
{
// we clear here for historical reasons, as many existing driver states
// assume everything is NULL before starting
return auto_alloc_clear(&machine, _DeviceClass(machine, *this));
}
};
// ======================> driver_device
// base class for machine driver-specific devices
class driver_device : public device_t
{
public:
// construction/destruction
driver_device(running_machine &machine, const driver_device_config_base &config);
virtual ~driver_device();
// additional video helpers
virtual bool video_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect);
virtual void video_eof();
protected:
// helpers called at startup
virtual void find_devices();
virtual void driver_start();
virtual void machine_start();
virtual void sound_start();
virtual void video_start();
// helpers called at reset
virtual void driver_reset();
virtual void machine_reset();
virtual void sound_reset();
virtual void video_reset();
// device-level overrides
virtual void device_start();
virtual void device_reset();
// device locators
template<class T>
bool optional_device(T *&device, const char *tag)
{
device = downcast<T *>(m_machine.device<T>(tag));
return (device != NULL);
}
template<class T>
void required_device(T *&device, const char *tag)
{
if (!optional_device(device, tag))
throw emu_fatalerror("Unable to find device '%s'", tag);
}
// internal state
const driver_device_config_base &m_config;
}; };

View File

@ -50,26 +50,16 @@
//------------------------------------------------- //-------------------------------------------------
machine_config::machine_config(machine_config_constructor constructor) machine_config::machine_config(machine_config_constructor constructor)
: m_driver_data_alloc(NULL), : m_minimum_quantum(attotime_zero),
m_minimum_quantum(attotime_zero),
m_perfect_cpu_quantum(NULL), m_perfect_cpu_quantum(NULL),
m_watchdog_vblank_count(0), m_watchdog_vblank_count(0),
m_watchdog_time(attotime_zero), m_watchdog_time(attotime_zero),
m_machine_start(NULL),
m_machine_reset(NULL),
m_nvram_handler(NULL), m_nvram_handler(NULL),
m_memcard_handler(NULL), m_memcard_handler(NULL),
m_video_attributes(0), m_video_attributes(0),
m_gfxdecodeinfo(NULL), m_gfxdecodeinfo(NULL),
m_total_colors(0), m_total_colors(0),
m_default_layout(NULL), m_default_layout(NULL),
m_init_palette(NULL),
m_video_start(NULL),
m_video_reset(NULL),
m_video_eof(NULL),
m_video_update(NULL),
m_sound_start(NULL),
m_sound_reset(NULL),
m_parse_level(0) m_parse_level(0)
{ {
// construct the config // construct the config

View File

@ -91,55 +91,10 @@
#define MEMCARD_HANDLER(name) void MEMCARD_HANDLER_NAME(name)(running_machine *machine, mame_file *file, int action) #define MEMCARD_HANDLER(name) void MEMCARD_HANDLER_NAME(name)(running_machine *machine, mame_file *file, int action)
#define MEMCARD_HANDLER_CALL(name) MEMCARD_HANDLER_NAME(name)(machine, file, action) #define MEMCARD_HANDLER_CALL(name) MEMCARD_HANDLER_NAME(name)(machine, file, action)
#define MACHINE_START_NAME(name) machine_start_##name
#define MACHINE_START(name) void MACHINE_START_NAME(name)(running_machine *machine)
#define MACHINE_START_CALL(name) MACHINE_START_NAME(name)(machine)
#define MACHINE_RESET_NAME(name) machine_reset_##name
#define MACHINE_RESET(name) void MACHINE_RESET_NAME(name)(running_machine *machine)
#define MACHINE_RESET_CALL(name) MACHINE_RESET_NAME(name)(machine)
#define SOUND_START_NAME(name) sound_start_##name
#define SOUND_START(name) void SOUND_START_NAME(name)(running_machine *machine)
#define SOUND_START_CALL(name) SOUND_START_NAME(name)(machine)
#define SOUND_RESET_NAME(name) sound_reset_##name
#define SOUND_RESET(name) void SOUND_RESET_NAME(name)(running_machine *machine)
#define SOUND_RESET_CALL(name) SOUND_RESET_NAME(name)(machine)
#define VIDEO_START_NAME(name) video_start_##name
#define VIDEO_START(name) void VIDEO_START_NAME(name)(running_machine *machine)
#define VIDEO_START_CALL(name) VIDEO_START_NAME(name)(machine)
#define VIDEO_RESET_NAME(name) video_reset_##name
#define VIDEO_RESET(name) void VIDEO_RESET_NAME(name)(running_machine *machine)
#define VIDEO_RESET_CALL(name) VIDEO_RESET_NAME(name)(machine)
#define PALETTE_INIT_NAME(name) palette_init_##name
#define PALETTE_INIT(name) void PALETTE_INIT_NAME(name)(running_machine *machine, const UINT8 *color_prom)
#define PALETTE_INIT_CALL(name) PALETTE_INIT_NAME(name)(machine, color_prom)
#define VIDEO_EOF_NAME(name) video_eof_##name
#define VIDEO_EOF(name) void VIDEO_EOF_NAME(name)(running_machine *machine)
#define VIDEO_EOF_CALL(name) VIDEO_EOF_NAME(name)(machine)
#define VIDEO_UPDATE_NAME(name) video_update_##name
#define VIDEO_UPDATE(name) UINT32 VIDEO_UPDATE_NAME(name)(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect)
#define VIDEO_UPDATE_CALL(name) VIDEO_UPDATE_NAME(name)(screen, bitmap, cliprect)
// NULL versions // NULL versions
#define nvram_handler_0 NULL #define nvram_handler_0 NULL
#define memcard_handler_0 NULL #define memcard_handler_0 NULL
#define machine_start_0 NULL
#define machine_reset_0 NULL
#define sound_start_0 NULL
#define sound_reset_0 NULL
#define video_start_0 NULL
#define video_reset_0 NULL
#define palette_init_0 NULL
#define video_eof_0 NULL
#define video_update_0 NULL
@ -149,23 +104,13 @@
// forward references // forward references
struct gfx_decode_entry; struct gfx_decode_entry;
class driver_data_t; class driver_device;
// various callback functions // various callback functions
typedef void (*nvram_handler_func)(running_machine *machine, mame_file *file, int read_or_write); typedef void (*nvram_handler_func)(running_machine *machine, mame_file *file, int read_or_write);
typedef void (*memcard_handler_func)(running_machine *machine, mame_file *file, int action); typedef void (*memcard_handler_func)(running_machine *machine, mame_file *file, int action);
typedef void (*machine_start_func)(running_machine *machine);
typedef void (*machine_reset_func)(running_machine *machine);
typedef void (*sound_start_func)(running_machine *machine);
typedef void (*sound_reset_func)(running_machine *machine);
typedef void (*video_start_func)(running_machine *machine);
typedef void (*video_reset_func)(running_machine *machine);
typedef void (*palette_init_func)(running_machine *machine, const UINT8 *color_prom);
typedef void (*video_eof_func)(running_machine *machine);
typedef UINT32 (*video_update_func)(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect);
typedef driver_data_t *(*driver_data_alloc_func)(running_machine &machine);
@ -182,16 +127,11 @@ public:
machine_config(machine_config_constructor constructor); machine_config(machine_config_constructor constructor);
~machine_config(); ~machine_config();
driver_data_alloc_func m_driver_data_alloc; // allocator for driver data
attotime m_minimum_quantum; // minimum scheduling quantum attotime m_minimum_quantum; // minimum scheduling quantum
const char * m_perfect_cpu_quantum; // tag of CPU to use for "perfect" scheduling const char * m_perfect_cpu_quantum; // tag of CPU to use for "perfect" scheduling
INT32 m_watchdog_vblank_count; // number of VBLANKs until the watchdog kills us INT32 m_watchdog_vblank_count; // number of VBLANKs until the watchdog kills us
attotime m_watchdog_time; // length of time until the watchdog kills us attotime m_watchdog_time; // length of time until the watchdog kills us
machine_start_func m_machine_start; // one-time machine start callback
machine_reset_func m_machine_reset; // machine reset callback
nvram_handler_func m_nvram_handler; // NVRAM save/load callback nvram_handler_func m_nvram_handler; // NVRAM save/load callback
memcard_handler_func m_memcard_handler; // memory card save/load callback memcard_handler_func m_memcard_handler; // memory card save/load callback
@ -200,15 +140,6 @@ public:
UINT32 m_total_colors; // total number of colors in the palette UINT32 m_total_colors; // total number of colors in the palette
const char * m_default_layout; // default layout for this machine const char * m_default_layout; // default layout for this machine
palette_init_func m_init_palette; // one-time palette init callback
video_start_func m_video_start; // one-time video start callback
video_reset_func m_video_reset; // video reset callback
video_eof_func m_video_eof; // end-of-frame video callback
video_update_func m_video_update; // video update callback
sound_start_func m_sound_start; // one-time sound start callback
sound_reset_func m_sound_reset; // sound reset callback
device_config_list m_devicelist; // list of device configs device_config_list m_devicelist; // list of device configs
// helpers during configuration; not for general use // helpers during configuration; not for general use
@ -231,43 +162,44 @@ private:
#define MACHINE_CONFIG_NAME(_name) construct_machine_config_##_name #define MACHINE_CONFIG_NAME(_name) construct_machine_config_##_name
#define MACHINE_CONFIG_START(_name, _class) \ #define MACHINE_CONFIG_START(_name, _class) \
void MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config *owner) \ device_config *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config *owner) \
{ \ { \
device_config *device = NULL; \ device_config *device = NULL; \
const char *tag; \ const char *tag; \
astring tempstring; \ astring tempstring; \
(void)device; \ (void)device; \
(void)tag; \ (void)tag; \
assert(config.m_driver_data_alloc == NULL); \ assert(owner == NULL); \
config.m_driver_data_alloc = &_class::alloc; \ owner = config.device_add(NULL, "root", &driver_device_config<_class>::static_alloc_device_config, 0); \
#define MACHINE_CONFIG_FRAGMENT(_name) \ #define MACHINE_CONFIG_FRAGMENT(_name) \
void MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config *owner) \ device_config *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config *owner) \
{ \ { \
device_config *device = NULL; \ device_config *device = NULL; \
const char *tag; \ const char *tag; \
astring tempstring; \ astring tempstring; \
(void)device; \ (void)device; \
(void)tag; \ (void)tag; \
assert(config.m_driver_data_alloc != NULL); \ assert(owner != NULL); \
#define MACHINE_CONFIG_DERIVED(_name, _base) \ #define MACHINE_CONFIG_DERIVED(_name, _base) \
void MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config *owner) \ device_config *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config *owner) \
{ \ { \
device_config *device = NULL; \ device_config *device = NULL; \
const char *tag; \ const char *tag; \
astring tempstring; \ astring tempstring; \
(void)device; \ (void)device; \
(void)tag; \ (void)tag; \
MACHINE_CONFIG_NAME(_base)(config, owner); \ owner = MACHINE_CONFIG_NAME(_base)(config, owner); \
assert(config.m_driver_data_alloc != NULL); \ assert(owner != NULL); \
#define MACHINE_CONFIG_END \ #define MACHINE_CONFIG_END \
return owner; \
} }
// use this to declare external references to a machine driver // use this to declare external references to a machine driver
#define MACHINE_CONFIG_EXTERN(_name) \ #define MACHINE_CONFIG_EXTERN(_name) \
extern void MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config *owner) extern device_config *MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config *owner)
// importing data from other machine drivers // importing data from other machine drivers
@ -290,12 +222,6 @@ void MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config *owner) \
// core functions // core functions
#define MDRV_MACHINE_START(_func) \
config.m_machine_start = MACHINE_START_NAME(_func); \
#define MDRV_MACHINE_RESET(_func) \
config.m_machine_reset = MACHINE_RESET_NAME(_func); \
#define MDRV_NVRAM_HANDLER(_func) \ #define MDRV_NVRAM_HANDLER(_func) \
config.m_nvram_handler = NVRAM_HANDLER_NAME(_func); \ config.m_nvram_handler = NVRAM_HANDLER_NAME(_func); \
@ -317,29 +243,37 @@ void MACHINE_CONFIG_NAME(_name)(machine_config &config, device_config *owner) \
config.m_default_layout = &(_layout)[0]; \ config.m_default_layout = &(_layout)[0]; \
// core video functions // core machine functions
#define MDRV_PALETTE_INIT(_func) \ #define MDRV_MACHINE_START(_func) \
config.m_init_palette = PALETTE_INIT_NAME(_func); \ driver_device_config_base::static_set_callback(owner, driver_device_config_base::CB_MACHINE_START, MACHINE_START_NAME(_func)); \
#define MDRV_VIDEO_START(_func) \ #define MDRV_MACHINE_RESET(_func) \
config.m_video_start = VIDEO_START_NAME(_func); \ driver_device_config_base::static_set_callback(owner, driver_device_config_base::CB_MACHINE_RESET, MACHINE_RESET_NAME(_func)); \
#define MDRV_VIDEO_RESET(_func) \
config.m_video_reset = VIDEO_RESET_NAME(_func); \
#define MDRV_VIDEO_EOF(_func) \
config.m_video_eof = VIDEO_EOF_NAME(_func); \
#define MDRV_VIDEO_UPDATE(_func) \
config.m_video_update = VIDEO_UPDATE_NAME(_func); \
// core sound functions // core sound functions
#define MDRV_SOUND_START(_func) \ #define MDRV_SOUND_START(_func) \
config.m_sound_start = SOUND_START_NAME(_func); \ driver_device_config_base::static_set_callback(owner, driver_device_config_base::CB_SOUND_START, SOUND_START_NAME(_func)); \
#define MDRV_SOUND_RESET(_func) \ #define MDRV_SOUND_RESET(_func) \
config.m_sound_reset = SOUND_RESET_NAME(_func); \ driver_device_config_base::static_set_callback(owner, driver_device_config_base::CB_SOUND_RESET, SOUND_RESET_NAME(_func)); \
// core video functions
#define MDRV_PALETTE_INIT(_func) \
driver_device_config_base::static_set_palette_init(owner, PALETTE_INIT_NAME(_func)); \
#define MDRV_VIDEO_START(_func) \
driver_device_config_base::static_set_callback(owner, driver_device_config_base::CB_VIDEO_START, VIDEO_START_NAME(_func)); \
#define MDRV_VIDEO_RESET(_func) \
driver_device_config_base::static_set_callback(owner, driver_device_config_base::CB_VIDEO_RESET, VIDEO_RESET_NAME(_func)); \
#define MDRV_VIDEO_EOF(_func) \
driver_device_config_base::static_set_callback(owner, driver_device_config_base::CB_VIDEO_EOF, VIDEO_EOF_NAME(_func)); \
#define MDRV_VIDEO_UPDATE(_func) \
driver_device_config_base::static_set_video_update(owner, VIDEO_UPDATE_NAME(_func)); \
// add/remove devices // add/remove devices

View File

@ -2021,7 +2021,7 @@ void address_space::populate_map_entry(const address_map_entry &entry, read_or_w
case AMH_DEVICE_DELEGATE: case AMH_DEVICE_DELEGATE:
if (data.m_type == AMH_DRIVER_DELEGATE) if (data.m_type == AMH_DRIVER_DELEGATE)
{ {
object = m_machine.driver_data<driver_data_t>(); object = m_machine.driver_data<driver_device>();
if (object == NULL) if (object == NULL)
throw emu_fatalerror("Attempted to map a driver delegate in space %s of device '%s' when there is no driver data\n", m_name, m_device.tag()); throw emu_fatalerror("Attempted to map a driver delegate in space %s of device '%s' when there is no driver data\n", m_name, m_device.tag());
} }

View File

@ -296,9 +296,6 @@ void video_init(running_machine *machine)
if (machine->config->m_video_attributes & VIDEO_BUFFERS_SPRITERAM) if (machine->config->m_video_attributes & VIDEO_BUFFERS_SPRITERAM)
init_buffered_spriteram(machine); init_buffered_spriteram(machine);
/* call the PALETTE_INIT function */
machine->driver_data<driver_data_t>()->palette_init(memory_region(machine, "proms"));
/* create a render target for snapshots */ /* create a render target for snapshots */
viewname = options_get_string(machine->options(), OPTION_SNAPVIEW); viewname = options_get_string(machine->options(), OPTION_SNAPVIEW);
global.snap_native = (machine->primary_screen != NULL && (viewname[0] == 0 || strcmp(viewname, "native") == 0)); global.snap_native = (machine->primary_screen != NULL && (viewname[0] == 0 || strcmp(viewname, "native") == 0));
@ -487,7 +484,7 @@ void video_frame_update(running_machine *machine, int debug)
else else
{ {
g_profiler.start(PROFILER_VIDEO); g_profiler.start(PROFILER_VIDEO);
machine->driver_data<driver_data_t>()->video_eof(); machine->driver_data<driver_device>()->video_eof();
g_profiler.stop(); g_profiler.stop();
} }
} }
@ -2205,7 +2202,7 @@ bool screen_device::update_partial(int scanline)
g_profiler.start(PROFILER_VIDEO); g_profiler.start(PROFILER_VIDEO);
LOG_PARTIAL_UPDATES(("updating %d-%d\n", clip.min_y, clip.max_y)); LOG_PARTIAL_UPDATES(("updating %d-%d\n", clip.min_y, clip.max_y));
flags = machine->driver_data<driver_data_t>()->video_update(*this, *m_bitmap[m_curbitmap], clip); flags = machine->driver_data<driver_device>()->video_update(*this, *m_bitmap[m_curbitmap], clip);
global.partial_updates_this_frame++; global.partial_updates_this_frame++;
g_profiler.stop(); g_profiler.stop();

View File

@ -47,13 +47,11 @@ Notes:
#define MASTER_CLOCK XTAL_16MHz #define MASTER_CLOCK XTAL_16MHz
class k3_state : public driver_data_t class k3_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, k3_state(machine)); } k3_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config),
k3_state(running_machine &machine)
: driver_data_t(machine),
oki1(machine.device<okim6295_device>("oki1")), oki1(machine.device<okim6295_device>("oki1")),
oki2(machine.device<okim6295_device>("oki2")) { } oki2(machine.device<okim6295_device>("oki2")) { }

View File

@ -49,13 +49,11 @@ DAC -26.6860Mhz
#include "sound/2610intf.h" #include "sound/2610intf.h"
class _2mindril_state : public driver_data_t class _2mindril_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, _2mindril_state(machine)); } _2mindril_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
_2mindril_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */ /* memory pointers */
UINT16 * map1ram; UINT16 * map1ram;

View File

@ -27,13 +27,11 @@
#include "machine/pxa255.h" #include "machine/pxa255.h"
#include "sound/dmadac.h" #include "sound/dmadac.h"
class _39in1_state : public driver_data_t class _39in1_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, _39in1_state(machine)); } _39in1_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
_39in1_state(running_machine &machine)
: driver_data_t(machine) { }
UINT32 seed; UINT32 seed;
UINT32 magic; UINT32 magic;

View File

@ -64,7 +64,7 @@ GFXDECODE_END
static MACHINE_CONFIG_START( 3super8, driver_data_t ) static MACHINE_CONFIG_START( 3super8, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80,24000000/4) /* 6 MHz */ MDRV_CPU_ADD("maincpu", Z80,24000000/4) /* 6 MHz */
MDRV_CPU_PROGRAM_MAP(map) MDRV_CPU_PROGRAM_MAP(map)

View File

@ -379,7 +379,7 @@ static const mc6845_interface mc6845_intf =
* Machine Drivers * * Machine Drivers *
**************************/ **************************/
static MACHINE_CONFIG_START( 4roses, driver_data_t ) static MACHINE_CONFIG_START( 4roses, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M65C02, MASTER_CLOCK/8) /* 2MHz, guess */ MDRV_CPU_ADD("maincpu", M65C02, MASTER_CLOCK/8) /* 2MHz, guess */
MDRV_CPU_PROGRAM_MAP(4roses_map) MDRV_CPU_PROGRAM_MAP(4roses_map)

View File

@ -1027,7 +1027,7 @@ static const ay8910_interface ay8910_config =
* Machine Drivers * * Machine Drivers *
*************************/ *************************/
static MACHINE_CONFIG_START( fclown, driver_data_t ) static MACHINE_CONFIG_START( fclown, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M6502, MASTER_CLOCK/8) /* guess, seems ok */ MDRV_CPU_ADD("maincpu", M6502, MASTER_CLOCK/8) /* guess, seems ok */

View File

@ -353,7 +353,7 @@ static PALETTE_INIT( lions )
} }
} }
static MACHINE_CONFIG_START( lions, driver_data_t ) static MACHINE_CONFIG_START( lions, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M6809, MAIN_CLOCK/4) /* 3 MHz.(guess) */ MDRV_CPU_ADD("maincpu", M6809, MAIN_CLOCK/4) /* 3 MHz.(guess) */
MDRV_CPU_PROGRAM_MAP(lions_map) MDRV_CPU_PROGRAM_MAP(lions_map)

View File

@ -43,13 +43,11 @@ A1 2101 2101
#define MASTER_CLOCK XTAL_18MHz #define MASTER_CLOCK XTAL_18MHz
class ace_state : public driver_data_t class ace_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, ace_state(machine)); } ace_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
ace_state(running_machine &machine)
: driver_data_t(machine) { }
/* video-related */ /* video-related */
UINT8 * ram2; UINT8 * ram2;

View File

@ -547,7 +547,7 @@ static GFXDECODE_START( acefruit )
GFXDECODE_ENTRY( "gfx1", 0x1800, charlayout, 8, 4 ) GFXDECODE_ENTRY( "gfx1", 0x1800, charlayout, 8, 4 )
GFXDECODE_END GFXDECODE_END
static MACHINE_CONFIG_START( acefruit, driver_data_t ) static MACHINE_CONFIG_START( acefruit, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, 2500000) /* 2.5MHz */ MDRV_CPU_ADD("maincpu", Z80, 2500000) /* 2.5MHz */

View File

@ -558,7 +558,7 @@ static INTERRUPT_GEN( acommand_irq )
} }
} }
static MACHINE_CONFIG_START( acommand, driver_data_t ) static MACHINE_CONFIG_START( acommand, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu",M68000,12000000) MDRV_CPU_ADD("maincpu",M68000,12000000)

View File

@ -152,13 +152,11 @@ Video board has additional chips:
#include "machine/microtch.h" #include "machine/microtch.h"
#include "machine/68681.h" #include "machine/68681.h"
class adp_state : public driver_data_t class adp_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, adp_state(machine)); } adp_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
adp_state(running_machine &machine)
: driver_data_t(machine) { }
/* misc */ /* misc */
UINT8 mux_data; UINT8 mux_data;

View File

@ -14,13 +14,11 @@ TODO:
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
#include "sound/ay8910.h" #include "sound/ay8910.h"
class albazc_state : public driver_data_t class albazc_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, albazc_state(machine)); } albazc_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
albazc_state(running_machine &machine)
: driver_data_t(machine) { }
/* video-related */ /* video-related */
UINT8 * spriteram1; UINT8 * spriteram1;

View File

@ -61,13 +61,11 @@ Code disassembling
#include "machine/8255ppi.h" #include "machine/8255ppi.h"
class albazg_state : public driver_data_t class albazg_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, albazg_state(machine)); } albazg_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
albazg_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */ /* memory pointers */
UINT8 * cus_ram; UINT8 * cus_ram;

View File

@ -403,7 +403,7 @@ static const mos6526_interface cia_1_intf =
DEVCB_NULL /* port B */ DEVCB_NULL /* port B */
}; };
static MACHINE_CONFIG_START( alg_r1, driver_data_t ) static MACHINE_CONFIG_START( alg_r1, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M68000, AMIGA_68000_NTSC_CLOCK) MDRV_CPU_ADD("maincpu", M68000, AMIGA_68000_NTSC_CLOCK)

View File

@ -610,7 +610,7 @@ GFXDECODE_END
* Machine Drivers * * Machine Drivers *
************************************/ ************************************/
static MACHINE_CONFIG_START( amaticmg, driver_data_t ) static MACHINE_CONFIG_START( amaticmg, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, CPU_CLOCK) /* WRONG! */ MDRV_CPU_ADD("maincpu", Z80, CPU_CLOCK) /* WRONG! */
MDRV_CPU_PROGRAM_MAP(amaticmg_map) MDRV_CPU_PROGRAM_MAP(amaticmg_map)

View File

@ -1054,7 +1054,7 @@ static const ay8910_interface ay8910_config =
* Machine Driver * * Machine Driver *
*************************/ *************************/
static MACHINE_CONFIG_START( ampoker2, driver_data_t ) static MACHINE_CONFIG_START( ampoker2, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, MASTER_CLOCK/2) /* 3 MHz */ MDRV_CPU_ADD("maincpu", Z80, MASTER_CLOCK/2) /* 3 MHz */

View File

@ -286,7 +286,7 @@ static const mos6526_interface cia_1_intf =
DEVCB_NULL DEVCB_NULL
}; };
static MACHINE_CONFIG_START( arcadia, driver_data_t ) static MACHINE_CONFIG_START( arcadia, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M68000, AMIGA_68000_NTSC_CLOCK) MDRV_CPU_ADD("maincpu", M68000, AMIGA_68000_NTSC_CLOCK)

View File

@ -529,7 +529,7 @@ static GFXDECODE_START( butasan )
GFXDECODE_END GFXDECODE_END
static MACHINE_CONFIG_START( argus, driver_data_t ) static MACHINE_CONFIG_START( argus, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, 5000000) /* 4 MHz */ MDRV_CPU_ADD("maincpu", Z80, 5000000) /* 4 MHz */
@ -587,7 +587,7 @@ static MACHINE_CONFIG_START( argus, driver_data_t )
#endif #endif
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( valtric, driver_data_t ) static MACHINE_CONFIG_START( valtric, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, 5000000) /* 5 MHz */ MDRV_CPU_ADD("maincpu", Z80, 5000000) /* 5 MHz */
@ -632,7 +632,7 @@ static MACHINE_CONFIG_START( valtric, driver_data_t )
MDRV_SOUND_ROUTE(3, "mono", 0.50) MDRV_SOUND_ROUTE(3, "mono", 0.50)
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( butasan, driver_data_t ) static MACHINE_CONFIG_START( butasan, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, 5000000) /* 5 MHz */ MDRV_CPU_ADD("maincpu", Z80, 5000000) /* 5 MHz */

View File

@ -1194,7 +1194,7 @@ static MACHINE_RESET( aristmk4 )
} }
static MACHINE_CONFIG_START( aristmk4, driver_data_t ) static MACHINE_CONFIG_START( aristmk4, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M6809, MAIN_CLOCK/8) // 1.5mhz (goldenc needs a bit faster for some reason) MDRV_CPU_ADD("maincpu", M6809, MAIN_CLOCK/8) // 1.5mhz (goldenc needs a bit faster for some reason)

View File

@ -214,7 +214,7 @@ static const i2cmem_interface i2cmem_interface =
}; };
static MACHINE_CONFIG_START( aristmk5, driver_data_t ) static MACHINE_CONFIG_START( aristmk5, driver_device )
MDRV_CPU_ADD("maincpu", ARM, 10000000) // ? MDRV_CPU_ADD("maincpu", ARM, 10000000) // ?
MDRV_CPU_PROGRAM_MAP(aristmk5_map) MDRV_CPU_PROGRAM_MAP(aristmk5_map)

View File

@ -705,7 +705,7 @@ INPUT_PORTS_END
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( artmagic, driver_data_t ) static MACHINE_CONFIG_START( artmagic, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M68000, MASTER_CLOCK_25MHz/2) MDRV_CPU_ADD("maincpu", M68000, MASTER_CLOCK_25MHz/2)

View File

@ -609,7 +609,7 @@ static const pokey_interface pokey_config =
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( asteroid, driver_data_t ) static MACHINE_CONFIG_START( asteroid, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M6502, MASTER_CLOCK/8) MDRV_CPU_ADD("maincpu", M6502, MASTER_CLOCK/8)

View File

@ -41,13 +41,11 @@ enum
}; };
class astinvad_state : public driver_data_t class astinvad_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, astinvad_state(machine)); } astinvad_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
astinvad_state(running_machine &machine)
: driver_data_t(machine) { }
UINT8 * colorram; UINT8 * colorram;
UINT8 * videoram; UINT8 * videoram;

View File

@ -1270,7 +1270,7 @@ static const z80_daisy_config tenpin_daisy_chain[] =
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( astrocade_base, driver_data_t ) static MACHINE_CONFIG_START( astrocade_base, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, ASTROCADE_CLOCK/4) MDRV_CPU_ADD("maincpu", Z80, ASTROCADE_CLOCK/4)

View File

@ -35,13 +35,11 @@ To do:
#include "machine/ticket.h" #include "machine/ticket.h"
#include "sound/okim6295.h" #include "sound/okim6295.h"
class astrocorp_state : public driver_data_t class astrocorp_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, astrocorp_state(machine)); } astrocorp_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
astrocorp_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */ /* memory pointers */
UINT16 * spriteram; UINT16 * spriteram;

View File

@ -694,7 +694,7 @@ INPUT_PORTS_END
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( atarisy4, driver_data_t ) static MACHINE_CONFIG_START( atarisy4, driver_device )
MDRV_CPU_ADD("maincpu", M68000, 8000000) MDRV_CPU_ADD("maincpu", M68000, 8000000)
MDRV_CPU_PROGRAM_MAP(main_map) MDRV_CPU_PROGRAM_MAP(main_map)
MDRV_CPU_VBLANK_INT("screen", vblank_int) MDRV_CPU_VBLANK_INT("screen", vblank_int)

View File

@ -310,7 +310,7 @@ static const eeprom_interface eeprom_intf =
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( ataxx, driver_data_t ) static MACHINE_CONFIG_START( ataxx, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("master", Z80, 6000000) MDRV_CPU_ADD("master", Z80, 6000000)

View File

@ -338,7 +338,7 @@ static const pokey_interface pokey_interface_2 =
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( atetris, driver_data_t ) static MACHINE_CONFIG_START( atetris, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M6502,MASTER_CLOCK/8) MDRV_CPU_ADD("maincpu", M6502,MASTER_CLOCK/8)
@ -374,7 +374,7 @@ static MACHINE_CONFIG_START( atetris, driver_data_t )
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( atetrisb2, driver_data_t ) static MACHINE_CONFIG_START( atetrisb2, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M6502,BOOTLEG_CLOCK/8) MDRV_CPU_ADD("maincpu", M6502,BOOTLEG_CLOCK/8)

View File

@ -46,13 +46,11 @@ LOIPOIO-B
#include "sound/mos6560.h" #include "sound/mos6560.h"
class attckufo_state : public driver_data_t class attckufo_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, attckufo_state(machine)); } attckufo_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config),
attckufo_state(running_machine &machine)
: driver_data_t(machine),
maincpu(machine.device<cpu_device>("maincpu")), maincpu(machine.device<cpu_device>("maincpu")),
mos6560(machine.device("mos6560")) { } mos6560(machine.device("mos6560")) { }

View File

@ -143,7 +143,7 @@ INPUT_PORTS_END
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( aztarac, driver_data_t ) static MACHINE_CONFIG_START( aztarac, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M68000, 8000000) MDRV_CPU_ADD("maincpu", M68000, 8000000)

View File

@ -20,13 +20,11 @@
#include "video/deco16ic.h" #include "video/deco16ic.h"
#include "rendlay.h" #include "rendlay.h"
class backfire_state : public driver_data_t class backfire_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, backfire_state(machine)); } backfire_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
backfire_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */ /* memory pointers */
UINT16 * pf1_rowscroll; UINT16 * pf1_rowscroll;

View File

@ -468,7 +468,7 @@ static const tms5110_interface bagman_tms5110_interface =
DEVCB_NULL /* rom clock - Only used to drive the data lines */ DEVCB_NULL /* rom clock - Only used to drive the data lines */
}; };
static MACHINE_CONFIG_START( bagman, driver_data_t ) static MACHINE_CONFIG_START( bagman, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, BAGMAN_H0) MDRV_CPU_ADD("maincpu", Z80, BAGMAN_H0)
@ -504,7 +504,7 @@ static MACHINE_CONFIG_START( bagman, driver_data_t )
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( pickin, driver_data_t ) static MACHINE_CONFIG_START( pickin, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, BAGMAN_H0) MDRV_CPU_ADD("maincpu", Z80, BAGMAN_H0)
@ -556,7 +556,7 @@ z80
*/ */
static MACHINE_CONFIG_START( botanic, driver_data_t ) static MACHINE_CONFIG_START( botanic, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, BAGMAN_H0) MDRV_CPU_ADD("maincpu", Z80, BAGMAN_H0)

View File

@ -390,7 +390,7 @@ static const namco_interface namco_config =
static MACHINE_CONFIG_START( baraduke, driver_data_t ) static MACHINE_CONFIG_START( baraduke, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M6809,49152000/32) MDRV_CPU_ADD("maincpu", M6809,49152000/32)

View File

@ -241,7 +241,7 @@ static const c6280_interface c6280_config =
"audiocpu" "audiocpu"
}; };
static MACHINE_CONFIG_START( battlera, driver_data_t ) static MACHINE_CONFIG_START( battlera, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", H6280,21477200/3) MDRV_CPU_ADD("maincpu", H6280,21477200/3)

View File

@ -55,13 +55,11 @@ Stephh's notes (based on the games Z80 code and some tests) :
#include "cpu/z80/z80.h" #include "cpu/z80/z80.h"
class beaminv_state : public driver_data_t class beaminv_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, beaminv_state(machine)); } beaminv_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
beaminv_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */ /* memory pointers */
UINT8 * videoram; UINT8 * videoram;

View File

@ -498,8 +498,8 @@ static DRIVER_INIT( beathead )
atarijsa_init(machine, "IN2", 0x0040); atarijsa_init(machine, "IN2", 0x0040);
/* prepare the speedups */ /* prepare the speedups */
state->m_speedup_data = state->m_maincpu.space(AS_PROGRAM)->install_handler(0x00000ae8, 0x00000aeb, 0, 0, read32_delegate_create(beathead_state, speedup_r, *state)); state->m_speedup_data = state->m_maincpu->space(AS_PROGRAM)->install_handler(0x00000ae8, 0x00000aeb, 0, 0, read32_delegate_create(beathead_state, speedup_r, *state));
state->m_movie_speedup_data = state->m_maincpu.space(AS_PROGRAM)->install_handler(0x00000804, 0x00000807, 0, 0, read32_delegate_create(beathead_state, movie_speedup_r, *state)); state->m_movie_speedup_data = state->m_maincpu->space(AS_PROGRAM)->install_handler(0x00000804, 0x00000807, 0, 0, read32_delegate_create(beathead_state, movie_speedup_r, *state));
} }

View File

@ -72,7 +72,7 @@ static INPUT_PORTS_START( beezer )
PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) )
INPUT_PORTS_END INPUT_PORTS_END
static MACHINE_CONFIG_START( beezer, driver_data_t ) static MACHINE_CONFIG_START( beezer, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M6809, 1000000) /* 1 MHz */ MDRV_CPU_ADD("maincpu", M6809, 1000000) /* 1 MHz */

View File

@ -1043,7 +1043,7 @@ INPUT_PORTS_END
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( berzerk, driver_data_t ) static MACHINE_CONFIG_START( berzerk, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, MAIN_CPU_CLOCK) MDRV_CPU_ADD("maincpu", Z80, MAIN_CPU_CLOCK)

View File

@ -328,7 +328,7 @@ static GFXDECODE_START( bestleag )
GFXDECODE_ENTRY( "gfx2", 0, bestleag_char16layout, 0x300, 16 ) GFXDECODE_ENTRY( "gfx2", 0, bestleag_char16layout, 0x300, 16 )
GFXDECODE_END GFXDECODE_END
static MACHINE_CONFIG_START( bestleag, driver_data_t ) static MACHINE_CONFIG_START( bestleag, driver_device )
MDRV_CPU_ADD("maincpu", M68000, 12000000) MDRV_CPU_ADD("maincpu", M68000, 12000000)
MDRV_CPU_PROGRAM_MAP(bestleag_map) MDRV_CPU_PROGRAM_MAP(bestleag_map)
MDRV_CPU_VBLANK_INT("screen", irq6_line_hold) MDRV_CPU_VBLANK_INT("screen", irq6_line_hold)

View File

@ -1729,7 +1729,7 @@ static INTERRUPT_GEN( vblank_gen )
update_irqs(device->machine); update_irqs(device->machine);
} }
static MACHINE_CONFIG_START( bfcobra, driver_data_t ) static MACHINE_CONFIG_START( bfcobra, driver_device )
MDRV_CPU_ADD("maincpu", Z80, Z80_XTAL) MDRV_CPU_ADD("maincpu", Z80, Z80_XTAL)
MDRV_CPU_PROGRAM_MAP(z80_prog_map) MDRV_CPU_PROGRAM_MAP(z80_prog_map)
MDRV_CPU_IO_MAP(z80_io_map) MDRV_CPU_IO_MAP(z80_io_map)

View File

@ -1240,7 +1240,7 @@ INPUT_PORTS_END
// machine driver for scorpion1 board /////////////////////////////////////////////// // machine driver for scorpion1 board ///////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
static MACHINE_CONFIG_START( scorpion1, driver_data_t ) static MACHINE_CONFIG_START( scorpion1, driver_device )
MDRV_MACHINE_RESET(bfm_sc1) // main scorpion1 board initialisation MDRV_MACHINE_RESET(bfm_sc1) // main scorpion1 board initialisation
MDRV_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4) // 6809 CPU at 1 Mhz MDRV_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4) // 6809 CPU at 1 Mhz
MDRV_CPU_PROGRAM_MAP(memmap) // setup read and write memorymap MDRV_CPU_PROGRAM_MAP(memmap) // setup read and write memorymap

View File

@ -2216,7 +2216,7 @@ INPUT_PORTS_END
// machine driver for scorpion2 board + adder2 expansion ////////////////// // machine driver for scorpion2 board + adder2 expansion //////////////////
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
static MACHINE_CONFIG_START( scorpion2_vid, driver_data_t ) static MACHINE_CONFIG_START( scorpion2_vid, driver_device )
MDRV_MACHINE_RESET( init ) // main scorpion2 board initialisation MDRV_MACHINE_RESET( init ) // main scorpion2 board initialisation
MDRV_QUANTUM_TIME(HZ(960)) // needed for serial communication !! MDRV_QUANTUM_TIME(HZ(960)) // needed for serial communication !!
MDRV_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4 ) // 6809 CPU at 2 Mhz MDRV_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4 ) // 6809 CPU at 2 Mhz
@ -3967,7 +3967,7 @@ INPUT_PORTS_END
/* machine driver for scorpion2 board */ /* machine driver for scorpion2 board */
static MACHINE_CONFIG_START( scorpion2, driver_data_t ) static MACHINE_CONFIG_START( scorpion2, driver_device )
MDRV_MACHINE_RESET(awp_init) MDRV_MACHINE_RESET(awp_init)
MDRV_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4 ) MDRV_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4 )
MDRV_CPU_PROGRAM_MAP(sc2_memmap) MDRV_CPU_PROGRAM_MAP(sc2_memmap)
@ -3995,7 +3995,7 @@ MACHINE_CONFIG_END
/* machine driver for scorpion2 board + matrix board */ /* machine driver for scorpion2 board + matrix board */
static MACHINE_CONFIG_START( scorpion2_dm01, driver_data_t ) static MACHINE_CONFIG_START( scorpion2_dm01, driver_device )
MDRV_MACHINE_RESET(dm01_init) MDRV_MACHINE_RESET(dm01_init)
MDRV_QUANTUM_TIME(HZ(960)) // needed for serial communication !! MDRV_QUANTUM_TIME(HZ(960)) // needed for serial communication !!
MDRV_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4 ) MDRV_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4 )

View File

@ -433,7 +433,7 @@ ADDRESS_MAP_END
// machine driver for system85 board ////////////////////////////////////// // machine driver for system85 board //////////////////////////////////////
static MACHINE_CONFIG_START( bfmsys85, driver_data_t ) static MACHINE_CONFIG_START( bfmsys85, driver_device )
MDRV_MACHINE_START(bfm_sys85) // main system85 board initialisation MDRV_MACHINE_START(bfm_sys85) // main system85 board initialisation
MDRV_MACHINE_RESET(bfm_sys85) MDRV_MACHINE_RESET(bfm_sys85)
MDRV_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4) // 6809 CPU at 1 Mhz MDRV_CPU_ADD("maincpu", M6809, MASTER_CLOCK/4) // 6809 CPU at 1 Mhz

View File

@ -237,7 +237,7 @@ static const ay8910_interface ay8910_config =
* Machine Driver * * Machine Driver *
**************************************/ **************************************/
static MACHINE_CONFIG_START( big10, driver_data_t ) static MACHINE_CONFIG_START( big10, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6) /* guess */ MDRV_CPU_ADD("maincpu", Z80, MASTER_CLOCK/6) /* guess */

View File

@ -117,13 +117,11 @@ Notes:
#include "sound/3812intf.h" #include "sound/3812intf.h"
class bigfghtr_state : public driver_data_t class bigfghtr_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, bigfghtr_state(machine)); } bigfghtr_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
bigfghtr_state(running_machine &machine)
: driver_data_t(machine) { }
/* video-related */ /* video-related */
UINT16 * text_videoram; UINT16 * text_videoram;

View File

@ -125,7 +125,7 @@ static INPUT_PORTS_START( bingoc )
INPUT_PORTS_END INPUT_PORTS_END
static MACHINE_CONFIG_START( bingoc, driver_data_t ) static MACHINE_CONFIG_START( bingoc, driver_device )
MDRV_CPU_ADD("maincpu", M68000,8000000) /* ? MHz */ MDRV_CPU_ADD("maincpu", M68000,8000000) /* ? MHz */
MDRV_CPU_PROGRAM_MAP(main_map) MDRV_CPU_PROGRAM_MAP(main_map)

View File

@ -602,7 +602,7 @@ static GFXDECODE_START( bingor )
GFXDECODE_END GFXDECODE_END
static MACHINE_CONFIG_START( bingor, driver_data_t ) static MACHINE_CONFIG_START( bingor, driver_device )
MDRV_CPU_ADD("maincpu", I80186, 14000000 ) //?? Mhz MDRV_CPU_ADD("maincpu", I80186, 14000000 ) //?? Mhz
MDRV_CPU_PROGRAM_MAP(bingor_map) MDRV_CPU_PROGRAM_MAP(bingor_map)
MDRV_CPU_IO_MAP(bingor_io) MDRV_CPU_IO_MAP(bingor_io)

View File

@ -825,7 +825,7 @@ static INTERRUPT_GEN( bishjan_interrupt )
} }
} }
static MACHINE_CONFIG_START( bishjan, driver_data_t ) static MACHINE_CONFIG_START( bishjan, driver_device )
MDRV_CPU_ADD("maincpu", H83044, XTAL_44_1MHz / 3) MDRV_CPU_ADD("maincpu", H83044, XTAL_44_1MHz / 3)
MDRV_CPU_PROGRAM_MAP( bishjan_map) MDRV_CPU_PROGRAM_MAP( bishjan_map)
MDRV_CPU_VBLANK_INT_HACK(bishjan_interrupt,2) MDRV_CPU_VBLANK_INT_HACK(bishjan_interrupt,2)
@ -856,7 +856,7 @@ static INTERRUPT_GEN( saklove_interrupt )
cpu_set_input_line_and_vector(device,0,HOLD_LINE,0x4c/4); cpu_set_input_line_and_vector(device,0,HOLD_LINE,0x4c/4);
} }
static MACHINE_CONFIG_START( saklove, driver_data_t ) static MACHINE_CONFIG_START( saklove, driver_device )
MDRV_CPU_ADD("maincpu", I80188, XTAL_20MHz ) // !! AMD AM188-EM !! MDRV_CPU_ADD("maincpu", I80188, XTAL_20MHz ) // !! AMD AM188-EM !!
MDRV_CPU_PROGRAM_MAP( saklove_map) MDRV_CPU_PROGRAM_MAP( saklove_map)
MDRV_CPU_IO_MAP( saklove_io) MDRV_CPU_IO_MAP( saklove_io)

View File

@ -471,7 +471,7 @@ ADDRESS_MAP_END
static MACHINE_CONFIG_START( blackt96, driver_data_t ) static MACHINE_CONFIG_START( blackt96, driver_device )
MDRV_CPU_ADD("maincpu", M68000, 18000000 /2) MDRV_CPU_ADD("maincpu", M68000, 18000000 /2)
MDRV_CPU_PROGRAM_MAP(blackt96_map) MDRV_CPU_PROGRAM_MAP(blackt96_map)
MDRV_CPU_VBLANK_INT("screen", irq1_line_hold) MDRV_CPU_VBLANK_INT("screen", irq1_line_hold)

View File

@ -766,7 +766,7 @@ static const mc6845_interface mc6845_intf =
* Machine Drivers * * Machine Drivers *
*********************************************/ *********************************************/
static MACHINE_CONFIG_START( megadpkr, driver_data_t ) static MACHINE_CONFIG_START( megadpkr, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M6502, CPU_CLOCK) MDRV_CPU_ADD("maincpu", M6502, CPU_CLOCK)

View File

@ -433,7 +433,7 @@ GFXDECODE_END
/* Machine Drivers */ /* Machine Drivers */
static MACHINE_CONFIG_START( bloodbro, driver_data_t ) static MACHINE_CONFIG_START( bloodbro, driver_device )
// basic machine hardware // basic machine hardware
MDRV_CPU_ADD("maincpu", M68000, XTAL_20MHz/2) /* verified on pcb */ MDRV_CPU_ADD("maincpu", M68000, XTAL_20MHz/2) /* verified on pcb */
MDRV_CPU_PROGRAM_MAP(bloodbro_map) MDRV_CPU_PROGRAM_MAP(bloodbro_map)

View File

@ -492,7 +492,7 @@ static INTERRUPT_GEN( bmc_interrupt )
cpu_set_input_line(device, 2, HOLD_LINE); cpu_set_input_line(device, 2, HOLD_LINE);
} }
static MACHINE_CONFIG_START( bmcbowl, driver_data_t ) static MACHINE_CONFIG_START( bmcbowl, driver_device )
MDRV_CPU_ADD("maincpu", M68000, 21477270/2 ) MDRV_CPU_ADD("maincpu", M68000, 21477270/2 )
MDRV_CPU_PROGRAM_MAP(bmcbowl_mem) MDRV_CPU_PROGRAM_MAP(bmcbowl_mem)
MDRV_CPU_VBLANK_INT_HACK(bmc_interrupt,2) MDRV_CPU_VBLANK_INT_HACK(bmc_interrupt,2)

View File

@ -1324,7 +1324,7 @@ static MACHINE_RESET( ms32 )
} }
static MACHINE_CONFIG_START( bnstars, driver_data_t ) static MACHINE_CONFIG_START( bnstars, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", V70, 20000000) // 20MHz MDRV_CPU_ADD("maincpu", V70, 20000000) // 20MHz

View File

@ -20,13 +20,11 @@
* *
*************************************/ *************************************/
class boxer_state : public driver_data_t class boxer_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, boxer_state(machine)); } boxer_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
boxer_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */ /* memory pointers */
UINT8 * tile_ram; UINT8 * tile_ram;

View File

@ -331,7 +331,7 @@ static const tms34010_config tms_config =
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( btoads, driver_data_t ) static MACHINE_CONFIG_START( btoads, driver_device )
MDRV_CPU_ADD("maincpu", TMS34020, CPU_CLOCK/2) MDRV_CPU_ADD("maincpu", TMS34020, CPU_CLOCK/2)
MDRV_CPU_CONFIG(tms_config) MDRV_CPU_CONFIG(tms_config)

View File

@ -69,7 +69,7 @@ static GFXDECODE_START( buster )
GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 16 ) GFXDECODE_ENTRY( "gfx1", 0, tiles8x8_layout, 0, 16 )
GFXDECODE_END GFXDECODE_END
static MACHINE_CONFIG_START( buster, driver_data_t ) static MACHINE_CONFIG_START( buster, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80,8000000) /* ? MHz */ MDRV_CPU_ADD("maincpu", Z80,8000000) /* ? MHz */
MDRV_CPU_PROGRAM_MAP(mainmap) MDRV_CPU_PROGRAM_MAP(mainmap)

View File

@ -709,7 +709,7 @@ static const pokey_interface pokey_interface_2 =
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( bwidow, driver_data_t ) static MACHINE_CONFIG_START( bwidow, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M6502, MASTER_CLOCK / 8) MDRV_CPU_ADD("maincpu", M6502, MASTER_CLOCK / 8)

View File

@ -549,7 +549,7 @@ static const pokey_interface redbaron_pokey_interface =
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( bzone_base, driver_data_t ) static MACHINE_CONFIG_START( bzone_base, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M6502, BZONE_MASTER_CLOCK / 8) MDRV_CPU_ADD("maincpu", M6502, BZONE_MASTER_CLOCK / 8)

View File

@ -303,7 +303,7 @@ static INTERRUPT_GEN( cabaret_interrupt )
cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); cpu_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
} }
static MACHINE_CONFIG_START( cabaret, driver_data_t ) static MACHINE_CONFIG_START( cabaret, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z180, XTAL_12MHz / 2) MDRV_CPU_ADD("maincpu", Z180, XTAL_12MHz / 2)
MDRV_CPU_PROGRAM_MAP(cabaret_map) MDRV_CPU_PROGRAM_MAP(cabaret_map)

View File

@ -648,7 +648,7 @@ static void calchase_set_keyb_int(running_machine *machine, int state) {
} }
static MACHINE_CONFIG_START( calchase, driver_data_t ) static MACHINE_CONFIG_START( calchase, driver_device )
MDRV_CPU_ADD("maincpu", PENTIUM, 200000000) // Cyrix 686MX-PR200 CPU MDRV_CPU_ADD("maincpu", PENTIUM, 200000000) // Cyrix 686MX-PR200 CPU
MDRV_CPU_PROGRAM_MAP(calchase_map) MDRV_CPU_PROGRAM_MAP(calchase_map)
MDRV_CPU_IO_MAP(calchase_io) MDRV_CPU_IO_MAP(calchase_io)

View File

@ -2744,7 +2744,7 @@ static const mc6845_interface mc6845_intf =
* Machine Drivers * * Machine Drivers *
*************************************************/ *************************************************/
static MACHINE_CONFIG_START( sys903, driver_data_t ) static MACHINE_CONFIG_START( sys903, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M6502, CPU_CLOCK) /* confirmed */ MDRV_CPU_ADD("maincpu", M6502, CPU_CLOCK) /* confirmed */
MDRV_CPU_PROGRAM_MAP(sys903_map) MDRV_CPU_PROGRAM_MAP(sys903_map)

View File

@ -83,13 +83,11 @@ Notes:
#include "sound/ay8910.h" #include "sound/ay8910.h"
class calorie_state : public driver_data_t class calorie_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, calorie_state(machine)); } calorie_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
calorie_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */ /* memory pointers */
UINT8 * fg_ram; UINT8 * fg_ram;

View File

@ -192,7 +192,7 @@ static PALETTE_INIT(cardline)
} }
} }
static MACHINE_CONFIG_START( cardline, driver_data_t ) static MACHINE_CONFIG_START( cardline, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", I80C32,12000000) MDRV_CPU_ADD("maincpu", I80C32,12000000)

View File

@ -230,7 +230,7 @@ GFXDECODE_END
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( carpolo, driver_data_t ) static MACHINE_CONFIG_START( carpolo, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M6502, XTAL_11_289MHz/12) /* 940.75 kHz */ MDRV_CPU_ADD("maincpu", M6502, XTAL_11_289MHz/12) /* 940.75 kHz */

View File

@ -313,7 +313,7 @@ static const mc6845_interface mc6845_intf =
}; };
static MACHINE_CONFIG_START( carrera, driver_data_t ) static MACHINE_CONFIG_START( carrera, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, MASTER_CLOCK / 6) MDRV_CPU_ADD("maincpu", Z80, MASTER_CLOCK / 6)
MDRV_CPU_PROGRAM_MAP(carrera_map) MDRV_CPU_PROGRAM_MAP(carrera_map)

View File

@ -274,7 +274,7 @@ static PALETTE_INIT( caswin )
} }
static MACHINE_CONFIG_START( vvillage, driver_data_t ) static MACHINE_CONFIG_START( vvillage, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80,4000000) /* ? MHz */ MDRV_CPU_ADD("maincpu", Z80,4000000) /* ? MHz */
MDRV_CPU_PROGRAM_MAP(vvillage_mem) MDRV_CPU_PROGRAM_MAP(vvillage_mem)

View File

@ -791,7 +791,7 @@ static const ay8910_interface cb2001_ay8910_config =
}; };
static const nec_config cb2001_config = { cb2001_decryption_table, }; static const nec_config cb2001_config = { cb2001_decryption_table, };
static MACHINE_CONFIG_START( cb2001, driver_data_t ) static MACHINE_CONFIG_START( cb2001, driver_device )
MDRV_CPU_ADD("maincpu", V30, 20000000) // CPU91A-011-0016JK004; encrypted cpu like nec v25/35 used in some irem game MDRV_CPU_ADD("maincpu", V30, 20000000) // CPU91A-011-0016JK004; encrypted cpu like nec v25/35 used in some irem game
MDRV_CPU_CONFIG(cb2001_config) MDRV_CPU_CONFIG(cb2001_config)
MDRV_CPU_PROGRAM_MAP(cb2001_map) MDRV_CPU_PROGRAM_MAP(cb2001_map)

View File

@ -8,13 +8,11 @@
#include "cpu/m6800/m6800.h" #include "cpu/m6800/m6800.h"
class cball_state : public driver_data_t class cball_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cball_state(machine)); } cball_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
cball_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */ /* memory pointers */
UINT8 * video_ram; UINT8 * video_ram;

View File

@ -153,7 +153,7 @@ static const z80_daisy_config daisy_chain[] =
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( cchasm, driver_data_t ) static MACHINE_CONFIG_START( cchasm, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M68000,CCHASM_68K_CLOCK) /* 8 MHz (from schematics) */ MDRV_CPU_ADD("maincpu", M68000,CCHASM_68K_CLOCK) /* 8 MHz (from schematics) */

View File

@ -981,7 +981,7 @@ GFXDECODE_END
static MACHINE_CONFIG_START( root, driver_data_t ) static MACHINE_CONFIG_START( root, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, MASTER_CLOCK/3/2) /* 3.072 MHz */ MDRV_CPU_ADD("maincpu", Z80, MASTER_CLOCK/3/2) /* 3.072 MHz */
@ -1077,7 +1077,7 @@ static MACHINE_CONFIG_DERIVED( toprollr, cclimber )
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( swimmer, driver_data_t ) static MACHINE_CONFIG_START( swimmer, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6) /* verified on pcb */ MDRV_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/6) /* verified on pcb */

View File

@ -558,13 +558,11 @@ struct _mcd212_ab_t
BYTE68K deltaUV[BYTE68K_MAX + 1]; BYTE68K deltaUV[BYTE68K_MAX + 1];
}; };
class cdi_state : public driver_data_t class cdi_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cdi_state(machine)); } cdi_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
cdi_state(running_machine &machine)
: driver_data_t(machine) { }
UINT16 *planea; UINT16 *planea;
UINT16 *planeb; UINT16 *planeb;

View File

@ -1586,7 +1586,7 @@ static const pokey_interface warlords_pokey_interface =
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( centiped, driver_data_t ) static MACHINE_CONFIG_START( centiped, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M6502, 12096000/8) /* 1.512 MHz (slows down to 0.75MHz while accessing playfield RAM) */ MDRV_CPU_ADD("maincpu", M6502, 12096000/8) /* 1.512 MHz (slows down to 0.75MHz while accessing playfield RAM) */
@ -1710,7 +1710,7 @@ static MACHINE_CONFIG_DERIVED( mazeinv, milliped )
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( bullsdrt, driver_data_t ) static MACHINE_CONFIG_START( bullsdrt, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", S2650, 12096000/8) MDRV_CPU_ADD("maincpu", S2650, 12096000/8)

View File

@ -309,7 +309,7 @@ static GFXDECODE_START( cham24 )
/* none, the ppu generates one */ /* none, the ppu generates one */
GFXDECODE_END GFXDECODE_END
static MACHINE_CONFIG_START( cham24, driver_data_t ) static MACHINE_CONFIG_START( cham24, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", N2A03, N2A03_DEFAULTCLOCK) MDRV_CPU_ADD("maincpu", N2A03, N2A03_DEFAULTCLOCK)
MDRV_CPU_PROGRAM_MAP(cham24_map) MDRV_CPU_PROGRAM_MAP(cham24_map)

View File

@ -51,13 +51,11 @@ ToDo:
#include "sound/2203intf.h" #include "sound/2203intf.h"
class chanbara_state : public driver_data_t class chanbara_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, chanbara_state(machine)); } chanbara_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
chanbara_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */ /* memory pointers */
UINT8 * videoram; UINT8 * videoram;

View File

@ -298,7 +298,7 @@ static MACHINE_START( chihiro )
debug_console_register_command(machine,"jamdis",CMDFLAG_NONE,0,2,3,jamtable_disasm_command); debug_console_register_command(machine,"jamdis",CMDFLAG_NONE,0,2,3,jamtable_disasm_command);
} }
static MACHINE_CONFIG_START( chihiro_base, driver_data_t ) static MACHINE_CONFIG_START( chihiro_base, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", PENTIUM, 733333333) /* Wrong! */ MDRV_CPU_ADD("maincpu", PENTIUM, 733333333) /* Wrong! */

View File

@ -47,13 +47,11 @@ MM63.10N
#include "sound/2203intf.h" #include "sound/2203intf.h"
#include "sound/msm5205.h" #include "sound/msm5205.h"
class chinsan_state : public driver_data_t class chinsan_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, chinsan_state(machine)); } chinsan_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
chinsan_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */ /* memory pointers */
UINT8 * video; UINT8 * video;

View File

@ -189,7 +189,7 @@ static GFXDECODE_START( chsuper )
GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout, 0, 1 ) GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout, 0, 1 )
GFXDECODE_END GFXDECODE_END
static MACHINE_CONFIG_START( chsuper, driver_data_t ) static MACHINE_CONFIG_START( chsuper, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z180, XTAL_12MHz / 2) /* HD64180RP8, 8 MHz? */ MDRV_CPU_ADD("maincpu", Z180, XTAL_12MHz / 2) /* HD64180RP8, 8 MHz? */

View File

@ -992,7 +992,7 @@ static const ccpu_config config_jmi =
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( cinemat_nojmi_4k, driver_data_t ) static MACHINE_CONFIG_START( cinemat_nojmi_4k, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", CCPU, MASTER_CLOCK/4) MDRV_CPU_ADD("maincpu", CCPU, MASTER_CLOCK/4)

View File

@ -1565,7 +1565,7 @@ static INTERRUPT_GEN( cischeat_interrupt )
static MACHINE_CONFIG_START( bigrun, driver_data_t ) static MACHINE_CONFIG_START( bigrun, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("cpu1", M68000, 10000000) MDRV_CPU_ADD("cpu1", M68000, 10000000)
@ -1710,7 +1710,7 @@ static INTERRUPT_GEN( interrupt_scudhamm )
} }
static MACHINE_CONFIG_START( scudhamm, driver_data_t ) static MACHINE_CONFIG_START( scudhamm, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu",M68000, 12000000) MDRV_CPU_ADD("maincpu",M68000, 12000000)

View File

@ -17,13 +17,11 @@
#include "machine/8255ppi.h" #include "machine/8255ppi.h"
class clayshoo_state : public driver_data_t class clayshoo_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, clayshoo_state(machine)); } clayshoo_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
clayshoo_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */ /* memory pointers */
UINT8 * videoram; UINT8 * videoram;

View File

@ -684,7 +684,7 @@ DISCRETE_SOUND_EXTERN( cliffhgr );
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( cliffhgr, driver_data_t ) static MACHINE_CONFIG_START( cliffhgr, driver_device )
MDRV_CPU_ADD("maincpu", Z80, 4000000) /* 4MHz */ MDRV_CPU_ADD("maincpu", Z80, 4000000) /* 4MHz */
MDRV_CPU_PROGRAM_MAP(mainmem) MDRV_CPU_PROGRAM_MAP(mainmem)

View File

@ -330,7 +330,7 @@ static const pokey_interface pokey_interface_2 =
* *
*************************************/ *************************************/
static MACHINE_CONFIG_START( cloak, driver_data_t ) static MACHINE_CONFIG_START( cloak, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", M6502, 1000000) /* 1 MHz ???? */ MDRV_CPU_ADD("maincpu", M6502, 1000000) /* 1 MHz ???? */

View File

@ -248,7 +248,7 @@ GFXDECODE_END
static MACHINE_CONFIG_START( firebatl, driver_data_t ) static MACHINE_CONFIG_START( firebatl, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, 3000000) /* ? */ MDRV_CPU_ADD("maincpu", Z80, 3000000) /* ? */
@ -283,7 +283,7 @@ static MACHINE_CONFIG_START( firebatl, driver_data_t )
MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END MACHINE_CONFIG_END
static MACHINE_CONFIG_START( clshroad, driver_data_t ) static MACHINE_CONFIG_START( clshroad, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/4) /* ? real speed unknown. 3MHz is too low and causes problems */ MDRV_CPU_ADD("maincpu", Z80, XTAL_18_432MHz/4) /* ? real speed unknown. 3MHz is too low and causes problems */

View File

@ -270,7 +270,7 @@ static MACHINE_RESET( cmmb )
{ {
} }
static MACHINE_CONFIG_START( cmmb, driver_data_t ) static MACHINE_CONFIG_START( cmmb, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu",M65C02,8000000/2) // unknown clock MDRV_CPU_ADD("maincpu",M65C02,8000000/2) // unknown clock

View File

@ -29,13 +29,11 @@
#include "sound/dac.h" #include "sound/dac.h"
class cntsteer_state : public driver_data_t class cntsteer_state : public driver_device
{ {
public: public:
static driver_data_t *alloc(running_machine &machine) { return auto_alloc_clear(&machine, cntsteer_state(machine)); } cntsteer_state(running_machine &machine, const driver_device_config_base &config)
: driver_device(machine, config) { }
cntsteer_state(running_machine &machine)
: driver_data_t(machine) { }
/* memory pointers */ /* memory pointers */
UINT8 * videoram; UINT8 * videoram;

View File

@ -980,7 +980,7 @@ static const mc6845_interface h46505_intf =
}; };
static MACHINE_CONFIG_START( coinmstr, driver_data_t ) static MACHINE_CONFIG_START( coinmstr, driver_device )
MDRV_CPU_ADD("maincpu",Z80,8000000) // ? MDRV_CPU_ADD("maincpu",Z80,8000000) // ?
MDRV_CPU_PROGRAM_MAP(coinmstr_map) MDRV_CPU_PROGRAM_MAP(coinmstr_map)
MDRV_CPU_VBLANK_INT("screen", irq0_line_hold) MDRV_CPU_VBLANK_INT("screen", irq0_line_hold)

View File

@ -652,7 +652,7 @@ static INTERRUPT_GEN( vblank_irq )
* Machine Drivers * * Machine Drivers *
*************************/ *************************/
static MACHINE_CONFIG_START( coinmvga, driver_data_t ) static MACHINE_CONFIG_START( coinmvga, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", H83007, CPU_CLOCK) /* xtal */ MDRV_CPU_ADD("maincpu", H83007, CPU_CLOCK) /* xtal */

View File

@ -1102,7 +1102,7 @@ static const jaguar_cpu_config dsp_config =
}; };
static MACHINE_CONFIG_START( cojagr3k, driver_data_t ) static MACHINE_CONFIG_START( cojagr3k, driver_device )
/* basic machine hardware */ /* basic machine hardware */
MDRV_CPU_ADD("maincpu", R3041BE, R3000_CLOCK) MDRV_CPU_ADD("maincpu", R3041BE, R3000_CLOCK)

Some files were not shown because too many files have changed in this diff Show More