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

« back to all changes in this revision

Viewing changes to src/mame/drivers/nycaptor.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:
200
200
#include "includes/nycaptor.h"
201
201
 
202
202
 
203
 
static WRITE8_HANDLER( sub_cpu_halt_w )
204
 
{
205
 
        nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
206
 
        device_set_input_line(state->m_subcpu, INPUT_LINE_HALT, (data) ? ASSERT_LINE : CLEAR_LINE);
207
 
}
208
 
 
209
 
static READ8_HANDLER( from_snd_r )
210
 
{
211
 
        nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
212
 
        return state->m_snd_data;
213
 
}
214
 
 
215
 
static WRITE8_HANDLER( to_main_w )
216
 
{
217
 
        nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
218
 
        state->m_snd_data = data;
219
 
}
220
 
 
221
 
 
222
 
static READ8_HANDLER(nycaptor_sharedram_r)
223
 
{
224
 
        nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
225
 
        return state->m_sharedram[offset];
226
 
}
227
 
 
228
 
static WRITE8_HANDLER(nycaptor_sharedram_w)
229
 
{
230
 
        nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
231
 
        state->m_sharedram[offset] = data;
232
 
}
233
 
 
234
 
static READ8_HANDLER( nycaptor_b_r )
 
203
WRITE8_MEMBER(nycaptor_state::sub_cpu_halt_w)
 
204
{
 
205
        device_set_input_line(m_subcpu, INPUT_LINE_HALT, (data) ? ASSERT_LINE : CLEAR_LINE);
 
206
}
 
207
 
 
208
READ8_MEMBER(nycaptor_state::from_snd_r)
 
209
{
 
210
        return m_snd_data;
 
211
}
 
212
 
 
213
WRITE8_MEMBER(nycaptor_state::to_main_w)
 
214
{
 
215
        m_snd_data = data;
 
216
}
 
217
 
 
218
 
 
219
READ8_MEMBER(nycaptor_state::nycaptor_sharedram_r)
 
220
{
 
221
        return m_sharedram[offset];
 
222
}
 
223
 
 
224
WRITE8_MEMBER(nycaptor_state::nycaptor_sharedram_w)
 
225
{
 
226
        m_sharedram[offset] = data;
 
227
}
 
228
 
 
229
READ8_MEMBER(nycaptor_state::nycaptor_b_r)
235
230
{
236
231
        return 1;
237
232
}
238
233
 
239
 
static READ8_HANDLER( nycaptor_by_r )
 
234
READ8_MEMBER(nycaptor_state::nycaptor_by_r)
240
235
{
241
 
        nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
242
 
        int port = input_port_read(space->machine(), "LIGHTY");
 
236
        int port = ioport("LIGHTY")->read();
243
237
 
244
 
        if (state->m_gametype == 1)
 
238
        if (m_gametype == 1)
245
239
                port = 255 - port;
246
240
 
247
241
        return port - 8;
248
242
}
249
243
 
250
 
static READ8_HANDLER( nycaptor_bx_r )
 
244
READ8_MEMBER(nycaptor_state::nycaptor_bx_r)
251
245
{
252
 
        return (input_port_read(space->machine(), "LIGHTX") + 0x27) | 1;
 
246
        return (ioport("LIGHTX")->read() + 0x27) | 1;
253
247
}
254
248
 
255
249
 
256
 
static WRITE8_HANDLER( sound_cpu_reset_w )
 
250
WRITE8_MEMBER(nycaptor_state::sound_cpu_reset_w)
257
251
{
258
 
        nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
259
 
        device_set_input_line(state->m_audiocpu, INPUT_LINE_RESET, (data&1 )? ASSERT_LINE : CLEAR_LINE);
 
252
        device_set_input_line(m_audiocpu, INPUT_LINE_RESET, (data&1 )? ASSERT_LINE : CLEAR_LINE);
260
253
}
261
254
 
262
255
 
287
280
                state->m_pending_nmi = 1;
288
281
}
289
282
 
290
 
static WRITE8_HANDLER( sound_command_w )
291
 
