25
25
static void update_plunger(running_machine &machine)
27
27
videopin_state *state = machine.driver_data<videopin_state>();
28
UINT8 val = input_port_read(machine, "IN2");
28
UINT8 val = state->ioport("IN2")->read();
30
30
if (state->m_prev != val)
84
static READ8_HANDLER( videopin_misc_r )
84
READ8_MEMBER(videopin_state::videopin_misc_r)
86
double plunger = calc_plunger_pos(space->machine());
86
double plunger = calc_plunger_pos(machine());
88
88
// The plunger of the ball shooter has a black piece of
89
89
// plastic (flag) attached to it. When the plunger flag passes
94
94
// signals received. This results in the MPU displaying the
95
95
// ball being shot onto the playfield at a certain speed.
97
UINT8 val = input_port_read(space->machine(), "IN1");
97
UINT8 val = ioport("IN1")->read();
99
99
if (plunger >= 0.000 && plunger <= 0.001)
112
static WRITE8_HANDLER( videopin_led_w )
112
WRITE8_MEMBER(videopin_state::videopin_led_w)
114
int i = (space->machine().primary_screen->vpos() >> 5) & 7;
114
int i = (machine().primary_screen->vpos() >> 5) & 7;
115
115
static const char *const matrix[8][4] =
117
117
{ "LED26", "LED18", "LED11", "LED13" },
130
130
output_set_value(matrix[i][3], (data >> 3) & 1);
133
set_led_status(space->machine(), 0, data & 8); /* start button */
133
set_led_status(machine(), 0, data & 8); /* start button */
135
cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
135
cputag_set_input_line(machine(), "maincpu", 0, CLEAR_LINE);
194
194
*************************************/
196
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8 )
196
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, videopin_state )
197
197
AM_RANGE(0x0000, 0x01ff) AM_RAM
198
AM_RANGE(0x0200, 0x07ff) AM_RAM_WRITE(videopin_video_ram_w) AM_BASE_MEMBER(videopin_state, m_video_ram)
199
AM_RANGE(0x0800, 0x0800) AM_READ(videopin_misc_r) AM_DEVWRITE("discrete", videopin_note_dvsr_w)
198
AM_RANGE(0x0200, 0x07ff) AM_RAM_WRITE(videopin_video_ram_w) AM_SHARE("video_ram")
199
AM_RANGE(0x0800, 0x0800) AM_READ(videopin_misc_r) AM_DEVWRITE_LEGACY("discrete", videopin_note_dvsr_w)
200
200
AM_RANGE(0x0801, 0x0801) AM_WRITE(videopin_led_w)
201
201
AM_RANGE(0x0802, 0x0802) AM_WRITE(watchdog_reset_w)
202
202
AM_RANGE(0x0804, 0x0804) AM_WRITE(videopin_ball_w)
203
AM_RANGE(0x0805, 0x0805) AM_DEVWRITE("discrete", videopin_out1_w)
204
AM_RANGE(0x0806, 0x0806) AM_DEVWRITE("discrete", videopin_out2_w)
203
AM_RANGE(0x0805, 0x0805) AM_DEVWRITE_LEGACY("discrete", videopin_out1_w)
204
AM_RANGE(0x0806, 0x0806) AM_DEVWRITE_LEGACY("discrete", videopin_out2_w)
205
205
AM_RANGE(0x1000, 0x1000) AM_READ_PORT("IN0")
206
206
AM_RANGE(0x1800, 0x1800) AM_READ_PORT("DSW")
207
207
AM_RANGE(0x2000, 0x3fff) AM_ROM
258
258
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED )
259
259
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED )
260
260
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_NAME("Nudge") PORT_CODE(KEYCODE_SPACE)
261
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_VBLANK )
261
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_VBLANK("screen")
263
263
PORT_START("IN2")
264
264
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Ball Shooter") PORT_CODE(KEYCODE_DOWN)