summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu
diff options
context:
space:
mode:
authorGravatarGravatar Vas Crabb <vas@vastheman.com>2019-10-09 02:19:32 +1100
committerGravatarGravatar Vas Crabb <vas@vastheman.com>2019-10-09 02:26:45 +1100
commitf43b28ed4a053e5531cfcd57e7031b8c9c6fc9d7 (patch)
treea4881b08a209a4acc7a20f0d025dacda8a5a3ddc /src/emu
parenta110c8923cfdc448d5c1659bfa19855dd335cc46 (diff)
(nw) misc stuff:
* screen: validate crystal values used for set_raw * driver: get rid of sound start/reset overrides in machine configuration * vrender0.cpp, nexus3d.cpp: corrected pixel clock crystal value * mw8080bw.cpp: turned several audio subsystems into devices * bus/sat_ctrl: don't start subdevices in device_start - the machine does it for you * mb14241.cpp: simplify handlers * fgoal.cpp: updated for simplified handlers * devfind, screen: repair some doxy comments that had rotted with refactoring * doxygen: disable warnings for undocumented things - it's most of our codebase * snowbros.cpp: restore an output level setting lost in MCFG removal There's an outstanding validation error from the HP98543 DIO video card not using a valid crystal value. Someone needs to find a picture of the card and confirm or deny the existence of the 39.504MHz crystal. The various start/reset overrides are bugs waiting to happen. It's not immediately obvious that the ones run earlier can end up being called multiple times if subsequent ones throw missing dependencies exceptions. They're a relic of when everything from the old C-style drivers was thrown into classes all jumbled together.
Diffstat (limited to 'src/emu')
-rw-r--r--src/emu/devfind.h16
-rw-r--r--src/emu/driver.cpp10
-rw-r--r--src/emu/driver.h18
-rw-r--r--src/emu/screen.h185
4 files changed, 121 insertions, 108 deletions
diff --git a/src/emu/devfind.h b/src/emu/devfind.h
index 2428e1a7325..2f90c48f370 100644
--- a/src/emu/devfind.h
+++ b/src/emu/devfind.h
@@ -100,8 +100,8 @@ public:
/// int argument.
/// \param [in] start Number to add to element index when
/// calculating values for string format argument.
- /// \arg [in] Optional additional constructor argument(s) passed to
- /// all elements.
+ /// \param [in] arg Optional additional constructor argument(s) passed
+ /// to all elements.
/// \sa util::string_format
template <typename F, typename... Param>
object_array_finder(device_t &base, F const &fmt, unsigned start, Param const &... arg)
@@ -117,8 +117,8 @@ public:
/// \param [in] tags Tags to search for, e.g. { "player", "dips" }.
/// The tags are not copied, it is the caller's responsibility to
/// ensure the pointers remain valid until resolution time.
- /// \arg [in] Optional additional constructor argument(s) passed to
- /// all elements.
+ /// \param [in] arg Optional additional constructor argument(s) passed
+ /// to all elements.
template <typename... Param>
object_array_finder(device_t &base, std::array<char const *, Count> const &tags, Param const &... arg)
: object_array_finder(base, tags, std::make_integer_sequence<unsigned, Count>(), arg...)
@@ -368,9 +368,9 @@ protected:
/// with the requested tag is found, but it doesn't match the
/// desired width.
/// \param [in] width Desired memory share width in bits.
- /// \param [out] bytes Set to memoyr share length in bytes if a
+ /// \param [out] bytes Set to memory share length in bytes if a
/// matching memory share is found, otherwise left unchanged.
- /// \param [in] required. Whether warning message should be printed
+ /// \param [in] required Whether warning message should be printed
/// if a memory share with matching tag of incorrect width is
/// found.
/// \return Pointer to base of memory share if a matching memory
@@ -387,7 +387,7 @@ protected:
/// or a space with the designated number.
/// \param [in] spacenum Address space number.
/// \param [in] width Specific data width, or 0.
- /// \param [in] required. Whether warning message should be printed
+ /// \param [in] required Whether warning message should be printed
/// if a device with no memory interface or space of that number
/// is found.
/// \return Pointer to address space if a matching address space
@@ -400,7 +400,7 @@ protected:
/// found, or false otherwise.
/// \param [in] spacenum Address space number.
/// \param [in] width Specific data width, or 0.
- /// \param [in] required. Whether warning message should be printed
+ /// \param [in] required Whether warning message should be printed
/// if a device with no memory interface or space of that number
/// is found.
/// \return True if the space is optional, or if the space is
diff --git a/src/emu/driver.cpp b/src/emu/driver.cpp
index 8dde7622da6..d13a4899136 100644
--- a/src/emu/driver.cpp
+++ b/src/emu/driver.cpp
@@ -236,10 +236,7 @@ void driver_device::device_start()
else
machine_start();
- if (!m_callbacks[CB_SOUND_START].isnull())
- m_callbacks[CB_SOUND_START]();
- else
- sound_start();
+ sound_start();
if (!m_callbacks[CB_VIDEO_START].isnull())
m_callbacks[CB_VIDEO_START]();
@@ -268,10 +265,7 @@ void driver_device::device_reset_after_children()
else
machine_reset();
- if (!m_callbacks[CB_SOUND_RESET].isnull())
- m_callbacks[CB_SOUND_RESET]();
- else
- sound_reset();
+ sound_reset();
if (!m_callbacks[CB_VIDEO_RESET].isnull())
m_callbacks[CB_VIDEO_RESET]();
diff --git a/src/emu/driver.h b/src/emu/driver.h
index 4f6576aa737..0a92151d07c 100644
--- a/src/emu/driver.h
+++ b/src/emu/driver.h
@@ -32,13 +32,6 @@
#define MCFG_MACHINE_RESET_REMOVE() \
driver_device::static_set_callback(config.root_device(), driver_device::CB_MACHINE_RESET, driver_callback_delegate());
-// core sound callbacks
-#define MCFG_SOUND_START_OVERRIDE(_class, _func) \
- driver_device::static_set_callback(config.root_device(), driver_device::CB_SOUND_START, driver_callback_delegate(&_class::SOUND_START_NAME(_func), this));
-
-#define MCFG_SOUND_RESET_OVERRIDE(_class, _func) \
- driver_device::static_set_callback(config.root_device(), driver_device::CB_SOUND_RESET, driver_callback_delegate(&_class::SOUND_RESET_NAME(_func), this));
-
// core video callbacks
#define MCFG_VIDEO_START_OVERRIDE(_class, _func) \
@@ -63,15 +56,6 @@
#define DECLARE_MACHINE_RESET(name) void MACHINE_RESET_NAME(name)()
#define MACHINE_RESET_MEMBER(cls,name) void cls::MACHINE_RESET_NAME(name)()
-#define SOUND_START_NAME(name) sound_start_##name
-#define DECLARE_SOUND_START(name) void SOUND_START_NAME(name)() ATTR_COLD
-#define SOUND_START_MEMBER(cls,name) void cls::SOUND_START_NAME(name)()
-
-#define SOUND_RESET_NAME(name) sound_reset_##name
-#define SOUND_RESET_CALL_MEMBER(name) SOUND_RESET_NAME(name)()
-#define DECLARE_SOUND_RESET(name) void SOUND_RESET_NAME(name)()
-#define SOUND_RESET_MEMBER(cls,name) void cls::SOUND_RESET_NAME(name)()
-
#define VIDEO_START_NAME(name) video_start_##name
#define VIDEO_START_CALL_MEMBER(name) VIDEO_START_NAME(name)()
#define DECLARE_VIDEO_START(name) void VIDEO_START_NAME(name)() ATTR_COLD
@@ -110,8 +94,6 @@ public:
{
CB_MACHINE_START,
CB_MACHINE_RESET,
- CB_SOUND_START,
- CB_SOUND_RESET,
CB_VIDEO_START,
CB_VIDEO_RESET,
CB_COUNT
diff --git a/src/emu/screen.h b/src/emu/screen.h
index 0ae11f85b9b..87eed6a2738 100644
--- a/src/emu/screen.h
+++ b/src/emu/screen.h
@@ -207,7 +207,24 @@ public:
void set_orientation(int orientation) { assert(!configured()); m_orientation = orientation; }
void set_physical_aspect(unsigned x, unsigned y) { assert(!configured()); m_phys_aspect = std::make_pair(x, y); }
void set_native_aspect() { assert(!configured()); m_phys_aspect = std::make_pair(~0U, ~0U); }
- void set_raw(u32 pixclock, u16 htotal, u16 hbend, u16 hbstart, u16 vtotal, u16 vbend, u16 vbstart)
+
+ /// \brief Configure screen parameters
+ ///
+ /// \param [in] pixclock Pixel clock frequency in Hertz.
+ /// \param [in] htotal Total pixel clocks per line, including
+ /// horizontal blanking period.
+ /// \param [in] hbend Index of first visible pixel after horizontal
+ /// blanking period ends.
+ /// \param [in] hbstart Index of first pixel in horzontal blanking
+ /// period after visible pixels.
+ /// \param [in] vtotal Total lines per frame, including vertical
+ /// blanking period.
+ /// \param [in] vbend Index of first visible line after vertical
+ /// blanking period ends.
+ /// \param [in] vbstart Index of first line in vertical blanking
+ /// period after visible lines.
+ /// \return Reference to device for method chaining.
+ screen_device &set_raw(u32 pixclock, u16 htotal, u16 hbend, u16 hbstart, u16 vtotal, u16 vbend, u16 vbstart)
{
assert(pixclock != 0);
m_clock = pixclock;
@@ -216,15 +233,101 @@ public:
m_width = htotal;
m_height = vtotal;
m_visarea.set(hbend, hbstart - 1, vbend, vbstart - 1);
+ return *this;
+ }
+ screen_device &set_raw(const XTAL &xtal, u16 htotal, u16 hbend, u16 hbstart, u16 vtotal, u16 vbend, u16 vbstart)
+ {
+ xtal.validate(std::string("Configuring screen ") + tag());
+ return set_raw(xtal.value(), htotal, hbend, hbstart, vtotal, vbend, vbstart);
}
- void set_raw(const XTAL &xtal, u16 htotal, u16 hbend, u16 hbstart, u16 vtotal, u16 vbend, u16 vbstart) { set_raw(xtal.value(), htotal, hbend, hbstart, vtotal, vbend, vbstart); }
void set_refresh(attoseconds_t rate) { m_refresh = rate; }
- template <typename T> void set_refresh_hz(T &&hz) { set_refresh(HZ_TO_ATTOSECONDS(std::forward<T>(hz))); }
- void set_vblank_time(attoseconds_t time) { m_vblank = time; m_oldstyle_vblank_supplied = true; }
- void set_size(u16 width, u16 height) { m_width = width; m_height = height; }
- void set_visarea(s16 minx, s16 maxx, s16 miny, s16 maxy) { m_visarea.set(minx, maxx, miny, maxy); }
- void set_visarea_full() { m_visarea.set(0, m_width - 1, 0, m_height - 1); } // call after set_size
- void set_default_position(double xscale, double xoffs, double yscale, double yoffs) {
+
+ /// \brief Set refresh rate in Hertz
+ ///
+ /// Sets refresh rate in Hertz (frames per second). Used in
+ /// conjunction with #set_vblank_time, #set_size and #set_visarea.
+ /// For raster displays, please use #set_raw to configure screen
+ /// parameters in terms of pixel clock.
+ /// \param [in] hz Desired refresh rate.
+ /// \return Reference to device for method chaining.
+ template <typename T> screen_device &set_refresh_hz(T &&hz)
+ {
+ set_refresh(HZ_TO_ATTOSECONDS(std::forward<T>(hz)));
+ return *this;
+ }
+
+ /// \brief Set vertical blanking interval time
+ ///
+ /// Sets vertical blanking interval period. Used in conjunction
+ /// with #set_refresh_hz, #set_size and #set_visarea. For raster
+ /// displays, please use #set_raw to configure screen parameters in
+ /// terms of pixel clock.
+ /// \param [in] time Length of vertical blanking interval.
+ /// \return Reference to device for method chaining.
+ screen_device &set_vblank_time(attoseconds_t time)
+ {
+ m_vblank = time;
+ m_oldstyle_vblank_supplied = true;
+ return *this;
+ }
+
+ /// \brief Set total screen size
+ ///
+ /// Set the total screen size in pixels, including blanking areas if
+ /// applicable. This sets the size of the screen bitmap. Used in
+ /// conjunction with #set_refresh_hz, #set_vblank_time and
+ /// #set_visarea. For raster displays, please use #set_raw to
+ /// configure screen parameters in terms of pixel clock.
+ /// \param [in] width Total width in pixels, including horizontal
+ /// blanking period if applicable.
+ /// \param [in] height Total height in lines, including vertical
+ /// blanking period if applicable.
+ /// \return Reference to device for method chaining.
+ screen_device &set_size(u16 width, u16 height)
+ {
+ m_width = width;
+ m_height = height;
+ return *this;
+ }
+
+ /// \brief Set visible screen area
+ ///
+ /// Set visible screen area. This should fit within the total
+ /// screen area. Used in conjunction with #set_refresh_hz,
+ /// #set_vblank_time and #set_size. For raster displays, please
+ /// use #set_raw to configure screen parameters in terms of pixel
+ /// clock.
+ /// \param [in] minx First visible pixel index after horizontal
+ /// blanking period ends.
+ /// \param [in] maxx Last visible pixel index before horizontal
+ /// blanking period starts.
+ /// \param [in] miny First visible line index after vertical
+ /// blanking period ends.
+ /// \param [in] maxy Last visible line index before vertical
+ /// blanking period starts.
+ /// \return Reference to device for method chaining.
+ screen_device &set_visarea(s16 minx, s16 maxx, s16 miny, s16 maxy)
+ {
+ m_visarea.set(minx, maxx, miny, maxy);
+ return *this;
+ }
+
+ /// \brief Set visible area to full area
+ ///
+ /// Set visible screen area to the full screen area (i.e. noi
+ /// horizontal or vertical blanking period). This is generally not
+ /// possible for raster displays, but is useful for other display
+ /// simulations. Must be called after calling #set_size.
+ /// \return Reference to device for method chaining.
+ /// \sa set_visarea
+ screen_device &set_visarea_full()
+ {
+ m_visarea.set(0, m_width - 1, 0, m_height - 1);
+ return *this;
+ }
+
+ void set_default_position(double xscale, double xoffs, double yscale, double yoffs)
+ {
m_xscale = xscale;
m_xoffset = xoffs;
m_yscale = yscale;
@@ -445,72 +548,6 @@ typedef device_type_iterator<screen_device> screen_device_iterator;
@def set_type
Modify the screen device type
@see screen_type_enum
-
- @def set_raw
- Configures screen parameters for the given screen.
- @remark It's better than using @see set_refresh_hz and @see set_vblank_time but still not enough.
-
- @param _pixclock
- Pixel Clock frequency value
-
- @param _htotal
- Total number of horizontal pixels, including hblank period.
-
- @param _hbend
- Horizontal pixel position for HBlank end event, also first pixel where screen rectangle is visible.
-
- @param _hbstart
- Horizontal pixel position for HBlank start event, also last pixel where screen rectangle is visible.
-
- @param _vtotal
- Total number of vertical pixels, including vblank period.
-
- @param _vbend
- Vertical pixel position for VBlank end event, also first pixel where screen rectangle is visible.
-
- @param _vbstart
- Vertical pixel position for VBlank start event, also last pixel where screen rectangle is visible.
-
- @def set_refresh_hz
- Sets the number of Frames Per Second for this screen
- @remarks Please use @see set_raw instead. Gives imprecise timings.
-
- @param _rate
- FPS number
-
- @def set_vblank_time
- Sets the vblank time of the given screen
- @remarks Please use @see MCFG_SCREEN_RAW_PARAMS instead. Gives imprecise timings.
-
- @param _time
- Time parameter, in attotime value
-
- @def set_size
- Sets total screen size, including H/V-Blanks
- @remarks Please use @see set_raw instead. Gives imprecise timings.
-
- @param _width
- Screen horizontal size
-
- @param _height
- Screen vertical size
-
- @def set_visarea
- Sets screen visible area
- @remarks Please use @see set_raw instead. Gives imprecise timings.
-
- @param _minx
- Screen left border
-
- @param _maxx
- Screen right border, must be in N-1 format
-
- @param _miny
- Screen top border
-
- @param _maxx
- Screen bottom border, must be in N-1 format
-
@}
*/