Here are some more DSFs, covering Segagaga, Rune Jade, Super Robot Taisen Alpha --> http://www.sendspace.com/file/v1emz7 (thanks to Knurek for supplying much of this sound data)
Segagaga is quite interesting as it appears to be highly sensitive to AICA slot monitor reads. It breaks apart quite badly w/ the current AOSDK. I've attempted to address as much of this as I could in the following patch:
Code
diff -Nru aosdk_base/eng_dsf/aica.c aosdk/eng_dsf/aica.c
--- aosdk_base/eng_dsf/aica.c 2008-02-19 23:19:46.000000000 -0800
+++ aosdk/eng_dsf/aica.c 2008-02-20 20:38:16.000000000 -0800
@@ -130,6 +130,7 @@
int curstep, nxtstep;
int cur_lpquant, cur_lpsample, cur_lpstep;
UINT8 *adbase, *nxtbase, *adlpbase;
+ UINT8 mslc; // monitored?
};
@@ -144,6 +145,9 @@
#define MIFULL(aica) ((aica->udata.data[4]>>0x0)&0x0200)
#define MIEMPTY(aica) ((aica->udata.data[4]>>0x0)&0x0100)
+#define AFSEL(aica) ((aica->udata.data[6]>>0x0)&0x4000)
+#define MSLC(aica) ((aica->udata.data[6]>>0x8)&0x3F)
+
#define SCILV0(aica) ((aica->udata.data[0xa8/2]>>0x0)&0xff)
#define SCILV1(aica) ((aica->udata.data[0xac/2]>>0x0)&0xff)
#define SCILV2(aica) ((aica->udata.data[0xb0/2]>>0x0)&0xff)
@@ -593,6 +597,7 @@
AICA->Slots[i].active=0;
AICA->Slots[i].base=NULL;
AICA->Slots[i].EG.state=RELEASE;
+ AICA->Slots[i].mslc=0;
}
AICALFO_Init();
@@ -625,6 +630,7 @@
{
if(KEYONB(s2) && s2->EG.state==RELEASE/*&& !s2->active*/)
{
+ if(s2->mslc) AICA->udata.data[0x10] &= 0x7FFF; // reset LP at KEY_ON
AICA_StartSlot(AICA, s2);
#if 0
printf("StartSlot[%02X]: SSCTL %01X SA %06X LSA %04X LEA %04X PCMS %01X LPCTL %01X\n",sl,SSCTL(s2),SA(s2),LSA(s2),LEA(s2),PCMS(s2),LPCTL(s2));
@@ -687,13 +693,13 @@
case 0x9:
AICA_MidiIn(0, AICA->udata.data[0x8/2]&0xff, 0);
break;
-/* case 0x12:
+ case 0x12:
case 0x13:
case 0x14:
case 0x15:
case 0x16:
case 0x17:
- break;*/
+ break;
case 0x90:
case 0x91:
if(AICA->Master)
@@ -786,12 +792,10 @@
case 0x10: // LP check
case 0x11:
{
- int MSLC = (AICA->udata.data[0xc/2]>>8) & 0x3f; // which slot are we monitoring?
-
-// AICA->udata.data[0x10/2] |= 0x8000; // set LP if necessary
+ //int MSLC = (AICA->udata.data[0xc/2]>>8) & 0x3f; // which slot are we monitoring?
}
break;
-
+
case 0x14: // CA (slot address)
case 0x15:
{
@@ -885,6 +889,7 @@
{
AICA_UpdateRegR(AICA, addr&0xff);
v= *((unsigned short *) (AICA->udata.datab+((addr&0xff))));
+ if((addr&0xfe)==0x10) AICA->udata.data[0x10/2] &= 0x7FFF; // reset LP on read
}
else if (addr == 0x2d00)
{
@@ -1075,12 +1080,14 @@
if(*addr[addr_select]>=LSA(slot) && *addr[addr_select]>=LEA(slot))
{
//slot->active=0;
+ if(slot->mslc) AICA->udata.data[8] |= 0x8000;
AICA_StopSlot(slot,0);
}
break;
case 1: //normal loop
if(*addr[addr_select]>=LEA(slot))
{
+ if(slot->mslc) AICA->udata.data[8] |= 0x8000;
rem_addr = *slot_addr[addr_select] - (LEA(slot)<<SHIFT);
*slot_addr[addr_select]=(LSA(slot)<<SHIFT) + rem_addr;
@@ -1122,6 +1129,16 @@
sample=(sample*EG_Update(slot))>>SHIFT;
else
sample=(sample*EG_TABLE[EG_Update(slot)>>(SHIFT-10)])>>SHIFT;
+
+ if(slot->mslc)
+ {
+ AICA->udata.data[0x12/2] = addr1;
+ if (!(AFSEL(AICA)))
+ {
+ AICA->udata.data[0x10/2] |= slot->EG.state<<13;
+ AICA->udata.data[0x10/2] |= 0x3FF - (slot->EG.volume>>EG_SHIFT);
+ }
+ }
return sample;
}
@@ -1143,10 +1160,11 @@
// mix slots' direct output
for(sl=0;sl<64;++sl)
{
+ struct _SLOT *slot=AICA->Slots+sl;
+ slot->mslc = (MSLC(AICA)==sl);
RBUFDST=AICA->RINGBUF+AICA->BUFPTR;
if(AICA->Slots[sl].active)
{
- struct _SLOT *slot=AICA->Slots+sl;
unsigned int Enc;
signed int sample;
Still not perfect, but perhaps the absence of the filter envelope may be somewhat responsible since filter envelopes can be monitored too.