29 #define BLANK_LOOP_START 4
30 #define BLANK_LOOP_END 8
31 #define BLANK_LOOP_SIZE 12
32 #define BLANK_HEAD_SIZE 32
43 int truesize,
size, loopsize, blocksize;
44 int loopend, sampleend;
46 struct snd_emu10k1 *
emu;
52 if (sp->
v.size == 0) {
53 snd_printd(
"emu: rom font for sample %d\n", sp->
v.sample);
58 sp->
v.end -= sp->
v.start;
59 sp->
v.loopstart -= sp->
v.start;
60 sp->
v.loopend -= sp->
v.start;
64 sampleend = sp->
v.end;
65 if (sampleend > sp->
v.size)
66 sampleend = sp->
v.size;
67 loopend = sp->
v.loopend;
68 if (loopend > sampleend)
72 if (sp->
v.loopstart >= sp->
v.loopend) {
73 int tmp = sp->
v.loopstart;
74 sp->
v.loopstart = sp->
v.loopend;
83 loopsize = sp->
v.loopend - sp->
v.loopstart;
95 snd_printd(
"emu10k1: synth malloc failed (size=%d)\n", blocksize);
100 sp->
v.truesize = blocksize;
107 if (offset + size > blocksize)
116 if (offset + size > blocksize)
132 unsigned short *wblock = (
unsigned short*)
block;
133 woffset = offset / 2;
134 if (offset + loopsize * 2 > blocksize)
136 for (
i = 0;
i < loopsize;
i++)
137 wblock[woffset +
i] = wblock[woffset -
i -1];
138 offset += loopsize * 2;
140 if (offset + loopsize > blocksize)
142 for (
i = 0;
i < loopsize;
i++)
149 sp->
v.loopend += loopsize;
151 sp->
v.loopstart += loopsize;
152 sp->
v.loopend += loopsize;
155 sp->
v.end += loopsize;
160 size = sp->
v.size - loopend;
173 if (offset < blocksize)
188 unsigned short *wblock = (
unsigned short*)
block;
189 for (
i = 0;
i < truesize;
i++)
192 for (
i = 0;
i < truesize;
i++)
217 struct snd_emu10k1 *
emu;