trunk/src/emu/sound/l7a1045_l6028_dsp_a.c
| r245578 | r245579 | |
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | | L7A1045 L6028 DSP-A |
| 3 | L7A1045 L6028 DSP-A |
| 4 | 4 | (QFP120 package) |
| 5 | 5 | |
| 6 | 6 | this is the audio chip used on the following |
| r245578 | r245579 | |
| 44 | 44 | |
| 45 | 45 | 7 ---------------- ---------------- llllllllrrrrrrrr left/right volume |
| 46 | 46 | |
| 47 | | 8 ---------------- ---------------- ---------------- (read only?) |
| 47 | 8 ---------------- ---------------- ---------------- (read only?) |
| 48 | 48 | |
| 49 | 49 | 9 ---------------- ---------------- ---------------- (read only?) |
| 50 | 50 | |
| r245578 | r245579 | |
| 149 | 149 | if ((start + pos) >= end) |
| 150 | 150 | { |
| 151 | 151 | m_key &= ~(1 << i); |
| 152 | | |
| 152 | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | sample = (INT8)m_rom[(start + pos) & (m_rom_size-1)]; |
| r245578 | r245579 | |
| 168 | 168 | |
| 169 | 169 | WRITE16_MEMBER( l7a1045_sound_device::l7a1045_sound_w ) |
| 170 | 170 | { |
| 171 | | m_stream->update(); |
| 171 | m_stream->update(); // TODO |
| 172 | 172 | |
| 173 | | switch (offset) |
| 174 | | { |
| 175 | | case 0x00:l7a1045_sound_select_w(space, offset, data, mem_mask); break; |
| 176 | | case 0x01:l7a1045_sound_data_02_w(space, offset, data, mem_mask); break; |
| 177 | | case 0x02:l7a1045_sound_data_04_w(space, offset, data, mem_mask); break; |
| 178 | | case 0x03:l7a1045_sound_data_06_w(space, offset, data, mem_mask); break; |
| 179 | | } |
| 180 | | |
| 173 | if(offset == 0) |
| 174 | sound_select_w(space, offset, data, mem_mask); |
| 175 | else |
| 176 | sound_data_w(space,offset - 1,data,mem_mask); |
| 181 | 177 | } |
| 182 | 178 | |
| 183 | 179 | |
| r245578 | r245579 | |
| 199 | 195 | } |
| 200 | 196 | |
| 201 | 197 | |
| 202 | | WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_select_w) |
| 198 | WRITE16_MEMBER(l7a1045_sound_device::sound_select_w) |
| 203 | 199 | { |
| 204 | 200 | // I'm guessing these addresses are the sound chip / DSP? |
| 205 | 201 | |
| r245578 | r245579 | |
| 222 | 218 | |
| 223 | 219 | } |
| 224 | 220 | |
| 225 | | WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_02_w) // upper? word of various registers? |
| 221 | WRITE16_MEMBER(l7a1045_sound_device::sound_data_w) |
| 226 | 222 | { |
| 227 | | m_audiodat[m_audioregister][m_audiochannel].dat[2] = data; |
| 223 | // if(m_audioregister == 0) |
| 224 | // printf("%04x %04x (%04x|%04x %04x)\n",offset,data,offset ^ 2,m_audioregister,m_audiochannel); |
| 228 | 225 | |
| 229 | | // write with registers 00, 01, 04, 06, 05, 03, 07, 02 on startup |
| 230 | | // groups writes of register 0a per channel |
| 226 | m_audiodat[m_audioregister][m_audiochannel].dat[offset] = data; |
| 231 | 227 | |
| 232 | | // register 08 / 09 not written? |
| 233 | | switch (m_audioregister) |
| 228 | if(offset == 0) |
| 234 | 229 | { |
| 235 | | default: |
| 236 | 230 | |
| 237 | | case 0x08: |
| 238 | | case 0x09: |
| 239 | | 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]); |
| 240 | | break; |
| 241 | | |
| 242 | | // case 0x00: |
| 243 | | case 0x01: |
| 244 | | case 0x04: |
| 245 | | case 0x06: |
| 246 | | case 0x05: |
| 247 | | case 0x03: |
| 248 | | case 0x02: |
| 249 | | case 0x07: |
| 250 | | |
| 251 | | case 0x0a: |
| 252 | | // 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]); |
| 253 | | break; |
| 254 | | |
| 231 | switch (m_audioregister) |
| 232 | { |
| 255 | 233 | case 0x00: |
| 256 | 234 | // hack |
| 257 | | l7a1045_voice *vptr = &m_voice[m_audiochannel]; |
| 235 | l7a1045_voice *vptr = &m_voice[m_audiochannel]; |
| 258 | 236 | |
| 259 | 237 | m_key |= 1 << m_audiochannel; |
| 260 | 238 | |
| 261 | 239 | vptr->frac = 0; |
| 262 | 240 | vptr->pos = 0; |
| 263 | 241 | |
| 264 | | vptr->start = (m_audiodat[0][m_audiochannel].dat[0] & 0x000f) << (16 + 4); |
| 265 | | vptr->start |= (m_audiodat[0][m_audiochannel].dat[1] & 0xffff) << (4); |
| 266 | | vptr->start |= (m_audiodat[0][m_audiochannel].dat[2] & 0xf000) >> (12); |
| 242 | vptr->start = (m_audiodat[0][m_audiochannel].dat[2] & 0x000f) << (16 + 4); |
| 243 | vptr->start |= (m_audiodat[0][m_audiochannel].dat[1] & 0xffff) << (4); |
| 244 | vptr->start |= (m_audiodat[0][m_audiochannel].dat[0] & 0xf000) >> (12); |
| 267 | 245 | |
| 268 | 246 | vptr->start &= m_rom_size - 1; |
| 269 | 247 | |
| 270 | 248 | //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]); |
| 271 | 249 | break; |
| 272 | 250 | } |
| 273 | | |
| 274 | 251 | } |
| 275 | | |
| 276 | | WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_04_w) // lower? word of various registers? |
| 277 | | { |
| 278 | | m_audiodat[m_audioregister][m_audiochannel].dat[1] = data; |
| 279 | | |
| 280 | | // write with registers 00, 04, 06, 05, 03, 07, 02, 01 on startup |
| 281 | | // groups writes of register 0a per channel |
| 282 | | |
| 283 | | // register 08 / 09 not written? |
| 284 | | |
| 285 | | switch (m_audioregister) |
| 286 | | { |
| 287 | | default: |
| 288 | | |
| 289 | | case 0x08: |
| 290 | | case 0x09: |
| 291 | | 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]); |
| 292 | | break; |
| 293 | | |
| 294 | | // case 0x00: |
| 295 | | case 0x04: |
| 296 | | case 0x06: |
| 297 | | case 0x05: |
| 298 | | case 0x03: |
| 299 | | case 0x07: |
| 300 | | case 0x01: |
| 301 | | case 0x02: |
| 302 | | |
| 303 | | case 0x0a: |
| 304 | | //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]); |
| 305 | | break; |
| 306 | | |
| 307 | | case 0x00: |
| 308 | | //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]); |
| 309 | | break; |
| 310 | | } |
| 311 | | |
| 312 | 252 | } |
| 313 | | WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_06_w) // other part? of various registers.. less used than 02/04, maybe flags? |
| 314 | | { |
| 315 | | // 00 / 01 written at startup |
| 316 | | // nothing else used? |
| 317 | 253 | |
| 318 | | m_audiodat[m_audioregister][m_audiochannel].dat[0] = data; |
| 319 | | switch (m_audioregister) |
| 320 | | { |
| 321 | | default: |
| 322 | 254 | |
| 323 | | case 0x02: |
| 324 | | case 0x03: |
| 325 | | case 0x04: |
| 326 | | case 0x05: |
| 327 | | case 0x06: |
| 328 | | case 0x07: |
| 329 | | case 0x08: |
| 330 | | case 0x09: |
| 331 | | case 0x0a: |
| 332 | | 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]); |
| 333 | | break; |
| 334 | | |
| 335 | | // case 0x00: |
| 336 | | case 0x01: |
| 337 | | //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]); |
| 338 | | break; |
| 339 | | |
| 340 | | case 0x00: |
| 341 | | |
| 342 | | // it writes 2 values here for each sample |
| 343 | | // the 2nd one seems to contain the upper 4 bits of the sample address |
| 344 | | // so why does it write different data first? |
| 345 | | //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]); |
| 346 | | break; |
| 347 | | |
| 348 | | } |
| 349 | | } |
| 350 | | |
| 351 | | |
| 352 | 255 | READ16_MEMBER(l7a1045_sound_device::l7a1045_sound_port_0004_r) |
| 353 | 256 | { |
| 354 | 257 | // it writes the channel select before reading this.. so either it works on channels, or the command.. |
trunk/src/mame/drivers/cninja.c
| r245578 | r245579 | |
| 2109 | 2109 | ROM_LOAD( "maf-09.18l", 0x00000, 0x80000, CRC(28e7ed81) SHA1(e168a2748b75c647f6f9c0d7d25d4f046aa98094) ) |
| 2110 | 2110 | ROM_END |
| 2111 | 2111 | |
| 2112 | |
| 2113 | ROM_START( mutantf2 ) /* World ver 2 */ |
| 2114 | ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 code */ |
| 2115 | ROM_LOAD16_BYTE("hd-03-1.2c", 0x00000, 0x20000, CRC(7110cefc) SHA1(26b470cf2fcd026542c7ff4fca11c2095a17501d) ) |
| 2116 | ROM_LOAD16_BYTE("hd-00-1.2a", 0x00001, 0x20000, CRC(b279875b) SHA1(fc148f3f70f289ae1d383f714c41d7b50381803e) ) |
| 2117 | ROM_LOAD16_BYTE("hd-04-1.4c", 0x40000, 0x20000, CRC(fd2ea8d7) SHA1(00e50d42fcc7f6d5076963b02f5abb36275dc993) ) |
| 2118 | ROM_LOAD16_BYTE("hd-01-1.4a", 0x40001, 0x20000, CRC(48a247ac) SHA1(c69d67e44ffae92b261de247f8d3eac2e02fcf11) ) |
| 2119 | |
| 2120 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* Sound CPU */ |
| 2121 | ROM_LOAD( "hd-12.21j", 0x00000, 0x10000, CRC(13d55f11) SHA1(6438dca57f43b3ca6d273bf82b62104a49260132) ) |
| 2122 | |
| 2123 | ROM_REGION( 0x0a0000, "gfx1", 0 ) /* chars */ |
| 2124 | ROM_LOAD16_BYTE( "hd-06-1.8d", 0x000000, 0x10000, CRC(8b7a558b) SHA1(06f1f6910b9a54e208ee9a0b734d5df946016236) ) |
| 2125 | ROM_LOAD16_BYTE( "hd-07-1.9d", 0x000001, 0x10000, CRC(d2a3d449) SHA1(10ad634eb0238f6e9ba04266e4dbaf9470f5d169) ) |
| 2126 | |
| 2127 | ROM_REGION( 0x080000, "gfx2", 0 ) |
| 2128 | ROM_LOAD( "maf-00.8a", 0x000000, 0x80000, CRC(e56f528d) SHA1(3908d9b189fa4895c532d1d1f133df0913810cf9) ) /* tiles 3 */ |
| 2129 | |
| 2130 | ROM_REGION( 0x100000, "gfx3", 0 ) |
| 2131 | ROM_LOAD( "maf-01.9a", 0x000000, 0x40000, CRC(c3d5173d) SHA1(2b6559bf65d7cc5b957ad347b64cf6a18f661686) ) /* tiles 1 */ |
| 2132 | ROM_CONTINUE( 0x080000, 0x40000 ) |
| 2133 | ROM_LOAD( "maf-02.11a", 0x040000, 0x40000, CRC(0b37d849) SHA1(a0606fb8130a2e86a241ce5ce0b4f61373a88c17) ) /* tiles 2 */ |
| 2134 | ROM_CONTINUE( 0x0c0000, 0x40000 ) |
| 2135 | |
| 2136 | ROM_REGION( 0x500000, "gfx4", 0 ) /* sprites */ |
| 2137 | ROM_LOAD16_BYTE( "maf-03.18a", 0x000000, 0x100000, CRC(f4366d2c) SHA1(20964d0e1b879b3e5cb5d18a46d2a17dca2b4171) ) |
| 2138 | ROM_LOAD16_BYTE( "maf-04.20a", 0x200000, 0x100000, CRC(0c8f654e) SHA1(e566d4b789b345e20caf7e061e43be7c2e1be9b2) ) |
| 2139 | ROM_LOAD16_BYTE( "maf-05.21a", 0x400000, 0x080000, CRC(b0cfeb80) SHA1(b8519c604b03eb8bcf26d00a43b39d48f1b45ab5) ) |
| 2140 | ROM_LOAD16_BYTE( "maf-06.18d", 0x000001, 0x100000, CRC(f5c7a9b5) SHA1(92efc9401347598c90acf62c9aef30109c990ad6) ) |
| 2141 | ROM_LOAD16_BYTE( "maf-07.20d", 0x200001, 0x100000, CRC(fd6008a3) SHA1(7b680424eca3804c70fa0c4dc415d665c8626498) ) |
| 2142 | ROM_LOAD16_BYTE( "maf-08.21d", 0x400001, 0x080000, CRC(e41cf1e7) SHA1(06524e1aed0adc4c32c92e16a00dc983014f4994) ) |
| 2143 | |
| 2144 | ROM_REGION( 0x40000, "gfx5", 0 ) /* sprites 2 */ |
| 2145 | ROM_LOAD32_BYTE("hf-08.15a", 0x00001, 0x10000, CRC(93b7279f) SHA1(14304a1ffe1bc791bfa83f8200793d897449133c) ) |
| 2146 | ROM_LOAD32_BYTE("hf-09.17a", 0x00003, 0x10000, CRC(05e2c074) SHA1(ec95303e8196424864964b5d2ae862bf75571e83) ) |
| 2147 | ROM_LOAD32_BYTE("hf-10.15c", 0x00000, 0x10000, CRC(9b06f418) SHA1(d1579ae36676e38c96ee55a1ffa20aa307a21654) ) |
| 2148 | ROM_LOAD32_BYTE("hf-11.17c", 0x00002, 0x10000, CRC(3859a531) SHA1(a2a0c1aa28181b5ef6c075ff0118178340389693) ) |
| 2149 | |
| 2150 | ROM_REGION( 0x40000, "oki1", 0 ) /* ADPCM samples */ |
| 2151 | ROM_LOAD( "maf-10.20l", 0x00000, 0x40000, CRC(7c57f48b) SHA1(9a5624553b3b038d70f9b517f410a635c00a8771) ) |
| 2152 | |
| 2153 | ROM_REGION( 0x80000, "oki2", 0 ) /* ADPCM samples */ |
| 2154 | ROM_LOAD( "maf-09.18l", 0x00000, 0x80000, CRC(28e7ed81) SHA1(e168a2748b75c647f6f9c0d7d25d4f046aa98094) ) |
| 2155 | ROM_END |
| 2156 | |
| 2112 | 2157 | ROM_START( deathbrd ) /* Japan ver 3 */ |
| 2113 | 2158 | ROM_REGION( 0x80000, "maincpu", 0 ) /* 68000 code */ |
| 2114 | 2159 | ROM_LOAD16_BYTE("hf-03-2.2c", 0x00000, 0x20000, CRC(fb86fff3) SHA1(af4cfc19ec85e0aa49b5e46d95bdd94a20922cce) ) |
| r245578 | r245579 | |
| 2198 | 2243 | GAME( 1992, mutantf, 0, mutantf, mutantf, cninja_state, mutantf, ROT0, "Data East Corporation", "Mutant Fighter (World ver EM-5)", GAME_SUPPORTS_SAVE ) |
| 2199 | 2244 | GAME( 1992, mutantf4, mutantf, mutantf, mutantf, cninja_state, mutantf, ROT0, "Data East Corporation", "Mutant Fighter (World ver EM-4)", GAME_SUPPORTS_SAVE ) |
| 2200 | 2245 | GAME( 1992, mutantf3, mutantf, mutantf, mutantf, cninja_state, mutantf, ROT0, "Data East Corporation", "Mutant Fighter (World ver EM-3)", GAME_SUPPORTS_SAVE ) |
| 2246 | GAME( 1992, mutantf2, mutantf, mutantf, mutantf, cninja_state, mutantf, ROT0, "Data East Corporation", "Mutant Fighter (World ver EM-2)", GAME_SUPPORTS_SAVE ) |
| 2201 | 2247 | GAME( 1992, deathbrd, mutantf, mutantf, mutantf, cninja_state, mutantf, ROT0, "Data East Corporation", "Death Brade (Japan ver JM-3)", GAME_SUPPORTS_SAVE ) |