MCPcopy Create free account
hub / github.com/TASEmulators/fceux / FlushEmulateSound

Function FlushEmulateSound

src/sound.cpp:1037–1110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1035
1036static int32 inbuf=0;
1037int FlushEmulateSound(void)
1038{
1039 int x;
1040 int32 end,left;
1041
1042 if(!soundtimestamp) return(0);
1043
1044 if(!FSettings.SndRate)
1045 {
1046 left=0;
1047 end=0;
1048 goto nosoundo;
1049 }
1050
1051 DoSQ1();
1052 DoSQ2();
1053 DoTriangle();
1054 DoNoise();
1055 DoPCM();
1056
1057 if(FSettings.soundq>=1)
1058 {
1059 int32 *tmpo=&WaveHi[soundtsoffs];
1060
1061 if(GameExpSound.HiFill) GameExpSound.HiFill();
1062
1063 for(x=soundtimestamp;x;x--)
1064 {
1065 uint32 b=*tmpo;
1066 *tmpo=(b&65535)+wlookup2[(b>>16)&255]+wlookup1[b>>24];
1067 tmpo++;
1068 }
1069 end=NeoFilterSound(WaveHi,WaveFinal,SOUNDTS,&left);
1070
1071 memmove(WaveHi,WaveHi+SOUNDTS-left,left*sizeof(uint32));
1072 memset(WaveHi+left,0,sizeof(WaveHi)-left*sizeof(uint32));
1073
1074 if(GameExpSound.HiSync) GameExpSound.HiSync(left);
1075 for(x=0;x<5;x++)
1076 ChannelBC[x]=left;
1077 }
1078 else
1079 {
1080 end=(SOUNDTS<<16)/soundtsinc;
1081 if(GameExpSound.Fill)
1082 GameExpSound.Fill(end&0xF);
1083
1084 SexyFilter(Wave,WaveFinal,end>>4);
1085
1086 //if(FSettings.lowpass)
1087 // SexyFilter2(WaveFinal,end>>4);
1088 if(end&0xF)
1089 Wave[0]=Wave[(end>>4)];
1090 Wave[end>>4]=0;
1091 }
1092 nosoundo:
1093
1094 if(FSettings.soundq>=1)

Callers 1

FCEUI_EmulateFunction · 0.85

Calls 3

NeoFilterSoundFunction · 0.85
SexyFilterFunction · 0.85
FCEU_WriteWaveDataFunction · 0.85

Tested by

no test coverage detected