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

  1. {∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞
  2. ┌───────────────────────────────────────────────────────────────────────────┐
  3. │EXAMPLE 3 & TGP is Copyright (c)1994,95 by Gunther Voet - aka Freaker / TuC│
  4. ├───────────────────────────────────────────────────────────────────────────┤
  5. │      Starfield:Sinecure/Optimization:Freaker/Music:CAL.MOD (by kiwi ?)    │
  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_3;
  11.  
  12. {This example shows you how to play a file copied binary to your executable }
  13. {file. You can do it manually by looking to the filesize, then do a OVLLOAD }
  14. {with the exact filesize of the execute (check again !), then perform a     }
  15. {binairy copy, and you will get the same like this example !                }
  16. {                                                                           }
  17. {A binairy copy can be performed by doing
  18.                    COPY EXAMPLE3.EXE/B+MODFILE.MOD/B TEST.EXE
  19.  
  20.  OR use COPY_BIN, also supplied in this package, you can see to the exact
  21.  size you must add in the pascalfile, and the program will append any modfile
  22.  to the executable. Remember: You must:      - FIRST CHECK THE EXE SIZE
  23.                                                or use "REALEXESIZE" as size.
  24.                                              - CHANGE THIS IN THE PROGRAM
  25.                                              - APPEND THEN THE MODFILE !    }
  26.  
  27. {Then you will see the file will be played from position 71xxx (size of this}
  28. {executable file! - you can add more than one modfile, just do the same, and}
  29. {change the location of the file. Just DON'T forget to unload every modfile!}
  30.  
  31.  
  32. {$M 4096,0,8192} {This directive is NECESSARY for the mod-load}
  33.                  {2000 bytes heap & stacksize is REQUIRED for the player}
  34.                  {4096 bytes heap / 9128 stack is RECOMMENDED}
  35.  
  36.  
  37.  
  38.    {MUSIC ROUTINES}
  39.    { V }
  40. USES TGP,TUC_DEMO;
  41.             { ^ }
  42.             {EXAMPLE GFX}
  43.  
  44.  
  45. begin
  46.   tgp.debugmode:=true;                  {TGP debugmode on, display errors}
  47.  
  48.   TGP.QUICKSETUP;
  49.   TGP.LOADOVL(REALEXESIZE);             {LOAD OVERLAY}
  50.  
  51.    {EXAMPLE3.MOD is used as overlay}
  52.  
  53.            {Use "REALEXESIZE" if you use only ONE modfile in your executable.
  54.            else use the number of the offset in the executable file.
  55.  
  56.            You can use REALEXESIZE if you compressed your file with PKLITE,
  57.            DIET, ... REALEXESIZE will always give the amount of bytes stored
  58.            in your executable file header.}
  59.  
  60.  
  61.   TGP.INITCARD;                         {INITIALIZE CARD}
  62.  
  63.   TGP.STARTMUS;                         {MUSIC! MAESTRO}
  64.  
  65.   TGP.VOLUME(254);                      {BLOW 't UP !}
  66.  
  67.   tgp.pollbuffer;                       {Poll before initstars}
  68.  
  69.   initstars;                            {Initialize star routines}
  70.  
  71.  repeat                                 {Start of Repeat}
  72.  
  73. {You can eventually call "TGP.POLLMUSIC" or "TGP.POLLBUFFER"
  74.  if you experience problems using TGP with interrupt dependent tasks.}
  75.  
  76.   plotstars;                            {plotstars by sinecure !}
  77.  
  78.  until port[$60]=1;                     {repeat until port $60 = 1 (faster }
  79.                                         {than keypressed $60 = ESC (#27))}
  80.  
  81.    TGP.STOPMUS;                         {Stop music (before unitialize)}
  82.    TGP.UNLOADMUS;                       {ALWAYS uninitialize !!!!!!!}
  83.  
  84.    uninit_demounit;                     {Go back to textmode & show copyright}
  85. end.
  86.