diff options
Diffstat (limited to 'src/mame/video/snes.c')
-rw-r--r-- | src/mame/video/snes.c | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/src/mame/video/snes.c b/src/mame/video/snes.c index a4a4cee305c..10bce015d9d 100644 --- a/src/mame/video/snes.c +++ b/src/mame/video/snes.c @@ -96,7 +96,7 @@ struct DEBUGOPTS static struct DEBUGOPTS debug_options; /* red green blue purple yellow cyan grey white */ static const UINT16 dbg_mode_colours[8] = { 0x1f, 0x3e0, 0x7c00, 0x7c1f, 0x3ff, 0x7fe0, 0x4210, 0x7fff }; -static UINT8 snes_dbg_video(running_machine *machine, UINT16 curline); +static UINT8 snes_dbg_video(running_machine &machine, UINT16 curline); #endif /* SNES_LAYER_DEBUG */ static const UINT16 table_obj_offset[8][8] = @@ -1498,7 +1498,7 @@ INLINE void snes_draw_blend( UINT16 offset, UINT16 *colour, UINT8 prevent_color_ * the optimized averaging algorithm. *********************************************/ -static void snes_refresh_scanline( running_machine *machine, bitmap_t *bitmap, UINT16 curline ) +static void snes_refresh_scanline( running_machine &machine, bitmap_t *bitmap, UINT16 curline ) { UINT16 ii; int x; @@ -1796,7 +1796,7 @@ SCREEN_UPDATE( snes ) /*NTSC SNES draw range is 1-225. */ for (y = cliprect->min_y; y <= cliprect->max_y; y++) { - snes_refresh_scanline(screen->machine, bitmap, y + 1); + snes_refresh_scanline(screen->machine(), bitmap, y + 1); } return 0; } @@ -1810,12 +1810,12 @@ 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_latch_counters( running_machine *machine ) +void snes_latch_counters( running_machine &machine ) { - snes_state *state = machine->driver_data<snes_state>(); + snes_state *state = machine.driver_data<snes_state>(); - snes_ppu.beam.current_horz = machine->primary_screen->hpos() / state->htmult; - snes_ppu.beam.latch_vert = machine->primary_screen->vpos(); + snes_ppu.beam.current_horz = machine.primary_screen->hpos() / state->htmult; + snes_ppu.beam.latch_vert = machine.primary_screen->vpos(); snes_ppu.beam.latch_horz = snes_ppu.beam.current_horz; snes_ram[STAT78] |= 0x40; // indicate we latched // state->read_ophct = state->read_opvct = 0; // clear read flags - 2009-08: I think we must clear these when STAT78 is read... @@ -1823,10 +1823,10 @@ void snes_latch_counters( running_machine *machine ) // printf("latched @ H %d V %d\n", snes_ppu.beam.latch_horz, snes_ppu.beam.latch_vert); } -static void snes_dynamic_res_change( running_machine *machine ) +static void snes_dynamic_res_change( running_machine &machine ) { - snes_state *state = machine->driver_data<snes_state>(); - rectangle visarea = machine->primary_screen->visible_area(); + snes_state *state = machine.driver_data<snes_state>(); + rectangle visarea = machine.primary_screen->visible_area(); attoseconds_t refresh; visarea.min_x = visarea.min_y = 0; @@ -1846,9 +1846,9 @@ static void snes_dynamic_res_change( running_machine *machine ) refresh = HZ_TO_ATTOSECONDS(DOTCLK_PAL) * SNES_HTOTAL * SNES_VTOTAL_PAL; if ((snes_ram[STAT78] & 0x10) == SNES_NTSC) - machine->primary_screen->configure(SNES_HTOTAL * 2, SNES_VTOTAL_NTSC * snes_ppu.interlace, visarea, refresh); + machine.primary_screen->configure(SNES_HTOTAL * 2, SNES_VTOTAL_NTSC * snes_ppu.interlace, visarea, refresh); else - machine->primary_screen->configure(SNES_HTOTAL * 2, SNES_VTOTAL_PAL * snes_ppu.interlace, visarea, refresh); + machine.primary_screen->configure(SNES_HTOTAL * 2, SNES_VTOTAL_PAL * snes_ppu.interlace, visarea, refresh); } /************************************************* @@ -1867,9 +1867,9 @@ static void snes_dynamic_res_change( running_machine *machine ) when interlace is active. *************************************************/ -INLINE UINT32 snes_get_vram_address( running_machine *machine ) +INLINE UINT32 snes_get_vram_address( running_machine &machine ) { - snes_state *state = machine->driver_data<snes_state>(); + snes_state *state = machine.driver_data<snes_state>(); UINT32 addr = state->vmadd; if (state->vram_fgr_count) @@ -1891,8 +1891,8 @@ static READ8_HANDLER( snes_vram_read ) res = snes_vram[offset]; else { - UINT16 v = space->machine->primary_screen->vpos(); - UINT16 h = space->machine->primary_screen->hpos(); + UINT16 v = space->machine().primary_screen->vpos(); + UINT16 h = space->machine().primary_screen->hpos(); UINT16 ls = (((snes_ram[STAT78] & 0x10) == SNES_NTSC ? 525 : 625) >> 1) - 1; if (snes_ppu.interlace == 2) @@ -1923,8 +1923,8 @@ static WRITE8_HANDLER( snes_vram_write ) snes_vram[offset] = data; else { - UINT16 v = space->machine->primary_screen->vpos(); - UINT16 h = space->machine->primary_screen->hpos(); + UINT16 v = space->machine().primary_screen->vpos(); + UINT16 h = space->machine().primary_screen->hpos(); if (v == 0) { if (h <= 4) @@ -1986,7 +1986,7 @@ static READ8_HANDLER( snes_oam_read ) if (!snes_ppu.screen_disabled) { - UINT16 v = space->machine->primary_screen->vpos(); + UINT16 v = space->machine().primary_screen->vpos(); if (v < snes_ppu.beam.last_visible_line) offset = 0x010c; @@ -2004,7 +2004,7 @@ static WRITE8_HANDLER( snes_oam_write ) if (!snes_ppu.screen_disabled) { - UINT16 v = space->machine->primary_screen->vpos(); + UINT16 v = space->machine().primary_screen->vpos(); if (v < snes_ppu.beam.last_visible_line) offset = 0x010c; @@ -2045,8 +2045,8 @@ static READ8_HANDLER( snes_cgram_read ) #if 0 if (!snes_ppu.screen_disabled) { - UINT16 v = space->machine->primary_screen->vpos(); - UINT16 h = space->machine->primary_screen->hpos(); + UINT16 v = space->machine().primary_screen->vpos(); + UINT16 h = space->machine().primary_screen->hpos(); if (v < snes_ppu.beam.last_visible_line && h >= 128 && h < 1096) offset = 0x1ff; @@ -2073,8 +2073,8 @@ static WRITE8_HANDLER( snes_cgram_write ) // writes to the cgram address if (!snes_ppu.screen_disabled) { - UINT16 v = space->machine->primary_screen->vpos(); - UINT16 h = space->machine->primary_screen->hpos(); + UINT16 v = space->machine().primary_screen->vpos(); + UINT16 h = space->machine().primary_screen->hpos(); if (v < snes_ppu.beam.last_visible_line && h >= 128 && h < 1096) offset = 0x1ff; @@ -2091,7 +2091,7 @@ static WRITE8_HANDLER( snes_cgram_write ) READ8_HANDLER( snes_ppu_read ) { - snes_state *state = space->machine->driver_data<snes_state>(); + snes_state *state = space->machine().driver_data<snes_state>(); UINT8 value; switch (offset) @@ -2138,7 +2138,7 @@ READ8_HANDLER( snes_ppu_read ) return snes_ppu.ppu1_open_bus; } case SLHV: /* Software latch for H/V counter */ - snes_latch_counters(space->machine); + snes_latch_counters(space->machine()); return snes_open_bus_r(space, 0); /* Return value is meaningless */ case ROAMDATA: /* Read data from OAM (DR) */ snes_ppu.ppu1_open_bus = snes_oam_read(space, snes_ppu.oam.address); @@ -2152,7 +2152,7 @@ READ8_HANDLER( snes_ppu_read ) return snes_ppu.ppu1_open_bus; case RVMDATAL: /* Read data from VRAM (low) */ { - UINT32 addr = snes_get_vram_address(space->machine) << 1; + UINT32 addr = snes_get_vram_address(space->machine()) << 1; snes_ppu.ppu1_open_bus = state->vram_read_buffer & 0xff; if (!state->vram_fgr_high) @@ -2167,7 +2167,7 @@ READ8_HANDLER( snes_ppu_read ) } case RVMDATAH: /* Read data from VRAM (high) */ { - UINT32 addr = snes_get_vram_address(space->machine) << 1; + UINT32 addr = snes_get_vram_address(space->machine()) << 1; snes_ppu.ppu1_open_bus = (state->vram_read_buffer >> 8) & 0xff; if (state->vram_fgr_high) @@ -2240,7 +2240,7 @@ READ8_HANDLER( snes_ppu_read ) WRITE8_HANDLER( snes_ppu_write ) { - snes_state *state = space->machine->driver_data<snes_state>(); + snes_state *state = space->machine().driver_data<snes_state>(); switch (offset) { @@ -2300,7 +2300,7 @@ WRITE8_HANDLER( snes_ppu_write ) return; case BGMODE: /* BG mode and character size settings */ snes_ppu.mode = data & 0x07; - snes_dynamic_res_change(space->machine); + snes_dynamic_res_change(space->machine()); snes_ppu.bg3_priority_bit = BIT(data, 3); snes_ppu.layer[SNES_BG1].tile_size = BIT(data, 4); snes_ppu.layer[SNES_BG2].tile_size = BIT(data, 5); @@ -2402,7 +2402,7 @@ WRITE8_HANDLER( snes_ppu_write ) { UINT32 addr; state->vmadd = (state->vmadd & 0xff00) | (data << 0); - addr = snes_get_vram_address(space->machine) << 1; + addr = snes_get_vram_address(space->machine()) << 1; state->vram_read_buffer = snes_vram_read(space, addr); state->vram_read_buffer |= (snes_vram_read(space, addr + 1) << 8); } @@ -2411,14 +2411,14 @@ WRITE8_HANDLER( snes_ppu_write ) { UINT32 addr; state->vmadd = (state->vmadd & 0x00ff) | (data << 8); - addr = snes_get_vram_address(space->machine) << 1; + addr = snes_get_vram_address(space->machine()) << 1; state->vram_read_buffer = snes_vram_read(space, addr); state->vram_read_buffer |= (snes_vram_read(space, addr + 1) << 8); } break; case VMDATAL: /* 2118: Data for VRAM write (low) */ { - UINT32 addr = snes_get_vram_address(space->machine) << 1; + UINT32 addr = snes_get_vram_address(space->machine()) << 1; snes_vram_write(space, addr, data); if (!state->vram_fgr_high) @@ -2427,7 +2427,7 @@ WRITE8_HANDLER( snes_ppu_write ) return; case VMDATAH: /* 2119: Data for VRAM write (high) */ { - UINT32 addr = snes_get_vram_address(space->machine) << 1; + UINT32 addr = snes_get_vram_address(space->machine()) << 1; snes_vram_write(space, addr + 1, data); if (state->vram_fgr_high) @@ -2631,7 +2631,7 @@ WRITE8_HANDLER( snes_ppu_write ) snes_ppu.beam.last_visible_line = (data & 0x04) ? 240 : 225; snes_ppu.pseudo_hires = BIT(data, 3); snes_ppu.mode7.extbg = BIT(data, 6); - snes_dynamic_res_change(space->machine); + snes_dynamic_res_change(space->machine()); #ifdef SNES_DBG_REG_W if ((data & 0x8) != (snes_ram[SETINI] & 0x8)) mame_printf_debug( "Pseudo 512 mode: %s\n", (data & 0x8) ? "on" : "off" ); @@ -2659,7 +2659,7 @@ WRITE8_HANDLER( snes_ppu_write ) } \ -static UINT8 snes_dbg_video( running_machine *machine, UINT16 curline ) +static UINT8 snes_dbg_video( running_machine &machine, UINT16 curline ) { int i; UINT8 toggles = input_port_read_safe(machine, "DEBUG1", 0); |