Titanics Player

Discussion about Amiga / C64 / Demoscene music and the ExoticA music archive. Favourite music, new rips, musicians, demo sounds, audio software. It's all welcome here.

Moderators: XtC, BuZz

User avatar
BuZz
Site Admin
Posts: 569
Joined: Mon Jun 10, 2002 12:52 pm
Location: Didcot, Oxfordshire
Contact:

Post by BuZz »

asle. is it possible to get the source to the latest prowizard which has titanics support ? :-)

asle
Posts: 208
Joined: Fri Mar 07, 2003 11:28 pm
Location: France
Contact:

Post by asle »

Yep, sure. But I'm not too confident with the whole PW4PC package. So, I propose via email ?.
Or is it only the Titanics part ? Could put it here if so.

You tell me :)
Cya
Sylvain

PS: "asle@free.fr" or "zremal" for google talk matters :)
Sylvain "Asle" Chipaux

User avatar
BuZz
Site Admin
Posts: 569
Joined: Mon Jun 10, 2002 12:52 pm
Location: Didcot, Oxfordshire
Contact:

Post by BuZz »

Email would be fine. thanks. I would also be interested in seeing just the titanics part, if you wanted to post it here :)

Thanks!

asle
Posts: 208
Joined: Fri Mar 07, 2003 11:28 pm
Location: France
Contact:

Post by asle »

Here's the depacker part :

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 */
}
Just consider PW_Start_Address to be the beginning of the packed file.
Once I find back your email, I'll send you the latest PW4PC src :)

Cya
Sylvain


-- edit
sent the src. And it's no spread please. Only because it's not much stable :)
Sylvain "Asle" Chipaux

cf
Posts: 63
Joined: Sun Sep 28, 2003 6:24 pm

Post by cf »

pheww! old post

have you ripped all the mods crypted ?!
is the last winuae version have the new prowiz ?

thanks

asle
Posts: 208
Joined: Fri Mar 07, 2003 11:28 pm
Location: France
Contact:

Post by asle »

Hi Cf,

To the first question, I've ripped off all the Titanics demos that are on amigascne.org
To the 2nd question, it's not in WinUAE. Fact is that the version I have is still not stable and even had a problem that was pointed out by Muerto. I got a better converter handy, now, but still unrealeased. I'll try to make a build this WE and send it over to WinUAE devs.

Kind regards,
Sylvain
Sylvain "Asle" Chipaux

Zeb
Posts: 48
Joined: Sun Sep 09, 2007 10:59 am

Re: Titanics Player

Post by Zeb »

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 :'(

asle
Posts: 208
Joined: Fri Mar 07, 2003 11:28 pm
Location: France
Contact:

Re: Titanics Player

Post by asle »

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 :'(
Hello,
Conversion to soundtracker (not PTK) is working correctly. I'll try to gather all the converted stuff (and originals) and post it here later. As to how to make TitanTrax work, I remember the touchy part was the bootloader. It definitely needs ks1.2.

Cya
Sylvain
Sylvain "Asle" Chipaux

Post Reply