{
292
 
        soundlatch_w(space, 0, data);
293
 
        space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
294
 
}
295
 
 
296
 
static WRITE8_HANDLER( nmi_disable_w )
297
 
{
298
 
        nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
299
 
        state->m_sound_nmi_enable = 0;
300
 
}
301
 
 
302
 
static WRITE8_HANDLER( nmi_enable_w )
303
 
{
304
 
        nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
305
 
        state->m_sound_nmi_enable = 1;
306
 
 
307
 
        if (state->m_pending_nmi)
 
283
WRITE8_MEMBER(nycaptor_state::sound_command_w)
 
284
{
 
285
        soundlatch_byte_w(space, 0, data);
 
286
        machine().scheduler().synchronize(FUNC(nmi_callback), data);
 
287
}
 
288
 
 
289
WRITE8_MEMBER(nycaptor_state::nmi_disable_w)
 
290
{
 
291
        m_sound_nmi_enable = 0;
 
292
}
 
293
 
 
294
WRITE8_MEMBER(nycaptor_state::nmi_enable_w)
 
295
{
 
296
        m_sound_nmi_enable = 1;
 
297
 
 
298
        if (m_pending_nmi)
308
299
        {
309
 
                device_set_input_line(state->m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
310
 
                state->m_pending_nmi = 0;
 
300
                device_set_input_line(m_audiocpu, INPUT_LINE_NMI, PULSE_LINE);
 
301
                m_pending_nmi = 0;
311
302
        }
312
303
}
313
304
 
332
323
};
333
324
 
334
325
 
335
 
static READ8_HANDLER ( nycaptor_generic_control_r )
336
 
{
337
 
        nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
338
 
        return state->m_generic_control_reg;
339
 
}
340
 
 
341
 
static WRITE8_HANDLER( nycaptor_generic_control_w )
342
 
{
343
 
        nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
344
 
        state->m_generic_control_reg = data;
345
 
        memory_set_bankptr(space->machine(), "bank1", space->machine().region("maincpu")->base() + 0x10000 + ((data&0x08)>>3)*0x4000 );
346
 
}
347
 
 
348
 
static ADDRESS_MAP_START( nycaptor_master_map, AS_PROGRAM, 8 )
 
326
READ8_MEMBER(nycaptor_state::nycaptor_generic_control_r)
 
327
{
 
328
        return m_generic_control_reg;
 
329
}
 
330
 
 
331
WRITE8_MEMBER(nycaptor_state::nycaptor_generic_control_w)
 
332
{
 
333
        m_generic_control_reg = data;
 
334
        membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000 + ((data&0x08)>>3)*0x4000 );
 
335
}
 
336
 
 
337
static ADDRESS_MAP_START( nycaptor_master_map, AS_PROGRAM, 8, nycaptor_state )
349
338
        AM_RANGE(0x0000, 0x7fff) AM_ROM
350
339
        AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
351
 
        AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(nycaptor_videoram_r, nycaptor_videoram_w) AM_BASE_SIZE_MEMBER(nycaptor_state, m_videoram, m_videoram_size)
 
340
        AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(nycaptor_videoram_r, nycaptor_videoram_w) AM_SHARE("videoram")
352
341
        AM_RANGE(0xd000, 0xd000) AM_READWRITE(nycaptor_mcu_r, nycaptor_mcu_w)
353
342
        AM_RANGE(0xd001, 0xd001) AM_WRITE(sub_cpu_halt_w)
354
343
        AM_RANGE(0xd002, 0xd002) AM_READWRITE(nycaptor_generic_control_r, nycaptor_generic_control_w)   /* bit 3 - memory bank at 0x8000-0xbfff */
364
353
        AM_RANGE(0xd806, 0xd806) AM_READNOP /* unknown ?sound? */
365
354
        AM_RANGE(0xd807, 0xd807) AM_READ(nycaptor_mcu_status_r2)
366
355
        AM_RANGE(0xdc00, 0xdc9f) AM_READWRITE(nycaptor_spriteram_r, nycaptor_spriteram_w)
