Use memset instead of a custom loop for zeroing the sample buffer.

svn-id: r48181
This commit is contained in:
Johannes Schickel 2010-03-08 00:34:29 +00:00
parent f67f7d36f1
commit e941780d39

View file

@ -1196,9 +1196,7 @@ Bit32u Chip::WriteAddr( Bit32u port, Bit8u val ) {
void Chip::GenerateBlock2( Bitu total, Bit32s* output ) {
while ( total > 0 ) {
Bit32u samples = ForwardLFO( total );
for ( Bitu i = 0; i < samples; i++ ) {
output[i] = 0;
}
memset(output, 0, sizeof(Bit32s) * samples);
int count = 0;
for( Channel* ch = chan; ch < chan + 9; ) {
count++;
@ -1212,10 +1210,7 @@ void Chip::GenerateBlock2( Bitu total, Bit32s* output ) {
void Chip::GenerateBlock3( Bitu total, Bit32s* output ) {
while ( total > 0 ) {
Bit32u samples = ForwardLFO( total );
for ( Bitu i = 0; i < samples; i++ ) {
output[i * 2 + 0 ] = 0;
output[i * 2 + 1 ] = 0;
}
memset(output, 0, sizeof(Bit32s) * 2 * samples);
int count = 0;
for( Channel* ch = chan; ch < chan + 18; ) {
count++;