home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 24 / CD_ASCQ_24_0995.iso / dos / prg / tucgp10b / examples / example2.pas < prev    next >
Pascal/Delphi Source File  |  1995-05-07  |  2KB  |  68 lines

  1. PROGRAM EXAMPLE_2;
  2.  
  3. {Example by Freaker / STARFIELD by Sinecure        Copyright (c)1995 by TuC }
  4.  
  5. {This example shows you how to play a file straigth without a fast load from}
  6. {INITPLYR and INITCARD get the same port, dma and irq. Else the player will }
  7. {crash. Also don't forget to unload the modfile before you load a new one.  }
  8. {You can use all routines with one example, like using the fastinit with the}
  9. {lowlevel routines.                                                         }
  10.  
  11.  
  12. {$M 4096,0,8192} {This directive is NECESSARY for the mod-load}
  13.  
  14.    {MUSIC ROUTINES}
  15.    { V }
  16. USES TUCGPLAY,TUC_DEMO;
  17.             { ^ }
  18.             {EXAMPLE GFX}
  19.  
  20.  
  21. begin
  22.   TGP.FILENAME:='TUCGPLAY.MOD'+chr(0);
  23.  
  24.   tgp.port:=260;                        {PORT, DMA, ETC...}
  25.   tgp.Irq:=0;                           {MAY ALL BE ZERO DUE AUTODETECT}
  26.   tgp.Dma:=0;
  27.   tgp.Device:=5;                        {5= AUTODETECT}
  28.  
  29.   TGP.INITPLYR(tgp.Device,tgp.port,tgp.Irq,tgp.Dma); {INITIALIZE PLAYER}
  30.  
  31.   TGP.FILELOAD(Addr(tgp.filename[1]));               {LOAD FILE}
  32.  
  33.   TGP.INITCARD(180,tgp.device,tgp.port,tgp.irq);     {INITIALIZE CARD}
  34.  
  35.   TGP.STARTMUS;                                      {MUSIC! MAESTRO}
  36.  
  37.   tgp.pollbuffer;                                    {Poll before initstars}
  38.  
  39.   TGP.VOLUME(255);                                   {BLOW 't UP !}
  40.  
  41.   initstars;                            {Initialize star routines}
  42.  
  43.  repeat                                 {Start of Repeat}
  44.  
  45.   tgp.pollbuffer;                       {Poll the music before plotstar}
  46.                                         {with buffer, it will fill a buffer}
  47.                                         {of 4k with the music. tgp_pollmusic}
  48.                                         {does only fill 1k !, tgp.pollmusic}
  49.                                         {takes only more time !}
  50.  
  51.   plotstars;                            {plotstars by sinecure !}
  52.  
  53.  until port[$60]=1;                     {repeat until port $60 = 1 (faster }
  54.                                         {than keypressed}
  55.  
  56.    TGP.STOPMUS;
  57.    TGP.UNLOADMUS;                       {ALWAYS uninitialize !!!!!!!}
  58.  
  59.      asm                                {Mode 3h - TEXTMODE 80x25}
  60.       mov ax,3h
  61.       int 10h
  62.     end;
  63.  writeln('Optimization & music routines by: Freaker / TuC');
  64.  writeln('Starfield idea & main code by: SiNECuRE / TuC');
  65.  Writeln;
  66.  writeln('Beat this TrT-2001!');
  67. end.
  68.