diff --git a/src/emu/sound/l7a1045_l6028_dsp_a.c b/src/emu/sound/l7a1045_l6028_dsp_a.c index 99265f1559f..9474973893a 100644 --- a/src/emu/sound/l7a1045_l6028_dsp_a.c +++ b/src/emu/sound/l7a1045_l6028_dsp_a.c @@ -1,6 +1,6 @@ /*************************************************************************** - L7A1045 L6028 DSP-A + L7A1045 L6028 DSP-A (QFP120 package) this is the audio chip used on the following @@ -44,7 +44,7 @@ 7 ---------------- ---------------- llllllllrrrrrrrr left/right volume - 8 ---------------- ---------------- ---------------- (read only?) + 8 ---------------- ---------------- ---------------- (read only?) 9 ---------------- ---------------- ---------------- (read only?) @@ -149,7 +149,7 @@ void l7a1045_sound_device::sound_stream_update(sound_stream &stream, stream_samp if ((start + pos) >= end) { m_key &= ~(1 << i); - + } sample = (INT8)m_rom[(start + pos) & (m_rom_size-1)]; @@ -168,16 +168,12 @@ void l7a1045_sound_device::sound_stream_update(sound_stream &stream, stream_samp WRITE16_MEMBER( l7a1045_sound_device::l7a1045_sound_w ) { - m_stream->update(); - - switch (offset) - { - case 0x00:l7a1045_sound_select_w(space, offset, data, mem_mask); break; - case 0x01:l7a1045_sound_data_02_w(space, offset, data, mem_mask); break; - case 0x02:l7a1045_sound_data_04_w(space, offset, data, mem_mask); break; - case 0x03:l7a1045_sound_data_06_w(space, offset, data, mem_mask); break; - } + m_stream->update(); // TODO + if(offset == 0) + sound_select_w(space, offset, data, mem_mask); + else + sound_data_w(space,offset - 1,data,mem_mask); } @@ -199,7 +195,7 @@ READ16_MEMBER( l7a1045_sound_device::l7a1045_sound_r ) } -WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_select_w) +WRITE16_MEMBER(l7a1045_sound_device::sound_select_w) { // I'm guessing these addresses are the sound chip / DSP? @@ -222,130 +218,37 @@ WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_select_w) } -WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_02_w) // upper? word of various registers? +WRITE16_MEMBER(l7a1045_sound_device::sound_data_w) { - m_audiodat[m_audioregister][m_audiochannel].dat[2] = data; +// if(m_audioregister == 0) +// printf("%04x %04x (%04x|%04x %04x)\n",offset,data,offset ^ 2,m_audioregister,m_audiochannel); - // write with registers 00, 01, 04, 06, 05, 03, 07, 02 on startup - // groups writes of register 0a per channel + m_audiodat[m_audioregister][m_audiochannel].dat[offset] = data; + + if(offset == 0) + { - // register 08 / 09 not written? switch (m_audioregister) { - default: - - case 0x08: - case 0x09: - printf("%08x: unexpected write port 0x0002 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); - break; - -// case 0x00: - case 0x01: - case 0x04: - case 0x06: - case 0x05: - case 0x03: - case 0x02: - case 0x07: - - case 0x0a: - // printf("%08x: write port 0x0002 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); - break; - case 0x00: // hack - l7a1045_voice *vptr = &m_voice[m_audiochannel]; + l7a1045_voice *vptr = &m_voice[m_audiochannel]; m_key |= 1 << m_audiochannel; vptr->frac = 0; vptr->pos = 0; - vptr->start = (m_audiodat[0][m_audiochannel].dat[0] & 0x000f) << (16 + 4); - vptr->start |= (m_audiodat[0][m_audiochannel].dat[1] & 0xffff) << (4); - vptr->start |= (m_audiodat[0][m_audiochannel].dat[2] & 0xf000) >> (12); + vptr->start = (m_audiodat[0][m_audiochannel].dat[2] & 0x000f) << (16 + 4); + vptr->start |= (m_audiodat[0][m_audiochannel].dat[1] & 0xffff) << (4); + vptr->start |= (m_audiodat[0][m_audiochannel].dat[0] & 0xf000) >> (12); vptr->start &= m_rom_size - 1; //printf("%08x: REGISTER 00 write port 0x0002 chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); break; } - } - -WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_04_w) // lower? word of various registers? -{ - m_audiodat[m_audioregister][m_audiochannel].dat[1] = data; - - // write with registers 00, 04, 06, 05, 03, 07, 02, 01 on startup - // groups writes of register 0a per channel - - // register 08 / 09 not written? - - switch (m_audioregister) - { - default: - - case 0x08: - case 0x09: - printf("%08x: unexpected write port 0x0004 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); - break; - -// case 0x00: - case 0x04: - case 0x06: - case 0x05: - case 0x03: - case 0x07: - case 0x01: - case 0x02: - - case 0x0a: - //printf("%08x: write port 0x0004 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); - break; - - case 0x00: - //printf("%08x: REGISTER 00 write port 0x0004 chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); - break; - } - -} -WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_06_w) // other part? of various registers.. less used than 02/04, maybe flags? -{ - // 00 / 01 written at startup - // nothing else used? - - m_audiodat[m_audioregister][m_audiochannel].dat[0] = data; - switch (m_audioregister) - { - default: - - case 0x02: - case 0x03: - case 0x04: - case 0x05: - case 0x06: - case 0x07: - case 0x08: - case 0x09: - case 0x0a: - printf("%08x: unexpected write port 0x0006 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); - break; - -// case 0x00: - case 0x01: - //printf("%08x: unexpected write port 0x0006 register %02x chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); - break; - - case 0x00: - - // it writes 2 values here for each sample - // the 2nd one seems to contain the upper 4 bits of the sample address - // so why does it write different data first? - //printf("%08x: REGISTER 00 write port 0x0006 chansel %02x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audiochannel, data, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); - break; - - } } diff --git a/src/emu/sound/l7a1045_l6028_dsp_a.h b/src/emu/sound/l7a1045_l6028_dsp_a.h index 13a1d5f6fdf..cd31cfe0892 100644 --- a/src/emu/sound/l7a1045_l6028_dsp_a.h +++ b/src/emu/sound/l7a1045_l6028_dsp_a.h @@ -15,7 +15,7 @@ struct l7a1045_voice UINT32 start; UINT32 pos; UINT32 frac; - + }; // ======================> l7a1045_sound_device @@ -55,10 +55,8 @@ private: l7a1045_48bit_data m_audiodat[0x10][0x20]; - DECLARE_WRITE16_MEMBER(l7a1045_sound_select_w); - DECLARE_WRITE16_MEMBER(l7a1045_sound_data_02_w); - DECLARE_WRITE16_MEMBER(l7a1045_sound_data_04_w); - DECLARE_WRITE16_MEMBER(l7a1045_sound_data_06_w); + DECLARE_WRITE16_MEMBER(sound_select_w); + DECLARE_WRITE16_MEMBER(sound_data_w); DECLARE_READ16_MEMBER(l7a1045_sound_port_0004_r); DECLARE_READ16_MEMBER(l7a1045_sound_port_0006_r); diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c index 12ca5acfa40..9f0307c9ce5 100644 --- a/src/mame/drivers/cninja.c +++ b/src/mame/drivers/cninja.c @@ -2109,6 +2109,51 @@ ROM_START( mutantf3 ) /* World ver 3 */ ROM_LOAD( "maf-09.18l", 0x00000, 0x80000, CRC(28e7ed81) SHA1(e168a2748b75c647f6f9c0d7d25d4f046aa98094) ) ROM_END + +ROM_START( mutantf2 ) /* World ver 2 */ + ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 code */ + ROM_LOAD16_BYTE("hd-03-1.2c", 0x00000, 0x20000, CRC(7110cefc) SHA1(26b470cf2fcd026542c7ff4fca11c2095a17501d) ) + ROM_LOAD16_BYTE("hd-00-1.2a", 0x00001, 0x20000, CRC(b279875b) SHA1(fc148f3f70f289ae1d383f714c41d7b50381803e) ) + ROM_LOAD16_BYTE("hd-04-1.4c", 0x40000, 0x20000, CRC(fd2ea8d7) SHA1(00e50d42fcc7f6d5076963b02f5abb36275dc993) ) + ROM_LOAD16_BYTE("hd-01-1.4a", 0x40001, 0x20000, CRC(48a247ac) SHA1(c69d67e44ffae92b261de247f8d3eac2e02fcf11) ) + + ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */ + ROM_LOAD( "hd-12.21j", 0x00000, 0x10000, CRC(13d55f11) SHA1(6438dca57f43b3ca6d273bf82b62104a49260132) ) + + ROM_REGION( 0x0a0000, "gfx1", 0 ) /* chars */ + ROM_LOAD16_BYTE( "hd-06-1.8d", 0x000000, 0x10000, CRC(8b7a558b) SHA1(06f1f6910b9a54e208ee9a0b734d5df946016236) ) + ROM_LOAD16_BYTE( "hd-07-1.9d", 0x000001, 0x10000, CRC(d2a3d449) SHA1(10ad634eb0238f6e9ba04266e4dbaf9470f5d169) ) + + ROM_REGION( 0x080000, "gfx2", 0 ) + ROM_LOAD( "maf-00.8a", 0x000000, 0x80000, CRC(e56f528d) SHA1(3908d9b189fa4895c532d1d1f133df0913810cf9) ) /* tiles 3 */ + + ROM_REGION( 0x100000, "gfx3", 0 ) + ROM_LOAD( "maf-01.9a", 0x000000, 0x40000, CRC(c3d5173d) SHA1(2b6559bf65d7cc5b957ad347b64cf6a18f661686) ) /* tiles 1 */ + ROM_CONTINUE( 0x080000, 0x40000 ) + ROM_LOAD( "maf-02.11a", 0x040000, 0x40000, CRC(0b37d849) SHA1(a0606fb8130a2e86a241ce5ce0b4f61373a88c17) ) /* tiles 2 */ + ROM_CONTINUE( 0x0c0000, 0x40000 ) + + ROM_REGION( 0x500000, "gfx4", 0 ) /* sprites */ + ROM_LOAD16_BYTE( "maf-03.18a", 0x000000, 0x100000, CRC(f4366d2c) SHA1(20964d0e1b879b3e5cb5d18a46d2a17dca2b4171) ) + ROM_LOAD16_BYTE( "maf-04.20a", 0x200000, 0x100000, CRC(0c8f654e) SHA1(e566d4b789b345e20caf7e061e43be7c2e1be9b2) ) + ROM_LOAD16_BYTE( "maf-05.21a", 0x400000, 0x080000, CRC(b0cfeb80) SHA1(b8519c604b03eb8bcf26d00a43b39d48f1b45ab5) ) + ROM_LOAD16_BYTE( "maf-06.18d", 0x000001, 0x100000, CRC(f5c7a9b5) SHA1(92efc9401347598c90acf62c9aef30109c990ad6) ) + ROM_LOAD16_BYTE( "maf-07.20d", 0x200001, 0x100000, CRC(fd6008a3) SHA1(7b680424eca3804c70fa0c4dc415d665c8626498) ) + ROM_LOAD16_BYTE( "maf-08.21d", 0x400001, 0x080000, CRC(e41cf1e7) SHA1(06524e1aed0adc4c32c92e16a00dc983014f4994) ) + + ROM_REGION( 0x40000, "gfx5", 0 ) /* sprites 2 */ + ROM_LOAD32_BYTE("hf-08.15a", 0x00001, 0x10000, CRC(93b7279f) SHA1(14304a1ffe1bc791bfa83f8200793d897449133c) ) + ROM_LOAD32_BYTE("hf-09.17a", 0x00003, 0x10000, CRC(05e2c074) SHA1(ec95303e8196424864964b5d2ae862bf75571e83) ) + ROM_LOAD32_BYTE("hf-10.15c", 0x00000, 0x10000, CRC(9b06f418) SHA1(d1579ae36676e38c96ee55a1ffa20aa307a21654) ) + ROM_LOAD32_BYTE("hf-11.17c", 0x00002, 0x10000, CRC(3859a531) SHA1(a2a0c1aa28181b5ef6c075ff0118178340389693) ) + + ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM samples */ + ROM_LOAD( "maf-10.20l", 0x00000, 0x40000, CRC(7c57f48b) SHA1(9a5624553b3b038d70f9b517f410a635c00a8771) ) + + ROM_REGION( 0x80000, "oki2", 0 ) /* ADPCM samples */ + ROM_LOAD( "maf-09.18l", 0x00000, 0x80000, CRC(28e7ed81) SHA1(e168a2748b75c647f6f9c0d7d25d4f046aa98094) ) +ROM_END + ROM_START( deathbrd ) /* Japan ver 3 */ ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 code */ ROM_LOAD16_BYTE("hf-03-2.2c", 0x00000, 0x20000, CRC(fb86fff3) SHA1(af4cfc19ec85e0aa49b5e46d95bdd94a20922cce) ) @@ -2198,4 +2243,5 @@ GAME( 1991, robocop2j,robocop2,robocop2, robocop2, driver_device, 0, ROT0 GAME( 1992, mutantf, 0, mutantf, mutantf, cninja_state, mutantf, ROT0, "Data East Corporation", "Mutant Fighter (World ver EM-5)", GAME_SUPPORTS_SAVE ) GAME( 1992, mutantf4, mutantf, mutantf, mutantf, cninja_state, mutantf, ROT0, "Data East Corporation", "Mutant Fighter (World ver EM-4)", GAME_SUPPORTS_SAVE ) GAME( 1992, mutantf3, mutantf, mutantf, mutantf, cninja_state, mutantf, ROT0, "Data East Corporation", "Mutant Fighter (World ver EM-3)", GAME_SUPPORTS_SAVE ) +GAME( 1992, mutantf2, mutantf, mutantf, mutantf, cninja_state, mutantf, ROT0, "Data East Corporation", "Mutant Fighter (World ver EM-2)", GAME_SUPPORTS_SAVE ) GAME( 1992, deathbrd, mutantf, mutantf, mutantf, cninja_state, mutantf, ROT0, "Data East Corporation", "Death Brade (Japan ver JM-3)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 238bf65a425..470ff80549b 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -6031,6 +6031,7 @@ supbtimej // MAE (c) 1990 Data East Corporation (Japan) mutantf // MAF (c) 1992 Data East Corporation (World) mutantf4 // MAF (c) 1992 Data East Corporation (World) mutantf3 // MAF (c) 1992 Data East Corporation (World) +mutantf2 // MAF (c) 1992 Data East Corporation (World) deathbrd // MAF (c) 1992 Data East Corporation (Japan) cninja // MAG (c) 1991 Data East Corporation (World) cninja1 // MAG (c) 1991 Data East Corporation (World)