home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / SND_TOOL / TUCPL13.ZIP / TGP_EXAM.ZIP / EXAMPLE2.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-07-06  |  2.4 KB  |  65 lines

  1. {∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞
  2. ┌───────────────────────────────────────────────────────────────────────────┐
  3. │EXAMPLE 2 & TGP is Copyright (c)1994,95 by Gunther Voet - aka Freaker / TuC│
  4. ├───────────────────────────────────────────────────────────────────────────┤
  5. │      Starfield:Sinecure/Optimization:Freaker/Music:TGR (phew)             │
  6. └───────────────────────────────────────────────────────────────────────────┘
  7. ∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞}
  8.  
  9.  
  10. PROGRAM EXAMPLE_2;
  11.  
  12. {This example shows you how to use the low level procedures to load a file   }
  13. {by setting the port, irq, dma and device specified by yourself. If you      }
  14. {define the wrong information the player will crash. If you want  to load a  }
  15. {new modfile, you must unload the modfile, and reload from memory.           }
  16.  
  17.  
  18. {$M 4096,0,8192} {This directive is NECESSARY for the mod-load}
  19.                  {2000 bytes heap & stacksize is REQUIRED for the player}
  20.                  {4096 bytes heap / 9128 stack is RECOMMENDED}
  21.  
  22.  
  23.    {MUSIC ROUTINES}
  24.    { V }
  25. USES TGP,TUC_DEMO;
  26.             { ^ }
  27.             {EXAMPLE GFX}
  28.  
  29.  
  30. begin
  31.   tgp.device:=6;
  32.   tgp.musport:=tgp.detectgus;             {Hardware detection can always give
  33.                                            conflicts with other cards .. so
  34.                                            the system can be unstable & crash!}
  35.   tgp.Irq:=0;
  36.   tgp.Dma:=0;
  37.  
  38.   TGP.INITPLAYER(tgp.Device,tgp.musport,tgp.Irq,tgp.Dma);
  39.                                           {INITIALIZE PLAYER}
  40.  
  41.   TGP.LOADFILE('EXAMPLE2.MOD');           {LOAD FILE}
  42.  
  43.   TGP.INITCARD;
  44.  
  45.   TGP.STARTMUS;                         {MUSIC! MAESTRO}
  46.  
  47.   initstars;                            {Initialize star routines}
  48.  
  49.  repeat                                 {Start of Repeat}
  50.  
  51. {You can eventually call "TGP.POLLMUSIC" or "TGP.POLLBUFFER"
  52.  if you experience problems using TGP with interrupt dependent tasks.}
  53.  
  54.   plotstars;                            {plotstars by sinecure !}
  55.  
  56.  until port[$60]=1;                     {repeat until port $60 = 1 (faster }
  57.                                         {than keypressed}
  58.  
  59.    TGP.STOPMUS;                         {Stop music (before unitialize)}
  60.    TGP.UNLOADMUS;                       {ALWAYS uninitialize !!!!!!!}
  61.  
  62.   uninit_demounit                       {Go back to textmode & show copyright}
  63.  
  64. end.
  65.