diff options
Diffstat (limited to 'src/mame/nichibutsu/galivan.cpp')
-rw-r--r-- | src/mame/nichibutsu/galivan.cpp | 198 |
1 files changed, 163 insertions, 35 deletions
diff --git a/src/mame/nichibutsu/galivan.cpp b/src/mame/nichibutsu/galivan.cpp index 91b47dc3df1..e85d678e3f4 100644 --- a/src/mame/nichibutsu/galivan.cpp +++ b/src/mame/nichibutsu/galivan.cpp @@ -14,7 +14,7 @@ Ninja Emaki (US) Youma Ninpou Chou (Japan) (c)1986 NihonBussan Co.,Ltd. Driver by -Takahiro Nogi (nogi@kt.rim.or.jp) 1999/12/17 - +Takahiro Nogi 1999/12/17 - TODO - Find out how layers are enabled\disabled @@ -24,13 +24,119 @@ TODO but it should really copy stuff from the extra ROM. - Ninja Emaki has minor protection issues, see NB1414M4 simulation for more info. -***************************************************************************/ + +Ninja Emaki (US) / Youma Ninpou Chou (Japan), Nichibutsu, 1986 +Hardware info by Guru + +Note this also covers the bootleg board which has a near identical PCB layout +but without the custom chips. The bootleg re-implements whatever the custom +chips do using common logic. + +Top board +--------- + +YN-1(1510) +|-----------------------------------| +|11.18F 7.18D | +| |-| +|10.16F 6.16D | | +| |--| | | +|9.15F 5.15D |1 | | | +| |4 | | | +|8.13F |1 | | | +| |4 | |-| +| |M | | +| PAL.10F |4 | | +| |--| | +| TMM2015 | +|J | +|A MB7114.8E |-| +|M MB7114.7E | | +|M MB7114.6E | | +|A 4.7D | | +| 6264 Z80B | | +| 3.4D | | +|DSW2 2.3D |-| +|DSW1 1.1D PAL.1B 12MHz| +|-----------------------------------| +Notes: + Z80B - Clock 6.000MHz [12/2] + TMM2015 - Toshiba TMM2015 2kB x8-bit SRAM (character RAM) + 6264 - Hitachi HM6264 8kB x8-bit SRAM (Z80 main program RAM) + DSW1/2 - 8-position DIP switch + 1414M4 - Nichibutsu 1414M4 custom chip + 1.1D - 27256 32kB x8-bit EPROM \ + 2.3D - 27128 16kB x8-bit EPROM | (Z80 main program) + 3.4D - 27256 32kB x8-bit EPROM / + 4.7D - 27256 32kB x8-bit EPROM (characters) + 5.15D - 27128 16kB x8-bit EPROM (text layer data for custom 1414M4 chip) + 6.16D - 27128 16kB x8-bit EPROM \ + 7.18D - 27128 16kB x8-bit EPROM / (background tile maps) + 8.13F \ + 9.15F | + 10.16F | 27256 32kB x8-bit EPROM (tiles) + 11.18F / +MB7114.6E - Fujitsu MB7114 256byte x4-bit Bi-polar PROM (red color PROM) +MB7114.7E - Fujitsu MB7114 256byte x4-bit Bi-polar PROM (green color PROM) +MB7114.8E - Fujitsu MB7114 256byte x4-bit Bi-polar PROM (blue color PROM) + HSync - 15.6242kHz + VSync - 59.40776Hz + +Bottom board +------------ + +YN-2(1510) +|-----------------------------------| +|MB3730 YM3014 YM3526 8MHz| +|VOL 6116 |-| +| MB3614 13.15B | | +| MB3614 12.14B | | +| Z80A | | +|PAL.12F | | +| 2148 | | +| 2148 |-| +| | +| | +| | +| | +| 1411M1 | +| |-| +| 2148 2148 | | +| 2148 2148 | | +|MB7114.7F | | +|17.6F | | +|16.4F | | +|15.3F MB7114.2D |-| +|14.1F 22MHz|<--21.400Mhz on bootleg +|-----------------------------------| +Notes: + Z80A - Clock 4.000MHz [8/2] (sound CPU) + YM3526 - Yamaha YM3526 FM Operator Type-L (OPL) Sound Generator. Clock input 4.000MHz [8/2] + YM3014 - Yamaha YM3014 Serial Input Floating D/A Converter. Clock input 1.000MHz [8/2/4 from YM3526 pin 23] + MB3730 - Fujitsu MB3730 Audio Power Amplifier (NEC UPC1182 on bootleg) + MB3614 - Fujitsu MB3614 Quad Operational Amplifier. Compatible with HA17324 & LM324 + 2148 - 1kB x4-bit SRAM (sprite RAM) + 6116 - 2kB x8-bit SRAM (Z80 sound program RAM) + 1411M1 - Nichibutsu 1411M1XBA custom chip + 13.15B - 27256 32kB x8-bit EPROM \ + 12.14B - 27128 16kB x8-bit EPROM / (Z80 sound program) + 14.1F \ + 15.3F | 27256 16kB x8-bit EPROM (sprites) + 16.4F | + 17.6F / +MB7114.7F - Fujitsu MB7114 256 x4-bit Bi-polar PROM (sprite palette bank) +MB7114.2D - Fujitsu MB7114 256 x4-bit Bi-polar PROM (sprite look-up table) + +*******************************************************************************/ + #include "emu.h" #include "galivan.h" #include "cpu/z80/z80.h" +#include "machine/rescap.h" #include "sound/dac.h" +#include "sound/flt_biquad.h" #include "sound/ymopl.h" #include "speaker.h" @@ -420,12 +526,10 @@ void galivan_state::video_config(machine_config &config) m_screen->set_palette(m_palette); } -void galivan_state::galivan(machine_config &config) +void galivan_state::galivan_common(machine_config &config) { /* basic machine hardware */ Z80(config, m_maincpu, XTAL(12'000'000)/2); /* 6 MHz? */ - m_maincpu->set_addrmap(AS_PROGRAM, &galivan_state::galivan_map); - m_maincpu->set_addrmap(AS_IO, &galivan_state::io_map); m_maincpu->set_vblank_int("screen", FUNC(galivan_state::irq0_line_assert)); z80_device &audiocpu(Z80(config, "audiocpu", XTAL(8'000'000)/2)); /* 4 MHz? */ @@ -433,24 +537,64 @@ void galivan_state::galivan(machine_config &config) audiocpu.set_addrmap(AS_IO, &galivan_state::sound_io_map); audiocpu.set_periodic_int(FUNC(galivan_state::irq0_line_hold), attotime::from_hz(XTAL(8'000'000)/2/512)); // ? - MCFG_MACHINE_START_OVERRIDE(galivan_state,galivan) - MCFG_MACHINE_RESET_OVERRIDE(galivan_state,galivan) - + /* video hardware */ video_config(config); - MCFG_VIDEO_START_OVERRIDE(galivan_state,galivan) - m_screen->set_screen_update(FUNC(galivan_state::screen_update_galivan)); - GFXDECODE(config, m_gfxdecode, m_palette, gfx_galivan); - PALETTE(config, m_palette, FUNC(galivan_state::galivan_palette), 16*16+16*16+256*16, 256); /* sound hardware */ SPEAKER(config, "speaker").front_center(); GENERIC_LATCH_8(config, m_soundlatch); - YM3526(config, "ymsnd", XTAL(8'000'000)/2).add_route(ALL_OUTPUTS, "speaker", 1.0); + // Note: The galivan filters are identical to the later Nichibutsu filters(armedf.cpp) + // with the sole exception of the mixing resistors and component locations. + // Mixing resistors: + // Yamaha - 1kohm = 0.6597 of total + // DAC1 - 4.7kohm = 0.1404 of total + // DAC2 - 3.3kohm = 0.1999 of total + // However, the actual volume output by the ym3014 dac and the r2r resistors + // is not the same range on each! + // The YM3014 dac has a DC offset of 1/2 VDD, then +- 1/4 VDD of signal, + // so min of 1.25v and max of 3.75v, vpp of 2.5v + // The R2R dacs are full range, min of 0v and max of (almost) 5v, vpp of ~5.0v + // Because of this, we have to compensate as MAME's ymfm core outputs full range. + // Math: + // YMFM: 0.6597 * 0.5 = 0.32985 + // DAC1: 0.1404 * 1.0 = 0.1404 + // DAC2: 0.1999 * 1.0 = 0.1999 + // Sum: 0.67015 + // Multiply all 3 values by 1 / 0.67015 (i.e. 1.492203): + // Final values are: ym: 0.492203; dac1: 0.209505; dac2: 0.298291 + + FILTER_BIQUAD(config, m_ymfilter).opamp_sk_lowpass_setup(RES_K(4.7), RES_K(4.7), RES_M(999.99), RES_R(0.001), CAP_N(3.3), CAP_N(1.0)); // R15, R14, nothing(infinite resistance), wire(short), C9, C11 + m_ymfilter->add_route(ALL_OUTPUTS, "speaker", 1.0); + FILTER_BIQUAD(config, m_dacfilter1).opamp_sk_lowpass_setup(RES_K(10), RES_K(10), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); // R11, R10, nothing(infinite resistance), wire(short), C7, C17 + m_dacfilter1->add_route(ALL_OUTPUTS, "speaker", 1.0); + FILTER_BIQUAD(config, m_dacfilter2).opamp_sk_lowpass_setup(RES_K(10), RES_K(10), RES_M(999.99), RES_R(0.001), CAP_N(10), CAP_N(4.7)); // R13, R12, nothing(infinite resistance), wire(short), C8, C18 + m_dacfilter2->add_route(ALL_OUTPUTS, "speaker", 1.0); + + YM3526(config, "ymsnd", XTAL(8'000'000)/2).add_route(ALL_OUTPUTS, m_ymfilter, 0.4922); + + // note the two dac channel volume mix values might be backwards, we need a pcb reference recording! + DAC_8BIT_R2R(config, "dac1", 0).add_route(ALL_OUTPUTS, m_dacfilter1, 0.2095); // SIP R2R DAC @ RA1 with 74HC374P latch + DAC_8BIT_R2R(config, "dac2", 0).add_route(ALL_OUTPUTS, m_dacfilter2, 0.2983); // SIP R2R DAC @ RA2 with 74HC374P latch +} + +void galivan_state::galivan(machine_config &config) +{ + galivan_common(config); + + /* basic machine hardware */ + m_maincpu->set_addrmap(AS_PROGRAM, &galivan_state::galivan_map); + m_maincpu->set_addrmap(AS_IO, &galivan_state::io_map); + + MCFG_MACHINE_START_OVERRIDE(galivan_state,galivan) + MCFG_MACHINE_RESET_OVERRIDE(galivan_state,galivan) - DAC_8BIT_R2R(config, "dac1", 0).add_route(ALL_OUTPUTS, "speaker", 0.4); // unknown DAC - DAC_8BIT_R2R(config, "dac2", 0).add_route(ALL_OUTPUTS, "speaker", 0.4); // unknown DAC + /* video hardware */ + MCFG_VIDEO_START_OVERRIDE(galivan_state,galivan) + m_screen->set_screen_update(FUNC(galivan_state::screen_update_galivan)); + GFXDECODE(config, m_gfxdecode, m_palette, gfx_galivan); + PALETTE(config, m_palette, FUNC(galivan_state::galivan_palette), 16*16+16*16+256*16, 256); } void dangarj_state::dangarj(machine_config &config) @@ -463,16 +607,11 @@ void dangarj_state::dangarj(machine_config &config) void galivan_state::ninjemak(machine_config &config) { + galivan_common(config); + /* basic machine hardware */ - Z80(config, m_maincpu, XTAL(12'000'000)/2); /* 6 MHz? */ m_maincpu->set_addrmap(AS_PROGRAM, &galivan_state::ninjemak_map); m_maincpu->set_addrmap(AS_IO, &galivan_state::ninjemak_io_map); - m_maincpu->set_vblank_int("screen", FUNC(galivan_state::irq0_line_assert)); - - z80_device &audiocpu(Z80(config, "audiocpu", XTAL(8'000'000)/2)); /* 4 MHz? */ - audiocpu.set_addrmap(AS_PROGRAM, &galivan_state::sound_map); - audiocpu.set_addrmap(AS_IO, &galivan_state::sound_io_map); - audiocpu.set_periodic_int(FUNC(galivan_state::irq0_line_hold), attotime::from_hz(XTAL(8'000'000)/2/512)); // ? MCFG_MACHINE_START_OVERRIDE(galivan_state,ninjemak) MCFG_MACHINE_RESET_OVERRIDE(galivan_state,ninjemak) @@ -480,21 +619,10 @@ void galivan_state::ninjemak(machine_config &config) NB1414M4(config, m_nb1414m4, 0); /* video hardware */ - video_config(config); MCFG_VIDEO_START_OVERRIDE(galivan_state,ninjemak) m_screen->set_screen_update(FUNC(galivan_state::screen_update_ninjemak)); GFXDECODE(config, m_gfxdecode, m_palette, gfx_ninjemak); PALETTE(config, m_palette, FUNC(galivan_state::ninjemak_palette), 8*16+16*16+256*16, 256); - - /* sound hardware */ - SPEAKER(config, "speaker").front_center(); - - GENERIC_LATCH_8(config, m_soundlatch); - - YM3526(config, "ymsnd", XTAL(8'000'000)/2).add_route(ALL_OUTPUTS, "speaker", 0.8); - - DAC_8BIT_R2R(config, "dac1", 0).add_route(ALL_OUTPUTS, "speaker", 1.0); // unknown DAC - DAC_8BIT_R2R(config, "dac2", 0).add_route(ALL_OUTPUTS, "speaker", 1.0); // unknown DAC } void galivan_state::youmab(machine_config &config) @@ -1162,10 +1290,10 @@ void galivan_state::init_youmab() GAME( 1985, galivan, 0, galivan, galivan, galivan_state, empty_init, ROT270, "Nichibutsu", "Cosmo Police Galivan (12/26/1985)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, galivan2, galivan, galivan, galivan, galivan_state, empty_init, ROT270, "Nichibutsu", "Cosmo Police Galivan (12/16/1985)", MACHINE_SUPPORTS_SAVE ) GAME( 1985, galivan3, galivan, galivan, galivan, galivan_state, empty_init, ROT270, "Nichibutsu", "Cosmo Police Galivan (12/11/1985)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, dangar, 0, galivan, dangar, galivan_state, empty_init, ROT270, "Nichibutsu", "Ufo Robo Dangar (4/07/1987)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, dangar, 0, galivan, dangar, galivan_state, empty_init, ROT270, "Nichibutsu", "Ufo Robo Dangar (4/09/1987)", MACHINE_SUPPORTS_SAVE ) // GV-1412-I and GV-1412-II pcbs GAME( 1986, dangara, dangar, galivan, dangar2, galivan_state, empty_init, ROT270, "Nichibutsu", "Ufo Robo Dangar (12/1/1986)", MACHINE_SUPPORTS_SAVE ) GAME( 1986, dangarj, dangar, dangarj, dangar2, dangarj_state, empty_init, ROT270, "Nichibutsu", "Ufo Robo Dangar (9/26/1986, Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, dangarb, dangar, galivan, dangar2, galivan_state, empty_init, 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, dangarb, dangar, galivan, dangar2, galivan_state, empty_init, ROT270, "bootleg", "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, empty_init, 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, empty_init, ROT270, "Nichibutsu", "Ninja Emaki (US)", MACHINE_SUPPORTS_SAVE|MACHINE_UNEMULATED_PROTECTION ) GAME( 1986, youma, ninjemak, ninjemak, ninjemak, galivan_state, empty_init, ROT270, "Nichibutsu", "Youma Ninpou Chou (Japan)", MACHINE_SUPPORTS_SAVE|MACHINE_UNEMULATED_PROTECTION ) |