summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/gamedrv.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/gamedrv.h')
-rw-r--r--src/emu/gamedrv.h162
1 files changed, 115 insertions, 47 deletions
diff --git a/src/emu/gamedrv.h b/src/emu/gamedrv.h
index b501960859a..f0168aa8b23 100644
--- a/src/emu/gamedrv.h
+++ b/src/emu/gamedrv.h
@@ -23,42 +23,78 @@
// maxima
constexpr int MAX_DRIVER_NAME_CHARS = 16;
-// flags for game drivers
-constexpr u32 ORIENTATION_MASK = 0x00000007;
-constexpr u32 MACHINE_NOT_WORKING = 0x00000008;
-constexpr u32 MACHINE_UNEMULATED_PROTECTION = 0x00000010; // game's protection not fully emulated
-constexpr u32 MACHINE_WRONG_COLORS = 0x00000020; // colors are totally wrong
-constexpr u32 MACHINE_IMPERFECT_COLORS = 0x00000040; // colors are not 100% accurate, but close
-constexpr u32 MACHINE_IMPERFECT_GRAPHICS = 0x00000080; // graphics are wrong/incomplete
-constexpr u32 MACHINE_NO_COCKTAIL = 0x00000100; // screen flip support is missing
-constexpr u32 MACHINE_NO_SOUND = 0x00000200; // sound is missing
-constexpr u32 MACHINE_IMPERFECT_SOUND = 0x00000400; // sound is known to be wrong
-constexpr u32 MACHINE_SUPPORTS_SAVE = 0x00000800; // game supports save states
-constexpr u32 MACHINE_IS_BIOS_ROOT = 0x00001000; // this driver entry is a BIOS root
-constexpr u32 MACHINE_NO_STANDALONE = 0x00002000; // this driver cannot stand alone
-constexpr u32 MACHINE_REQUIRES_ARTWORK = 0x00004000; // the driver requires external artwork for key elements of the game
-constexpr u32 MACHINE_UNOFFICIAL = 0x00008000; // unofficial hardware change
-constexpr u32 MACHINE_NO_SOUND_HW = 0x00010000; // sound hardware not available
-constexpr u32 MACHINE_MECHANICAL = 0x00020000; // contains mechanical parts (pinball, redemption games,...)
-constexpr u32 MACHINE_TYPE_ARCADE = 0x00040000; // arcade machine (coin operated machines)
-constexpr u32 MACHINE_TYPE_CONSOLE = 0x00080000; // console system
-constexpr u32 MACHINE_TYPE_COMPUTER = 0x00100000; // any kind of computer including home computers, minis, calcs,...
-constexpr u32 MACHINE_TYPE_OTHER = 0x00200000; // any other emulated system that doesn't fit above (ex. clock, satellite receiver,...)
-constexpr u32 MACHINE_IMPERFECT_KEYBOARD = 0x00400000; // keyboard is known to be wrong
-constexpr u32 MACHINE_CLICKABLE_ARTWORK = 0x00800000; // marking that artwork is clickable and require mouse cursor
-constexpr u32 MACHINE_IS_INCOMPLETE = 0x01000000; // any official game/system with blatantly incomplete HW or SW should be marked with this
-constexpr u32 MACHINE_NODEVICE_MICROPHONE = 0x02000000; // any game/system that has unemulated recording voice device peripheral
-constexpr u32 MACHINE_NODEVICE_CAMERA = 0x04000000; // any game/system that has unemulated capturing image device peripheral
-constexpr u32 MACHINE_NODEVICE_PRINTER = 0x08000000; // any game/system that has unemulated grabbing of screen content device
-constexpr u32 MACHINE_NODEVICE_LAN = 0x10000000; // any game/system that has unemulated multi-linking capability
-constexpr u32 MACHINE_NODEVICE_WAN = 0x20000000; // any game/system that has unemulated networking capability
+struct machine_flags
+{
+ enum type : u32
+ {
+ MASK_ORIENTATION = 0x00000007,
+ MASK_TYPE = 0x00000038,
+
+ FLIP_X = 0x00000001,
+ FLIP_Y = 0x00000002,
+ SWAP_XY = 0x00000004,
+ ROT0 = 0x00000000,
+ ROT90 = FLIP_X | SWAP_XY,
+ ROT180 = FLIP_X | FLIP_Y,
+ ROT270 = FLIP_Y | SWAP_XY,
+
+ TYPE_ARCADE = 0x00000008, // coin-operated machine for public use
+ TYPE_CONSOLE = 0x00000010, // console system
+ TYPE_COMPUTER = 0x00000018, // any kind of computer including home computers, minis, calculators, ...
+ TYPE_OTHER = 0x00000038, // any other emulated system (e.g. clock, satellite receiver, ...)
+
+ NOT_WORKING = 0x00000040,
+ SUPPORTS_SAVE = 0x00000080, // system supports save states
+ NO_COCKTAIL = 0x00000100, // screen flip support is missing
+ IS_BIOS_ROOT = 0x00000200, // this driver entry is a BIOS root
+ NO_STANDALONE = 0x00000400, // this driver cannot stand alone
+ REQUIRES_ARTWORK = 0x00000800, // requires external artwork for key game elements
+ CLICKABLE_ARTWORK = 0x00001000, // artwork is clickable and requires mouse cursor
+ UNOFFICIAL = 0x00002000, // unofficial hardware change
+ NO_SOUND_HW = 0x00004000, // system has no sound output
+ MECHANICAL = 0x00008000, // contains mechanical parts (pinball, redemption games, ...)
+ IS_INCOMPLETE = 0x00010000 // official system with blatantly incomplete hardware/software
+ };
+};
+
+DECLARE_ENUM_BITWISE_OPERATORS(machine_flags::type);
+
+
+// flags for machine drivers
+constexpr u64 MACHINE_TYPE_ARCADE = machine_flags::TYPE_ARCADE;
+constexpr u64 MACHINE_TYPE_CONSOLE = machine_flags::TYPE_CONSOLE;
+constexpr u64 MACHINE_TYPE_COMPUTER = machine_flags::TYPE_COMPUTER;
+constexpr u64 MACHINE_TYPE_OTHER = machine_flags::TYPE_OTHER;
+constexpr u64 MACHINE_NOT_WORKING = machine_flags::NOT_WORKING;
+constexpr u64 MACHINE_SUPPORTS_SAVE = machine_flags::SUPPORTS_SAVE;
+constexpr u64 MACHINE_NO_COCKTAIL = machine_flags::NO_COCKTAIL;
+constexpr u64 MACHINE_IS_BIOS_ROOT = machine_flags::IS_BIOS_ROOT;
+constexpr u64 MACHINE_NO_STANDALONE = machine_flags::NO_STANDALONE;
+constexpr u64 MACHINE_REQUIRES_ARTWORK = machine_flags::REQUIRES_ARTWORK;
+constexpr u64 MACHINE_CLICKABLE_ARTWORK = machine_flags::CLICKABLE_ARTWORK;
+constexpr u64 MACHINE_UNOFFICIAL = machine_flags::UNOFFICIAL;
+constexpr u64 MACHINE_NO_SOUND_HW = machine_flags::NO_SOUND_HW;
+constexpr u64 MACHINE_MECHANICAL = machine_flags::MECHANICAL;
+constexpr u64 MACHINE_IS_INCOMPLETE = machine_flags::IS_INCOMPLETE;
+
+// flags taht map to device feature flags
+constexpr u64 MACHINE_UNEMULATED_PROTECTION = 0x00000001'00000000; // game's protection not fully emulated
+constexpr u64 MACHINE_WRONG_COLORS = 0x00000002'00000000; // colors are totally wrong
+constexpr u64 MACHINE_IMPERFECT_COLORS = 0x00000004'00000000; // colors are not 100% accurate, but close
+constexpr u64 MACHINE_IMPERFECT_GRAPHICS = 0x00000008'00000000; // graphics are wrong/incomplete
+constexpr u64 MACHINE_NO_SOUND = 0x00000010'00000000; // sound is missing
+constexpr u64 MACHINE_IMPERFECT_SOUND = 0x00000020'00000000; // sound is known to be wrong
+constexpr u64 MACHINE_IMPERFECT_KEYBOARD = 0x00000040'00000000; // keyboard is known to be wrong
+constexpr u64 MACHINE_NODEVICE_MICROPHONE = 0x00000080'00000000; // any game/system that has unemulated recording voice device peripheral
+constexpr u64 MACHINE_NODEVICE_CAMERA = 0x00000100'00000000; // any game/system that has unemulated capturing image device peripheral
+constexpr u64 MACHINE_NODEVICE_PRINTER = 0x00000200'00000000; // any game/system that has unemulated grabbing of screen content device
+constexpr u64 MACHINE_NODEVICE_LAN = 0x00000400'00000000; // any game/system that has unemulated multi-linking capability
+constexpr u64 MACHINE_NODEVICE_WAN = 0x00000800'00000000; // any game/system that has unemulated networking capability
// useful combinations of flags
-constexpr u32 MACHINE_IS_SKELETON = MACHINE_NO_SOUND | MACHINE_NOT_WORKING; // mask for skelly games
-constexpr u32 MACHINE_IS_SKELETON_MECHANICAL = MACHINE_IS_SKELETON | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK; // mask for skelly mechanical games
-constexpr u32 MACHINE_FATAL_FLAGS = MACHINE_NOT_WORKING | MACHINE_UNEMULATED_PROTECTION | MACHINE_MECHANICAL; // red disclaimer
-constexpr u32 MACHINE_WARNING_FLAGS = MACHINE_WRONG_COLORS | MACHINE_IMPERFECT_COLORS | MACHINE_REQUIRES_ARTWORK | MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_KEYBOARD | MACHINE_NO_SOUND | MACHINE_NO_COCKTAIL | MACHINE_NODEVICE_MICROPHONE | MACHINE_NODEVICE_CAMERA | MACHINE_NODEVICE_PRINTER | MACHINE_NODEVICE_LAN | MACHINE_NODEVICE_WAN; // yellow disclaimer
-constexpr u32 MACHINE_BTANB_FLAGS = MACHINE_IS_INCOMPLETE | MACHINE_NO_SOUND_HW; // default disclaimer
+constexpr u64 MACHINE_IS_SKELETON = MACHINE_NO_SOUND | MACHINE_NOT_WORKING; // mask for skelly games
+constexpr u64 MACHINE_IS_SKELETON_MECHANICAL = MACHINE_IS_SKELETON | MACHINE_MECHANICAL | MACHINE_REQUIRES_ARTWORK; // mask for skelly mechanical games
+
//**************************************************************************
// TYPE DEFINITIONS
@@ -89,7 +125,32 @@ public:
void (DriverClass::*const m_method)();
};
- template <class DriverClass> static constexpr auto make_driver_init(void (DriverClass::*method)()) { return driver_init_helper_impl<DriverClass>(method); }
+ template <class DriverClass> static constexpr auto make_driver_init(void (DriverClass::*method)())
+ {
+ return driver_init_helper_impl<DriverClass>(method);
+ }
+
+ static constexpr device_t::feature_type unemulated_features(u64 flags)
+ {
+ return
+ ((flags & MACHINE_WRONG_COLORS) ? device_t::feature::PALETTE : device_t::feature::NONE) |
+ ((flags & MACHINE_NO_SOUND) ? device_t::feature::SOUND : device_t::feature::NONE) |
+ ((flags & MACHINE_NODEVICE_MICROPHONE) ? device_t::feature::MICROPHONE : device_t::feature::NONE) |
+ ((flags & MACHINE_NODEVICE_CAMERA) ? device_t::feature::CAMERA : device_t::feature::NONE) |
+ ((flags & MACHINE_NODEVICE_PRINTER) ? device_t::feature::PRINTER : device_t::feature::NONE) |
+ ((flags & MACHINE_NODEVICE_LAN) ? device_t::feature::LAN : device_t::feature::NONE) |
+ ((flags & MACHINE_NODEVICE_WAN) ? device_t::feature::WAN : device_t::feature::NONE);
+ }
+
+ static constexpr device_t::feature_type imperfect_features(u64 flags)
+ {
+ return
+ ((flags & MACHINE_UNEMULATED_PROTECTION) ? device_t::feature::PROTECTION : device_t::feature::NONE) |
+ ((flags & MACHINE_IMPERFECT_COLORS) ? device_t::feature::PALETTE : device_t::feature::NONE) |
+ ((flags & MACHINE_IMPERFECT_GRAPHICS) ? device_t::feature::GRAPHICS : device_t::feature::NONE) |
+ ((flags & MACHINE_IMPERFECT_SOUND) ? device_t::feature::SOUND : device_t::feature::NONE) |
+ ((flags & MACHINE_IMPERFECT_KEYBOARD) ? device_t::feature::KEYBOARD : device_t::feature::NONE);
+ }
device_type type; // static type info for driver class
const char * parent; // if this is a clone, the name of the parent
@@ -101,7 +162,7 @@ public:
const tiny_rom_entry * rom; // pointer to list of ROMs for the game
const char * compatible_with;
const internal_layout * default_layout; // default internally defined layout
- u32 flags; // orientation and other flags; see defines above
+ machine_flags::type flags; // orientation and other flags; see defines above
char name[MAX_DRIVER_NAME_CHARS + 1]; // short name of the game
};
@@ -127,14 +188,21 @@ namespace { \
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, CLASS) driver_device_creator<CLASS, (GAME_TRAITS_NAME(NAME)::shortname), (GAME_TRAITS_NAME(NAME)::fullname), (GAME_TRAITS_NAME(NAME)::source)>
+#define GAME_DRIVER_TYPE(NAME, CLASS, FLAGS) \
+driver_device_creator< \
+ CLASS, \
+ (GAME_TRAITS_NAME(NAME)::shortname), \
+ (GAME_TRAITS_NAME(NAME)::fullname), \
+ (GAME_TRAITS_NAME(NAME)::source), \
+ game_driver::unemulated_features(FLAGS), \
+ game_driver::imperfect_features(FLAGS)>
// standard GAME() macro
#define GAME(YEAR,NAME,PARENT,MACHINE,INPUT,CLASS,INIT,MONITOR,COMPANY,FULLNAME,FLAGS) \
GAME_DRIVER_TRAITS(NAME,FULLNAME) \
extern game_driver const GAME_NAME(NAME) \
{ \
- GAME_DRIVER_TYPE(NAME, CLASS), \
+ GAME_DRIVER_TYPE(NAME, CLASS, FLAGS), \
#PARENT, \
#YEAR, \
COMPANY, \
@@ -144,7 +212,7 @@ extern game_driver const GAME_NAME(NAME) \
ROM_NAME(NAME), \
nullptr, \
nullptr, \
- (MONITOR) | (FLAGS) | MACHINE_TYPE_ARCADE, \
+ machine_flags::type(u32((MONITOR) | (FLAGS) | MACHINE_TYPE_ARCADE)),\
#NAME \
};
@@ -153,7 +221,7 @@ extern game_driver const GAME_NAME(NAME) \
GAME_DRIVER_TRAITS(NAME,FULLNAME) \
extern game_driver const GAME_NAME(NAME) \
{ \
- GAME_DRIVER_TYPE(NAME, CLASS), \
+ GAME_DRIVER_TYPE(NAME, CLASS, FLAGS), \
#PARENT, \
#YEAR, \
COMPANY, \
@@ -163,7 +231,7 @@ extern game_driver const GAME_NAME(NAME) \
ROM_NAME(NAME), \
nullptr, \
&LAYOUT, \
- (MONITOR) | (FLAGS) | MACHINE_TYPE_ARCADE, \
+ machine_flags::type(u32((MONITOR) | (FLAGS) | MACHINE_TYPE_ARCADE)),\
#NAME \
};
@@ -173,7 +241,7 @@ extern game_driver const GAME_NAME(NAME) \
GAME_DRIVER_TRAITS(NAME,FULLNAME) \
extern game_driver const GAME_NAME(NAME) \
{ \
- GAME_DRIVER_TYPE(NAME, CLASS), \
+ GAME_DRIVER_TYPE(NAME, CLASS, FLAGS), \
#PARENT, \
#YEAR, \
COMPANY, \
@@ -183,7 +251,7 @@ extern game_driver const GAME_NAME(NAME) \
ROM_NAME(NAME), \
#COMPAT, \
nullptr, \
- ROT0 | (FLAGS) | MACHINE_TYPE_CONSOLE, \
+ machine_flags::type(u32(ROT0 | (FLAGS) | MACHINE_TYPE_CONSOLE)), \
#NAME \
};
@@ -192,7 +260,7 @@ extern game_driver const GAME_NAME(NAME) \
GAME_DRIVER_TRAITS(NAME,FULLNAME) \
extern game_driver const GAME_NAME(NAME) \
{ \
- GAME_DRIVER_TYPE(NAME, CLASS), \
+ GAME_DRIVER_TYPE(NAME, CLASS, FLAGS), \
#PARENT, \
#YEAR, \
COMPANY, \
@@ -202,7 +270,7 @@ extern game_driver const GAME_NAME(NAME) \
ROM_NAME(NAME), \
#COMPAT, \
nullptr, \
- ROT0 | (FLAGS) | MACHINE_TYPE_COMPUTER, \
+ machine_flags::type(u32(ROT0 | (FLAGS) | MACHINE_TYPE_COMPUTER)), \
#NAME \
};
@@ -211,7 +279,7 @@ extern game_driver const GAME_NAME(NAME) \
GAME_DRIVER_TRAITS(NAME,FULLNAME) \
extern game_driver const GAME_NAME(NAME) \
{ \
- GAME_DRIVER_TYPE(NAME, CLASS), \
+ GAME_DRIVER_TYPE(NAME, CLASS, FLAGS), \
#PARENT, \
#YEAR, \
COMPANY, \
@@ -221,7 +289,7 @@ extern game_driver const GAME_NAME(NAME) \
ROM_NAME(NAME), \
#COMPAT, \
nullptr, \
- ROT0 | (FLAGS) | MACHINE_TYPE_OTHER, \
+ machine_flags::type(u32(ROT0 | (FLAGS) | MACHINE_TYPE_OTHER)), \
#NAME \
};