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

« back to all changes in this revision

Viewing changes to src/mame/drivers/kangaroo.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:
174
174
 
175
175
static MACHINE_START( kangaroo )
176
176
{
177
 
        memory_configure_bank(machine, "bank1", 0, 2, machine->region("gfx1")->base(), 0x2000);
 
177
        memory_configure_bank(machine, "bank1", 0, 2, machine.region("gfx1")->base(), 0x2000);
178
178
}
179
179
 
180
180
 
181
181
static MACHINE_START( kangaroo_mcu )
182
182
{
183
 
        kangaroo_state *state = machine->driver_data<kangaroo_state>();
 
183
        kangaroo_state *state = machine.driver_data<kangaroo_state>();
184
184
 
185
185
        MACHINE_START_CALL(kangaroo);
186
 
        memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xef00, 0xefff, 0, 0, mcu_sim_r, mcu_sim_w);
187
 
        state_save_register_global(machine, state->clock);
 
186
        machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xef00, 0xefff, FUNC(mcu_sim_r), FUNC(mcu_sim_w));
 
187
        state->save_item(NAME(state->m_clock));
188
188
}
189
189
 
190
190
 
191
191
static MACHINE_RESET( kangaroo )
192
192
{
193
 
        kangaroo_state *state = machine->driver_data<kangaroo_state>();
 
193
        kangaroo_state *state = machine.driver_data<kangaroo_state>();
194
194
 
195
195
        /* I think there is a bug in the startup checks of the game. At the very */
196
196
        /* beginning, during the RAM check, it goes one byte too far, and ends up */
205
205
        /* properly starts. */
206
206
        cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
207
207
 
208
 
        state->clock = 0;
 
208
        state->m_clock = 0;
209
209
}
210
210
 
211
211
 
222
222
 
223
223
static READ8_HANDLER( mcu_sim_r )
224
224
{
225
 
        kangaroo_state *state = space->machine->driver_data<kangaroo_state>();
226
 
        return ++state->clock & 0x0f;
 
225
        kangaroo_state *state = space->machine().driver_data<kangaroo_state>();
 
226
        return ++state->m_clock & 0x0f;
227
227
}
228
228
 
229
229
static WRITE8_HANDLER( mcu_sim_w )
240
240
 
241
241
static WRITE8_HANDLER( kangaroo_coin_counter_w )
242
242
{
243
 
        coin_counter_w(space->machine, 0, data & 1);
244
 
        coin_counter_w(space->machine, 1, data & 2);
 
243
        coin_counter_w(space->machine(), 0, data & 1);
 
244
        coin_counter_w(space->machine(), 1, data & 2);
245
245
}
246
246
 
247
247
 
252
252
 *
253
253
 *************************************/
254
254
 
255
 
static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
 
255
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8 )
256
256
        AM_RANGE(0x0000, 0x5fff) AM_ROM
257
257
        AM_RANGE(0x8000, 0xbfff) AM_WRITE(kangaroo_videoram_w)
258
258
        AM_RANGE(0xc000, 0xdfff) AM_ROMBANK("bank1")
259
259
        AM_RANGE(0xe000, 0xe3ff) AM_RAM
260
260
        AM_RANGE(0xe400, 0xe400) AM_MIRROR(0x03ff) AM_READ_PORT("DSW0")
261
 
        AM_RANGE(0xe800, 0xe80a) AM_MIRROR(0x03f0) AM_WRITE(kangaroo_video_control_w) AM_BASE_MEMBER(kangaroo_state, video_control)
 
261
        AM_RANGE(0xe800, 0xe80a) AM_MIRROR(0x03f0) AM_WRITE(kangaroo_video_control_w) AM_BASE_MEMBER(kangaroo_state, m_video_control)
262
262
        AM_RANGE(0xec00, 0xec00) AM_MIRROR(0x00ff) AM_READ_PORT("IN0") AM_WRITE(soundlatch_w)
263
263
        AM_RANGE(0xed00, 0xed00) AM_MIRROR(0x00ff) AM_READ_PORT("IN1") AM_WRITE(kangaroo_coin_counter_w)
264
264
        AM_RANGE(0xee00, 0xee00) AM_MIRROR(0x00ff) AM_READ_PORT("IN2")
272
272
 *
273
273
 *************************************/
274
274
 
275
 
static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 )
 
275
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8 )
276
276
        AM_RANGE(0x0000, 0x0fff) AM_ROM
277
277
        AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0c00) AM_RAM
278
278
        AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_READ(soundlatch_r)
282
282
 
283
283
 
284
284
/* yes, this is identical */
285
 
static ADDRESS_MAP_START( sound_portmap, ADDRESS_SPACE_IO, 8 )
 
285
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8 )
286
286
        AM_RANGE(0x0000, 0x0fff) AM_ROM
287
287
        AM_RANGE(0x4000, 0x43ff) AM_MIRROR(0x0c00) AM_RAM
288
288
        AM_RANGE(0x6000, 0x6000) AM_MIRROR(0x0fff) AM_READ(soundlatch_r)
448
448
        MCFG_SCREEN_ADD("screen", RASTER)
449
449
        MCFG_SCREEN_FORMAT(BITMAP_FORMAT_RGB32)
450
450
        MCFG_SCREEN_RAW_PARAMS(MASTER_CLOCK, 320*2, 0*2, 256*2, 260, 8, 248)
 
451
        MCFG_SCREEN_UPDATE(kangaroo)
451
452
 
452
453
        MCFG_VIDEO_START(kangaroo)
453
 
        MCFG_VIDEO_UPDATE(kangaroo)
454
454
 
455
455
        /* sound hardware */
456
456
        MCFG_SPEAKER_STANDARD_MONO("mono")