summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/screen.h
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2019-10-09 02:19:32 +1100
committer Vas Crabb <vas@vastheman.com>2019-10-09 02:26:45 +1100
commitf43b28ed4a053e5531cfcd57e7031b8c9c6fc9d7 (patch)
treea4881b08a209a4acc7a20f0d025dacda8a5a3ddc /src/emu/screen.h
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/screen.h')
-rw-r--r--src/emu/screen.h185
1 files changed, 111 insertions, 74 deletions
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
-
@}
*/