grub2: bring back build of aros-side grub2 tools
[AROS.git] / workbench / devs / AHI / Device / addtest.c
blobf516604b1405e573f43ae7c058761e8aff38109a
2 #include "addroutines.h"
5 /*
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*
14 ** should be used).
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,\
21 LONG ScaleLeft,\
22 LONG ScaleRight,\
23 LONG *StartPointLeft,\
24 LONG *StartPointRight,\
25 void *Src,\
26 void **Dst,\
27 LONG FirstOffsetI,\
28 Fixed64 Add,\
29 Fixed64 *Offset,\
30 BOOL StopAtZero
33 processed = ((ADDFUNC *) cd->cd_AddRoutine)( try_samples,
34 cd->cd_ScaleLeft,
35 cd->cd_ScaleRight,
36 &cd->cd_TempStartPointL,
37 &cd->cd_TempStartPointR,
38 cd->cd_DataStart,
39 &dstptr,
40 cd->cd_FirstOffsetI,
41 cd->cd_Add,
42 &cd->cd_Offset,
43 TRUE );
46 //#include <stdio.h>
47 //#include <string.h>
49 ULONG __amigappc__=1;
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
57 int
58 main( void )
60 int i;
61 int num = 10;
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,
75 &startpointleft,
76 &startpointright,
77 sample,
78 &dst,
80 0x080000000,
81 &offset,
82 FALSE );
84 // printf( "Iterations: %d\n", num );
86 // for( i = 0; i < num * 2; i++ )
87 // {
88 // printf( "%3d: %08x\n", i, outbuffer[ i ] );
89 // }
91 // printf( "spl: %08x, spr: %08x, dst: %08lx, offset: %ld\n",
92 // startpointleft, startpointright, dst, offset );
94 startpointleft = startpointright = 0;
95 dst = outbuffer;
96 offset = 0;
98 num = (*af)( num, 0x0, 0x00000,
99 &startpointleft,
100 &startpointright,
101 sample,
102 &dst,
104 0x080000000,
105 &offset,
106 TRUE );
108 // printf( "Iterations: %d\n", num );
110 // for( i = 0; i < num * 2; i++ )
111 // {
112 // printf( "%3d: %08x\n", i, outbuffer[ i ] );
113 // }
115 // printf( "spl: %08x, spr: %08x, dst: %08lx, offset: %ld\n",
116 // startpointleft, startpointright, dst, offset );
118 return 0;