Posted: Tue May 01, 2007 4:51 pm
asle. is it possible to get the source to the latest prowizard which has titanics support ? 
ExoticA is an Amiga and retro gaming/computer music interest wiki including search-able computer music collections, game and demo scene information and plenty more.
https://www.exotica.org.uk/forum/
Code: Select all
void Depack_TitanicsPlayer ( void )
{
Uchar *Whatever;
Uchar c1=0x00,c2=0x00,c3=0x00,c4=0x00;
long Pat_Addresses[128];
long Pat_Addresses_ord[128];
long Pat_Addresses_final[128];
long Max=0l;
Uchar poss[37][2];
Uchar PatPos;
long Where=PW_Start_Address;
long SmpAddresses[15];
long SampleSizes[15];
unsigned long i=0,j=0,k=0,l;
FILE *out;
if ( Save_Status == BAD )
return;
BZERO ( Pat_Addresses , 128 );
BZERO ( Pat_Addresses_ord , 128 );
BZERO ( Pat_Addresses_final , 128 );
fillPTKtable(poss);
sprintf ( Depacked_OutName , "%ld.stk" , Cpt_Filename-1 );
out = PW_fopen ( Depacked_OutName , "w+b" );
/* title */
Whatever = (Uchar *) malloc ( 2048 );
BZERO ( Whatever , 2048 );
fwrite ( &Whatever[0] , 20 , 1 , out );
/* read and write whole header */
/*printf ( "Converting sample headers ... " );*/
for ( i=0 ; i<15 ; i++ ) /* only 15 samples */
{
/* retrieve addresses of samples */
SmpAddresses[i] = ((in_data[Where]*256*256*256)+
(in_data[Where+1]*256*256)+
(in_data[Where+2]*256)+
(in_data[Where+3]));
/* write name */
fwrite ( &Whatever[0] , 22 , 1 , out );
/* size */
k = (in_data[Where+4] * 256) + in_data[Where+5];
k *= 2;
SampleSizes[i] = k;
fwrite ( &in_data[Where+4] , 1 , 1 , out );
fwrite ( &in_data[Where+5] , 1 , 1 , out );
/* finetune */
fwrite ( &in_data[Where+6] , 1 , 1 , out );
/* volume */
fwrite ( &in_data[Where+7] , 1 , 1 , out);
/* loop start */
fwrite ( &in_data[Where+8] , 1 , 1 , out );
fwrite ( &in_data[Where+9] , 1 , 1 , out );
fwrite ( &in_data[Where+10] , 1 , 1 , out );
fwrite ( &in_data[Where+11] , 1 , 1 , out );
Where += 12;
}
/*printf ( "ok\n" );*/
/* pattern list */
/*printf ( "creating the pattern list ... " );*/
for ( PatPos=0x00 ; PatPos<128 ; PatPos++ )
{
if ( in_data[Where+PatPos*2] == 0xFF )
break;
Pat_Addresses_ord[PatPos] = Pat_Addresses[PatPos] = (in_data[Where+PatPos*2]*256)+in_data[Where+PatPos*2+1];
}
/* write patpos */
fwrite ( &PatPos , 1 , 1 , out );
/* restart byte */
c1 = 0x00;
fwrite ( &c1 , 1 , 1 , out );
/* With the help of Xigh :) .. thx */
qsort (Pat_Addresses_ord,PatPos,sizeof(long),cmplong);
j=0;
for (i=0;i<PatPos;i++)
{
Pat_Addresses_final[j++] = Pat_Addresses_ord[i];
while ((Pat_Addresses_ord[i+1] == Pat_Addresses_ord[i]) && (i<PatPos))
i += 1;
}
/* write pattern list */
for (i=0;i<PatPos;i++)
{
for (j=0;Pat_Addresses[i]!=Pat_Addresses_final[j];j++);
Whatever[i] = j;
if (j>Max)
Max = j;
}
fwrite ( Whatever , 128 , 1 , out );
/*printf ( "ok\n" );*/
/* pattern data */
for (i=0;i<=Max;i++)
{
k = 0;
/*printf ("Where : %ld\n",Where);*/
Where = Pat_Addresses_final[i] + PW_Start_Address;
BZERO (Whatever,2048);
do
{
/* k is row nbr */
c1 = (((in_data[Where+1]>>6)&0x03)*4); /* voice */
/* no note ... */
if ((in_data[Where+1]&0x3f)<=36)
{
Whatever[(k*16)+c1] = poss[in_data[Where+1]&0x3f][0];
Whatever[(k*16)+c1+1] = poss[in_data[Where+1]&0x3F][1];
}
Whatever[(k*16)+c1+2] = in_data[Where+2];
Whatever[(k*16)+c1+3] = in_data[Where+3];
Where += 4;
if ((in_data[Where]&0x7f) != 0x00)
k += (in_data[Where]&0x7f);
if (k > 1024)
{
/*printf ("pat %ld too big\n",i);*/
break;
}
}while ((in_data[Where-4] & 0x80) != 0x80); /* pattern break it seems */
fwrite (&Whatever[0],1024,1,out);
}
Where -= 4;
/* Where is now on the first smp */
free ( Whatever );
/*printf ( " ok\n" );*/
/*fflush ( stdout );*/
/* sample data */
/*printf ( "Saving sample data ... " );*/
for (i=0; i<15; i++)
{
if ( SmpAddresses[i] != 0 )
fwrite ( &in_data[PW_Start_Address+SmpAddresses[i]], SampleSizes[i], 1, out);
}
/* crap */
Crap15 ( " Titanics Player " , BAD , BAD , out );
fflush ( out );
fclose ( out );
printf ( "done\n" );
return; /* useless ... but */
}Hello,Zeb wrote:Has anyone managed to convert this to Protracker or write a player?
I have downloaded two copies of Titan Trax by Titanics (ADF and DMS) and can't get either working in WinUAE :'(