summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound
diff options
context:
space:
mode:
author Angelo Salese <angelosa@users.noreply.github.com>2022-01-17 23:30:04 +0100
committer GitHub <noreply@github.com>2022-01-17 23:30:04 +0100
commit5342d0e7f5d6d804cfed3be1290a8327b68a2e96 (patch)
tree629663d7648f02a9a717570dd7dd100a4c4f8e8e /src/devices/sound
parent7439e33919d7e19167b98f4989a62ed749f515d0 (diff)
Fix several issues in DC-based HW (#9150)
- Streamlined logging across chips to use logmacro.h, removed popmessages and printfs in production code; - Add missing include guards in header files; - split Atomiswave into own file from naomi.cpp (dc_atomiswave.cpp); - powervr2.cpp: YUV pitch follows U size, fixes #8999 - powervr2.cpp: move Elan related stuff back into naomi2_state; - naomi.cpp: support for player 2 keyboard inputs; - naomi.cpp: add proper inputs to alpilot/alpilotj and sstrkfgt; - naomi.cpp: hookup lightgun for deathcox; - naomi.cpp: make G2-DMA timings slightly more accurate (fixes sfz3ugd silent BGMs regression caused by implicit insta-DMAs) - dc_g2if.cpp: wrote a device for G2 DMA interface, fixes #9000 ; - dc_g2if.cpp: add E1/E2/DD channels thru template, add area protection, add illegal address and overflow exceptions (fixes loopchk g2 bus tests 0302 and 0303) - aica.cpp: $2814 CA reads doesn't need shifting, fixes ADX repeating sample/hang bugs in many entries [Angelo Salese, MetalliC]; - powervr2.cpp: make ISP/TSP irq to be slower, fixes regression bug with Capcom fighters having frame hiccups [David Haywood, Angelo Salese] - dc_atomiswave.cpp: converted aw_modem_r/_w to 32-bit, added 3p/4p inputs to ggisuka, expose EXID to an input/output ioports for future extensions; - dc_atomiswave.cpp: extend xtrmhnt2 ALL.Net hack for -drc, move around state machine to derive ALL.Net external device mapping instead of driver_init fn, demote to MUP for obvious reasons; - dc_atomiswave: add Area 1 mirrors, fix maxspeed title screen animation; - [MT#8143](https://mametesters.org/view.php?id=8143) is fixed New NOT_WORKING software list additions --------------------------------------- dc.xml: DC Checker for Repair v2.05R (World), Loop Checker v1.00 (World), GD Drive Repair Program v0.1 (World) [Hidden Palace]
Diffstat (limited to 'src/devices/sound')
-rw-r--r--src/devices/sound/aica.cpp44
1 files changed, 24 insertions, 20 deletions
diff --git a/src/devices/sound/aica.cpp b/src/devices/sound/aica.cpp
index 9351f6ede5f..623bf9ece7e 100644
--- a/src/devices/sound/aica.cpp
+++ b/src/devices/sound/aica.cpp
@@ -17,6 +17,11 @@
- Convert I/O registers to space addresses;
- Timebases are based on 44100KHz case?
- Derive from SCSP device;
+ - Sound clips a bit too much (cfr. deathcox, bdrdown, samba title screen, cfield).
+ According to skmp note: "The [ADX] sound decompression code on the sh4 uses FTRC
+ (float -> int) to convert the samples. Make sure you saturate the value when converting"
+ -> Verify this statement.
+
*/
#include "emu.h"
@@ -839,19 +844,10 @@ void aica_device::UpdateRegR(int reg)
//m_stream->update();
int slotnum = MSLC();
AICA_SLOT *slot = m_Slots + slotnum;
- u32 CA;
-
- if (PCMS(slot) == 0) // 16-bit samples
- {
- CA = (slot->cur_addr >> (SHIFT - 1)) & ~1;
- }
- else // 8-bit PCM and 4-bit ADPCM
- {
- CA = (slot->cur_addr >> SHIFT);
- }
-
- //printf("%08x %08x\n",CA,slot->cur_addr & ~1);
-
+ // NB: despite previous implementation this does not depend on PCMS setting.
+ // Was "CA = (slot->cur_addr >> (SHIFT - 1)) & ~1;" on 16-bit path,
+ // causing repeated samples/hangs in several ADX driven entries.
+ u32 CA = (slot->cur_addr >> SHIFT);
m_udata.data[0x14 / 2] = CA;
}
break;
@@ -918,7 +914,12 @@ void aica_device::w16(u32 addr,u16 val)
else if (addr < 0x3300)
*((u16 *)(m_DSP.MADRS+(addr - 0x3200) / 2)) = val;
else if (addr < 0x3400)
- popmessage("AICADSP write to undocumented reg %04x -> %04x", addr, val);
+ {
+ // 3300-fc zapped along with the full 0x3000-0x3bfc range,
+ // most likely done by the SDK for convenience in resetting DSP in one go.
+ if (val)
+ logerror("%s: AICADSP write to undocumented reg %04x -> %04x\n", machine().describe_context(), addr, val);
+ }
else if (addr < 0x3c00)
{
*((u16 *)(m_DSP.MPRO+(addr - 0x3400) / 2)) = val;
@@ -978,7 +979,9 @@ u16 aica_device::r16(u32 addr)
v = m_EFSPAN[addr & 0x7f];
}
else if (addr < 0x2800)
- popmessage("AICA read undocumented reg %04x", addr);
+ {
+ //logerror("%s: AICA read to undocumented reg %04x\n", machine().describe_context(), addr);
+ }
else if (addr < 0x28be)
{
UpdateRegR(addr & 0xff);
@@ -1001,11 +1004,15 @@ u16 aica_device::r16(u32 addr)
else if (addr < 0x3300)
v= *((u16 *)(m_DSP.MADRS+(addr - 0x3200) / 2));
else if (addr < 0x3400)
- popmessage("AICADSP read undocumented reg %04x", addr);
+ {
+ //logerror("%s: AICADSP read to undocumented reg %04x\n", machine().describe_context(), addr);
+ }
else if (addr < 0x3c00)
v= *((u16 *)(m_DSP.MPRO+(addr - 0x3400) / 2));
else if (addr < 0x4000)
- popmessage("AICADSP read undocumented reg %04x",addr);
+ {
+ //logerror("%s: AICADSP read to undocumented reg %04x\n", machine().describe_context(), addr);
+ }
else if (addr < 0x4400)
{
if (addr & 4)
@@ -1191,9 +1198,6 @@ s32 aica_device::UpdateSlot(AICA_SLOT *slot)
}
break;
case 1: //normal loop
- // TODO: loop mechanism causes hangs in Border Down/Metal Slug 6/Karous etc.
- // - For mslug6 culprit RAM address is 0x13880 ARM side (a flag that should be zeroed somehow)
- // - The lpend mechanism more or less works if the ARM CPU is downclocked at about 10%.
if (*addr[addr_select] >= chanlea)
{
slot->lpend = 1;