Order of the Butterfly
Posts: 171 from 2006/10/6
From: Spain
I have a problem very strange, i sure that it's my fault. I wrote a little synth very simple, it stores the song on a char string, the main problem is that i wrote a function to do this called fill_buffer declarared static, if i put modulus, shift bytes or strlib function calls, it hangs directly using -nostartfiles, but works properly without that option. This function it's called inside entry/main function, and inside display function registered as idle function on TinyGL, i tried also to create a macro with the same function and it works with -nostartfiles, but the executable gives some bytes more, so it appears that it doesn't work when i used that operations outside entry or display function. This is part of the code:
Code:
static ULONG tbuf = 0, track_note = 0, note = 0;
static char song[] ="@@EHGHJHGAAHGHJHGCCJHJLJHEHGHJH";
static void fill_buffer(BYTE* p)
{
for (i = 0; i < BUFFERSIZE; i++) {
if (((tbuf + i + 1) & 1023) == 0){
track_note ++;
/*?This mod operation hangs the application,
using a macro works, and removing mod operation also.
And it works without -nostartfiles
*/
note = song[track_note%31]-64;
}
p[i] = (i*note)&255;
}
tbuf += BUFFERSIZE;
}
Balrog Software -
AmigaSkool.netMac Mini - MorphOS 3.8 - G4 1.5Ghz - Ati 9200 64 Mb
Efika - MorphOS 3.6 - Ati 9200 64Mb - 80 Gb HD
Amiga 1200D - OS 3.9 - Blizzard 603e/240mh