1
/***************************************************************************
5
Routines to control the unique NES video hardware/PPU.
7
***************************************************************************/
10
#include "video/ppu2c0x.h"
11
#include "includes/nes.h"
12
#include "machine/nes_mmc.h"
14
static void nes_vh_reset( running_machine &machine )
16
nes_state *state = machine.driver_data<nes_state>();
17
ppu2c0x_set_vidaccess_callback(machine.device("ppu"), nes_ppu_vidaccess);
19
if (state->m_four_screen_vram)
20
set_nt_mirroring(machine, PPU_MIRROR_4SCREEN);
23
switch (state->m_hard_mirroring)
29
set_nt_mirroring(machine, state->m_hard_mirroring);
32
set_nt_mirroring(machine, PPU_MIRROR_NONE);
40
nes_state *state = machine.driver_data<nes_state>();
42
state->m_last_frame_flip = 0;
44
machine.add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(nes_vh_reset),&machine));
49
ppu2c0x_init_palette(machine, 0);
53
/***************************************************************************
57
***************************************************************************/
61
nes_state *state = screen->machine().driver_data<nes_state>();
64
ppu2c0x_render(state->m_ppu, bitmap, 0, 0, 0, 0);
66
/* if this is a disk system game, check for the flip-disk key */
67
if (state->m_disk_expansion && state->m_pcb_id == NO_BOARD)
69
// latch this input so it doesn't go at warp speed
70
if ((input_port_read(screen->machine(), "FLIPDISK") & 0x01) && (!state->m_last_frame_flip))
72
state->m_last_frame_flip = 1;
73
state->m_fds_current_side++;
74
if (state->m_fds_current_side > state->m_fds_sides)
75
state->m_fds_current_side = 0;
77
if (state->m_fds_current_side == 0)
78
popmessage("No disk inserted.");
80
popmessage("Disk set to side %d", state->m_fds_current_side);
83
if (!(input_port_read(screen->machine(), "FLIPDISK") & 0x01))
84
state->m_last_frame_flip = 0;