367
 
        AM_RANGE(0xdca0, 0xdcbf) AM_READWRITE(nycaptor_scrlram_r, nycaptor_scrlram_w) AM_BASE_MEMBER(nycaptor_state, m_scrlram)
 
356
        AM_RANGE(0xdca0, 0xdcbf) AM_READWRITE(nycaptor_scrlram_r, nycaptor_scrlram_w) AM_SHARE("scrlram")
368
357
        AM_RANGE(0xdce1, 0xdce1) AM_WRITENOP
369
358
        AM_RANGE(0xdd00, 0xdeff) AM_READWRITE(nycaptor_palette_r, nycaptor_palette_w)
370
359
        AM_RANGE(0xdf03, 0xdf03) AM_READWRITE(nycaptor_gfxctrl_r, nycaptor_gfxctrl_w)
371
 
        AM_RANGE(0xe000, 0xffff) AM_READWRITE(nycaptor_sharedram_r, nycaptor_sharedram_w) AM_BASE_MEMBER(nycaptor_state, m_sharedram)
 
360
        AM_RANGE(0xe000, 0xffff) AM_READWRITE(nycaptor_sharedram_r, nycaptor_sharedram_w) AM_SHARE("sharedram")
372
361
ADDRESS_MAP_END
373
362
 
374
 
static ADDRESS_MAP_START( nycaptor_slave_map, AS_PROGRAM, 8 )
 
363
static ADDRESS_MAP_START( nycaptor_slave_map, AS_PROGRAM, 8, nycaptor_state )
375
364
        AM_RANGE(0x0000, 0x7fff) AM_ROM
376
 
        AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(nycaptor_videoram_r, nycaptor_videoram_w) AM_BASE_SIZE_MEMBER(nycaptor_state, m_videoram, m_videoram_size)
 
365
        AM_RANGE(0xc000, 0xc7ff) AM_READWRITE(nycaptor_videoram_r, nycaptor_videoram_w) AM_SHARE("videoram")
377
366
        AM_RANGE(0xd800, 0xd800) AM_READ_PORT("DSWA")
378
367
        AM_RANGE(0xd801, 0xd801) AM_READ_PORT("DSWB")
379
368
        AM_RANGE(0xd802, 0xd802) AM_READ_PORT("DSWC")
380
369
        AM_RANGE(0xd803, 0xd803) AM_READ_PORT("IN0")
381
370
        AM_RANGE(0xd804, 0xd804) AM_READ_PORT("IN1")
382
371
        AM_RANGE(0xdc00, 0xdc9f) AM_READWRITE(nycaptor_spriteram_r, nycaptor_spriteram_w)
383
 
        AM_RANGE(0xdca0, 0xdcbf) AM_WRITE(nycaptor_scrlram_w) AM_BASE_MEMBER(nycaptor_state, m_scrlram)
 
372
        AM_RANGE(0xdca0, 0xdcbf) AM_WRITE(nycaptor_scrlram_w) AM_SHARE("scrlram")
384
373
 
385
374
        AM_RANGE(0xdd00, 0xdeff) AM_READWRITE(nycaptor_palette_r, nycaptor_palette_w)
386
375
        AM_RANGE(0xdf00, 0xdf00) AM_READ(nycaptor_bx_r)
390
379
        AM_RANGE(0xe000, 0xffff) AM_READWRITE(nycaptor_sharedram_r, nycaptor_sharedram_w)
391
380
ADDRESS_MAP_END
392
381
 
393
 
static ADDRESS_MAP_START( nycaptor_sound_map, AS_PROGRAM, 8 )
 
382
static ADDRESS_MAP_START( nycaptor_sound_map, AS_PROGRAM, 8, nycaptor_state )
394
383
        AM_RANGE(0x0000, 0xbfff) AM_ROM
395
384
        AM_RANGE(0xc000, 0xc7ff) AM_RAM
396
 
        AM_RANGE(0xc800, 0xc801) AM_DEVWRITE("ay1", ay8910_address_data_w)
