diff options
author | angelosa <salese_corp_ltd@email.it> | 2018-04-21 06:58:06 +0200 |
---|---|---|
committer | angelosa <salese_corp_ltd@email.it> | 2018-04-21 07:00:31 +0200 |
commit | 5d74309d3bbf3d15a67dad2e4dccd38881b020e9 (patch) | |
tree | 3d67fd74e8992ef40f8aa816ffd2eb916bdc684c | |
parent | 5e53c46819b008d4fdc40d88f1c3bb114025ab9e (diff) |
new working clone
-----------------
Ufo Robo Dangar (9/26/1986, Japan) [Angelo Salese]
-rw-r--r-- | src/mame/drivers/cop01.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/galivan.cpp | 64 | ||||
-rw-r--r-- | src/mame/includes/galivan.h | 11 |
3 files changed, 67 insertions, 10 deletions
diff --git a/src/mame/drivers/cop01.cpp b/src/mame/drivers/cop01.cpp index 736e6e304a9..6bf0b79425f 100644 --- a/src/mame/drivers/cop01.cpp +++ b/src/mame/drivers/cop01.cpp @@ -228,7 +228,7 @@ WRITE8_MEMBER(cop01_state::prot_address_w) WRITE8_MEMBER(cop01_state::prot_data_w) { - if( m_prot_command>=0x32 && m_prot_command<=0x37 ) + if( m_prot_command >=0x32 && m_prot_command <=0x37 ) { m_prot_reg[m_prot_command-0x32] = data; diff --git a/src/mame/drivers/galivan.cpp b/src/mame/drivers/galivan.cpp index 27da2d486ce..23d3d9f31fe 100644 --- a/src/mame/drivers/galivan.cpp +++ b/src/mame/drivers/galivan.cpp @@ -24,12 +24,10 @@ TODO but it should really copy stuff from the extra ROM. - Ninja Emaki has minor protection issues, see NB1414M4 simulation for more info. - dangarj has unemulated protection at I/Os 0x80-1 for missing sprites. - [0x80] W is data - [0x81] W --11 xxxx address - [0x80] R result - The protection is used for a code snippet at 0xf9c0, that of course is the + This is a 1412M2, which is the same chip used in terracre.cpp and cop01.cpp + The protection here is used for a code snippet at 0xf9c0, that of course is the sprite handling. The code snippet is sum8 with 0x27 at 0x9d74 so no, the - later dangar US version snippet doesn't work ... + later dangar US version snippet doesn't work ***************************************************************************/ @@ -60,7 +58,40 @@ READ8_MEMBER(galivan_state::IO_port_c0_r) return (0x58); /* To Avoid Reset on Ufo Robot dangar */ } +// simplified version of the 1412M2 in cop01 (needs to be device-ified) +READ8_MEMBER(galivan_state::prot_data_r) +{ + if(m_prot_command == 0x37) + { + uint16_t prot_offset = (m_prot_reg[1]<<8)|(m_prot_reg[2]); + uint8_t *prot_rom = memregion("prot_data")->base(); + uint8_t prot_adj = 0x44; + + //printf("%02x",(prot_rom[prot_offset] - 0x44) & 0xff); + return prot_rom[prot_offset & 0x1fff] - prot_adj; // minus value correct? + } + + popmessage("%02x protection read used",m_prot_command); + + return 0; +} + +WRITE8_MEMBER(galivan_state::prot_data_w) +{ + if( m_prot_command >=0x32 && m_prot_command <=0x37 ) + { + m_prot_reg[m_prot_command-0x32] = data; + return; + } + + popmessage("%02x protection write used",m_prot_command); +} + +WRITE8_MEMBER(galivan_state::prot_address_w) +{ + m_prot_command = data; +} void galivan_state::galivan_map(address_map &map) { @@ -101,6 +132,15 @@ void galivan_state::io_map(address_map &map) map(0xc0, 0xc0).r(this, FUNC(galivan_state::IO_port_c0_r)); /* dangar needs to return 0x58 */ } +void galivan_state::dangarj_io_map(address_map &map) +{ + io_map(map); + // 1412M2 + map(0x80, 0x80).rw(this, FUNC(galivan_state::prot_data_r), FUNC(galivan_state::prot_data_w)); + map(0x81, 0x81).w(this, FUNC(galivan_state::prot_address_w)); +} + + WRITE8_MEMBER(galivan_state::blit_trigger_w) { m_nb1414m4->exec((m_videoram[0] << 8) | (m_videoram[1] & 0xff),m_videoram,m_scrollx,m_scrolly,m_tx_tilemap); @@ -474,6 +514,12 @@ MACHINE_CONFIG_START(galivan_state::galivan) MCFG_SOUND_ROUTE_EX(0, "dac2", 1.0, DAC_VREF_POS_INPUT) MCFG_SOUND_ROUTE_EX(0, "dac2", -1.0, DAC_VREF_NEG_INPUT) MACHINE_CONFIG_END +MACHINE_CONFIG_START(galivan_state::dangarj) + galivan(config); + MCFG_CPU_MODIFY("maincpu") + MCFG_CPU_IO_MAP(dangarj_io_map) +MACHINE_CONFIG_END + MACHINE_CONFIG_START(galivan_state::ninjemak) /* basic machine hardware */ @@ -796,7 +842,7 @@ ROM_START( dangarj ) /* all rom labels are simply numbers, with the owl logo and ROM_REGION( 0x0100, "user1", 0 ) ROM_LOAD( "82s129.7f", 0x0000, 0x0100, CRC(29bc6216) SHA1(1d7864ad06ad0cd5e3d1905fc6066bee1cd90995) ) /* sprite palette bank */ - ROM_REGION( 0x2000, "user2", 0 ) /* located on a daughter card DG-3 with an additional 8.00MHz OSC & Nichibutsu 1412M2 XBA (unknown MCU?) */ + ROM_REGION( 0x2000, "prot_data", 0 ) /* located on a daughter card DG-3 with an additional 8.00MHz OSC & Nichibutsu 1412M2 XBA (unknown MCU?) */ ROM_LOAD( "dg-3.ic7.2764", 0x0000, 0x2000, CRC(84a56d26) SHA1(6a1cdac7b9e04ccbcc29491f37f7554d09ea6d34) ) ROM_END @@ -1192,9 +1238,9 @@ GAME( 1985, galivan2, galivan, galivan, galivan, galivan_state, 0, ROT27 GAME( 1985, galivan3, galivan, galivan, galivan, galivan_state, 0, ROT270, "Nichibutsu", "Cosmo Police Galivan (12/11/1985)", MACHINE_SUPPORTS_SAVE ) GAME( 1986, dangar, 0, galivan, dangar, galivan_state, 0, ROT270, "Nichibutsu", "Ufo Robo Dangar (4/07/1987)", MACHINE_SUPPORTS_SAVE ) GAME( 1986, dangara, dangar, galivan, dangar2, galivan_state, 0, ROT270, "Nichibutsu", "Ufo Robo Dangar (12/1/1986)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, dangarb, dangar, galivan, dangar2, galivan_state, 0, ROT270, "Nichibutsu", "Ufo Robo Dangar (9/26/1986)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, dangarj, dangar, galivan, dangar2, galivan_state, 0, ROT270, "Nichibutsu", "Ufo Robo Dangar (9/26/1986, Japan)", MACHINE_SUPPORTS_SAVE|MACHINE_NOT_WORKING ) // no sprites visable -GAME( 1986, dangarbt, dangar, galivan, dangarb, galivan_state, 0, ROT270, "bootleg", "Ufo Robo Dangar (bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, dangarj, dangar, dangarj, dangar2, galivan_state, 0, ROT270, "Nichibutsu", "Ufo Robo Dangar (9/26/1986, Japan)", MACHINE_SUPPORTS_SAVE|MACHINE_IMPERFECT_SOUND ) // wrong BGM in game, no SFXs +GAME( 1986, dangarb, dangar, galivan, dangar2, galivan_state, 0, ROT270, "Nichibutsu", "Ufo Robo Dangar (9/26/1986, bootleg set 1)", MACHINE_SUPPORTS_SAVE ) // checks protection like dangarj but check readback is patched at 0x9d58 (also checks i/o port 0xc0?) +GAME( 1986, dangarbt, dangar, galivan, dangarb, galivan_state, 0, ROT270, "bootleg", "Ufo Robo Dangar (9/26/1986, bootleg set 2)", MACHINE_SUPPORTS_SAVE ) // directly patched at entry point 0x9d44 GAME( 1986, ninjemak, 0, ninjemak, ninjemak, galivan_state, 0, ROT270, "Nichibutsu", "Ninja Emaki (US)", MACHINE_SUPPORTS_SAVE|MACHINE_UNEMULATED_PROTECTION ) GAME( 1986, youma, ninjemak, ninjemak, ninjemak, galivan_state, 0, ROT270, "Nichibutsu", "Youma Ninpou Chou (Japan)", MACHINE_SUPPORTS_SAVE|MACHINE_UNEMULATED_PROTECTION ) GAME( 1986, youma2, ninjemak, ninjemak, ninjemak, galivan_state, 0, ROT270, "Nichibutsu", "Youma Ninpou Chou (Japan, alt)", MACHINE_SUPPORTS_SAVE|MACHINE_UNEMULATED_PROTECTION ) diff --git a/src/mame/includes/galivan.h b/src/mame/includes/galivan.h index 3bb5c921aea..6703f87cecb 100644 --- a/src/mame/includes/galivan.h +++ b/src/mame/includes/galivan.h @@ -42,6 +42,10 @@ public: DECLARE_WRITE8_MEMBER(galivan_sound_command_w); DECLARE_READ8_MEMBER(soundlatch_clear_r); DECLARE_READ8_MEMBER(IO_port_c0_r); + DECLARE_WRITE8_MEMBER(prot_address_w); + DECLARE_WRITE8_MEMBER(prot_data_w); + DECLARE_READ8_MEMBER(prot_data_r); + DECLARE_WRITE8_MEMBER(blit_trigger_w); DECLARE_WRITE8_MEMBER(youmab_extra_bank_w); DECLARE_READ8_MEMBER(youmab_8a_r); @@ -74,12 +78,19 @@ public: required_device<palette_device> m_palette; required_device<generic_latch_8_device> m_soundlatch; void galivan(machine_config &config); + void dangarj(machine_config &config); void ninjemak(machine_config &config); void youmab(machine_config &config); void galivan_map(address_map &map); void io_map(address_map &map); + void dangarj_io_map(address_map &map); void ninjemak_io_map(address_map &map); void ninjemak_map(address_map &map); void sound_io_map(address_map &map); void sound_map(address_map &map); +private: + // dangarj specific (to be removed from here) + uint8_t m_prot_command; + uint8_t m_prot_reg[6]; + uint8_t test; }; |