diff options
author | Osso <mesgnet@yahoo.it> | 2014-12-29 20:21:57 +0100 |
---|---|---|
committer | Osso <mesgnet@yahoo.it> | 2014-12-29 20:21:57 +0100 |
commit | 0bd97a7c13f357fd18791f1a7d8bcb64a65fe82b (patch) | |
tree | 66368b70204adb5d16dc6e11e677cc87b51cfc66 | |
parent | c32c95a62d797767fa9197679dee7916cb16f092 (diff) |
snes_ppu_device: removed unneeded running_machine parameter were it wasn't needed and removed some machine().first_screen() calls (nw)
-rw-r--r-- | src/emu/video/snes_ppu.c | 50 | ||||
-rw-r--r-- | src/emu/video/snes_ppu.h | 10 | ||||
-rw-r--r-- | src/mame/machine/snes.c | 8 |
3 files changed, 34 insertions, 34 deletions
diff --git a/src/emu/video/snes_ppu.c b/src/emu/video/snes_ppu.c index 900d1f07a83..6defa1b22b7 100644 --- a/src/emu/video/snes_ppu.c +++ b/src/emu/video/snes_ppu.c @@ -1810,7 +1810,7 @@ inline void snes_ppu_device::draw_blend( UINT16 offset, UINT16 *colour, UINT8 pr * the optimized averaging algorithm. *********************************************/ -void snes_ppu_device::refresh_scanline( running_machine &machine, bitmap_rgb32 &bitmap, UINT16 curline ) +void snes_ppu_device::refresh_scanline( bitmap_rgb32 &bitmap, UINT16 curline ) { UINT16 ii; int x; @@ -1818,7 +1818,7 @@ void snes_ppu_device::refresh_scanline( running_machine &machine, bitmap_rgb32 & struct SNES_SCANLINE *scanline1, *scanline2; UINT16 c; UINT16 prev_colour = 0; - int blurring = machine.root_device().ioport("OPTIONS")->read_safe(0) & 0x01; + int blurring = machine().root_device().ioport("OPTIONS")->read_safe(0) & 0x01; g_profiler.start(PROFILER_VIDEO); @@ -1866,7 +1866,7 @@ void snes_ppu_device::refresh_scanline( running_machine &machine, bitmap_rgb32 & update_obsel(); #if SNES_LAYER_DEBUG - if (dbg_video(machine, curline)) + if (dbg_video(curline)) { g_profiler.stop(); return; @@ -1978,10 +1978,10 @@ static const UINT16 vram_fgr_inccnts[4] = { 0, 32, 64, 128 }; static const UINT16 vram_fgr_shiftab[4] = { 0, 5, 6, 7 }; // utility function - latches the H/V counters. Used by IRQ, writes to WRIO, etc. -void snes_ppu_device::latch_counters( running_machine &machine ) +void snes_ppu_device::latch_counters() { - m_beam.current_horz = machine.first_screen()->hpos() / m_htmult; - m_beam.latch_vert = machine.first_screen()->vpos(); + m_beam.current_horz = m_screen->hpos() / m_htmult; + m_beam.latch_vert = m_screen->vpos(); m_beam.latch_horz = m_beam.current_horz; m_stat78 |= 0x40; // indicate we latched // m_read_ophct = m_read_opvct = 0; // clear read flags - 2009-08: I think we must clear these when STAT78 is read... @@ -1989,9 +1989,9 @@ void snes_ppu_device::latch_counters( running_machine &machine ) // printf("latched @ H %d V %d\n", m_beam.latch_horz, m_beam.latch_vert); } -void snes_ppu_device::dynamic_res_change( running_machine &machine ) +void snes_ppu_device::dynamic_res_change() { - rectangle visarea = machine.first_screen()->visible_area(); + rectangle visarea = m_screen->visible_area(); attoseconds_t refresh; visarea.min_x = visarea.min_y = 0; @@ -2008,12 +2008,12 @@ void snes_ppu_device::dynamic_res_change( running_machine &machine ) if ((m_stat78 & 0x10) == SNES_NTSC) { refresh = HZ_TO_ATTOSECONDS(DOTCLK_NTSC) * SNES_HTOTAL * SNES_VTOTAL_NTSC; - machine.first_screen()->configure(SNES_HTOTAL * 2, SNES_VTOTAL_NTSC * m_interlace, visarea, refresh); + m_screen->configure(SNES_HTOTAL * 2, SNES_VTOTAL_NTSC * m_interlace, visarea, refresh); } else { refresh = HZ_TO_ATTOSECONDS(DOTCLK_PAL) * SNES_HTOTAL * SNES_VTOTAL_PAL; - machine.first_screen()->configure(SNES_HTOTAL * 2, SNES_VTOTAL_PAL * m_interlace, visarea, refresh); + m_screen->configure(SNES_HTOTAL * 2, SNES_VTOTAL_PAL * m_interlace, visarea, refresh); } } @@ -2033,7 +2033,7 @@ void snes_ppu_device::dynamic_res_change( running_machine &machine ) when interlace is active. *************************************************/ -inline UINT32 snes_ppu_device::get_vram_address( running_machine &machine ) +inline UINT32 snes_ppu_device::get_vram_address() { UINT32 addr = m_vmadd; @@ -2308,7 +2308,7 @@ UINT8 snes_ppu_device::read(address_space &space, UINT32 offset, UINT8 wrio_bit7 return m_ppu1_open_bus; } case SLHV: /* Software latch for H/V counter */ - latch_counters(space.machine()); + latch_counters(); return m_openbus_cb(space, 0); /* Return value is meaningless */ case ROAMDATA: /* Read data from OAM (DR) */ @@ -2323,7 +2323,7 @@ UINT8 snes_ppu_device::read(address_space &space, UINT32 offset, UINT8 wrio_bit7 return m_ppu1_open_bus; case RVMDATAL: /* Read data from VRAM (low) */ { - UINT32 addr = get_vram_address(space.machine()); + UINT32 addr = get_vram_address(); m_ppu1_open_bus = m_vram_read_buffer & 0xff; if (!m_vram_fgr_high) @@ -2338,7 +2338,7 @@ UINT8 snes_ppu_device::read(address_space &space, UINT32 offset, UINT8 wrio_bit7 } case RVMDATAH: /* Read data from VRAM (high) */ { - UINT32 addr = get_vram_address(space.machine()); + UINT32 addr = get_vram_address(); m_ppu1_open_bus = (m_vram_read_buffer >> 8) & 0xff; if (m_vram_fgr_high) @@ -2469,7 +2469,7 @@ void snes_ppu_device::write(address_space &space, UINT32 offset, UINT8 data) return; case BGMODE: /* BG mode and character size settings */ m_mode = data & 0x07; - dynamic_res_change(space.machine()); + dynamic_res_change(); m_bg3_priority_bit = BIT(data, 3); m_layer[SNES_BG1].tile_size = BIT(data, 4); m_layer[SNES_BG2].tile_size = BIT(data, 5); @@ -2571,7 +2571,7 @@ void snes_ppu_device::write(address_space &space, UINT32 offset, UINT8 data) { UINT32 addr; m_vmadd = (m_vmadd & 0xff00) | (data << 0); - addr = get_vram_address(space.machine()); + addr = get_vram_address(); m_vram_read_buffer = vram_read(space, addr); m_vram_read_buffer |= (vram_read(space, addr + 1) << 8); } @@ -2580,14 +2580,14 @@ void snes_ppu_device::write(address_space &space, UINT32 offset, UINT8 data) { UINT32 addr; m_vmadd = (m_vmadd & 0x00ff) | (data << 8); - addr = get_vram_address(space.machine()); + addr = get_vram_address(); m_vram_read_buffer = vram_read(space, addr); m_vram_read_buffer |= (vram_read(space, addr + 1) << 8); } break; case VMDATAL: /* 2118: Data for VRAM write (low) */ { - UINT32 addr = get_vram_address(space.machine()); + UINT32 addr = get_vram_address(); vram_write(space, addr, data); if (!m_vram_fgr_high) @@ -2596,7 +2596,7 @@ void snes_ppu_device::write(address_space &space, UINT32 offset, UINT8 data) return; case VMDATAH: /* 2119: Data for VRAM write (high) */ { - UINT32 addr = get_vram_address(space.machine()); + UINT32 addr = get_vram_address(); vram_write(space, addr + 1, data); if (m_vram_fgr_high) @@ -2800,7 +2800,7 @@ void snes_ppu_device::write(address_space &space, UINT32 offset, UINT8 data) m_beam.last_visible_line = (data & 0x04) ? 240 : 225; m_pseudo_hires = BIT(data, 3); m_mode7.extbg = BIT(data, 6); - dynamic_res_change(space.machine()); + dynamic_res_change(); #ifdef SNES_DBG_REG_W if ((data & 0x8) != (PPU_REG(SETINI) & 0x8)) osd_printf_debug("Pseudo 512 mode: %s\n", (data & 0x8) ? "on" : "off"); @@ -2827,16 +2827,16 @@ void snes_ppu_device::write(address_space &space, UINT32 offset, UINT8 data) popmessage MSG2; \ } -UINT8 snes_ppu_device::dbg_video( running_machine &machine, UINT16 curline ) +UINT8 snes_ppu_device::dbg_video( UINT16 curline ) { int i; - UINT8 toggles = machine.root_device().ioport("DEBUG1")->read_safe(0); + UINT8 toggles = machine().root_device().ioport("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 = machine.root_device().ioport("DEBUG2")->read_safe(0); + toggles = machine().root_device().ioport("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")) @@ -2844,11 +2844,11 @@ UINT8 snes_ppu_device::dbg_video( running_machine &machine, 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 = machine.root_device().ioport("DEBUG4")->read_safe(0); + toggles = machine().root_device().ioport("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 = machine.root_device().ioport("DEBUG3")->read_safe(0); + toggles = machine().root_device().ioport("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/emu/video/snes_ppu.h b/src/emu/video/snes_ppu.h index 7b1e4eeb401..7b25c1a4417 100644 --- a/src/emu/video/snes_ppu.h +++ b/src/emu/video/snes_ppu.h @@ -248,12 +248,12 @@ public: void update_windowmasks(void); void update_offsets(void); inline void draw_blend(UINT16 offset, UINT16 *colour, UINT8 prevent_color_math, UINT8 black_pen_clip, int switch_screens); - void refresh_scanline(running_machine &machine, bitmap_rgb32 &bitmap, UINT16 curline); + void refresh_scanline(bitmap_rgb32 &bitmap, UINT16 curline); - void latch_counters(running_machine &machine); - void dynamic_res_change(running_machine &machine); - inline UINT32 get_vram_address(running_machine &machine); - UINT8 dbg_video(running_machine &machine, UINT16 curline); + void latch_counters(); + void dynamic_res_change(); + inline UINT32 get_vram_address(); + UINT8 dbg_video(UINT16 curline); UINT8 read(address_space &space, UINT32 offset, UINT8 wrio_bit7); void write(address_space &space, UINT32 offset, UINT8 data); diff --git a/src/mame/machine/snes.c b/src/mame/machine/snes.c index 40424926e79..7b9981efaaa 100644 --- a/src/mame/machine/snes.c +++ b/src/mame/machine/snes.c @@ -32,7 +32,7 @@ UINT32 snes_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, co { /* NTSC SNES draw range is 1-225. */ for (int y = cliprect.min_y; y <= cliprect.max_y; y++) - m_ppu->refresh_scanline(machine(), bitmap, y + 1); + m_ppu->refresh_scanline(bitmap, y + 1); return 0; } @@ -87,7 +87,7 @@ void snes_state::hirq_tick() { // latch the counters and pull IRQ // (don't need to switch to the 65816 context, we don't do anything dependant on it) - m_ppu->latch_counters(machine()); + m_ppu->latch_counters(); SNES_CPU_REG(TIMEUP) = 0x80; /* Indicate that irq occurred */ m_maincpu->set_input_line(G65816_LINE_IRQ, ASSERT_LINE); @@ -142,7 +142,7 @@ TIMER_CALLBACK_MEMBER(snes_state::snes_scanline_tick) { SNES_CPU_REG(TIMEUP) = 0x80; /* Indicate that irq occurred */ // IRQ latches the counters, do it now - m_ppu->latch_counters(machine()); + m_ppu->latch_counters(); m_maincpu->set_input_line(G65816_LINE_IRQ, ASSERT_LINE ); } } @@ -539,7 +539,7 @@ WRITE8_MEMBER( snes_state::snes_w_io ) if (!(SNES_CPU_REG(WRIO) & 0x80) && (data & 0x80)) { // external latch - m_ppu->latch_counters(space.machine()); + m_ppu->latch_counters(); } SNES_CPU_REG(WRIO) = data; return; |