397
 
        AM_RANGE(0xc802, 0xc803) AM_DEVWRITE("ay2", ay8910_address_data_w)
398
 
        AM_RANGE(0xc900, 0xc90d) AM_DEVWRITE("msm", msm5232_w)
 
385
        AM_RANGE(0xc800, 0xc801) AM_DEVWRITE_LEGACY("ay1", ay8910_address_data_w)
 
386
        AM_RANGE(0xc802, 0xc803) AM_DEVWRITE_LEGACY("ay2", ay8910_address_data_w)
 
387
        AM_RANGE(0xc900, 0xc90d) AM_DEVWRITE_LEGACY("msm", msm5232_w)
399
388
        AM_RANGE(0xca00, 0xca00) AM_WRITENOP
400
389
        AM_RANGE(0xcb00, 0xcb00) AM_WRITENOP
401
390
        AM_RANGE(0xcc00, 0xcc00) AM_WRITENOP
402
 
        AM_RANGE(0xd000, 0xd000) AM_READWRITE(soundlatch_r, to_main_w)
 
391
        AM_RANGE(0xd000, 0xd000) AM_READ(soundlatch_byte_r) AM_WRITE(to_main_w)
403
392
        AM_RANGE(0xd200, 0xd200) AM_READNOP AM_WRITE(nmi_enable_w)
404
393
        AM_RANGE(0xd400, 0xd400) AM_WRITE(nmi_disable_w)
405
394
        AM_RANGE(0xd600, 0xd600) AM_WRITENOP
406
395
        AM_RANGE(0xe000, 0xefff) AM_NOP
407
396
ADDRESS_MAP_END
408
397
 
409
 
static ADDRESS_MAP_START( nycaptor_m68705_map, AS_PROGRAM, 8 )
 
398
static ADDRESS_MAP_START( nycaptor_m68705_map, AS_PROGRAM, 8, nycaptor_state )
410
399
        ADDRESS_MAP_GLOBAL_MASK(0x7ff)
411
400
        AM_RANGE(0x0000, 0x0000) AM_READWRITE(nycaptor_68705_port_a_r, nycaptor_68705_port_a_w)
412
401
        AM_RANGE(0x0001, 0x0001) AM_READWRITE(nycaptor_68705_port_b_r, nycaptor_68705_port_b_w)
422
411
/* Cycle Shooting */
423
412
 
424
413
 
425
 
static READ8_HANDLER(cyclshtg_mcu_status_r)
 
414
READ8_MEMBER(nycaptor_state::cyclshtg_mcu_status_r)
426
415
{
427
416
        return 0xff;
428
417
}
429
418
 
430
 
static READ8_HANDLER(cyclshtg_mcu_r)
 
419
READ8_MEMBER(nycaptor_state::cyclshtg_mcu_r)
431
420
{
432
421
        return 7;
433
422
}
434
423
 
435
 
static WRITE8_HANDLER(cyclshtg_mcu_w)
436
 
{
437
 
 
438
 
}
439
 
 
440
 
static READ8_HANDLER(cyclshtg_mcu_status_r1)
441
 
{
442
 
        return space->machine().rand();
443
 
}
444
 
 
445
 
static WRITE8_HANDLER( cyclshtg_generic_control_w )
446
 
{
447
 
        nycaptor_state *state = space->machine().driver_data<nycaptor_state>();
 
424
WRITE8_MEMBER(nycaptor_state::cyclshtg_mcu_w)
 
425
{
 
426
 
 
427
}
 
428
 
 
429
READ8_MEMBER(nycaptor_state::cyclshtg_mcu_status_r1)
 
430
{
 
431
        return machine().rand();
 
432
}
 
433
 
 
434
WRITE8_MEMBER(nycaptor_state::cyclshtg_generic_control_w)
 
435
{
448
436
        int bank = (data >> 2) & 3;
449
437
 
450
 
        state->m_generic_control_reg = data;
451
 
        memory_set_bankptr(space->machine(), "bank1", space->machine().region("maincpu")->base() + 0x10000 + bank*0x4000 );
 
438
        m_generic_control_reg = data;
 
439
        membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000 + bank*0x4000 );
452
440
}
453
441
 
