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

« back to all changes in this revision

Viewing changes to src/mame/drivers/xtheball.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:
18
18
{
19
19
public:
20
20
        xtheball_state(const machine_config &mconfig, device_type type, const char *tag)
21
 
                : driver_device(mconfig, type, tag) { }
 
21
                : driver_device(mconfig, type, tag) ,
 
22
                m_vram_bg(*this, "vrabg"),
 
23
                m_vram_fg(*this, "vrafg"){ }
22
24
 
23
 
        UINT16 *m_vram_bg;
24
 
        UINT16 *m_vram_fg;
 
25
        required_shared_ptr<UINT16> m_vram_bg;
 
26
        required_shared_ptr<UINT16> m_vram_fg;
25
27
        UINT8 m_bitvals[32];
 
28
        DECLARE_WRITE16_MEMBER(bit_controls_w);
 
29
        DECLARE_READ16_MEMBER(analogx_r);
 
30
        DECLARE_READ16_MEMBER(analogy_watchdog_r);
26
31
};
27
32
 
28
33
 
115
120
 *
116
121
 *************************************/
117
122
 
118
 
static WRITE16_HANDLER( bit_controls_w )
 
123
WRITE16_MEMBER(xtheball_state::bit_controls_w)
119
124
{
120
 
        xtheball_state *state = space->machine().driver_data<xtheball_state>();
121
 
        UINT8 *bitvals = state->m_bitvals;
 
125
        UINT8 *bitvals = m_bitvals;
122
126
        if (ACCESSING_BITS_0_7)
123
127
        {
124
128
                if (bitvals[offset] != (data & 1))
125
129
                {
126
 
                        logerror("%08x:bit_controls_w(%x,%d)\n", cpu_get_pc(&space->device()), offset, data & 1);
 
130
                        logerror("%08x:bit_controls_w(%x,%d)\n", cpu_get_pc(&space.device()), offset, data & 1);
127
131
 
128
132
                        switch (offset)
129
133
                        {
130
134
                                case 7:
131
 
                                        ticket_dispenser_w(space->machine().device("ticket"), 0, data << 7);
 
135
                                        machine().device<ticket_dispenser_device>("ticket")->write(space, 0, data << 7);
132
136
                                        break;
133
137
 
134
138
                                case 8:
135
 
                                        set_led_status(space->machine(), 0, data & 1);
 
139
                                        set_led_status(machine(), 0, data & 1);
136
140
                                        break;
137
141
                        }
138
142
                }
185
189
 *
186
190
 *************************************/
187
191
 
188
 
static READ16_HANDLER( analogx_r )
 
192
READ16_MEMBER(xtheball_state::analogx_r)
189
193
{
190
 
        return (input_port_read(space->machine(), "ANALOGX") << 8) | 0x00ff;
 
194
        return (ioport("ANALOGX")->read() << 8) | 0x00ff;
191
195
}
192
196
 
193
197
 
194
 
static READ16_HANDLER( analogy_watchdog_r )
 
198
READ16_MEMBER(xtheball_state::analogy_watchdog_r)
195
199
{
196
200
        /* doubles as a watchdog address */
197
201
        watchdog_reset_w(space,0,0);
198
 
        return (input_port_read(space->machine(), "ANALOGY") << 8) | 0x00ff;
 
202
        return (ioport("ANALOGY")->read() << 8) | 0x00ff;
199
203
}
200
204
 
201
205
 
206
210
 *
207
211
 *************************************/
208
212
 
209
 
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16 )
 
213
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, xtheball_state )
210
214
        AM_RANGE(0x00000000, 0x0001ffff) AM_RAM AM_SHARE("nvram")
211
 
        AM_RANGE(0x01000000, 0x010fffff) AM_RAM AM_BASE_MEMBER(xtheball_state, m_vram_bg)
212
 
        AM_RANGE(0x02000000, 0x020fffff) AM_RAM AM_BASE_MEMBER(xtheball_state, m_vram_fg)
213
 
        AM_RANGE(0x03000000, 0x030000ff) AM_DEVREADWRITE8("tlc34076", tlc34076_r, tlc34076_w, 0x00ff)
 
215
        AM_RANGE(0x01000000, 0x010fffff) AM_RAM AM_SHARE("vrabg")
 
216
        AM_RANGE(0x02000000, 0x020fffff) AM_RAM AM_SHARE("vrafg")
 
217
        AM_RANGE(0x03000000, 0x030000ff) AM_DEVREADWRITE8_LEGACY("tlc34076", tlc34076_r, tlc34076_w, 0x00ff)
214
218
        AM_RANGE(0x03040000, 0x030401ff) AM_WRITE(bit_controls_w)
215
219
        AM_RANGE(0x03040080, 0x0304008f) AM_READ_PORT("DSW")
216
220
        AM_RANGE(0x03040100, 0x0304010f) AM_READ(analogx_r)
221
225
        AM_RANGE(0x03040160, 0x0304016f) AM_READ_PORT("SERVICE")
222
226
        AM_RANGE(0x03040170, 0x0304017f) AM_READ_PORT("SERVICE1")
223
227
        AM_RANGE(0x03040180, 0x0304018f) AM_READ(analogy_watchdog_r)
224
 
        AM_RANGE(0x03060000, 0x0306000f) AM_DEVWRITE8("dac", dac_w, 0xff00)
 
228
        AM_RANGE(0x03060000, 0x0306000f) AM_DEVWRITE8_LEGACY("dac", dac_w, 0xff00)
225
229
        AM_RANGE(0x04000000, 0x057fffff) AM_ROM AM_REGION("user2", 0)
226
 
        AM_RANGE(0xc0000000, 0xc00001ff) AM_READWRITE(tms34010_io_register_r, tms34010_io_register_w)
 
230
        AM_RANGE(0xc0000000, 0xc00001ff) AM_READWRITE_LEGACY(tms34010_io_register_r, tms34010_io_register_w)
227
231
        AM_RANGE(0xfff80000, 0xffffffff) AM_ROM AM_REGION("user1", 0)
228
232
ADDRESS_MAP_END
229
233
 
238
242
static INPUT_PORTS_START( xtheball )
239
243
        PORT_START("DSW")
240
244
        PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_UNUSED )
241
 
        PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE("ticket", ticket_dispenser_line_r)
 
245
        PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("ticket", ticket_dispenser_device, line_r)
242
246
        PORT_BIT( 0x00e0, IP_ACTIVE_LOW, IPT_UNUSED )
243
247
        PORT_DIPNAME( 0x0700, 0x0000, "Target Tickets")
244
248
        PORT_DIPSETTING(      0x0000, "3" )
338
342
 
339
343
        MCFG_NVRAM_ADD_1FILL("nvram")
340
344
 
341
 
        MCFG_TICKET_DISPENSER_ADD("ticket", 100, TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
 
345
        MCFG_TICKET_DISPENSER_ADD("ticket", attotime::from_msec(100), TICKET_MOTOR_ACTIVE_HIGH, TICKET_STATUS_ACTIVE_HIGH)
342
346
 
343
347
        /* video hardware */
344
348
        MCFG_TLC34076_ADD("tlc34076", TLC34076_6_BIT)