static int64 sqacc[2]={0,0};
uint8 sqnon=0;
+uint32 soundtsoffs=0;
+
#undef printf
uint16 nreg;
static DECLFW(Write_PSG)
{
//if((A>=0x4004 && A<=0x4007) || A==0x4015)
- //printf("$%04x:$%02x, %d\n",A,V,timestamp);
+ //printf("$%04x:$%02x, %d\n",A,V,SOUNDTS);
A&=0x1f;
switch(A)
{
uint32 out=PSG[0x11]<<3;
start=ChannelBC[4];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
ChannelBC[4]=end;
CalcRectAmp(0);
start=ChannelBC[0];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
ChannelBC[0]=end;
CalcRectAmp(1);
start=ChannelBC[1];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
ChannelBC[1]=end;
int64 freq=(((PSG[0xa]|((PSG[0xb]&7)<<8))+1));
start=ChannelBC[2];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
ChannelBC[2]=end;
int32 start,end;
start=ChannelBC[3];
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
if(end<=start) return;
ChannelBC[3]=end;
int FlushEmulateSound(void)
{
- uint32 end;
int x;
-
+ uint32 end;
if(!timestamp) return(0);
goto nosoundo;
}
- end=(timestamp<<16)/soundtsinc;
+ end=(SOUNDTS<<16)/soundtsinc;
DoSQ1();
DoSQ2();
DoTriangle();
nosoundo:
for(x=0;x<5;x++)
ChannelBC[x]=end&0xF;
- timestampbase+=timestamp;
- timestamp=(soundtsinc*(end&0xF))>>16;
- timestampbase-=timestamp;
+ soundtsoffs=(soundtsinc*(end&0xF))>>16;
return(end>>4);
}
fhcnt=fhinc;
fcnt=0;
nreg=1;
+ soundtsoffs=0;
}
void ResetSound(void)