454
442
 
455
 
static ADDRESS_MAP_START( cyclshtg_master_map, AS_PROGRAM, 8 )
 
443
static ADDRESS_MAP_START( cyclshtg_master_map, AS_PROGRAM, 8, nycaptor_state )
456
444
        AM_RANGE(0x0000, 0x7fff) AM_ROM
457
445
        AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
458
 
        AM_RANGE(0xc000, 0xcfff) AM_READWRITE(nycaptor_videoram_r, nycaptor_videoram_w) AM_BASE_SIZE_MEMBER(nycaptor_state, m_videoram, m_videoram_size)
 
446
        AM_RANGE(0xc000, 0xcfff) AM_READWRITE(nycaptor_videoram_r, nycaptor_videoram_w) AM_SHARE("videoram")
459
447
        AM_RANGE(0xd000, 0xd000) AM_READWRITE(cyclshtg_mcu_r, cyclshtg_mcu_w)
460
448
        AM_RANGE(0xd001, 0xd001) AM_WRITE(sub_cpu_halt_w)
461
449
        AM_RANGE(0xd002, 0xd002) AM_READWRITE(nycaptor_generic_control_r, cyclshtg_generic_control_w)
470
458
        AM_RANGE(0xd806, 0xd806) AM_READNOP
471
459
        AM_RANGE(0xd807, 0xd807) AM_READ(cyclshtg_mcu_status_r)
472
460
        AM_RANGE(0xdc00, 0xdc9f) AM_READWRITE(nycaptor_spriteram_r, nycaptor_spriteram_w)
473
 
        AM_RANGE(0xdca0, 0xdcbf) AM_READWRITE(nycaptor_scrlram_r, nycaptor_scrlram_w) AM_BASE_MEMBER(nycaptor_state, m_scrlram)
 
461
        AM_RANGE(0xdca0, 0xdcbf) AM_READWRITE(nycaptor_scrlram_r, nycaptor_scrlram_w) AM_SHARE("scrlram")
474
462
        AM_RANGE(0xdce1, 0xdce1) AM_WRITENOP
475
463
        AM_RANGE(0xdd00, 0xdeff) AM_READWRITE(nycaptor_palette_r, nycaptor_palette_w)
476
464
        AM_RANGE(0xdf03, 0xdf03) AM_READWRITE(nycaptor_gfxctrl_r, nycaptor_gfxctrl_w)
477
 
        AM_RANGE(0xe000, 0xffff) AM_READWRITE(nycaptor_sharedram_r, nycaptor_sharedram_w) AM_BASE_MEMBER(nycaptor_state, m_sharedram)
 
465
        AM_RANGE(0xe000, 0xffff) AM_READWRITE(nycaptor_sharedram_r, nycaptor_sharedram_w) AM_SHARE("sharedram")
478
466
ADDRESS_MAP_END
479
467
 
480
 
static ADDRESS_MAP_START( cyclshtg_slave_map, AS_PROGRAM, 8 )
 
468
static ADDRESS_MAP_START( cyclshtg_slave_map, AS_PROGRAM, 8, nycaptor_state )
481
469
        AM_RANGE(0x0000, 0xbfff) AM_ROM
482
 
        AM_RANGE(0xc000, 0xcfff) AM_READWRITE(nycaptor_videoram_r, nycaptor_videoram_w) AM_BASE_SIZE_MEMBER(nycaptor_state, m_videoram, m_videoram_size)
 
470
        AM_RANGE(0xc000, 0xcfff) AM_READWRITE(nycaptor_videoram_r, nycaptor_videoram_w) AM_SHARE("videoram")
483
471
        AM_RANGE(0xd800, 0xd800) AM_READ_PORT("DSWA")
484
472
        AM_RANGE(0xd801, 0xd801) AM_READ_PORT("DSWB")
