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

  1. {∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞
  2. ┌───────────────────────────────────────────────────────────────────────────┐
  3. │EXAMPLE 1 & TGP is Copyright (c)1994,95 by Gunther Voet - aka Freaker / TuC│
  4. ├───────────────────────────────────────────────────────────────────────────┤
  5. │      Starfield:Sinecure/Optimization:Freaker/Music:Jester (flowerpower)   │
  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_4;
  11.  
  12.  
  13. {Example by Freaker / STARFIELD by Sinecure        Copyright (c)1995 by TuC }
  14.  
  15. {This example shows you how to use the low level procedures to load a file   }
  16. {by setting the port, irq, dma and device specified by yourself. If you      }
  17. {define the wrong information the player will crash. If you want  to load a  }
  18. {new modfile, you must unload the modfile, and reload from memory.           }
  19.  
  20.  
  21.  
  22. {$M 4096,0,8192} {This directive is NECESSARY for the mod-load}
  23.                  {2000 bytes heap & stacksize is REQUIRED for the player}
  24.                  {4096 bytes heap / 9128 stack is RECOMMENDED}
  25.  
  26.  
  27.  
  28.    {MUSIC ROUTINES}
  29.    { V }
  30. USES TGP,TUC_DEMO;
  31.             { ^ }
  32.             {EXAMPLE GFX}
  33.  
  34.  
  35. begin
  36.   debugmode:=true;
  37.  
  38.   Writeln('The best card found in this system is: ',tgp.bestcard);
  39.   {By looking to the variable of tgp.bestcard, TGP will automatically search
  40.   the best-card irq, dma, port, etc...   You can use tgp.bestcard without
  41.   making output to the screen.                                               }
  42.  
  43.   tgp.device:=tgp.info.bestcard.device;
  44.   tgp.musport:=tgp.info.bestcard.port;
  45.   tgp.Irq:=tgp.info.bestcard.irq;
  46.   tgp.Dma:=tgp.info.bestcard.dma;
  47.  
  48.   TGP.INITPLAYER(tgp.Device,tgp.musport,tgp.Irq,tgp.Dma); {INITIALIZE PLAYER}
  49.  
  50.   TGP.LOADFILE('EXAMPLE4.MOD');                         {LOAD FILE}
  51.  
  52.   TGP.INITCARD;
  53.  
  54.   TGP.STARTMUS;                                         {MUSIC! MAESTRO}
  55.  
  56.   initstars;                            {Initialize star routines}
  57.  
  58.  repeat                                 {Start of Repeat}
  59. {You can eventually call "TGP.POLLMUSIC" or "TGP.POLLBUFFER"
  60.  if you experience problems using TGP with interrupt dependent tasks.}
  61.  
  62.   plotstars;                            {plotstars by sinecure !}
  63.  
  64.  until port[$60]=1;                     {repeat until port $60 = 1 (faster }
  65.                                         {than keypressed}
  66.  
  67.    TGP.STOPMUS;
  68.    TGP.UNLOADMUS;                       {ALWAYS uninitialize !!!!!!!}
  69.  
  70.    uninit_demounit;                     {Go back to textmode & showing credits}
  71.    TGP.UNLOADMUS;
  72. end.
  73.