Esempio n. 1
0
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]);
}
Esempio n. 2
0
static MACHINE_START( kangaroo_mcu )
{
	kangaroo_state *state = (kangaroo_state *)machine->driver_data;

	MACHINE_START_CALL(kangaroo);
	memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xef00, 0xefff, 0, 0, mcu_sim_r, mcu_sim_w);
	state_save_register_global(machine, state->clock);
}
Esempio n. 3
0
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);
}
Esempio n. 4
0
static void vendetta_video_banking( running_machine *machine, int select )
{
	vendetta_state *state = (vendetta_state *)machine->driver_data;
	const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM);

	if (select & 1)
	{
		memory_install_read_bank(space, state->video_banking_base + 0x2000, state->video_banking_base + 0x2fff, 0, 0, "bank4" );
		memory_install_write8_handler(space, state->video_banking_base + 0x2000, state->video_banking_base + 0x2fff, 0, 0, paletteram_xBBBBBGGGGGRRRRR_be_w );
		memory_install_readwrite8_device_handler(space, state->k053246, state->video_banking_base + 0x0000, state->video_banking_base + 0x0fff, 0, 0, k053247_r, k053247_w );
		memory_set_bankptr(machine, "bank4", machine->generic.paletteram.v);
	}
	else
	{
		memory_install_readwrite8_handler(space, state->video_banking_base + 0x2000, state->video_banking_base + 0x2fff, 0, 0, vendetta_K052109_r, vendetta_K052109_w );
		memory_install_readwrite8_device_handler(space, state->k052109, state->video_banking_base + 0x0000, state->video_banking_base + 0x0fff, 0, 0, k052109_r, k052109_w );
	}
}
Esempio n. 5
0
void a600xl_mmu(running_machine *machine, UINT8 new_mmu)
{
	read8_machine_func rbank2;
	write8_machine_func wbank2;

	/* check if self-test ROM changed */
	if ( new_mmu & 0x80 )
	{
		logerror("%s MMU SELFTEST RAM\n", Machine->gamedrv->name);
		rbank2 = SMH_NOP;
		wbank2 = SMH_NOP;
	}
	else
	{
		logerror("%s MMU SELFTEST ROM\n", Machine->gamedrv->name);
		rbank2 = SMH_BANK2;
		wbank2 = SMH_UNMAP;
	}
	memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x57ff, 0, 0, rbank2, wbank2);
	if (rbank2 == SMH_BANK2)
		memory_set_bankptr(2, memory_region(REGION_CPU1)+0x5000);
}
Esempio n. 6
0
static MACHINE_START( kangaroo_mcu )
{
	MACHINE_START_CALL(kangaroo);
	memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xef00, 0xefff, 0, 0, mcu_sim_r, mcu_sim_w);
	kangaroo_clock = 0;
}
Esempio n. 7
0
static DRIVER_INIT( trvmstr )
{
	/* install questions' handlers  */
	memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xc002, 0, 0, trvmstr_questions_r, trvmstr_questions_w);
}
Esempio n. 8
0
void a800xl_mmu(running_machine *machine, UINT8 new_mmu)
{
	read8_machine_func rbank1, rbank2, rbank3, rbank4;
	write8_machine_func wbank1, wbank2, wbank3, wbank4;
	UINT8 *base1, *base2, *base3, *base4;

	/* check if memory C000-FFFF changed */
	if( new_mmu & 0x01 )
	{
		logerror("%s MMU BIOS ROM\n", Machine->gamedrv->name);
		rbank3 = SMH_BANK3;
		wbank3 = SMH_UNMAP;
		base3 = memory_region(REGION_CPU1)+0x14000;  /* 8K lo BIOS */
		rbank4 = SMH_BANK4;
		wbank4 = SMH_UNMAP;
		base4 = memory_region(REGION_CPU1)+0x15800;  /* 4K FP ROM + 8K hi BIOS */
	}
	else
	{
		logerror("%s MMU BIOS RAM\n", Machine->gamedrv->name);
		rbank3 = SMH_BANK3;
		wbank3 = SMH_BANK3;
		base3 = memory_region(REGION_CPU1)+0x0c000;  /* 8K RAM */
		rbank4 = SMH_BANK4;
		wbank4 = SMH_BANK4;
		base4 = memory_region(REGION_CPU1)+0x0d800;  /* 4K RAM + 8K RAM */
	}
	memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xc000, 0xcfff, 0, 0, rbank3, wbank3);
	memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xd800, 0xffff, 0, 0, rbank4, wbank4);
	memory_set_bankptr(3, base3);
	memory_set_bankptr(4, base4);

	/* check if BASIC changed */
	if( new_mmu & 0x02 )
	{
		logerror("%s MMU BASIC RAM\n", Machine->gamedrv->name);
		rbank1 = SMH_BANK1;
		wbank1 = SMH_BANK1;
		base1 = memory_region(REGION_CPU1)+0x0a000;  /* 8K RAM */
	}
	else
	{
		logerror("%s MMU BASIC ROM\n", Machine->gamedrv->name);
		rbank1 = SMH_BANK1;
		wbank1 = SMH_UNMAP;
		base1 = memory_region(REGION_CPU1)+0x10000;  /* 8K BASIC */
	}
	memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0xa000, 0xbfff, 0, 0, rbank1, wbank1);
	memory_set_bankptr(1, base1);

	/* check if self-test ROM changed */
	if( new_mmu & 0x80 )
	{
		logerror("%s MMU SELFTEST RAM\n", Machine->gamedrv->name);
		rbank2 = SMH_BANK2;
		wbank2 = SMH_BANK2;
		base2 = memory_region(REGION_CPU1)+0x05000;  /* 0x0800 bytes */
	}
	else
	{
		logerror("%s MMU SELFTEST ROM\n", Machine->gamedrv->name);
		rbank2 = SMH_BANK2;
		wbank2 = SMH_UNMAP;
		base2 = memory_region(REGION_CPU1)+0x15000;  /* 0x0800 bytes */
	}
	memory_install_readwrite8_handler(machine, 0, ADDRESS_SPACE_PROGRAM, 0x5000, 0x57ff, 0, 0, rbank2, wbank2);
	memory_set_bankptr(2, base2);
}
Esempio n. 9
0
static DRIVER_INIT( trvmstr )
{
	/* install questions' handlers  */
	memory_install_readwrite8_handler(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0xc000, 0xc002, 0, 0, trvmstr_questions_r, trvmstr_questions_w);
}