Пример #1
0
void _z80_init(void)
{
#ifdef CPUZ80_CZ80_CORE
	Cz80_Init(&neocd_cz80_struc);
	Cz80_Set_Fetch(&neocd_cz80_struc,0x0000,0xFFFF,(u32)((void *)&mame_z80mem));
	Cz80_Set_ReadB(&neocd_cz80_struc,&cpu_readmem8);
	Cz80_Set_WriteB(&neocd_cz80_struc,&cpu_writemem8);
#if CZ80_USE_WORD_HANDLER
	Cz80_Set_ReadW(&neocd_cz80_struc,&cpu_readmem16);
	Cz80_Set_WriteW(&neocd_cz80_struc,&cpu_writemem16);
#endif
	Cz80_Set_INPort(&neocd_cz80_struc,(CZ80_READ *)&mame_z80_readport16);
	Cz80_Set_OUTPort(&neocd_cz80_struc,(CZ80_WRITE *)&mame_z80_writeport16);
	Cz80_Set_IRQ_Callback(&neocd_cz80_struc,cpu_z80_irq_callback);
	Cz80_Reset(&neocd_cz80_struc);
	//Cz80_Exec(&neocd_cz80_struc,100000);
#endif
#ifdef CPUZ80_MAMEZ80_CORE
	z80_init();
	/*
	z80map1 = mame_z80mem + 0x8000;
	z80map2 = mame_z80mem + 0xc000;
	z80map3 = mame_z80mem + 0xe000;
	z80map4 = mame_z80mem + 0xf000;
	z80_bank[0]=0x8000;
	z80_bank[1]=0xc000;
	z80_bank[2]=0xe000;
	z80_bank[3]=0xf000;
	*/
	z80_reset(NULL);
	//z80_set_irq_callback(cpu_z80_irq_callback);
#endif
}
Пример #2
0
void z80_init(void)
{
	Cz80_Init(&CZ80);
#if (EMU_SYSTEM == CPS1)
	Cz80_Set_Fetch(&CZ80, 0x0000, 0xffff, (UINT32)memory_region_cpu2);
	if (memory_region_user2)
	{
		Cz80_Set_Encrypt_Range(&CZ80, 0x0000, 0x8000, (UINT32)memory_region_user2);
	}
	Cz80_Set_ReadB(&CZ80, z80_read_memory_8);
	Cz80_Set_WriteB(&CZ80, z80_write_memory_8);
#elif (EMU_SYSTEM == CPS2)
	Cz80_Set_Fetch(&CZ80, 0x0000, 0xffff, (UINT32)memory_region_cpu2);
	Cz80_Set_ReadB(&CZ80, &z80_read_memory_8);
	Cz80_Set_WriteB(&CZ80, &z80_write_memory_8);
#elif (EMU_SYSTEM == MVS || EMU_SYSTEM == NCDZ)
	Cz80_Set_Fetch(&CZ80, 0x0000, 0xffff, (UINT32)memory_region_cpu2);
	Cz80_Set_ReadB(&CZ80, &z80_read_memory_8);
	Cz80_Set_WriteB(&CZ80, &z80_write_memory_8);
	Cz80_Set_INPort(&CZ80, &neogeo_z80_port_r);
	Cz80_Set_OUTPort(&CZ80, &neogeo_z80_port_w);
#endif
}