summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2016-08-03 18:01:49 -0400
committer AJR <ajrhacker@users.noreply.github.com>2016-08-05 19:05:01 -0400
commitda754c80782425a4c63d2da0a2635ca4fbaf16a5 (patch)
tree22e55dc4ec81a097a24346d2d735ad8348315933 /src/devices/video
parent1317019974231191a0a42d732ef9b603dcd00896 (diff)
Devfind revision phase 2 (nw)
- Eliminate read_safe as a global function and make it a method of optional_ioport (and required_ioport, for which it makes less sense). - New constructor for optional_ioport_array and required_ioport_array using std::initializer_list to specify tag list - Remove pointer/reference conversion operators for required_ioport and optional_ioport. Explicit getters like found() and target() are now required when dereferencing isn't wanted. Many drivers have been changed to use required_ioport_array and optional_ioport_array to make this cleaner. - Update numerous drivers that were using read_safe to use I/O port finders generally. Port names have been kept the same as far as possible to avoid breaking saves.(Some of the optional finders should probably be required.) - Give edfbl and monkelf their own memory maps so hacky input reading routines can be removed. - Clean up some legacy static handlers in amiga.cpp and cubo.cpp.
Diffstat (limited to 'src/devices/video')
-rw-r--r--src/devices/video/snes_ppu.cpp17
-rw-r--r--src/devices/video/snes_ppu.h5
2 files changed, 16 insertions, 6 deletions
diff --git a/src/devices/video/snes_ppu.cpp b/src/devices/video/snes_ppu.cpp
index fa7c85e3f7c..603b19e1a93 100644
--- a/src/devices/video/snes_ppu.cpp
+++ b/src/devices/video/snes_ppu.cpp
@@ -203,7 +203,12 @@ const device_type SNES_PPU = &device_creator<snes_ppu_device>;
snes_ppu_device::snes_ppu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, SNES_PPU, "SNES PPU", tag, owner, clock, "snes_ppu", __FILE__),
device_video_interface(mconfig, *this),
- m_openbus_cb(*this)
+ m_openbus_cb(*this),
+ m_options(*this, ":OPTIONS"),
+ m_debug1(*this, ":DEBUG1"),
+ m_debug2(*this, ":DEBUG2"),
+ m_debug3(*this, ":DEBUG3"),
+ m_debug4(*this, ":DEBUG4")
{
}
@@ -1819,7 +1824,7 @@ void snes_ppu_device::refresh_scanline( bitmap_rgb32 &bitmap, UINT16 curline )
struct SNES_SCANLINE *scanline1, *scanline2;
UINT16 c;
UINT16 prev_colour = 0;
- int blurring = read_safe(machine().root_device().ioport("OPTIONS"), 0) & 0x01;
+ int blurring = m_options.read_safe(0) & 0x01;
g_profiler.start(PROFILER_VIDEO);
@@ -2831,13 +2836,13 @@ void snes_ppu_device::write(address_space &space, UINT32 offset, UINT8 data)
UINT8 snes_ppu_device::dbg_video( UINT16 curline )
{
int i;
- UINT8 toggles = read_safe(machine().root_device().ioport("DEBUG1"), 0);
+ UINT8 toggles = m_debug1.read_safe(0);
m_debug_options.select_pri[SNES_BG1] = (toggles & 0x03);
m_debug_options.select_pri[SNES_BG2] = (toggles & 0x0c) >> 2;
m_debug_options.select_pri[SNES_BG3] = (toggles & 0x30) >> 4;
m_debug_options.select_pri[SNES_BG4] = (toggles & 0xc0) >> 6;
- toggles = read_safe(machine().root_device().ioport("DEBUG2"), 0);
+ toggles = m_debug2.read_safe(0);
for (i = 0; i < 4; i++)
DEBUG_TOGGLE(i, m_debug_options.bg_disabled[i], ("Debug: Disabled BG%d.\n", i + 1), ("Debug: Enabled BG%d.\n", i + 1))
DEBUG_TOGGLE(4, m_debug_options.bg_disabled[SNES_OAM], ("Debug: Disabled OAM.\n"), ("Debug: Enabled OAM.\n"))
@@ -2845,11 +2850,11 @@ UINT8 snes_ppu_device::dbg_video( UINT16 curline )
DEBUG_TOGGLE(6, m_debug_options.colormath_disabled, ("Debug: Disabled Color Math.\n"), ("Debug: Enabled Color Math.\n"))
DEBUG_TOGGLE(7, m_debug_options.windows_disabled, ("Debug: Disabled Window Masks.\n"), ("Debug: Enabled Window Masks.\n"))
- toggles = read_safe(machine().root_device().ioport("DEBUG4"), 0);
+ toggles = m_debug4.read_safe(0);
for (i = 0; i < 8; i++)
DEBUG_TOGGLE(i, m_debug_options.mode_disabled[i], ("Debug: Disabled Mode %d drawing.\n", i), ("Debug: Enabled Mode %d drawing.\n", i))
- toggles = read_safe(machine().root_device().ioport("DEBUG3"), 0);
+ toggles = m_debug3.read_safe(0);
DEBUG_TOGGLE(2, m_debug_options.mosaic_disabled, ("Debug: Disabled Mosaic.\n"), ("Debug: Enabled Mosaic.\n"))
m_debug_options.sprite_reversed = BIT(toggles, 7);
m_debug_options.select_pri[SNES_OAM] = (toggles & 0x70) >> 4;
diff --git a/src/devices/video/snes_ppu.h b/src/devices/video/snes_ppu.h
index cc1f2a3311d..79bcf34f7b7 100644
--- a/src/devices/video/snes_ppu.h
+++ b/src/devices/video/snes_ppu.h
@@ -278,6 +278,11 @@ protected:
private:
devcb_read16 m_openbus_cb;
+ optional_ioport m_options;
+ optional_ioport m_debug1;
+ optional_ioport m_debug2;
+ optional_ioport m_debug3;
+ optional_ioport m_debug4;
};