mirror of
https://github.com/holub/mame
synced 2025-07-05 01:48:29 +03:00
well, that causes mpu4 to take way too much memory to compile, the changes to device instantiation still apply (nw)
This commit is contained in:
parent
f7180a9504
commit
fa80bef249
@ -160,6 +160,27 @@ const tiny_rom_entry *driver_device::device_rom_region() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// device_add_mconfig - add machine configuration
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
void driver_device::device_add_mconfig(machine_config &config)
|
||||||
|
{
|
||||||
|
m_system->machine_config(config, this, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//-------------------------------------------------
|
||||||
|
// device_input_ports - return a pointer to the
|
||||||
|
// game's input ports
|
||||||
|
//-------------------------------------------------
|
||||||
|
|
||||||
|
ioport_constructor driver_device::device_input_ports() const
|
||||||
|
{
|
||||||
|
return m_system->ipt;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// device_start - device override which calls
|
// device_start - device override which calls
|
||||||
// the various helpers
|
// the various helpers
|
||||||
|
@ -197,6 +197,8 @@ protected:
|
|||||||
|
|
||||||
// device-level overrides
|
// device-level overrides
|
||||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||||
|
virtual void device_add_mconfig(machine_config &config) override;
|
||||||
|
virtual ioport_constructor device_input_ports() const override;
|
||||||
virtual void device_start() override;
|
virtual void device_start() override;
|
||||||
virtual void device_reset_after_children() override;
|
virtual void device_reset_after_children() override;
|
||||||
|
|
||||||
|
@ -95,6 +95,8 @@ public:
|
|||||||
const char * parent; // if this is a clone, the name of the parent
|
const char * parent; // if this is a clone, the name of the parent
|
||||||
const char * year; // year the game was released
|
const char * year; // year the game was released
|
||||||
const char * manufacturer; // manufacturer of the game
|
const char * manufacturer; // manufacturer of the game
|
||||||
|
machine_config_constructor machine_config; // machine driver tokens
|
||||||
|
ioport_constructor ipt; // pointer to constructor for input ports
|
||||||
driver_init_helper const & driver_init; // DRIVER_INIT callback
|
driver_init_helper const & driver_init; // DRIVER_INIT callback
|
||||||
const tiny_rom_entry * rom; // pointer to list of ROMs for the game
|
const tiny_rom_entry * rom; // pointer to list of ROMs for the game
|
||||||
const char * compatible_with;
|
const char * compatible_with;
|
||||||
@ -116,34 +118,28 @@ public:
|
|||||||
|
|
||||||
// wrappers for declaring and defining game drivers
|
// wrappers for declaring and defining game drivers
|
||||||
#define GAME_NAME(name) driver_##name
|
#define GAME_NAME(name) driver_##name
|
||||||
#define GAME_TRAITS_NAME(name) driver_##name##_device
|
#define GAME_TRAITS_NAME(name) driver_##name##traits
|
||||||
#define GAME_EXTERN(name) extern game_driver const GAME_NAME(name)
|
#define GAME_EXTERN(name) extern game_driver const GAME_NAME(name)
|
||||||
|
|
||||||
// static game traits
|
// static game traits
|
||||||
#define GAME_DRIVER_TRAITS(NAME, FULLNAME, MACHINE, INPUT, CLASS) \
|
#define GAME_DRIVER_TRAITS(NAME, FULLNAME) \
|
||||||
namespace { \
|
namespace { \
|
||||||
class GAME_TRAITS_NAME(NAME) : public CLASS \
|
struct GAME_TRAITS_NAME(NAME) { static constexpr char const shortname[] = #NAME, fullname[] = FULLNAME, source[] = __FILE__; }; \
|
||||||
{ \
|
|
||||||
public: \
|
|
||||||
static constexpr char const shortname[] = #NAME, fullname[] = FULLNAME, source[] = __FILE__; \
|
|
||||||
GAME_TRAITS_NAME(NAME)(const machine_config &mconfig, device_type type, const char *tag) : CLASS(mconfig, type, tag) { } \
|
|
||||||
protected: \
|
|
||||||
virtual void device_add_mconfig(machine_config &config) override { MACHINE_CONFIG_NAME(MACHINE)(config, this, nullptr); } \
|
|
||||||
virtual ioport_constructor device_input_ports() const override { return INPUT_PORTS_NAME(INPUT); } \
|
|
||||||
}; \
|
|
||||||
constexpr char const GAME_TRAITS_NAME(NAME)::shortname[], GAME_TRAITS_NAME(NAME)::fullname[], GAME_TRAITS_NAME(NAME)::source[]; \
|
constexpr char const GAME_TRAITS_NAME(NAME)::shortname[], GAME_TRAITS_NAME(NAME)::fullname[], GAME_TRAITS_NAME(NAME)::source[]; \
|
||||||
}
|
}
|
||||||
#define GAME_DRIVER_TYPE(NAME) driver_device_creator<GAME_TRAITS_NAME(NAME), (GAME_TRAITS_NAME(NAME)::shortname), (GAME_TRAITS_NAME(NAME)::fullname), (GAME_TRAITS_NAME(NAME)::source)>
|
#define GAME_DRIVER_TYPE(NAME, CLASS) driver_device_creator<CLASS, (GAME_TRAITS_NAME(NAME)::shortname), (GAME_TRAITS_NAME(NAME)::fullname), (GAME_TRAITS_NAME(NAME)::source)>
|
||||||
|
|
||||||
// standard GAME() macro
|
// standard GAME() macro
|
||||||
#define GAME(YEAR,NAME,PARENT,MACHINE,INPUT,CLASS,INIT,MONITOR,COMPANY,FULLNAME,FLAGS) \
|
#define GAME(YEAR,NAME,PARENT,MACHINE,INPUT,CLASS,INIT,MONITOR,COMPANY,FULLNAME,FLAGS) \
|
||||||
GAME_DRIVER_TRAITS(NAME, FULLNAME, MACHINE, INPUT, CLASS) \
|
GAME_DRIVER_TRAITS(NAME,FULLNAME) \
|
||||||
extern game_driver const GAME_NAME(NAME) \
|
extern game_driver const GAME_NAME(NAME) \
|
||||||
{ \
|
{ \
|
||||||
GAME_DRIVER_TYPE(NAME), \
|
GAME_DRIVER_TYPE(NAME, CLASS), \
|
||||||
#PARENT, \
|
#PARENT, \
|
||||||
#YEAR, \
|
#YEAR, \
|
||||||
COMPANY, \
|
COMPANY, \
|
||||||
|
MACHINE_CONFIG_NAME(MACHINE), \
|
||||||
|
INPUT_PORTS_NAME(INPUT), \
|
||||||
game_driver::make_driver_init(&CLASS::init_##INIT), \
|
game_driver::make_driver_init(&CLASS::init_##INIT), \
|
||||||
ROM_NAME(NAME), \
|
ROM_NAME(NAME), \
|
||||||
nullptr, \
|
nullptr, \
|
||||||
@ -154,13 +150,15 @@ extern game_driver const GAME_NAME(NAME) \
|
|||||||
|
|
||||||
// standard macro with additional layout
|
// standard macro with additional layout
|
||||||
#define GAMEL(YEAR,NAME,PARENT,MACHINE,INPUT,CLASS,INIT,MONITOR,COMPANY,FULLNAME,FLAGS,LAYOUT) \
|
#define GAMEL(YEAR,NAME,PARENT,MACHINE,INPUT,CLASS,INIT,MONITOR,COMPANY,FULLNAME,FLAGS,LAYOUT) \
|
||||||
GAME_DRIVER_TRAITS(NAME, FULLNAME, MACHINE, INPUT, CLASS) \
|
GAME_DRIVER_TRAITS(NAME,FULLNAME) \
|
||||||
extern game_driver const GAME_NAME(NAME) \
|
extern game_driver const GAME_NAME(NAME) \
|
||||||
{ \
|
{ \
|
||||||
GAME_DRIVER_TYPE(NAME), \
|
GAME_DRIVER_TYPE(NAME, CLASS), \
|
||||||
#PARENT, \
|
#PARENT, \
|
||||||
#YEAR, \
|
#YEAR, \
|
||||||
COMPANY, \
|
COMPANY, \
|
||||||
|
MACHINE_CONFIG_NAME(MACHINE), \
|
||||||
|
INPUT_PORTS_NAME(INPUT), \
|
||||||
game_driver::make_driver_init(&CLASS::init_##INIT), \
|
game_driver::make_driver_init(&CLASS::init_##INIT), \
|
||||||
ROM_NAME(NAME), \
|
ROM_NAME(NAME), \
|
||||||
nullptr, \
|
nullptr, \
|
||||||
@ -172,13 +170,15 @@ extern game_driver const GAME_NAME(NAME) \
|
|||||||
|
|
||||||
// standard console definition macro
|
// standard console definition macro
|
||||||
#define CONS(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,CLASS,INIT,COMPANY,FULLNAME,FLAGS) \
|
#define CONS(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,CLASS,INIT,COMPANY,FULLNAME,FLAGS) \
|
||||||
GAME_DRIVER_TRAITS(NAME, FULLNAME, MACHINE, INPUT, CLASS) \
|
GAME_DRIVER_TRAITS(NAME,FULLNAME) \
|
||||||
extern game_driver const GAME_NAME(NAME) \
|
extern game_driver const GAME_NAME(NAME) \
|
||||||
{ \
|
{ \
|
||||||
GAME_DRIVER_TYPE(NAME), \
|
GAME_DRIVER_TYPE(NAME, CLASS), \
|
||||||
#PARENT, \
|
#PARENT, \
|
||||||
#YEAR, \
|
#YEAR, \
|
||||||
COMPANY, \
|
COMPANY, \
|
||||||
|
MACHINE_CONFIG_NAME(MACHINE), \
|
||||||
|
INPUT_PORTS_NAME(INPUT), \
|
||||||
game_driver::make_driver_init(&CLASS::init_##INIT), \
|
game_driver::make_driver_init(&CLASS::init_##INIT), \
|
||||||
ROM_NAME(NAME), \
|
ROM_NAME(NAME), \
|
||||||
#COMPAT, \
|
#COMPAT, \
|
||||||
@ -189,13 +189,15 @@ extern game_driver const GAME_NAME(NAME) \
|
|||||||
|
|
||||||
// standard computer definition macro
|
// standard computer definition macro
|
||||||
#define COMP(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,CLASS,INIT,COMPANY,FULLNAME,FLAGS) \
|
#define COMP(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,CLASS,INIT,COMPANY,FULLNAME,FLAGS) \
|
||||||
GAME_DRIVER_TRAITS(NAME, FULLNAME, MACHINE, INPUT, CLASS) \
|
GAME_DRIVER_TRAITS(NAME,FULLNAME) \
|
||||||
extern game_driver const GAME_NAME(NAME) \
|
extern game_driver const GAME_NAME(NAME) \
|
||||||
{ \
|
{ \
|
||||||
GAME_DRIVER_TYPE(NAME), \
|
GAME_DRIVER_TYPE(NAME, CLASS), \
|
||||||
#PARENT, \
|
#PARENT, \
|
||||||
#YEAR, \
|
#YEAR, \
|
||||||
COMPANY, \
|
COMPANY, \
|
||||||
|
MACHINE_CONFIG_NAME(MACHINE), \
|
||||||
|
INPUT_PORTS_NAME(INPUT), \
|
||||||
game_driver::make_driver_init(&CLASS::init_##INIT), \
|
game_driver::make_driver_init(&CLASS::init_##INIT), \
|
||||||
ROM_NAME(NAME), \
|
ROM_NAME(NAME), \
|
||||||
#COMPAT, \
|
#COMPAT, \
|
||||||
@ -206,13 +208,15 @@ extern game_driver const GAME_NAME(NAME) \
|
|||||||
|
|
||||||
// standard system definition macro
|
// standard system definition macro
|
||||||
#define SYST(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,CLASS,INIT,COMPANY,FULLNAME,FLAGS) \
|
#define SYST(YEAR,NAME,PARENT,COMPAT,MACHINE,INPUT,CLASS,INIT,COMPANY,FULLNAME,FLAGS) \
|
||||||
GAME_DRIVER_TRAITS(NAME, FULLNAME, MACHINE, INPUT, CLASS) \
|
GAME_DRIVER_TRAITS(NAME,FULLNAME) \
|
||||||
extern game_driver const GAME_NAME(NAME) \
|
extern game_driver const GAME_NAME(NAME) \
|
||||||
{ \
|
{ \
|
||||||
GAME_DRIVER_TYPE(NAME), \
|
GAME_DRIVER_TYPE(NAME, CLASS), \
|
||||||
#PARENT, \
|
#PARENT, \
|
||||||
#YEAR, \
|
#YEAR, \
|
||||||
COMPANY, \
|
COMPANY, \
|
||||||
|
MACHINE_CONFIG_NAME(MACHINE), \
|
||||||
|
INPUT_PORTS_NAME(INPUT), \
|
||||||
game_driver::make_driver_init(&CLASS::init_##INIT), \
|
game_driver::make_driver_init(&CLASS::init_##INIT), \
|
||||||
ROM_NAME(NAME), \
|
ROM_NAME(NAME), \
|
||||||
#COMPAT, \
|
#COMPAT, \
|
||||||
|
Loading…
Reference in New Issue
Block a user