mirror of
https://github.com/mamedev/mame.git
synced 2024-11-16 07:48:32 +01:00
Merge branch 'master' of https://github.com/mamedev/mame
This commit is contained in:
commit
b0ea29e26c
3 changed files with 71 additions and 19 deletions
|
@ -93,9 +93,10 @@ const device_type L7A1045 = &device_creator<l7a1045_sound_device>;
|
|||
l7a1045_sound_device::l7a1045_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
|
||||
: device_t(mconfig, L7A1045, "L7A1045 L6028 DSP-A", tag, owner, clock, "l7a1045_custom", __FILE__),
|
||||
device_sound_interface(mconfig, *this),
|
||||
m_stream(NULL)
|
||||
/*m_key(0),
|
||||
m_base(NULL)*/
|
||||
m_stream(NULL),
|
||||
m_key(0),
|
||||
m_rom(NULL),
|
||||
m_rom_size(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -108,6 +109,9 @@ void l7a1045_sound_device::device_start()
|
|||
{
|
||||
/* Allocate the stream */
|
||||
m_stream = stream_alloc(0, 2, clock() / 384);
|
||||
|
||||
m_rom = m_region->base();
|
||||
m_rom_size = m_region->bytes();
|
||||
}
|
||||
|
||||
|
||||
|
@ -120,6 +124,44 @@ void l7a1045_sound_device::sound_stream_update(sound_stream &stream, stream_samp
|
|||
/* Clear the buffers */
|
||||
memset(outputs[0], 0, samples*sizeof(*outputs[0]));
|
||||
memset(outputs[1], 0, samples*sizeof(*outputs[1]));
|
||||
|
||||
for (int i = 0; i < 32; i++)
|
||||
{
|
||||
if (m_key & (1 << i))
|
||||
{
|
||||
l7a1045_voice *vptr = &m_voice[i];
|
||||
|
||||
UINT32 start = 0x000000;
|
||||
UINT32 end = 0x002000;
|
||||
UINT32 step = 0x0800;
|
||||
|
||||
UINT32 pos = vptr->pos;
|
||||
UINT32 frac = vptr->frac;
|
||||
|
||||
for (int j = 0; j < samples; j++)
|
||||
{
|
||||
INT32 sample;
|
||||
|
||||
pos += (frac >> 12);
|
||||
frac &= 0xfff;
|
||||
|
||||
if ((start + pos) >= end)
|
||||
{
|
||||
m_key &= ~(1 << i);
|
||||
|
||||
}
|
||||
|
||||
sample = (INT8)m_rom[start + pos];
|
||||
frac += step;
|
||||
|
||||
outputs[0][j] += ((sample * 0x8000) >> 8);
|
||||
outputs[1][j] += ((sample * 0x8000) >> 8);
|
||||
}
|
||||
|
||||
vptr->pos = pos;
|
||||
vptr->frac = frac;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -196,7 +238,7 @@ WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_02_w) // upper? word of
|
|||
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 0x00:
|
||||
case 0x01:
|
||||
case 0x04:
|
||||
case 0x06:
|
||||
|
@ -209,6 +251,17 @@ WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_02_w) // upper? word of
|
|||
// 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
|
||||
m_key |= 1 << m_audioregister;
|
||||
|
||||
m_voice[m_audioregister].frac = 0;
|
||||
m_voice[m_audioregister].pos = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,18 +4,16 @@
|
|||
|
||||
struct l7a1045_voice
|
||||
{
|
||||
/*
|
||||
l7a1045_voice() :
|
||||
pos(0),
|
||||
frac(0)
|
||||
{
|
||||
memset(regs, 0, sizeof(UINT32)*8);
|
||||
//memset(regs, 0, sizeof(UINT32)*8);
|
||||
}
|
||||
|
||||
UINT32 regs[8];
|
||||
UINT32 pos;
|
||||
UINT32 frac;
|
||||
*/
|
||||
|
||||
};
|
||||
|
||||
// ======================> l7a1045_sound_device
|
||||
|
@ -41,9 +39,10 @@ protected:
|
|||
|
||||
private:
|
||||
sound_stream *m_stream;
|
||||
// l7a1045_voice m_voice[32];
|
||||
// UINT16 m_key;
|
||||
// INT8* m_base;
|
||||
l7a1045_voice m_voice[32];
|
||||
UINT32 m_key;
|
||||
UINT8 *m_rom;
|
||||
INT32 m_rom_size;
|
||||
|
||||
UINT8 m_audiochannel;
|
||||
UINT8 m_audioregister;
|
||||
|
|
|
@ -1616,7 +1616,7 @@ ROM_START( hng64 )
|
|||
ROM_REGION( 0x4000, "sprtile", ROMREGION_ERASEFF )
|
||||
ROM_REGION( 0x1000000, "textures", ROMREGION_ERASEFF )
|
||||
ROM_REGION16_BE( 0x0c00000, "verts", ROMREGION_ERASEFF )
|
||||
ROM_REGION( 0x1000000, "samples", ROMREGION_ERASEFF ) /* Sound Samples */
|
||||
ROM_REGION( 0x1000000, "l7a1045", ROMREGION_ERASEFF ) /* Sound Samples */
|
||||
ROM_END
|
||||
|
||||
|
||||
|
@ -1667,7 +1667,7 @@ ROM_START( roadedge )
|
|||
ROMX_LOAD( "001vt02a.18", 0x0000002, 0x400000, CRC(449f94d0) SHA1(2228690532d82d2661285aeb4260689b027597cb), ROM_GROUPWORD | ROM_SKIP(4) )
|
||||
ROMX_LOAD( "001vt03a.19", 0x0000004, 0x400000, CRC(50ac8639) SHA1(dd2d3689466990a7c479bb8f11bd930ea45e47b5), ROM_GROUPWORD | ROM_SKIP(4) )
|
||||
|
||||
ROM_REGION( 0x1000000, "samples", 0 ) /* Sound Samples */
|
||||
ROM_REGION( 0x1000000, "l7a1045", 0 ) /* Sound Samples */
|
||||
ROM_LOAD( "001sd01a.77", 0x0000000, 0x400000, CRC(a851da99) SHA1(2ba24feddafc5fadec155cdb7af305fdffcf6690) )
|
||||
ROM_LOAD( "001sd02a.78", 0x0400000, 0x400000, CRC(ca5cec15) SHA1(05e91a602728a048d61bf86aa8d43bb4186aeac1) )
|
||||
ROM_END
|
||||
|
@ -1721,7 +1721,7 @@ ROM_START( sams64 )
|
|||
ROMX_LOAD( "002-vt05a.21", 0x0c00002, 0x400000, CRC(d32ee9cb) SHA1(a768dfc15899924eb05eccbf8e85cb29c7b60396), ROM_GROUPWORD | ROM_SKIP(4) )
|
||||
ROMX_LOAD( "002-vt06a.22", 0x0c00004, 0x400000, CRC(13bf3636) SHA1(7c704bf66b571350207bccc7a2d6ed1ec9de4cd5), ROM_GROUPWORD | ROM_SKIP(4) )
|
||||
|
||||
ROM_REGION( 0x1000000, "samples", 0 ) /* Sound Samples */
|
||||
ROM_REGION( 0x1000000, "l7a1045", 0 ) /* Sound Samples */
|
||||
ROM_LOAD( "002-sd01a.77", 0x0000000, 0x400000, CRC(6215036b) SHA1(ded71dce98b7f7ef78ef32d966a292bbf0d15332) )
|
||||
ROM_LOAD( "002-sd02a.78", 0x0400000, 0x400000, CRC(32b28310) SHA1(5b80750a66c12b035b493d06e3842741a3334d0f) )
|
||||
ROM_LOAD( "002-sd03a.79", 0x0800000, 0x400000, CRC(53591413) SHA1(36c7efa1aced0ca38b3ce7b95af28755973698f3) )
|
||||
|
@ -1763,7 +1763,7 @@ ROM_START( xrally )
|
|||
ROMX_LOAD( "003-vt02a.18", 0x0000002, 0x400000, CRC(da7b956e) SHA1(c57cbb8c51145ae224faba5b6a1a7e61cb2bee64), ROM_GROUPWORD | ROM_SKIP(4) )
|
||||
ROMX_LOAD( "003-vt03a.19", 0x0000004, 0x400000, CRC(4fe72cb7) SHA1(9f8e662f0656f201924834d1ee78498d4223745e), ROM_GROUPWORD | ROM_SKIP(4) )
|
||||
|
||||
ROM_REGION( 0x1000000, "samples", 0 ) /* Sound Samples */
|
||||
ROM_REGION( 0x1000000, "l7a1045", 0 ) /* Sound Samples */
|
||||
ROM_LOAD( "003-sd01a.77", 0x0000000, 0x400000, CRC(c43898ff) SHA1(0e49b87181b56c62a674d255d326f761942b99b1) )
|
||||
ROM_LOAD( "003-sd02a.78", 0x0400000, 0x400000, CRC(079a3d5a) SHA1(a97b052de69fee7d605cae30f5a228e6ffeabb26) )
|
||||
ROM_LOAD( "003-sd03a.79", 0x0800000, 0x400000, CRC(96c0991a) SHA1(01be872b3e307258236fe96a544417dd8a0bc8bd) )
|
||||
|
@ -1811,7 +1811,7 @@ ROM_START( bbust2 )
|
|||
ROMX_LOAD( "004-vt02a.18", 0x0000002, 0x400000, CRC(279fc216) SHA1(eb90cc347745491c1d1b1fb611fd6e227310731c), ROM_GROUPWORD | ROM_SKIP(4) )
|
||||
ROMX_LOAD( "004-vt03a.19", 0x0000004, 0x400000, CRC(e0cf6a42) SHA1(dd09b3d05739cf030c820cd7dbaea2e7262764ab), ROM_GROUPWORD | ROM_SKIP(4) )
|
||||
|
||||
ROM_REGION( 0x1000000, "samples", 0 ) /* Sound Samples */
|
||||
ROM_REGION( 0x1000000, "l7a1045", 0 ) /* Sound Samples */
|
||||
ROM_LOAD( "004-sd01a.77", 0x0000000, 0x400000, CRC(2ef868bd) SHA1(0a1ef002efe6738698ebe98a1c3695b151fdd282) )
|
||||
ROM_LOAD( "004-sd02a.78", 0x0400000, 0x400000, CRC(07fb3135) SHA1(56cc8e29ba9b13f82a4c9248bff02e2b7a0c49b0) )
|
||||
ROM_LOAD( "004-sd03a.79", 0x0800000, 0x400000, CRC(42571f1d) SHA1(425cbd3f7c8aea1c0f057ea8f186acffb0091dc0) )
|
||||
|
@ -1882,7 +1882,7 @@ ROM_START( sams64_2 )
|
|||
ROMX_LOAD( "005vt05a.21", 0x0c00002, 0x400000, CRC(49c82bec) SHA1(09255279edb9a204bbe1cce8cef58d5c81e86d1f), ROM_GROUPWORD | ROM_SKIP(4) )
|
||||
ROMX_LOAD( "005vt06a.22", 0x0c00004, 0x400000, CRC(7ba05b6c) SHA1(729c1d182d74998dd904b587a2405f55af9825e0), ROM_GROUPWORD | ROM_SKIP(4) )
|
||||
|
||||
ROM_REGION( 0x1000000, "samples", 0 ) /* Sound Samples */
|
||||
ROM_REGION( 0x1000000, "l7a1045", 0 ) /* Sound Samples */
|
||||
ROM_LOAD( "005sd01a.77", 0x0000000, 0x400000, CRC(8f68150f) SHA1(a1e5efdfd1ed29f81e25c8da669851ddb7b0c826) )
|
||||
ROM_LOAD( "005sd02a.78", 0x0400000, 0x400000, CRC(6b4da6a0) SHA1(8606c413c129635bdaaa37254edbfd19b10426bb) )
|
||||
ROM_LOAD( "005sd03a.79", 0x0800000, 0x400000, CRC(a529fab3) SHA1(8559d402c8f66f638590b8b57ec9efa775010c96) )
|
||||
|
@ -1947,7 +1947,7 @@ ROM_START( fatfurwa )
|
|||
ROMX_LOAD( "006vt02a.18", 0x0000002, 0x400000, CRC(150eb717) SHA1(9acb067346eb386256047c0f1d24dc8fcc2118ca), ROM_GROUPWORD | ROM_SKIP(4) )
|
||||
ROMX_LOAD( "006vt03a.19", 0x0000004, 0x400000, CRC(021cfcaf) SHA1(fb8b5f50d3490b31f0a4c3e6d3ae1b98bae41c97), ROM_GROUPWORD | ROM_SKIP(4) )
|
||||
|
||||
ROM_REGION( 0x1000000, "samples", 0 ) /* Sound Samples */
|
||||
ROM_REGION( 0x1000000, "l7a1045", 0 ) /* Sound Samples */
|
||||
ROM_LOAD( "006sd01a.77", 0x0000000, 0x400000, CRC(790efb6d) SHA1(23ddd3ee8ae808e58cbcaf92a9ef56d3ca6289b5) )
|
||||
ROM_LOAD( "006sd02a.78", 0x0400000, 0x400000, CRC(f7f020c7) SHA1(b72fde4ff6384b80166a3cb67d31bf7afda750bc) )
|
||||
ROM_LOAD( "006sd03a.79", 0x0800000, 0x400000, CRC(1a678084) SHA1(f52efb6145102d289f332d8341d89a5d231ba003) )
|
||||
|
@ -2014,7 +2014,7 @@ ROM_START( buriki )
|
|||
ROMX_LOAD( "007vt02a.18", 0x0000002, 0x400000, CRC(f365f608) SHA1(035fd9b829b7720c4aee6fdf204c080e6157994f), ROM_GROUPWORD | ROM_SKIP(4) )
|
||||
ROMX_LOAD( "007vt03a.19", 0x0000004, 0x400000, CRC(ba05654d) SHA1(b7fe532732c0af7860c8eded3c5abd304d74e08e), ROM_GROUPWORD | ROM_SKIP(4) )
|
||||
|
||||
ROM_REGION( 0x1000000, "samples", 0 ) /* Sound Samples */
|
||||
ROM_REGION( 0x1000000, "l7a1045", 0 ) /* Sound Samples */
|
||||
ROM_LOAD( "007sd01a.77", 0x0000000, 0x400000, CRC(1afb48c6) SHA1(b072d4fe72d6c5267864818d300b32e85b426213) )
|
||||
ROM_LOAD( "007sd02a.78", 0x0400000, 0x400000, CRC(c65f1dd5) SHA1(7f504c585a10c1090dbd1ac31a3a0db920c992a0) )
|
||||
ROM_LOAD( "007sd03a.79", 0x0800000, 0x400000, CRC(356f25c8) SHA1(5250865900894232960686f40c5da35b3868b78c) )
|
||||
|
|
Loading…
Reference in a new issue