~ubuntu-branches/debian/wheezy/mame/wheezy

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Emmanuel Kasper, Félix Arreola Rodríguez, Jordi Mallach
  • Date: 2011-05-11 21:06:50 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110511210650-jizvh8a6x117y9hr
Tags: 0.142-1
[ Emmanuel Kasper ]
* New upstream release
* Set NOWERROR=1 to allow compiling with gcc-4.6
* Remove fix_powerpc_build.patch, as upstream has taken it in this release
* Add gnome-video-arcade front end as a suggested package

[ Félix Arreola Rodríguez ]
* Add kfreebsd-build.patch to quilt series, to fix build on kfreebsd

[ Jordi Mallach ]
* Remove unneeded and bogus addition of --with-quilt to the dh invocation.
* Add Cesare Falco (long time Ubuntu maintainer) to Uploaders, and wrap
  them into multiple lines.

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
        switch (offset)
128
128
        {
129
129
                //           player inputs        dsw1                           dsw2
130
 
                case 0: data = input_port_read(space->machine, "IN0") | ((input_port_read(space->machine, "DSW1") & 0x02) << 5) | ((input_port_read(space->machine, "DSW2") & 0x01) << 4); break;
131
 
                case 1: data = input_port_read(space->machine, "IN1") | ((input_port_read(space->machine, "DSW1") & 0x01) << 6) | ((input_port_read(space->machine, "DSW2") & 0x02) << 3); break;
132
 
                case 2: data = input_port_read(space->machine, "IN2") | ((input_port_read(space->machine, "DSW1") & 0x08) << 3) | ((input_port_read(space->machine, "DSW2") & 0x04) << 2); break;
133
 
                case 3: data = input_port_read(space->machine, "IN3") | ((input_port_read(space->machine, "DSW1") & 0x04) << 4) | ((input_port_read(space->machine, "DSW2") & 0x08) << 1); break;
134
 
                case 4: data = ((input_port_read(space->machine, "DSW1") & 0x20) << 2) | ((input_port_read(space->machine, "DSW2") & 0x10) << 1); break;
135
 
                case 5: data = ((input_port_read(space->machine, "DSW1") & 0x10) << 3) | ((input_port_read(space->machine, "DSW2") & 0x20) << 0); break;
136
 
                case 6: data = ((input_port_read(space->machine, "DSW1") & 0x80) << 0) | ((input_port_read(space->machine, "DSW2") & 0x40) >> 1); break;
137
 
                case 7: data = ((input_port_read(space->machine, "DSW1") & 0x40) << 1) | ((input_port_read(space->machine, "DSW2") & 0x80) >> 2); break;
 
130
                case 0: data = input_port_read(space->machine(), "IN0") | ((input_port_read(space->machine(), "DSW1") & 0x02) << 5) | ((input_port_read(space->machine(), "DSW2") & 0x01) << 4); break;
 
131
                case 1: data = input_port_read(space->machine(), "IN1") | ((input_port_read(space->machine(), "DSW1") & 0x01) << 6) | ((input_port_read(space->machine(), "DSW2") & 0x02) << 3); break;
 
132
                case 2: data = input_port_read(space->machine(), "IN2") | ((input_port_read(space->machine(), "DSW1") & 0x08) << 3) | ((input_port_read(space->machine(), "DSW2") & 0x04) << 2); break;
 
133
                case 3: data = input_port_read(space->machine(), "IN3") | ((input_port_read(space->machine(), "DSW1") & 0x04) << 4) | ((input_port_read(space->machine(), "DSW2") & 0x08) << 1); break;
 
134
                case 4: data = ((input_port_read(space->machine(), "DSW1") & 0x20) << 2) | ((input_port_read(space->machine(), "DSW2") & 0x10) << 1); break;
 
135
                case 5: data = ((input_port_read(space->machine(), "DSW1") & 0x10) << 3) | ((input_port_read(space->machine(), "DSW2") & 0x20) << 0); break;
 
136
                case 6: data = ((input_port_read(space->machine(), "DSW1") & 0x80) << 0) | ((input_port_read(space->machine(), "DSW2") & 0x40) >> 1); break;
 
137
                case 7: data = ((input_port_read(space->machine(), "DSW1") & 0x40) << 1) | ((input_port_read(space->machine(), "DSW2") & 0x80) >> 2); break;
138
138
        }
139
139
        return data;
140
140
}
141
141
 
142
142
static READ8_HANDLER( popper_soundcpu_nmi_r )
143
143
{
144
 
        popper_state *state = space->machine->driver_data<popper_state>();
145
 
        cpu_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
 
144
        popper_state *state = space->machine().driver_data<popper_state>();
 
145
        device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
146
146
        return 0;
147
147
}
148
148
 
152
152
 *
153
153
 *************************************/
154
154
 
155
 
static ADDRESS_MAP_START( popper_map, ADDRESS_SPACE_PROGRAM, 8 )
 
155
static ADDRESS_MAP_START( popper_map, AS_PROGRAM, 8 )
156
156
        AM_RANGE(0x0000, 0x5fff) AM_ROM
157
157
        AM_RANGE(0xc000, 0xc1bf) AM_RAM
158
 
        AM_RANGE(0xc1c0, 0xc1ff) AM_RAM_WRITE(popper_ol_videoram_w) AM_BASE_MEMBER(popper_state, ol_videoram)
