diff options
author | 2017-05-22 18:55:02 +1000 | |
---|---|---|
committer | 2017-05-22 18:55:02 +1000 | |
commit | fa80bef249997659ae4341463fdb85f2a43b230a (patch) | |
tree | ec99a8c51a65e241649c86a30221af0c1d4c5a15 /src/emu/gamedrv.h | |
parent | f7180a9504fa1ac39cb6c5f2af45f56c70a5bd77 (diff) |
well, that causes mpu4 to take way too much memory to compile, the changes to device instantiation still apply (nw)
Diffstat (limited to 'src/emu/gamedrv.h')
-rw-r--r-- | src/emu/gamedrv.h | 48 |
1 files changed, 26 insertions, 22 deletions
diff --git a/src/emu/gamedrv.h b/src/emu/gamedrv.h index 41009260801..b501960859a 100644 --- a/src/emu/gamedrv.h +++ b/src/emu/gamedrv.h @@ -95,6 +95,8 @@ public: const char * parent; // if this is a clone, the name of the parent const char * year; // year the game was released 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 const tiny_rom_entry * rom; // pointer to list of ROMs for the game const char * compatible_with; @@ -116,34 +118,28 @@ public: // wrappers for declaring and defining game drivers #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) // static game traits -#define GAME_DRIVER_TRAITS(NAME, FULLNAME, MACHINE, INPUT, CLASS) \ +#define GAME_DRIVER_TRAITS(NAME, FULLNAME) \ namespace { \ - class GAME_TRAITS_NAME(NAME) : public CLASS \ - { \ - 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); } \ - }; \ + struct GAME_TRAITS_NAME(NAME) { static constexpr char const shortname[] = #NAME, fullname[] = FULLNAME, source[] = __FILE__; }; \ 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 #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) \ { \ - GAME_DRIVER_TYPE(NAME), \ + GAME_DRIVER_TYPE(NAME, CLASS), \ #PARENT, \ #YEAR, \ COMPANY, \ + MACHINE_CONFIG_NAME(MACHINE), \ + INPUT_PORTS_NAME(INPUT), \ game_driver::make_driver_init(&CLASS::init_##INIT), \ ROM_NAME(NAME), \ nullptr, \ @@ -154,13 +150,15 @@ extern game_driver const GAME_NAME(NAME) \ // standard macro with additional 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) \ { \ - GAME_DRIVER_TYPE(NAME), \ + GAME_DRIVER_TYPE(NAME, CLASS), \ #PARENT, \ #YEAR, \ COMPANY, \ + MACHINE_CONFIG_NAME(MACHINE), \ + INPUT_PORTS_NAME(INPUT), \ game_driver::make_driver_init(&CLASS::init_##INIT), \ ROM_NAME(NAME), \ nullptr, \ @@ -172,13 +170,15 @@ extern game_driver const GAME_NAME(NAME) \ // standard console definition macro #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) \ { \ - GAME_DRIVER_TYPE(NAME), \ + GAME_DRIVER_TYPE(NAME, CLASS), \ #PARENT, \ #YEAR, \ COMPANY, \ + MACHINE_CONFIG_NAME(MACHINE), \ + INPUT_PORTS_NAME(INPUT), \ game_driver::make_driver_init(&CLASS::init_##INIT), \ ROM_NAME(NAME), \ #COMPAT, \ @@ -189,13 +189,15 @@ extern game_driver const GAME_NAME(NAME) \ // standard computer definition macro #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) \ { \ - GAME_DRIVER_TYPE(NAME), \ + GAME_DRIVER_TYPE(NAME, CLASS), \ #PARENT, \ #YEAR, \ COMPANY, \ + MACHINE_CONFIG_NAME(MACHINE), \ + INPUT_PORTS_NAME(INPUT), \ game_driver::make_driver_init(&CLASS::init_##INIT), \ ROM_NAME(NAME), \ #COMPAT, \ @@ -206,13 +208,15 @@ extern game_driver const GAME_NAME(NAME) \ // standard system definition macro #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) \ { \ - GAME_DRIVER_TYPE(NAME), \ + GAME_DRIVER_TYPE(NAME, CLASS), \ #PARENT, \ #YEAR, \ COMPANY, \ + MACHINE_CONFIG_NAME(MACHINE), \ + INPUT_PORTS_NAME(INPUT), \ game_driver::make_driver_init(&CLASS::init_##INIT), \ ROM_NAME(NAME), \ #COMPAT, \ |