Previous 199869 Revisions Next

r36877 Wednesday 1st April, 2015 at 12:00:52 UTC by David Haywood
hng64: make a sound when there is a sound request, should allow me to check to see if any of the registers are sample start address (nw)
[scripts/src/osd]modules.lua
[src/emu/sound]l7a1045_l6028_dsp_a.c l7a1045_l6028_dsp_a.h
[src/mame/drivers]hng64.c

trunk/scripts/src/osd/modules.lua
r245388r245389
111111         }
112112      else
113113         buildoptions {
114            string.gsub(os.outputof("pkg-config --cflags QtGui"), '[\r\n]+', ' '),
114            string.gsub(os.outputof("pkg-config --cflags Qt"), '[\r\n]+', ' '),
115115         }
116116      end
117117   else
trunk/src/emu/sound/l7a1045_l6028_dsp_a.c
r245388r245389
9393l7a1045_sound_device::l7a1045_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
9494   : device_t(mconfig, L7A1045, "L7A1045 L6028 DSP-A", tag, owner, clock, "l7a1045_custom", __FILE__),
9595      device_sound_interface(mconfig, *this),
96      m_stream(NULL)
97      /*m_key(0),
98      m_base(NULL)*/
96      m_stream(NULL),
97      m_key(0),
98      m_rom(NULL),
99      m_rom_size(0)
99100{
100101}
101102
r245388r245389
108109{
109110   /* Allocate the stream */
110111   m_stream = stream_alloc(0, 2, clock() / 384);
112
113   m_rom = m_region->base();
114   m_rom_size = m_region->bytes();
111115}
112116
113117
r245388r245389
120124   /* Clear the buffers */
121125   memset(outputs[0], 0, samples*sizeof(*outputs[0]));
122126   memset(outputs[1], 0, samples*sizeof(*outputs[1]));
127
128   for (int i = 0; i < 32; i++)
129   {
130      if (m_key & (1 << i))
131      {
132         l7a1045_voice *vptr = &m_voice[i];
133
134         UINT32 start = 0x000000;
135         UINT32 end = 0x002000;
136         UINT32 step  = 0x0800;
137
138         UINT32 pos = vptr->pos;
139         UINT32 frac = vptr->frac;
140
141         for (int j = 0; j < samples; j++)
142         {
143            INT32 sample;
144
145            pos += (frac >> 12);
146            frac &= 0xfff;
147
148            if ((start + pos) >= end)
149            {
150               m_key &= ~(1 << i);
151           
152            }
153
154            sample = (INT8)m_rom[start + pos];
155            frac += step;
156
157            outputs[0][j] += ((sample * 0x8000) >> 8);
158            outputs[1][j] += ((sample * 0x8000) >> 8);
159         }
160
161         vptr->pos = pos;
162         vptr->frac = frac;
163      }
164   }
123165}
124166
125167
r245388r245389
196238      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]);
197239      break;
198240
199   case 0x00:
241//   case 0x00:
200242   case 0x01:
201243   case 0x04:
202244   case 0x06:
r245388r245389
209251   //   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]);
210252      break;
211253
254   case 0x00:
255      {
256         // hack
257         m_key |= 1 << m_audioregister;
258
259         m_voice[m_audioregister].frac = 0;
260         m_voice[m_audioregister].pos = 0;
261         break;
262      }
263   
264
212265   }
213266
214267}
trunk/src/emu/sound/l7a1045_l6028_dsp_a.h
r245388r245389
44
55struct l7a1045_voice
66{
7   /*
87   l7a1045_voice() :
98      pos(0),
109      frac(0)
1110   {
12      memset(regs, 0, sizeof(UINT32)*8);
11      //memset(regs, 0, sizeof(UINT32)*8);
1312   }
1413
15   UINT32 regs[8];
1614   UINT32 pos;
1715   UINT32 frac;
18   */
16   
1917};
2018
2119// ======================> l7a1045_sound_device
r245388r245389
4139
4240private:
4341   sound_stream *m_stream;
44//   l7a1045_voice m_voice[32];
45//   UINT16     m_key;
46//   INT8*      m_base;
42   l7a1045_voice m_voice[32];
43   UINT32    m_key;
44   UINT8 *m_rom;
45   INT32 m_rom_size;
4746
4847   UINT8 m_audiochannel;
4948   UINT8 m_audioregister;
trunk/src/mame/drivers/hng64.c
r245388r245389
16161616   ROM_REGION( 0x4000, "sprtile", ROMREGION_ERASEFF )
16171617   ROM_REGION( 0x1000000, "textures", ROMREGION_ERASEFF )
16181618   ROM_REGION16_BE( 0x0c00000, "verts", ROMREGION_ERASEFF )
1619   ROM_REGION( 0x1000000, "samples", ROMREGION_ERASEFF ) /* Sound Samples */
1619   ROM_REGION( 0x1000000, "l7a1045", ROMREGION_ERASEFF ) /* Sound Samples */
16201620ROM_END
16211621
16221622
r245388r245389
16671667   ROMX_LOAD( "001vt02a.18", 0x0000002, 0x400000, CRC(449f94d0) SHA1(2228690532d82d2661285aeb4260689b027597cb), ROM_GROUPWORD | ROM_SKIP(4) )
16681668   ROMX_LOAD( "001vt03a.19", 0x0000004, 0x400000, CRC(50ac8639) SHA1(dd2d3689466990a7c479bb8f11bd930ea45e47b5), ROM_GROUPWORD | ROM_SKIP(4) )
16691669
1670   ROM_REGION( 0x1000000, "samples", 0 ) /* Sound Samples */
1670   ROM_REGION( 0x1000000, "l7a1045", 0 ) /* Sound Samples */
16711671   ROM_LOAD( "001sd01a.77", 0x0000000, 0x400000, CRC(a851da99) SHA1(2ba24feddafc5fadec155cdb7af305fdffcf6690) )
16721672   ROM_LOAD( "001sd02a.78", 0x0400000, 0x400000, CRC(ca5cec15) SHA1(05e91a602728a048d61bf86aa8d43bb4186aeac1) )
16731673ROM_END
r245388r245389
17211721   ROMX_LOAD( "002-vt05a.21", 0x0c00002, 0x400000, CRC(d32ee9cb) SHA1(a768dfc15899924eb05eccbf8e85cb29c7b60396), ROM_GROUPWORD | ROM_SKIP(4) )
17221722   ROMX_LOAD( "002-vt06a.22", 0x0c00004, 0x400000, CRC(13bf3636) SHA1(7c704bf66b571350207bccc7a2d6ed1ec9de4cd5), ROM_GROUPWORD | ROM_SKIP(4) )
17231723
1724   ROM_REGION( 0x1000000, "samples", 0 ) /* Sound Samples */
1724   ROM_REGION( 0x1000000, "l7a1045", 0 ) /* Sound Samples */
17251725   ROM_LOAD( "002-sd01a.77", 0x0000000, 0x400000, CRC(6215036b) SHA1(ded71dce98b7f7ef78ef32d966a292bbf0d15332) )
17261726   ROM_LOAD( "002-sd02a.78", 0x0400000, 0x400000, CRC(32b28310) SHA1(5b80750a66c12b035b493d06e3842741a3334d0f) )
17271727   ROM_LOAD( "002-sd03a.79", 0x0800000, 0x400000, CRC(53591413) SHA1(36c7efa1aced0ca38b3ce7b95af28755973698f3) )
r245388r245389
17631763   ROMX_LOAD( "003-vt02a.18", 0x0000002, 0x400000, CRC(da7b956e) SHA1(c57cbb8c51145ae224faba5b6a1a7e61cb2bee64), ROM_GROUPWORD | ROM_SKIP(4) )
17641764   ROMX_LOAD( "003-vt03a.19", 0x0000004, 0x400000, CRC(4fe72cb7) SHA1(9f8e662f0656f201924834d1ee78498d4223745e), ROM_GROUPWORD | ROM_SKIP(4) )
17651765
1766   ROM_REGION( 0x1000000, "samples", 0 ) /* Sound Samples */
1766   ROM_REGION( 0x1000000, "l7a1045", 0 ) /* Sound Samples */
17671767   ROM_LOAD( "003-sd01a.77", 0x0000000, 0x400000, CRC(c43898ff) SHA1(0e49b87181b56c62a674d255d326f761942b99b1) )
17681768   ROM_LOAD( "003-sd02a.78", 0x0400000, 0x400000, CRC(079a3d5a) SHA1(a97b052de69fee7d605cae30f5a228e6ffeabb26) )
17691769   ROM_LOAD( "003-sd03a.79", 0x0800000, 0x400000, CRC(96c0991a) SHA1(01be872b3e307258236fe96a544417dd8a0bc8bd) )
r245388r245389
18111811   ROMX_LOAD( "004-vt02a.18", 0x0000002, 0x400000, CRC(279fc216) SHA1(eb90cc347745491c1d1b1fb611fd6e227310731c), ROM_GROUPWORD | ROM_SKIP(4) )
18121812   ROMX_LOAD( "004-vt03a.19", 0x0000004, 0x400000, CRC(e0cf6a42) SHA1(dd09b3d05739cf030c820cd7dbaea2e7262764ab), ROM_GROUPWORD | ROM_SKIP(4) )
18131813
1814   ROM_REGION( 0x1000000, "samples", 0 ) /* Sound Samples */
1814   ROM_REGION( 0x1000000, "l7a1045", 0 ) /* Sound Samples */
18151815   ROM_LOAD( "004-sd01a.77", 0x0000000, 0x400000, CRC(2ef868bd) SHA1(0a1ef002efe6738698ebe98a1c3695b151fdd282) )
18161816   ROM_LOAD( "004-sd02a.78", 0x0400000, 0x400000, CRC(07fb3135) SHA1(56cc8e29ba9b13f82a4c9248bff02e2b7a0c49b0) )
18171817   ROM_LOAD( "004-sd03a.79", 0x0800000, 0x400000, CRC(42571f1d) SHA1(425cbd3f7c8aea1c0f057ea8f186acffb0091dc0) )
r245388r245389
18821882   ROMX_LOAD( "005vt05a.21", 0x0c00002, 0x400000, CRC(49c82bec) SHA1(09255279edb9a204bbe1cce8cef58d5c81e86d1f), ROM_GROUPWORD | ROM_SKIP(4) )
18831883   ROMX_LOAD( "005vt06a.22", 0x0c00004, 0x400000, CRC(7ba05b6c) SHA1(729c1d182d74998dd904b587a2405f55af9825e0), ROM_GROUPWORD | ROM_SKIP(4) )
18841884
1885   ROM_REGION( 0x1000000, "samples", 0 ) /* Sound Samples */
1885   ROM_REGION( 0x1000000, "l7a1045", 0 ) /* Sound Samples */
18861886   ROM_LOAD( "005sd01a.77", 0x0000000, 0x400000, CRC(8f68150f) SHA1(a1e5efdfd1ed29f81e25c8da669851ddb7b0c826) )
18871887   ROM_LOAD( "005sd02a.78", 0x0400000, 0x400000, CRC(6b4da6a0) SHA1(8606c413c129635bdaaa37254edbfd19b10426bb) )
18881888   ROM_LOAD( "005sd03a.79", 0x0800000, 0x400000, CRC(a529fab3) SHA1(8559d402c8f66f638590b8b57ec9efa775010c96) )
r245388r245389
19471947   ROMX_LOAD( "006vt02a.18", 0x0000002, 0x400000, CRC(150eb717) SHA1(9acb067346eb386256047c0f1d24dc8fcc2118ca), ROM_GROUPWORD | ROM_SKIP(4) )
19481948   ROMX_LOAD( "006vt03a.19", 0x0000004, 0x400000, CRC(021cfcaf) SHA1(fb8b5f50d3490b31f0a4c3e6d3ae1b98bae41c97), ROM_GROUPWORD | ROM_SKIP(4) )
19491949
1950   ROM_REGION( 0x1000000, "samples", 0 ) /* Sound Samples */
1950   ROM_REGION( 0x1000000, "l7a1045", 0 ) /* Sound Samples */
19511951   ROM_LOAD( "006sd01a.77", 0x0000000, 0x400000, CRC(790efb6d) SHA1(23ddd3ee8ae808e58cbcaf92a9ef56d3ca6289b5) )
19521952   ROM_LOAD( "006sd02a.78", 0x0400000, 0x400000, CRC(f7f020c7) SHA1(b72fde4ff6384b80166a3cb67d31bf7afda750bc) )
19531953   ROM_LOAD( "006sd03a.79", 0x0800000, 0x400000, CRC(1a678084) SHA1(f52efb6145102d289f332d8341d89a5d231ba003) )
r245388r245389
20142014   ROMX_LOAD( "007vt02a.18", 0x0000002, 0x400000, CRC(f365f608) SHA1(035fd9b829b7720c4aee6fdf204c080e6157994f), ROM_GROUPWORD | ROM_SKIP(4) )
20152015   ROMX_LOAD( "007vt03a.19", 0x0000004, 0x400000, CRC(ba05654d) SHA1(b7fe532732c0af7860c8eded3c5abd304d74e08e), ROM_GROUPWORD | ROM_SKIP(4) )
20162016
2017   ROM_REGION( 0x1000000, "samples", 0 ) /* Sound Samples */
2017   ROM_REGION( 0x1000000, "l7a1045", 0 ) /* Sound Samples */
20182018   ROM_LOAD( "007sd01a.77", 0x0000000, 0x400000, CRC(1afb48c6) SHA1(b072d4fe72d6c5267864818d300b32e85b426213) )
20192019   ROM_LOAD( "007sd02a.78", 0x0400000, 0x400000, CRC(c65f1dd5) SHA1(7f504c585a10c1090dbd1ac31a3a0db920c992a0) )
20202020   ROM_LOAD( "007sd03a.79", 0x0800000, 0x400000, CRC(356f25c8) SHA1(5250865900894232960686f40c5da35b3868b78c) )


Previous 199869 Revisions Next


© 1997-2024 The MAME Team