159
 
        AM_RANGE(0xc200, 0xc61f) AM_RAM_WRITE(popper_videoram_w) AM_BASE_MEMBER(popper_state, videoram)
 
158
        AM_RANGE(0xc1c0, 0xc1ff) AM_RAM_WRITE(popper_ol_videoram_w) AM_BASE_MEMBER(popper_state, m_ol_videoram)
 
159
        AM_RANGE(0xc200, 0xc61f) AM_RAM_WRITE(popper_videoram_w) AM_BASE_MEMBER(popper_state, m_videoram)
160
160
        AM_RANGE(0xc620, 0xc9bf) AM_RAM
161
 
        AM_RANGE(0xc9c0, 0xc9ff) AM_RAM_WRITE(popper_ol_attribram_w) AM_BASE_MEMBER(popper_state, ol_attribram)
162
 
        AM_RANGE(0xca00, 0xce1f) AM_RAM_WRITE(popper_attribram_w) AM_BASE_MEMBER(popper_state, attribram)
 
161
        AM_RANGE(0xc9c0, 0xc9ff) AM_RAM_WRITE(popper_ol_attribram_w) AM_BASE_MEMBER(popper_state, m_ol_attribram)
 
162
        AM_RANGE(0xca00, 0xce1f) AM_RAM_WRITE(popper_attribram_w) AM_BASE_MEMBER(popper_state, m_attribram)
163
163
        AM_RANGE(0xce20, 0xcfff) AM_RAM
164
 
        AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE_SIZE_MEMBER(popper_state, spriteram, spriteram_size)
 
164
        AM_RANGE(0xd000, 0xd7ff) AM_RAM AM_BASE_SIZE_MEMBER(popper_state, m_spriteram, m_spriteram_size)
165
165
        AM_RANGE(0xd800, 0xdfff) AM_RAM AM_SHARE("share1")
166
166
        AM_RANGE(0xe000, 0xe007) AM_READ(popper_input_ports_r)
167
167
        AM_RANGE(0xe000, 0xe000) AM_WRITE(interrupt_enable_w)
175
175
        AM_RANGE(0xffff, 0xffff) AM_READNOP
176
176
ADDRESS_MAP_END
177
177
 
178
 
static ADDRESS_MAP_START( popper_sound_map, ADDRESS_SPACE_PROGRAM, 8 )
 
178
static ADDRESS_MAP_START( popper_sound_map, AS_PROGRAM, 8 )
179
179
        AM_RANGE(0x0000, 0x0fff) AM_ROM
180
180
        AM_RANGE(0x8000, 0x8001) AM_DEVWRITE("ay1", ay8910_address_data_w)
181
181
        AM_RANGE(0x8002, 0x8002) AM_READNOP                                     //?? all read once at startup and the
307
307
 
308
308
static MACHINE_START( popper )
309
309
{
310
 
        popper_state *state = machine->driver_data<popper_state>();
311
 
 
312
 
        state->audiocpu = machine->device("audiocpu");
313
 
 
314
 
        state_save_register_global(machine, state->flipscreen);
315
 
        state_save_register_global(machine, state->e002);
316
 
        state_save_register_global(machine, state->gfx_bank);
 
310
        popper_state *state = machine.driver_data<popper_state>();
 
311
 
 
312
        state->m_audiocpu = machine.device("audiocpu");
 
313
 
 
314
        state->save_item(NAME(state->m_flipscreen));
 
315
        state->save_item(NAME(state->m_e002));
 
316
        state->save_item(NAME(state->m_gfx_bank));
317
317
}
318
318
 
319
319
static MACHINE_RESET( popper )
320
320
{
321
 
        popper_state *state = machine->driver_data<popper_state>();
 
321
        popper_state *state = machine.driver_data<popper_state>();
322
322
 
323
 
        state->flipscreen = 0;
324
 
        state->e002 = 0;
325
 
        state->gfx_bank = 0;
 
323
        state->m_flipscreen = 0;
 
324
        state->m_e002 = 0;
 
325
        state->m_gfx_bank = 0;
326
326
}
327
327
 
328
328
static MACHINE_CONFIG_START( popper, popper_state )
336
336
        MCFG_CPU_PROGRAM_MAP(popper_sound_map)
337
337
        MCFG_CPU_VBLANK_INT_HACK(irq0_line_hold,4)              //NMIs caused by the main CPU
338
338
 
339
 
        MCFG_QUANTUM_TIME(HZ(1800))
 
339
        MCFG_QUANTUM_TIME(attotime::from_hz(1800))
340
340
 
341
341
        MCFG_MACHINE_START(popper)
342
342
        MCFG_MACHINE_RESET(popper)
348
348
        MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
349
349
        MCFG_SCREEN_SIZE(33*8, 32*8)
350
350
        MCFG_SCREEN_VISIBLE_AREA(0*8, 33*8-1, 2*8, 30*8-1)
 
351
        MCFG_SCREEN_UPDATE(popper)
351
352
 
352
353
        MCFG_GFXDECODE(popper)
353
354
        MCFG_PALETTE_LENGTH(64)
354
355
 
355
356
        MCFG_PALETTE_INIT(popper)
356
357
        MCFG_VIDEO_START(popper)
357
 
        MCFG_VIDEO_UPDATE(popper)
358
358
 
359
359
        /* sound hardware */
360
360
        MCFG_SPEAKER_STANDARD_MONO("mono")