static WRITE8_HANDLER( pending_command_clear_w ) { pending_command = 0; } static WRITE8_HANDLER( taotaido_sh_bankswitch_w ) { UINT8 *rom = memory_region(space->machine, "audiocpu") + 0x10000; memory_set_bankptr(space->machine, 1,rom + (data & 0x03) * 0x8000); } static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x77ff) AM_ROM AM_RANGE(0x7800, 0x7fff) AM_RAM AM_RANGE(0x8000, 0xffff) AM_READWRITE(SMH_BANK(1), SMH_ROM) ADDRESS_MAP_END static ADDRESS_MAP_START( sound_port_map, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x03) AM_DEVREADWRITE("ym", ym2610_r, ym2610_w) AM_RANGE(0x04, 0x04) AM_WRITE(taotaido_sh_bankswitch_w) AM_RANGE(0x08, 0x08) AM_WRITE(pending_command_clear_w) AM_RANGE(0x0c, 0x0c) AM_READ(soundlatch_r) ADDRESS_MAP_END static INPUT_PORTS_START( taotaido ) PORT_START("P1") /* 0xffff81.b */ PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
static WRITE8_DEVICE_HANDLER( upscope_cia_0_porta_w ) { /* switch banks as appropriate */ memory_set_bank(device->machine, 1, data & 1); /* swap the write handlers between ROM and bank 1 based on the bit */ if ((data & 1) == 0) /* overlay disabled, map RAM on 0x000000 */ memory_install_write16_handler(cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x000000, 0x07ffff, 0, 0, (write16_space_func)SMH_BANK(1)); else /* overlay enabled, map Amiga system ROM on 0x000000 */ memory_install_write16_handler(cputag_get_address_space(device->machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x000000, 0x07ffff, 0, 0, (write16_space_func)SMH_UNMAP); }
static DRIVER_INIT( bradley ) { memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x400, 0x7ff, 0, 0, (read8_space_func)SMH_BANK(1), (write8_space_func)SMH_BANK(1)); memory_set_bankptr(machine, 1, auto_alloc_array(machine, UINT8, 0x400)); memory_install_read_port_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1808, 0x1808, 0, 0, "1808"); memory_install_read_port_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1809, 0x1809, 0, 0, "1809"); memory_install_read8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x180a, 0x180a, 0, 0, analog_data_r); memory_install_write8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0x1848, 0x1850, 0, 0, analog_select_w); }
{ cputag_set_input_line(space->machine, "maincpu", 0, HOLD_LINE); } // else // logerror("%x \n", cpu_get_previouspc(space->cpu)); } trvmadns_tileram[offset] = data; tilemap_mark_tile_dirty(bg_tilemap,offset >> 1); } static ADDRESS_MAP_START( cpu_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x5fff) AM_ROM AM_RANGE(0x6000, 0x6fff) AM_READ(SMH_BANK(1)) AM_RANGE(0x7000, 0x7fff) AM_READ(SMH_BANK(2)) AM_RANGE(0x6000, 0x7fff) AM_WRITE(trvmadns_gfxram_w) AM_BASE(&trvmadns_gfxram) AM_RANGE(0x8000, 0x87ff) AM_RAM AM_RANGE(0xc000, 0xc01f) AM_RAM_WRITE(paletteram_xxxxBBBBRRRRGGGG_le_w) AM_BASE(&paletteram) AM_RANGE(0xa000, 0xbfff) AM_RAM_WRITE(trvmadns_tileram_w) AM_BASE(&trvmadns_tileram) AM_RANGE(0xe000, 0xe000) AM_WRITE(w2)//NOP AM_RANGE(0xe004, 0xe004) AM_WRITE(w3)//NOP ADDRESS_MAP_END static ADDRESS_MAP_START( io_map, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x01) AM_DEVWRITE("ay", ay8910_address_data_w) AM_RANGE(0x02, 0x02) AM_READ_PORT("IN0") AM_RANGE(0x80, 0x80) AM_WRITE(trvmadns_banking_w) ADDRESS_MAP_END
soundlatch_w(space,0,data|0x80); } static READ8_HANDLER (sound_status_r) { return sound_status|4; } static WRITE8_HANDLER(tomaincpu_w) { sound_status|=0x80; } static ADDRESS_MAP_START( maincpu_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x3fff) AM_ROM AM_RANGE(0x4000, 0x7fff) AM_READWRITE(SMH_BANK(1), SMH_NOP) AM_RANGE(0x8000, 0x9fff) AM_ROM AM_RANGE(0xa000, 0xa7ff) AM_RAM AM_RANGE(0xa800, 0xa800) AM_READ_PORT("P1") AM_RANGE(0xa801, 0xa801) AM_READ_PORT("P2") AM_RANGE(0xa802, 0xa802) AM_READ_PORT("DSW") AM_RANGE(0xa803, 0xa803) AM_READNOP /* watchdog ? */ AM_RANGE(0xa804, 0xa804) AM_WRITE(ksayakyu_videoctrl_w) AM_RANGE(0xa805, 0xa805) AM_WRITE(latch_w) AM_RANGE(0xa806, 0xa806) AM_READ(sound_status_r) AM_RANGE(0xa807, 0xa807) AM_READNOP /* watchdog ? */ AM_RANGE(0xa808, 0xa808) AM_WRITE(bank_select_w) AM_RANGE(0xb000, 0xb7ff) AM_RAM_WRITE(ksayakyu_videoram_w) AM_BASE(&videoram) AM_RANGE(0xb800, 0xbfff) AM_RAM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) ADDRESS_MAP_END
static WRITE16_HANDLER( arcadia_multibios_change_game ) { memory_install_read16_handler(space, 0x800000, 0x97ffff, 0, 0, (read16_space_func)((data == 0) ? SMH_BANK(2) : SMH_NOP)); }
PORT_START("SERVICE") PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_TILT ) PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) INPUT_PORTS_END /* DAIKAIJU */ static ADDRESS_MAP_START( daikaiju_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0x9fff) AM_READ(SMH_BANK(1)) AM_RANGE(0xa000, 0xbfff) AM_RAM /* SRAM */ AM_RANGE(0xc000, 0xdfff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) /* SCREEN RAM */ AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_BASE(&lsasquad_scrollram) /* SCROLL RAM */ AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_BASE(&spriteram) AM_SIZE(&spriteram_size) /* OBJECT RAM */ AM_RANGE(0xe800, 0xe800) AM_READ_PORT("DSWA") AM_RANGE(0xe801, 0xe801) AM_READ_PORT("DSWB") AM_RANGE(0xe803, 0xe803) AM_READ(daikaiju_mcu_status_r) /* COIN + 68705 status */ AM_RANGE(0xe804, 0xe804) AM_READ_PORT("P1") AM_RANGE(0xe805, 0xe805) AM_READ_PORT("P2") AM_RANGE(0xe806, 0xe806) AM_READ_PORT("START") AM_RANGE(0xe807, 0xe807) AM_READ_PORT("SERVICE") AM_RANGE(0xea00, 0xea00) AM_WRITE(lsasquad_bankswitch_w) AM_RANGE(0xec00, 0xec00) AM_WRITE(lsasquad_sound_command_w) AM_RANGE(0xec01, 0xec01) AM_READ(lsasquad_sound_status_r) AM_RANGE(0xee00, 0xee00) AM_READWRITE(daikaiju_mcu_r, daikaiju_mcu_w)
static WRITE8_HANDLER( kikcubic_coin_w ) { /* bits 0 is flip screen */ /* bit 1 is used but unknown */ /* bits 4/5 are coin counters */ coin_counter_w(0,data & 0x10); coin_counter_w(1,data & 0x20); } static ADDRESS_MAP_START( vigilant_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_BANK(1)) /* Fallthrough */ AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0xc020, 0xc0df) AM_RAM_WRITE(SMH_RAM) AM_BASE(&spriteram) AM_SIZE(&spriteram_size) AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(vigilant_paletteram_w) AM_BASE(&paletteram) AM_RANGE(0xd000, 0xdfff) AM_RAM AM_BASE(&videoram) AM_SIZE(&videoram_size) AM_RANGE(0xe000, 0xefff) AM_RAM ADDRESS_MAP_END static ADDRESS_MAP_START( vigilant_io_map, ADDRESS_SPACE_IO, 8 ) ADDRESS_MAP_GLOBAL_MASK(0xff) AM_RANGE(0x00, 0x00) AM_READ_PORT("IN0") AM_WRITE(m72_sound_command_byte_w) /* SD */ AM_RANGE(0x01, 0x01) AM_READ_PORT("IN1") AM_WRITE(vigilant_out2_w) /* OUT2 */ AM_RANGE(0x02, 0x02) AM_READ_PORT("IN2") AM_RANGE(0x03, 0x03) AM_READ_PORT("DSW1") AM_RANGE(0x04, 0x04) AM_READ_PORT("DSW2") AM_WRITE(vigilant_bank_select_w) /* PBANK */ AM_RANGE(0x80, 0x81) AM_WRITE(vigilant_horiz_scroll_w) /* HSPL, HSPH */
ROM_END /*************************************************************************** Game driver(s) ***************************************************************************/ static KONAMI_SETLINES_CALLBACK( crimfght_banking ) { UINT8 *RAM = memory_region(device->machine, "maincpu"); int offs = 0; /* bit 5 = select work RAM or palette */ if (lines & 0x20) { memory_install_readwrite8_handler(cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM), 0x0000, 0x03ff, 0, 0, (read8_space_func)SMH_BANK(3), paletteram_xBBBBBGGGGGRRRRR_be_w); memory_set_bankptr(device->machine, 3, paletteram); } else memory_install_readwrite8_handler(cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM), 0x0000, 0x03ff, 0, 0, (read8_space_func)SMH_BANK(1), (write8_space_func)SMH_BANK(1)); /* RAM */ /* bit 6 = enable char ROM reading through the video RAM */ K052109_set_RMRD_line((lines & 0x40) ? ASSERT_LINE : CLEAR_LINE); offs = 0x10000 + ((lines & 0x0f) * 0x2000); memory_set_bankptr(device->machine, 2, &RAM[offs]); }
int bit = !BIT(offset, 13); cpu_interrupt_enable(cputag_get_cpu(space->machine, "mcu"), bit); if (!bit) cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE); } static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x0fff) AM_RAM_WRITE(pacland_videoram_w) AM_BASE(&pacland_videoram) AM_RANGE(0x1000, 0x1fff) AM_RAM_WRITE(pacland_videoram2_w) AM_BASE(&pacland_videoram2) AM_RANGE(0x2000, 0x37ff) AM_RAM AM_BASE(&pacland_spriteram) AM_RANGE(0x3800, 0x3801) AM_WRITE(pacland_scroll0_w) AM_RANGE(0x3a00, 0x3a01) AM_WRITE(pacland_scroll1_w) AM_RANGE(0x3c00, 0x3c00) AM_WRITE(pacland_bankswitch_w) AM_RANGE(0x4000, 0x5fff) AM_READ(SMH_BANK(1)) AM_RANGE(0x6800, 0x6bff) AM_DEVREADWRITE("namco", namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */ AM_RANGE(0x7000, 0x7fff) AM_WRITE(pacland_irq_1_ctrl_w) AM_RANGE(0x7800, 0x7fff) AM_READ(watchdog_reset_r) AM_RANGE(0x8000, 0xffff) AM_READ(SMH_ROM) AM_RANGE(0x8000, 0x8fff) AM_WRITE(pacland_subreset_w) AM_RANGE(0x9000, 0x9fff) AM_WRITE(pacland_flipscreen_w) ADDRESS_MAP_END static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x001f) AM_READWRITE(hd63701_internal_registers_r, hd63701_internal_registers_w) AM_RANGE(0x0080, 0x00ff) AM_RAM AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE("namco", namcos1_cus30_r, namcos1_cus30_w) AM_BASE(&namco_wavedata) /* PSG device, shared RAM */ AM_RANGE(0x2000, 0x3fff) AM_WRITE(watchdog_reset_w) /* watchdog? */ AM_RANGE(0x4000, 0x7fff) AM_WRITE(pacland_irq_2_ctrl_w) AM_RANGE(0x8000, 0xbfff) AM_READ(SMH_ROM)