trunk/src/emu/sound/l7a1045_l6028_dsp_a.c
| r245323 | r245324 | |
| 52 | 52 | |
| 53 | 53 | Registers are not yet understood. |
| 54 | 54 | |
| 55 | probably sample start, end, loop positions, panning etc. |
| 56 | like CPS3, Qsound etc. |
| 57 | |
| 58 | case 0x00: |
| 59 | case 0x01: |
| 60 | case 0x02: |
| 61 | case 0x03: // 00003fffffff (startup only?) |
| 62 | case 0x04: // doesn't use 6 |
| 63 | case 0x05: // 00003fffffff (mostly, often) |
| 64 | case 0x06: // 00007ff0ffff mostly |
| 65 | case 0x07: // 0000000f0708 etc. (low values) |
| 66 | case 0x08: // doesn't write to 2/4/6 with this set?? |
| 67 | case 0x09: // doesn't write to 2/4/6 with this set?? |
| 68 | case 0x0a: // random looking values |
| 69 | |
| 55 | 70 | Some of the other ports on the HNG64 sound CPU may also be tied |
| 56 | 71 | to this chip, this isn't yet clear. |
| 57 | 72 | |
| r245323 | r245324 | |
| 148 | 163 | // ---- ---- 000c cccc |
| 149 | 164 | // c = channel |
| 150 | 165 | |
| 151 | | if (data & 0x00e0) printf("%08x: l7a1045_sound_select_w unknown channel %02x\n", space.device().safe_pc(), data & 0x00ff); |
| 166 | if (ACCESSING_BITS_0_7) |
| 167 | { |
| 168 | m_audiochannel = data; |
| 169 | if (m_audiochannel & 0xe0) printf("%08x: l7a1045_sound_select_w unknown channel %01x\n", space.device().safe_pc(), m_audiochannel & 0xff); |
| 170 | m_audiochannel &= 0x1f; |
| 171 | } |
| 152 | 172 | |
| 153 | | UINT8 command = data >> 8; |
| 173 | if (ACCESSING_BITS_8_15) |
| 174 | { |
| 175 | m_audioregister = (data >> 8); |
| 176 | if (m_audioregister >0x0a) printf("%08x: l7a1045_sound_select_w unknown register %01x\n", space.device().safe_pc(), m_audioregister & 0xff); |
| 177 | m_audioregister &= 0x0f; |
| 178 | } |
| 154 | 179 | |
| 155 | | switch (command) |
| 180 | } |
| 181 | |
| 182 | WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_02_w) // upper? word of various registers? |
| 183 | { |
| 184 | m_audiodat[m_audioregister][m_audiochannel].dat[2] = data; |
| 185 | |
| 186 | // write with registers 00, 01, 04, 06, 05, 03, 07, 02 on startup |
| 187 | // groups writes of register 0a per channel |
| 188 | |
| 189 | // register 08 / 09 not written? |
| 190 | switch (m_audioregister) |
| 156 | 191 | { |
| 192 | default: |
| 193 | |
| 194 | case 0x08: |
| 195 | case 0x09: |
| 196 | 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]); |
| 197 | break; |
| 198 | |
| 157 | 199 | case 0x00: |
| 158 | 200 | case 0x01: |
| 201 | case 0x04: |
| 202 | case 0x06: |
| 203 | case 0x05: |
| 204 | case 0x03: |
| 159 | 205 | case 0x02: |
| 160 | | case 0x03: // 00003fffffff (startup only?) |
| 161 | | case 0x04: // doesn't use 6 |
| 162 | | case 0x05: // 00003fffffff (mostly, often) |
| 163 | | case 0x06: // 00007ff0ffff mostly |
| 164 | | case 0x07: // 0000000f0708 etc. (low values) |
| 165 | | case 0x08: // doesn't write to 2/4/6 with this set?? |
| 166 | | case 0x09: // doesn't write to 2/4/6 with this set?? |
| 167 | | case 0x0a: // random looking values |
| 206 | case 0x07: |
| 168 | 207 | |
| 208 | case 0x0a: |
| 209 | // 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]); |
| 169 | 210 | break; |
| 170 | 211 | |
| 171 | | default: |
| 172 | | printf("%08x: l7a1045_sound_select_w unrecognized command %02x\n", space.device().safe_pc(), command); |
| 173 | | break; |
| 174 | 212 | } |
| 175 | 213 | |
| 176 | | COMBINE_DATA(&m_audiochannel); |
| 177 | 214 | } |
| 178 | 215 | |
| 179 | | WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_02_w) |
| 216 | WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_04_w) // lower? word of various registers? |
| 180 | 217 | { |
| 181 | | m_audiodat[m_audiochannel].dat[2] = data; |
| 218 | m_audiodat[m_audioregister][m_audiochannel].dat[1] = data; |
| 182 | 219 | |
| 183 | | // if ((m_audiochannel & 0xff00) == 0x0a00) |
| 184 | | // printf("%08x: write port 0x0002 chansel %04x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audiochannel, data, m_audiodat[m_audiochannel].dat[0], m_audiodat[m_audiochannel].dat[1], m_audiodat[m_audiochannel].dat[2]); |
| 185 | | } |
| 220 | // write with registers 00, 04, 06, 05, 03, 07, 02, 01 on startup |
| 221 | // groups writes of register 0a per channel |
| 186 | 222 | |
| 187 | | WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_04_w) |
| 188 | | { |
| 189 | | m_audiodat[m_audiochannel].dat[1] = data; |
| 223 | // register 08 / 09 not written? |
| 190 | 224 | |
| 191 | | // if ((m_audiochannel & 0xff00) == 0x0a00) |
| 192 | | // printf("%08x: write port 0x0004 chansel %04x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audiochannel, data, m_audiodat[m_audiochannel].dat[0], m_audiodat[m_audiochannel].dat[1], m_audiodat[m_audiochannel].dat[2]); |
| 225 | switch (m_audioregister) |
| 226 | { |
| 227 | default: |
| 228 | |
| 229 | case 0x08: |
| 230 | case 0x09: |
| 231 | 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]); |
| 232 | break; |
| 233 | |
| 234 | case 0x00: |
| 235 | case 0x04: |
| 236 | case 0x06: |
| 237 | case 0x05: |
| 238 | case 0x03: |
| 239 | case 0x07: |
| 240 | case 0x01: |
| 241 | case 0x02: |
| 242 | |
| 243 | case 0x0a: |
| 244 | //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]); |
| 245 | break; |
| 246 | } |
| 247 | |
| 193 | 248 | } |
| 194 | | WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_06_w) |
| 249 | WRITE16_MEMBER(l7a1045_sound_device::l7a1045_sound_data_06_w) // other part? of various registers.. less used than 02/04, maybe flags? |
| 195 | 250 | { |
| 196 | | m_audiodat[m_audiochannel].dat[0] = data; |
| 251 | // 00 / 01 written at startup |
| 252 | // nothing else used? |
| 197 | 253 | |
| 198 | | // if ((m_audiochannel & 0xff00) == 0x0a00) |
| 199 | | // printf("%08x: write port 0x0006 chansel %04x data %04x (%04x%04x%04x)\n", space.device().safe_pc(), m_audiochannel, data, m_audiodat[m_audiochannel].dat[0], m_audiodat[m_audiochannel].dat[1], m_audiodat[m_audiochannel].dat[2]); |
| 254 | m_audiodat[m_audioregister][m_audiochannel].dat[0] = data; |
| 255 | switch (m_audioregister) |
| 256 | { |
| 257 | default: |
| 258 | |
| 259 | case 0x02: |
| 260 | case 0x03: |
| 261 | case 0x04: |
| 262 | case 0x05: |
| 263 | case 0x06: |
| 264 | case 0x07: |
| 265 | case 0x08: |
| 266 | case 0x09: |
| 267 | case 0x0a: |
| 268 | 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]); |
| 269 | break; |
| 270 | |
| 271 | case 0x00: |
| 272 | case 0x01: |
| 273 | //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]); |
| 274 | break; |
| 275 | |
| 276 | } |
| 200 | 277 | } |
| 201 | 278 | |
| 202 | 279 | |
| 203 | 280 | READ16_MEMBER(l7a1045_sound_device::l7a1045_sound_port_0004_r) |
| 204 | 281 | { |
| 205 | 282 | // it writes the channel select before reading this.. so either it works on channels, or the command.. |
| 206 | | // read in irq5 |
| 207 | | printf("%08x: l7a1045_sound_port_0004_r mask (%04x) chn %04x\n", space.device().safe_pc(), mem_mask, m_audiochannel); |
| 283 | |
| 284 | // buriki reads registers 03/05/00 these at the moment, others don't |
| 285 | // also reads 06 |
| 286 | |
| 287 | switch (m_audioregister) |
| 288 | { |
| 289 | default: |
| 290 | |
| 291 | case 0x01: |
| 292 | case 0x02: |
| 293 | case 0x04: |
| 294 | case 0x07: |
| 295 | case 0x08: |
| 296 | case 0x09: |
| 297 | case 0x0a: |
| 298 | printf("%08x: unexpected read port 0x0004 register %02x chansel %02x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); |
| 299 | break; |
| 300 | |
| 301 | case 0x03: |
| 302 | case 0x05: |
| 303 | case 0x00: |
| 304 | case 0x06: |
| 305 | //printf("%08x: read port 0x0004 register %02x chansel %02x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); |
| 306 | break; |
| 307 | |
| 308 | |
| 309 | } |
| 208 | 310 | return rand(); |
| 209 | 311 | } |
| 210 | 312 | |
| 211 | 313 | READ16_MEMBER(l7a1045_sound_device::l7a1045_sound_port_0006_r) |
| 212 | 314 | { |
| 213 | 315 | // it writes the channel select before reading this.. so either it works on channels, or the command.. |
| 214 | | // read in irq5 |
| 215 | | printf("%08x: l7a1045_sound_port_0006_r mask (%04x) chn %04x\n", space.device().safe_pc(), mem_mask, m_audiochannel); |
| 316 | |
| 317 | // buriki reads register 00 |
| 318 | |
| 319 | switch (m_audioregister) |
| 320 | { |
| 321 | default: |
| 322 | |
| 323 | case 0x01: |
| 324 | case 0x02: |
| 325 | case 0x03: |
| 326 | case 0x04: |
| 327 | case 0x05: |
| 328 | case 0x06: |
| 329 | case 0x07: |
| 330 | case 0x08: |
| 331 | case 0x09: |
| 332 | case 0x0a: |
| 333 | printf("%08x: unexpected read port 0x0006 register %02x chansel %02x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, m_audiodat[m_audioregister][m_audiochannel].dat[0], m_audiodat[m_audioregister][m_audiochannel].dat[1], m_audiodat[m_audioregister][m_audiochannel].dat[2]); |
| 334 | break; |
| 335 | |
| 336 | case 0x00: |
| 337 | //printf("%08x: read port 0x0006 register %02x chansel %02x (%04x%04x%04x)\n", space.device().safe_pc(), m_audioregister, m_audiochannel, 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 | } |
| 216 | 340 | return rand(); |
| 217 | 341 | } |