485
473
        AM_RANGE(0xd802, 0xd802) AM_READ_PORT("DSWC")
486
474
        AM_RANGE(0xd803, 0xd803) AM_READ_PORT("IN0")
487
475
        AM_RANGE(0xd804, 0xd804) AM_READ_PORT("IN1")
488
476
        AM_RANGE(0xdc00, 0xdc9f) AM_READWRITE(nycaptor_spriteram_r, nycaptor_spriteram_w)
489
 
        AM_RANGE(0xdca0, 0xdcbf) AM_WRITE(nycaptor_scrlram_w) AM_BASE_MEMBER(nycaptor_state, m_scrlram)
 
477
        AM_RANGE(0xdca0, 0xdcbf) AM_WRITE(nycaptor_scrlram_w) AM_SHARE("scrlram")
490
478
        AM_RANGE(0xdd00, 0xdeff) AM_READWRITE(nycaptor_palette_r, nycaptor_palette_w)
491
479
        AM_RANGE(0xdf00, 0xdf00) AM_READ(nycaptor_bx_r)
492
480
        AM_RANGE(0xdf01, 0xdf01) AM_READ(nycaptor_by_r)
496
484
        AM_RANGE(0xe000, 0xffff) AM_READWRITE(nycaptor_sharedram_r, nycaptor_sharedram_w)
497
485
ADDRESS_MAP_END
498
486
 
499
 
static READ8_HANDLER( unk_r )
 
487
READ8_MEMBER(nycaptor_state::unk_r)
500
488
{
501
 
        return space->machine().rand();
 
489
        return machine().rand();
502
490
}
503
491
 
504
 
static ADDRESS_MAP_START( bronx_master_map, AS_PROGRAM, 8 )
 
492
static ADDRESS_MAP_START( bronx_master_map, AS_PROGRAM, 8, nycaptor_state )
505
493
        AM_RANGE(0x0000, 0x7fff) AM_ROM
506
494
        AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1")
507
 
        AM_RANGE(0xc000, 0xcfff) AM_READWRITE(nycaptor_videoram_r, nycaptor_videoram_w) AM_BASE_SIZE_MEMBER(nycaptor_state, m_videoram, m_videoram_size)
 
495
        AM_RANGE(0xc000, 0xcfff) AM_READWRITE(nycaptor_videoram_r, nycaptor_videoram_w) AM_SHARE("videoram")
508
496
        AM_RANGE(0xd000, 0xd000) AM_READ(cyclshtg_mcu_r) AM_WRITENOP
509
497
        AM_RANGE(0xd001, 0xd001) AM_WRITE(sub_cpu_halt_w)
510
498
        AM_RANGE(0xd002, 0xd002) AM_READWRITE(nycaptor_generic_control_r, cyclshtg_generic_control_w)
520
508
        AM_RANGE(0xd806, 0xd806) AM_READNOP
521
509
        AM_RANGE(0xd807, 0xd807) AM_READ(cyclshtg_mcu_status_r)
522
510
        AM_RANGE(0xdc00, 0xdc9f) AM_READWRITE(nycaptor_spriteram_r, nycaptor_spriteram_w)
523
 
        AM_RANGE(0xdca0, 0xdcbf) AM_READWRITE(nycaptor_scrlram_r, nycaptor_scrlram_w) AM_BASE_MEMBER(nycaptor_state, m_scrlram)
 
511
        AM_RANGE(0xdca0, 0xdcbf) AM_READWRITE(nycaptor_scrlram_r, nycaptor_scrlram_w) AM_SHARE("scrlram")
524
512
        AM_RANGE(0xdd00, 0xdeff) AM_READWRITE(nycaptor_palette_r, nycaptor_palette_w)
525
513
        AM_RANGE(0xdf03, 0xdf03) AM_READWRITE(nycaptor_gfxctrl_r, nycaptor_gfxctrl_w)
526
 
        AM_RANGE(0xe000, 0xffff) AM_READWRITE(nycaptor_sharedram_r, nycaptor_sharedram_w) AM_BASE_MEMBER(nycaptor_state, m_sharedram)
 
