Fix issue with overwriting internal address map for snes. This should be made device_address_map in future but cpu core needs first to be converted to c++ (nw)

This commit is contained in:
Miodrag Milanovic 2013-03-05 10:43:09 +00:00
parent 7d59f1d7e9
commit 6fbf9923e3
3 changed files with 20 additions and 2 deletions

View File

@ -674,6 +674,22 @@ static ADDRESS_MAP_START(_5a22_map, AS_PROGRAM, 8, legacy_cpu_device)
ADDRESS_MAP_END
void set_5a22_map(legacy_cpu_device &cpu)
{
cpu.space(AS_PROGRAM).install_legacy_write_handler(0x4202, 0x4202, 0, 0x3f0000, FUNC(wrmpya_w));
cpu.space(AS_PROGRAM).install_legacy_write_handler(0x4203, 0x4203, 0, 0x3f0000, FUNC(wrmpyb_w));
cpu.space(AS_PROGRAM).install_legacy_write_handler(0x4204, 0x4204, 0, 0x3f0000, FUNC(wrdivl_w));
cpu.space(AS_PROGRAM).install_legacy_write_handler(0x4205, 0x4205, 0, 0x3f0000, FUNC(wrdivh_w));
cpu.space(AS_PROGRAM).install_legacy_write_handler(0x4206, 0x4206, 0, 0x3f0000, FUNC(wrdvdd_w));
cpu.space(AS_PROGRAM).install_legacy_write_handler(0x420d, 0x420d, 0, 0x3f0000, FUNC(memsel_w));
cpu.space(AS_PROGRAM).install_legacy_read_handler(0x4214, 0x4214, 0, 0x3f0000, FUNC(rddivl_r));
cpu.space(AS_PROGRAM).install_legacy_read_handler(0x4215, 0x4215, 0, 0x3f0000, FUNC(rddivh_r));
cpu.space(AS_PROGRAM).install_legacy_read_handler(0x4216, 0x4216, 0, 0x3f0000, FUNC(rdmpyl_r));
cpu.space(AS_PROGRAM).install_legacy_read_handler(0x4217, 0x4217, 0, 0x3f0000, FUNC(rdmpyh_r));
}
CPU_SET_INFO( _5a22 )
{
g65816i_cpu_struct *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL;

View File

@ -67,6 +67,7 @@ DECLARE_LEGACY_CPU_DEVICE(_5A22, _5a22);
void g65816_set_read_vector_callback(device_t *device, read8_delegate read_vector);
void set_5a22_map(legacy_cpu_device &cpu);
/* ======================================================================== */
/* ============================== END OF FILE ============================= */

View File

@ -2373,8 +2373,9 @@ static MACHINE_START( snesnew )
case SNES_MODE21:
case SNES_MODE25:
case SNES_DSP_MODE21:
// machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x000000, 0x7dffff, FUNC(snes21_lo_r), FUNC(snes21_lo_w));
// machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x800000, 0xffffff, FUNC(snes21_hi_r), FUNC(snes21_hi_w));
machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x000000, 0x7dffff, FUNC(snes21_lo_r), FUNC(snes21_lo_w));
machine.device("maincpu")->memory().space(AS_PROGRAM).install_legacy_readwrite_handler(0x800000, 0xffffff, FUNC(snes21_hi_r), FUNC(snes21_hi_w));
set_5a22_map(*state->m_maincpu);
break;
}
}