396
392
/**** sound pan control ****/
398
static WRITE8_HANDLER( ninjaw_pancontrol )
394
WRITE8_MEMBER(ninjaw_state::ninjaw_pancontrol)
400
ninjaw_state *state = space->machine().driver_data<ninjaw_state>();
401
396
device_t *flt = NULL;
406
case 0: flt = state->m_2610_1l; break;
407
case 1: flt = state->m_2610_1r; break;
408
case 2: flt = state->m_2610_2l; break;
409
case 3: flt = state->m_2610_2r; break;
401
case 0: flt = m_2610_1l; break;
402
case 1: flt = m_2610_1r; break;
403
case 2: flt = m_2610_2l; break;
404
case 3: flt = m_2610_2r; break;
412
state->m_pandata[offset] = (float)data * (100.f / 255.0f);
413
//popmessage(" pan %02x %02x %02x %02x", state->m_pandata[0], state->m_pandata[1], state->m_pandata[2], state->m_pandata[3] );
414
flt_volume_set_volume(flt, state->m_pandata[offset] / 100.0);
407
m_pandata[offset] = (float)data * (100.f / 255.0f);
408
//popmessage(" pan %02x %02x %02x %02x", m_pandata[0], m_pandata[1], m_pandata[2], m_pandata[3] );
409
flt_volume_set_volume(flt, m_pandata[offset] / 100.0);
418
static WRITE16_HANDLER( tc0100scn_triple_screen_w )
413
WRITE16_MEMBER(ninjaw_state::tc0100scn_triple_screen_w)
420
ninjaw_state *state = space->machine().driver_data<ninjaw_state>();
422
tc0100scn_word_w(state->m_tc0100scn_1, offset, data, mem_mask);
423
tc0100scn_word_w(state->m_tc0100scn_2, offset, data, mem_mask);
424
tc0100scn_word_w(state->m_tc0100scn_3, offset, data, mem_mask);
416
tc0100scn_word_w(m_tc0100scn_1, offset, data, mem_mask);
417
tc0100scn_word_w(m_tc0100scn_2, offset, data, mem_mask);
418
tc0100scn_word_w(m_tc0100scn_3, offset, data, mem_mask);
427
421
/***********************************************************
428
422
MEMORY STRUCTURES
429
423
***********************************************************/
431
static ADDRESS_MAP_START( ninjaw_master_map, AS_PROGRAM, 16 )
425
static ADDRESS_MAP_START( ninjaw_master_map, AS_PROGRAM, 16, ninjaw_state )
432
426
AM_RANGE(0x000000, 0x0bffff) AM_ROM
433
427
AM_RANGE(0x0c0000, 0x0cffff) AM_RAM /* main ram */
434
AM_RANGE(0x200000, 0x200001) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_portreg_r, tc0220ioc_portreg_w, 0x00ff)
435
AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0x00ff)
428
AM_RANGE(0x200000, 0x200001) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_portreg_r, tc0220ioc_portreg_w, 0x00ff)
429
AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0x00ff)
436
430
AM_RANGE(0x210000, 0x210001) AM_WRITE(cpua_ctrl_w)
437
431
AM_RANGE(0x220000, 0x220003) AM_READWRITE(ninjaw_sound_r,ninjaw_sound_w)
438
432
AM_RANGE(0x240000, 0x24ffff) AM_RAM AM_SHARE("share1")
439
AM_RANGE(0x260000, 0x263fff) AM_RAM AM_SHARE("share2") AM_BASE_SIZE_MEMBER(ninjaw_state, m_spriteram, m_spriteram_size)
440
AM_RANGE(0x280000, 0x293fff) AM_DEVREAD("tc0100scn_1", tc0100scn_word_r) AM_WRITE(tc0100scn_triple_screen_w) /* tilemaps (1st screen/all screens) */
441
AM_RANGE(0x2a0000, 0x2a000f) AM_DEVREADWRITE("tc0100scn_1", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
442
AM_RANGE(0x2c0000, 0x2d3fff) AM_DEVREADWRITE("tc0100scn_2", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps (2nd screen) */
443
AM_RANGE(0x2e0000, 0x2e000f) AM_DEVREADWRITE("tc0100scn_2", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
444
AM_RANGE(0x300000, 0x313fff) AM_DEVREADWRITE("tc0100scn_3", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps (3rd screen) */
445
AM_RANGE(0x320000, 0x32000f) AM_DEVREADWRITE("tc0100scn_3", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
446
AM_RANGE(0x340000, 0x340007) AM_DEVREADWRITE("tc0110pcr_1", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (1st screen) */
447
AM_RANGE(0x350000, 0x350007) AM_DEVREADWRITE("tc0110pcr_2", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (2nd screen) */
448
AM_RANGE(0x360000, 0x360007) AM_DEVREADWRITE("tc0110pcr_3", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (3rd screen) */
433
AM_RANGE(0x260000, 0x263fff) AM_RAM AM_SHARE("spriteram")
434
AM_RANGE(0x280000, 0x293fff) AM_DEVREAD_LEGACY("tc0100scn_1", tc0100scn_word_r) AM_WRITE(tc0100scn_triple_screen_w) /* tilemaps (1st screen/all screens) */
435
AM_RANGE(0x2a0000, 0x2a000f) AM_DEVREADWRITE_LEGACY("tc0100scn_1", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
436
AM_RANGE(0x2c0000, 0x2d3fff) AM_DEVREADWRITE_LEGACY("tc0100scn_2", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps (2nd screen) */
437
AM_RANGE(0x2e0000, 0x2e000f) AM_DEVREADWRITE_LEGACY("tc0100scn_2", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
438
AM_RANGE(0x300000, 0x313fff) AM_DEVREADWRITE_LEGACY("tc0100scn_3", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps (3rd screen) */
439
AM_RANGE(0x320000, 0x32000f) AM_DEVREADWRITE_LEGACY("tc0100scn_3", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
440
AM_RANGE(0x340000, 0x340007) AM_DEVREADWRITE_LEGACY("tc0110pcr_1", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (1st screen) */
441
AM_RANGE(0x350000, 0x350007) AM_DEVREADWRITE_LEGACY("tc0110pcr_2", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (2nd screen) */
442
AM_RANGE(0x360000, 0x360007) AM_DEVREADWRITE_LEGACY("tc0110pcr_3", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (3rd screen) */
451
445
// NB there could be conflicts between which cpu writes what to the
452
446
// palette, as our interleaving won't match the original board.
454
static ADDRESS_MAP_START( ninjaw_slave_map, AS_PROGRAM, 16 )
448
static ADDRESS_MAP_START( ninjaw_slave_map, AS_PROGRAM, 16, ninjaw_state )
455
449
AM_RANGE(0x000000, 0x05ffff) AM_ROM
456
450
AM_RANGE(0x080000, 0x08ffff) AM_RAM /* main ram */
457
AM_RANGE(0x200000, 0x200001) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_portreg_r, tc0220ioc_portreg_w, 0x00ff)
458
AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0x00ff)
451
AM_RANGE(0x200000, 0x200001) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_portreg_r, tc0220ioc_portreg_w, 0x00ff)
452
AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0x00ff)
459
453
AM_RANGE(0x240000, 0x24ffff) AM_RAM AM_SHARE("share1")
460
AM_RANGE(0x260000, 0x263fff) AM_RAM AM_SHARE("share2")
461
AM_RANGE(0x280000, 0x293fff) AM_DEVREAD("tc0100scn_1", tc0100scn_word_r) AM_WRITE(tc0100scn_triple_screen_w) /* tilemaps (1st screen/all screens) */
462
AM_RANGE(0x340000, 0x340007) AM_DEVREADWRITE("tc0110pcr_1", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (1st screen) */
463
AM_RANGE(0x350000, 0x350007) AM_DEVREADWRITE("tc0110pcr_2", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (2nd screen) */
464
AM_RANGE(0x360000, 0x360007) AM_DEVREADWRITE("tc0110pcr_3", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (3rd screen) */
454
AM_RANGE(0x260000, 0x263fff) AM_RAM AM_SHARE("spriteram")
455
AM_RANGE(0x280000, 0x293fff) AM_DEVREAD_LEGACY("tc0100scn_1", tc0100scn_word_r) AM_WRITE(tc0100scn_triple_screen_w) /* tilemaps (1st screen/all screens) */
456
AM_RANGE(0x340000, 0x340007) AM_DEVREADWRITE_LEGACY("tc0110pcr_1", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (1st screen) */
457
AM_RANGE(0x350000, 0x350007) AM_DEVREADWRITE_LEGACY("tc0110pcr_2", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (2nd screen) */
458
AM_RANGE(0x360000, 0x360007) AM_DEVREADWRITE_LEGACY("tc0110pcr_3", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (3rd screen) */
467
static ADDRESS_MAP_START( darius2_master_map, AS_PROGRAM, 16 )
461
static ADDRESS_MAP_START( darius2_master_map, AS_PROGRAM, 16, ninjaw_state )
468
462
AM_RANGE(0x000000, 0x0bffff) AM_ROM
469
463
AM_RANGE(0x0c0000, 0x0cffff) AM_RAM /* main ram */
470
AM_RANGE(0x200000, 0x200001) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_portreg_r, tc0220ioc_portreg_w, 0x00ff)
471
AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0x00ff)
464
AM_RANGE(0x200000, 0x200001) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_portreg_r, tc0220ioc_portreg_w, 0x00ff)
465
AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0x00ff)
472
466
AM_RANGE(0x210000, 0x210001) AM_WRITE(cpua_ctrl_w)
473
467
AM_RANGE(0x220000, 0x220003) AM_READWRITE(ninjaw_sound_r,ninjaw_sound_w)
474
468
AM_RANGE(0x240000, 0x24ffff) AM_RAM AM_SHARE("share1")
475
AM_RANGE(0x260000, 0x263fff) AM_RAM AM_SHARE("share2") AM_BASE_SIZE_MEMBER(ninjaw_state, m_spriteram, m_spriteram_size)
476
AM_RANGE(0x280000, 0x293fff) AM_DEVREAD("tc0100scn_1", tc0100scn_word_r) AM_WRITE(tc0100scn_triple_screen_w) /* tilemaps (1st screen/all screens) */
477
AM_RANGE(0x2a0000, 0x2a000f) AM_DEVREADWRITE("tc0100scn_1", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
478
AM_RANGE(0x2c0000, 0x2d3fff) AM_DEVREADWRITE("tc0100scn_2", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps (2nd screen) */
479
AM_RANGE(0x2e0000, 0x2e000f) AM_DEVREADWRITE("tc0100scn_2", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
480
AM_RANGE(0x300000, 0x313fff) AM_DEVREADWRITE("tc0100scn_3", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps (3rd screen) */
481
AM_RANGE(0x320000, 0x32000f) AM_DEVREADWRITE("tc0100scn_3", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
482
AM_RANGE(0x340000, 0x340007) AM_DEVREADWRITE("tc0110pcr_1", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (1st screen) */
483
AM_RANGE(0x350000, 0x350007) AM_DEVREADWRITE("tc0110pcr_2", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (2nd screen) */
484
AM_RANGE(0x360000, 0x360007) AM_DEVREADWRITE("tc0110pcr_3", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (3rd screen) */
469
AM_RANGE(0x260000, 0x263fff) AM_RAM AM_SHARE("spriteram")
470
AM_RANGE(0x280000, 0x293fff) AM_DEVREAD_LEGACY("tc0100scn_1", tc0100scn_word_r) AM_WRITE(tc0100scn_triple_screen_w) /* tilemaps (1st screen/all screens) */
471
AM_RANGE(0x2a0000, 0x2a000f) AM_DEVREADWRITE_LEGACY("tc0100scn_1", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
472
AM_RANGE(0x2c0000, 0x2d3fff) AM_DEVREADWRITE_LEGACY("tc0100scn_2", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps (2nd screen) */
473
AM_RANGE(0x2e0000, 0x2e000f) AM_DEVREADWRITE_LEGACY("tc0100scn_2", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
474
AM_RANGE(0x300000, 0x313fff) AM_DEVREADWRITE_LEGACY("tc0100scn_3", tc0100scn_word_r, tc0100scn_word_w) /* tilemaps (3rd screen) */
475
AM_RANGE(0x320000, 0x32000f) AM_DEVREADWRITE_LEGACY("tc0100scn_3", tc0100scn_ctrl_word_r, tc0100scn_ctrl_word_w)
476
AM_RANGE(0x340000, 0x340007) AM_DEVREADWRITE_LEGACY("tc0110pcr_1", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (1st screen) */
477
AM_RANGE(0x350000, 0x350007) AM_DEVREADWRITE_LEGACY("tc0110pcr_2", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (2nd screen) */
478
AM_RANGE(0x360000, 0x360007) AM_DEVREADWRITE_LEGACY("tc0110pcr_3", tc0110pcr_word_r, tc0110pcr_step1_word_w) /* palette (3rd screen) */
487
static ADDRESS_MAP_START( darius2_slave_map, AS_PROGRAM, 16 )
481
static ADDRESS_MAP_START( darius2_slave_map, AS_PROGRAM, 16, ninjaw_state )
488
482
AM_RANGE(0x000000, 0x05ffff) AM_ROM
489
483
AM_RANGE(0x080000, 0x08ffff) AM_RAM /* main ram */
490
AM_RANGE(0x200000, 0x200001) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_portreg_r, tc0220ioc_portreg_w, 0x00ff)
491
AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0x00ff)
484
AM_RANGE(0x200000, 0x200001) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_portreg_r, tc0220ioc_portreg_w, 0x00ff)
485
AM_RANGE(0x200002, 0x200003) AM_DEVREADWRITE8_LEGACY("tc0220ioc", tc0220ioc_port_r, tc0220ioc_port_w, 0x00ff)
492
486
AM_RANGE(0x240000, 0x24ffff) AM_RAM AM_SHARE("share1")
493
AM_RANGE(0x260000, 0x263fff) AM_RAM AM_SHARE("share2")
494
AM_RANGE(0x280000, 0x293fff) AM_DEVREAD("tc0100scn_1", tc0100scn_word_r) AM_WRITE(tc0100scn_triple_screen_w) /* tilemaps (1st screen/all screens) */
487
AM_RANGE(0x260000, 0x263fff) AM_RAM AM_SHARE("spriteram")
488
AM_RANGE(0x280000, 0x293fff) AM_DEVREAD_LEGACY("tc0100scn_1", tc0100scn_word_r) AM_WRITE(tc0100scn_triple_screen_w) /* tilemaps (1st screen/all screens) */
498
492
/***************************************************************************/
500
static ADDRESS_MAP_START( ninjaw_sound_map, AS_PROGRAM, 8 )
494
static ADDRESS_MAP_START( ninjaw_sound_map, AS_PROGRAM, 8, ninjaw_state )
501
495
AM_RANGE(0x0000, 0x3fff) AM_ROM
502
496
AM_RANGE(0x4000, 0x7fff) AM_ROMBANK("bank10")
503
497
AM_RANGE(0xc000, 0xdfff) AM_RAM
504
AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE("ymsnd", ym2610_r,ym2610_w)
505
AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_slave_port_w)
506
AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE("tc0140syt", tc0140syt_slave_comm_r,tc0140syt_slave_comm_w)
498
AM_RANGE(0xe000, 0xe003) AM_DEVREADWRITE_LEGACY("ymsnd", ym2610_r,ym2610_w)
499
AM_RANGE(0xe200, 0xe200) AM_READNOP AM_DEVWRITE_LEGACY("tc0140syt", tc0140syt_slave_port_w)
500
AM_RANGE(0xe201, 0xe201) AM_DEVREADWRITE_LEGACY("tc0140syt", tc0140syt_slave_comm_r,tc0140syt_slave_comm_w)
507
501
AM_RANGE(0xe400, 0xe403) AM_WRITE(ninjaw_pancontrol) /* pan */
508
502
AM_RANGE(0xea00, 0xea00) AM_READNOP
509
503
AM_RANGE(0xee00, 0xee00) AM_WRITENOP /* ? */