514
        AM_RANGE(0xe000, 0xffff) AM_READWRITE(nycaptor_sharedram_r, nycaptor_sharedram_w) AM_SHARE("sharedram")
527
515
ADDRESS_MAP_END
528
516
 
529
 
static ADDRESS_MAP_START( bronx_slave_map, AS_PROGRAM, 8 )
 
517
static ADDRESS_MAP_START( bronx_slave_map, AS_PROGRAM, 8, nycaptor_state )
530
518
        AM_RANGE(0x0000, 0x7fff) AM_ROM
531
 
        AM_RANGE(0xc000, 0xcfff) AM_READWRITE(nycaptor_videoram_r, nycaptor_videoram_w) AM_BASE_SIZE_MEMBER(nycaptor_state, m_videoram, m_videoram_size)
 
519
        AM_RANGE(0xc000, 0xcfff) AM_READWRITE(nycaptor_videoram_r, nycaptor_videoram_w) AM_SHARE("videoram")
532
520
        AM_RANGE(0xd800, 0xd800) AM_READ_PORT("DSWA")
533
521
        AM_RANGE(0xd801, 0xd801) AM_READ_PORT("DSWB")
534
522
        AM_RANGE(0xd802, 0xd802) AM_READ_PORT("DSWC")
537
525
        AM_RANGE(0xd805, 0xd805) AM_READ(cyclshtg_mcu_status_r1)
538
526
        AM_RANGE(0xd807, 0xd807) AM_READ(cyclshtg_mcu_status_r)
539
527
        AM_RANGE(0xdc00, 0xdc9f) AM_READWRITE(nycaptor_spriteram_r, nycaptor_spriteram_w)
540
 
        AM_RANGE(0xdca0, 0xdcbf) AM_WRITE(nycaptor_scrlram_w) AM_BASE_MEMBER(nycaptor_state, m_scrlram)
 
528
        AM_RANGE(0xdca0, 0xdcbf) AM_WRITE(nycaptor_scrlram_w) AM_SHARE("scrlram")
541
529
        AM_RANGE(0xdd00, 0xdeff) AM_READWRITE(nycaptor_palette_r, nycaptor_palette_w)
542
530
        AM_RANGE(0xdf00, 0xdf00) AM_READ(nycaptor_bx_r)
543
531
        AM_RANGE(0xdf01, 0xdf01) AM_READ(nycaptor_by_r)
546
534
        AM_RANGE(0xe000, 0xffff) AM_READWRITE(nycaptor_sharedram_r, nycaptor_sharedram_w)
547
535
ADDRESS_MAP_END
548
536
 
549
 
static ADDRESS_MAP_START( bronx_slave_io_map, AS_IO, 8 )
 
537
static ADDRESS_MAP_START( bronx_slave_io_map, AS_IO, 8, nycaptor_state )
550
538
        AM_RANGE(0x0000, 0x7fff) AM_ROM AM_REGION("user1", 0)
551
539
ADDRESS_MAP_END
552
540
 
1366
1354
{
1367
1355
        nycaptor_state *state = machine.driver_data<nycaptor_state>();
1368
1356
        int i;
1369
 
        UINT8 *rom = machine.region("maincpu")->base();
 
1357
        UINT8 *rom = state->memregion("maincpu")->base();
1370
1358
 
1371
1359
        for (i = 0; i < 0x20000; i++)
1372
1360
                rom[i] = BITSWAP8(rom[i], 0, 1, 2, 3, 4, 5, 6, 7);
1378
1366
{
1379
1367
        nycaptor_state *state = machine.driver_data<nycaptor_state>();
1380
1368
        int i;
1381
 
        UINT8 *rom = machine.region("maincpu")->base();
 
1369
        UINT8 *rom = state->memregion("maincpu")->base();
1382
1370
 
1383
1371
        for (i = 0; i < 0x20000; i++)
1384
1372
                rom[i] = BITSWAP8(rom[i], 0, 1, 2, 3, 4, 5, 6, 7);