summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/aica.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/aica.cpp')
-rw-r--r--src/devices/sound/aica.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/devices/sound/aica.cpp b/src/devices/sound/aica.cpp
index f636f209576..24b114719f7 100644
--- a/src/devices/sound/aica.cpp
+++ b/src/devices/sound/aica.cpp
@@ -913,7 +913,10 @@ void aica_device::w16(address_space &space,unsigned int addr,unsigned short val)
if(addr<0x3200) //COEF
*((unsigned short *) (m_DSP.COEF+(addr-0x3000)/2))=val;
else if(addr<0x3400)
+ {
+ assert(((addr-0x3200)/2) < ARRAY_LENGTH(m_DSP.MADRS));
*((unsigned short *) (m_DSP.MADRS+(addr-0x3200)/2))=val;
+ }
else if(addr<0x3c00)
{
*((unsigned short *) (m_DSP.MPRO+(addr-0x3400)/2))=val;
@@ -975,6 +978,7 @@ unsigned short aica_device::r16(address_space &space, unsigned int addr)
else if (addr < 0x28be)
{
UpdateRegR(space, addr&0xff);
+ assert((addr&0xff) < ARRAY_LENGTH(m_udata.datab));
v= *((unsigned short *) (m_udata.datab+((addr&0xff))));
if((addr&0xfffe)==0x2810) m_udata.data[0x10/2] &= 0x7FFF; // reset LP on read
}
@@ -993,7 +997,10 @@ unsigned short aica_device::r16(address_space &space, unsigned int addr)
if(addr<0x3200) //COEF
v= *((unsigned short *) (m_DSP.COEF+(addr-0x3000)/2));
else if(addr<0x3400)
+ {
+ assert(((addr-0x3200)/2) < ARRAY_LENGTH(m_DSP.MADRS));
v= *((unsigned short *) (m_DSP.MADRS+(addr-0x3200)/2));
+ }
else if(addr<0x3c00)
v= *((unsigned short *) (m_DSP.MPRO+(addr-0x3400)/2));
else if(addr<0x4000)