summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/video.h
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-08-26 15:21:19 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-08-26 15:21:19 +0000
commit47dd9fe5680add9e438e75d71ce476b082382fdf (patch)
tree55f9ab6e9fe1351cbff6992924197ed9a6a33e26 /src/emu/video.h
parent33e4664bb21d437c5b8fee3c470b00084d0d9d8a (diff)
De-converted MACHINE_DRIVER from tokens back to constructor functions, regaining
type safety. If legacy devices still use inline data, those types are not checked. However, new devices no longer have access to the generic m_inline_data. Instead their MDRV_* macros should map to calls to static functions in the device config class which downcast a generic device_config to the specific device config, and then set the appropriate values. This is not to be done inline in order to prevent further code bloat in the constructors. See eeprom/7474/i2cmem/okim6295 for examples. #ifdef'ed several unused machine driver definitions that weren't referenced.
Diffstat (limited to 'src/emu/video.h')
-rw-r--r--src/emu/video.h64
1 files changed, 19 insertions, 45 deletions
diff --git a/src/emu/video.h b/src/emu/video.h
index b05c96d1e41..76a3ea92967 100644
--- a/src/emu/video.h
+++ b/src/emu/video.h
@@ -108,32 +108,21 @@ public:
float xscale() const { return m_xscale; }
float yscale() const { return m_yscale; }
- // indexes to inline data
- enum
- {
- INLINE_TYPE,
- INLINE_FORMAT,
- INLINE_REFRESH,
- INLINE_VBLANK,
- INLINE_WIDTH,
- INLINE_HEIGHT,
- INLINE_VIS_MINX,
- INLINE_VIS_MAXX,
- INLINE_VIS_MINY,
- INLINE_VIS_MAXY,
- INLINE_XOFFSET,
- INLINE_XSCALE,
- INLINE_YOFFSET,
- INLINE_YSCALE,
- INLINE_OLDVBLANK
- };
+ // inline configuration helpers
+ static void static_set_format(device_config *device, bitmap_format format);
+ static void static_set_type(device_config *device, screen_type_enum type);
+ static void static_set_raw(device_config *device, UINT32 pixclock, UINT16 htotal, UINT16 hbend, UINT16 hbstart, UINT16 vtotal, UINT16 vbend, UINT16 vbstart);
+ static void static_set_refresh(device_config *device, attoseconds_t rate);
+ static void static_set_vblank_time(device_config *device, attoseconds_t time);
+ static void static_set_size(device_config *device, UINT16 width, UINT16 height);
+ static void static_set_visarea(device_config *device, INT16 minx, INT16 maxx, INT16 miny, INT16 maxy);
+ static void static_set_default_position(device_config *device, double xscale, double xoffs, double yscale, double yoffs);
private:
// device_config overrides
- virtual void device_config_complete();
virtual bool device_validity_check(const game_driver &driver) const;
- // configuration data
+ // inline configuration data
screen_type_enum m_type; // type of screen
int m_width, m_height; // default total width/height (HTOTAL, VTOTAL)
rectangle m_visarea; // default visible area (HBLANK end/start, VBLANK end/start)
@@ -279,49 +268,34 @@ extern const device_type SCREEN;
#define MDRV_SCREEN_ADD(_tag, _type) \
MDRV_DEVICE_ADD(_tag, SCREEN, 0) \
- MDRV_SCREEN_TYPE(_type)
+ MDRV_SCREEN_TYPE(_type) \
#define MDRV_SCREEN_MODIFY(_tag) \
MDRV_DEVICE_MODIFY(_tag)
#define MDRV_SCREEN_FORMAT(_format) \
- MDRV_DEVICE_INLINE_DATA16(screen_device_config::INLINE_FORMAT, _format)
+ screen_device_config::static_set_format(device, _format); \
#define MDRV_SCREEN_TYPE(_type) \
- MDRV_DEVICE_INLINE_DATA16(screen_device_config::INLINE_TYPE, SCREEN_TYPE_##_type)
+ screen_device_config::static_set_type(device, SCREEN_TYPE_##_type); \
#define MDRV_SCREEN_RAW_PARAMS(_pixclock, _htotal, _hbend, _hbstart, _vtotal, _vbend, _vbstart) \
- MDRV_DEVICE_INLINE_DATA64(screen_device_config::INLINE_REFRESH, HZ_TO_ATTOSECONDS(_pixclock) * (_htotal) * (_vtotal)) \
- MDRV_DEVICE_INLINE_DATA64(screen_device_config::INLINE_VBLANK, ((HZ_TO_ATTOSECONDS(_pixclock) * (_htotal) * (_vtotal)) / (_vtotal)) * ((_vtotal) - ((_vbstart) - (_vbend)))) \
- MDRV_DEVICE_INLINE_DATA16(screen_device_config::INLINE_WIDTH, _htotal) \
- MDRV_DEVICE_INLINE_DATA16(screen_device_config::INLINE_HEIGHT, _vtotal) \
- MDRV_DEVICE_INLINE_DATA16(screen_device_config::INLINE_VIS_MINX, _hbend) \
- MDRV_DEVICE_INLINE_DATA16(screen_device_config::INLINE_VIS_MAXX, (_hbstart) - 1) \
- MDRV_DEVICE_INLINE_DATA16(screen_device_config::INLINE_VIS_MINY, _vbend) \
- MDRV_DEVICE_INLINE_DATA16(screen_device_config::INLINE_VIS_MAXY, (_vbstart) - 1)
+ screen_device_config::static_set_raw(device, _pixclock, _htotal, _hbend, _hbstart, _vtotal, _vbend, _vbstart);
#define MDRV_SCREEN_REFRESH_RATE(_rate) \
- MDRV_DEVICE_INLINE_DATA64(screen_device_config::INLINE_REFRESH, HZ_TO_ATTOSECONDS(_rate))
+ screen_device_config::static_set_refresh(device, HZ_TO_ATTOSECONDS(_rate)); \
#define MDRV_SCREEN_VBLANK_TIME(_time) \
- MDRV_DEVICE_INLINE_DATA64(screen_device_config::INLINE_VBLANK, _time) \
- MDRV_DEVICE_INLINE_DATA16(screen_device_config::INLINE_OLDVBLANK, true)
+ screen_device_config::static_set_vblank_time(device, _time); \
#define MDRV_SCREEN_SIZE(_width, _height) \
- MDRV_DEVICE_INLINE_DATA16(screen_device_config::INLINE_WIDTH, _width) \
- MDRV_DEVICE_INLINE_DATA16(screen_device_config::INLINE_HEIGHT, _height)
+ screen_device_config::static_set_size(device, _width, _height); \
#define MDRV_SCREEN_VISIBLE_AREA(_minx, _maxx, _miny, _maxy) \
- MDRV_DEVICE_INLINE_DATA16(screen_device_config::INLINE_VIS_MINX, _minx) \
- MDRV_DEVICE_INLINE_DATA16(screen_device_config::INLINE_VIS_MAXX, _maxx) \
- MDRV_DEVICE_INLINE_DATA16(screen_device_config::INLINE_VIS_MINY, _miny) \
- MDRV_DEVICE_INLINE_DATA16(screen_device_config::INLINE_VIS_MAXY, _maxy)
+ screen_device_config::static_set_visarea(device, _minx, _maxx, _miny, _maxy); \
#define MDRV_SCREEN_DEFAULT_POSITION(_xscale, _xoffs, _yscale, _yoffs) \
- MDRV_DEVICE_INLINE_DATA32(screen_device_config::INLINE_XOFFSET, (INT32)((_xoffs) * (double)(1 << 24))) \
- MDRV_DEVICE_INLINE_DATA32(screen_device_config::INLINE_XSCALE, (INT32)((_xscale) * (double)(1 << 24))) \
- MDRV_DEVICE_INLINE_DATA32(screen_device_config::INLINE_YOFFSET, (INT32)((_yoffs) * (double)(1 << 24))) \
- MDRV_DEVICE_INLINE_DATA32(screen_device_config::INLINE_YSCALE, (INT32)((_yscale) * (double)(1 << 24)))
+ screen_device_config::static_set_default_position(device, _xscale, _xoffs, _yscale, _yoffs); \