diff options
Diffstat (limited to 'src/mame/drivers/megaphx.cpp')
-rw-r--r-- | src/mame/drivers/megaphx.cpp | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/mame/drivers/megaphx.cpp b/src/mame/drivers/megaphx.cpp index 48987219692..f6b5f253cea 100644 --- a/src/mame/drivers/megaphx.cpp +++ b/src/mame/drivers/megaphx.cpp @@ -104,6 +104,7 @@ public: void init_megaphx(); protected: + virtual void machine_start() override; virtual void machine_reset() override; required_device<inder_vid_device> m_indervid; @@ -144,6 +145,13 @@ protected: virtual void machine_reset() override; }; +void megaphx_state::machine_start() +{ + uint16_t *src = (uint16_t*)memregion( "boot" )->base(); + // copy vector table? - it must be writable because the game write the irq vector.. + memcpy(m_mainram, src, 0x80); +} + void megaphx_state::machine_reset() { m_indervid->set_bpp(8); @@ -376,17 +384,18 @@ WRITE_LINE_MEMBER( megaphx_state::dsw_w ) m_dsw_data = state; } -MACHINE_CONFIG_START(megaphx_state::megaphx) - MCFG_DEVICE_ADD("maincpu", M68000, 16_MHz_XTAL / 2) - MCFG_DEVICE_PROGRAM_MAP(megaphx_68k_map) +void megaphx_state::megaphx(machine_config &config) +{ + M68000(config, m_maincpu, 16_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &megaphx_state::megaphx_68k_map); - MCFG_DEVICE_ADD("pic", PIC16C54, 6_MHz_XTAL) // correct? - MCFG_PIC16C5x_READ_A_CB(READ8(*this, megaphx_state, pic_porta_r)) - MCFG_PIC16C5x_WRITE_A_CB(WRITE8(*this, megaphx_state, pic_porta_w)) - MCFG_PIC16C5x_READ_B_CB(READ8(*this, megaphx_state, pic_portb_r)) - MCFG_PIC16C5x_WRITE_B_CB(WRITE8(*this, megaphx_state, pic_portb_w)) + pic16c54_device &pic(PIC16C54(config, "pic", 6_MHz_XTAL)); // correct? + pic.read_a().set(FUNC(megaphx_state::pic_porta_r)); + pic.write_a().set(FUNC(megaphx_state::pic_porta_w)); + pic.read_b().set(FUNC(megaphx_state::pic_portb_r)); + pic.write_b().set(FUNC(megaphx_state::pic_portb_w)); - MCFG_QUANTUM_PERFECT_CPU("maincpu") + config.m_perfect_cpu_quantum = subtag("maincpu"); TTL166(config, m_dsw_shifter[0]); m_dsw_shifter[0]->data_callback().set_ioport("DSW1"); @@ -405,16 +414,8 @@ MACHINE_CONFIG_START(megaphx_state::megaphx) INDER_VIDEO(config, m_indervid, 0); INDER_AUDIO(config, "inder_sb", 0); -MACHINE_CONFIG_END - -void megaphx_state::init_megaphx() -{ - uint16_t *src = (uint16_t*)memregion( "boot" )->base(); - // copy vector table? - it must be writable because the game write the irq vector.. - memcpy(m_mainram, src, 0x80); } - ROM_START( megaphx ) ROM_REGION16_BE( 0x40000, "boot", 0 ) // the majority of the data in these does not get used?! (only the vector table) is it just garbage?? ROM_LOAD16_BYTE( "mph6.u32", 0x000001, 0x20000, CRC(b99703d4) SHA1(393b6869e71d4c61060e66e0e9e36a1e6ca345d1) ) @@ -471,5 +472,5 @@ ROM_START( hamboy ) ROM_FILL(0x2c, 1, 0x01) // patch timer length or its too slow (pic issue?) ROM_END -GAME( 1991, megaphx, 0, megaphx, megaphx, megaphx_state, init_megaphx, ROT0, "Dinamic / Inder", "Mega Phoenix", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) -GAME( 1990, hamboy, 0, megaphx, hamboy, hamboy_state, init_megaphx, ROT0, "Dinamic / Inder", "Hammer Boy", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +GAME( 1991, megaphx, 0, megaphx, megaphx, megaphx_state, empty_init, ROT0, "Dinamic / Inder", "Mega Phoenix", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) +GAME( 1990, hamboy, 0, megaphx, hamboy, hamboy_state, empty_init, ROT0, "Dinamic / Inder", "Hammer Boy", MACHINE_IMPERFECT_GRAPHICS | MACHINE_IMPERFECT_SOUND ) |