~ubuntu-branches/debian/sid/mame/sid

« back to all changes in this revision

Viewing changes to src/mame/drivers/videopin.c

  • Committer: Package Import Robot
  • Author(s): Jordi Mallach, Emmanuel Kasper, Jordi Mallach
  • Date: 2012-06-05 20:02:23 UTC
  • mfrom: (0.3.1) (0.1.4)
  • Revision ID: package-import@ubuntu.com-20120605200223-gnlpogjrg6oqe9md
Tags: 0.146-1
[ Emmanuel Kasper ]
* New upstream release
* Drop patch to fix man pages section and patches to link with flac 
  and jpeg system lib: all this has been pushed upstream by Cesare Falco
* Add DM-Upload-Allowed: yes field.

[ Jordi Mallach ]
* Create a "gnu" TARGETOS stanza that defines NO_AFFINITY_NP.
* Stop setting TARGETOS to "unix" in d/rules. It should be autodetected,
  and set to the appropriate value.
* mame_manpage_section.patch: Change mame's manpage section to 6 (games),
  in the TH declaration.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
static void update_plunger(running_machine &machine)
26
26
{
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();
29
29
 
30
30
        if (state->m_prev != val)
31
31
        {
81
81
}
82
82
 
83
83
 
84
 
static READ8_HANDLER( videopin_misc_r )
 
84
READ8_MEMBER(videopin_state::videopin_misc_r)
85
85
{
86
 
        double plunger = calc_plunger_pos(space->machine());
 
86
        double plunger = calc_plunger_pos(machine());
87
87
 
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.
96
96
 
97
 
        UINT8 val = input_port_read(space->machine(), "IN1");
 
97
        UINT8 val = ioport("IN1")->read();
98
98
 
99
99
        if (plunger >= 0.000 && plunger <= 0.001)
100
100
        {
109
109
}
110
110
 
111
111
 
112
 
static WRITE8_HANDLER( videopin_led_w )
 
112
WRITE8_MEMBER(videopin_state::videopin_led_w)
113
113
{
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] =
116
116
        {
117
117
                { "LED26", "LED18", "LED11", "LED13" },
130
130
        output_set_value(matrix[i][3], (data >> 3) & 1);
131
131
 
132
132
        if (i == 7)
133
 
                set_led_status(space->machine(), 0, data & 8);   /* start button */
 
133
                set_led_status(machine(), 0, data & 8);   /* start button */
134
134
 
135
 
        cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
 
135
        cputag_set_input_line(machine(), "maincpu", 0, CLEAR_LINE);
136
136
}
137
137
 
138
138
 
193
193
 *
194
194
 *************************************/
195
195
 
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")
262
262
 
263
263
        PORT_START("IN2")
264
264
        PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_BUTTON4 ) PORT_NAME("Ball Shooter") PORT_CODE(KEYCODE_DOWN)