2 #include "addroutines.h"
6 ** Samples Number of samples to calculate.
7 ** ScaleLeft Left volume multiplier.
8 ** ScaleRight Right volume multiplier (not used for mono sounds).
9 ** StartPointLeft Sample value from last session, for interpolation. Update!
10 ** StartPointRight Sample value from last session, for interpolation. Update!
11 ** Src Pointer to source samples.
12 ** Dst Pointer to pointer to destination buffer. Update!
13 ** FirstOffsetI The offset value of the first sample (when StartPoint*
15 ** Offset The offset (fix-point). Update!
16 ** Add Add value (fix-point).
17 ** StopAtZero If true, abort at next zero-crossing.
20 #define ADDARGS LONG Samples,\
23 LONG *StartPointLeft,\
24 LONG *StartPointRight,\
33 processed = ((ADDFUNC *) cd->cd_AddRoutine)( try_samples,
36 &cd->cd_TempStartPointL,
37 &cd->cd_TempStartPointR,
51 static long outbuffer
[ 4096 ];
52 static char sample
[16] =
54 0, 16, 32, 48, 64, 48, 32, 16, 0, -16, -32, -48, -64, -48, -32, -16
62 long startpointleft
= 0;
63 long startpointright
= 0;
64 void* dst
= outbuffer
;
65 long long offset
= 0x00000000;
67 ADDFUNC
* af
= AddByteMono
;
69 // memset( outbuffer, 0x00, sizeof( outbuffer ) );
71 // printf( "spl: %08x, spr: %08x, dst: %08lx, offset: %ld\n",
72 // startpointleft, startpointright, dst, offset );
74 num
= (*af
)( num
, 0x1, 0x00000,
84 // printf( "Iterations: %d\n", num );
86 // for( i = 0; i < num * 2; i++ )
88 // printf( "%3d: %08x\n", i, outbuffer[ i ] );
91 // printf( "spl: %08x, spr: %08x, dst: %08lx, offset: %ld\n",
92 // startpointleft, startpointright, dst, offset );
94 startpointleft
= startpointright
= 0;
98 num
= (*af
)( num
, 0x0, 0x00000,
108 // printf( "Iterations: %d\n", num );
110 // for( i = 0; i < num * 2; i++ )
112 // printf( "%3d: %08x\n", i, outbuffer[ i ] );
115 // printf( "spl: %08x, spr: %08x, dst: %08lx, offset: %ld\n",
116 // startpointleft, startpointright, dst, offset );