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

  1. PROGRAM EXAMPLE_3;
  2.  
  3. {Example by Freaker / STARFIELD by Sinecure        Copyright (c)1995 by TuC }
  4.  
  5. {This example shows you how to play a file copied binary to your executable }
  6. {file. You can do it manually by looking to the filesize, then do a OVLLOAD }
  7. {with the exact filesize of the execute (check again !), then perform a     }
  8. {binairy copy, and you will get the same like this example !                }
  9. {                                                                           }
  10. {A binairy copy can be performed by doing
  11.                    COPY EXAMPLE3.EXE/B+MODFILE.MOD/B TEST.EXE
  12.  
  13.  OR use COPY_BIN, also supplied in this package, you can see to the exact
  14.  size you must add in the pascalfile, and the program will append any modfile
  15.  to the executable. Remember: You must:      - FIRST CHECK THE EXE SIZE
  16.                                              - CHANGE THIS IN THE PROGRAM
  17.                                              - APPEND THEN THE MODFILE !    }
  18.  
  19. {Then you will see the file will be played from position 62080 (size of this}
  20. {executable file! - you can add more than one modfile, just do the same, and}
  21. {change the location of the file. Just DON'T forget to unload every modfile!}
  22.  
  23.  
  24. {$M 4096,0,8192} {This directive is NECESSARY for the mod-load}
  25.  
  26.    {MUSIC ROUTINES}
  27.    { V }
  28. USES TUCGPLAY,TUC_DEMO;
  29.             { ^ }
  30.             {EXAMPLE GFX}
  31.  
  32.  
  33. begin
  34.   TGP.FILENAME:='TUCGPLAY.MOD'+chr(0);
  35.  
  36.   tgp.port:=260;                        {PORT, DMA, ETC...}
  37.   tgp.Irq:=0;                           {MAY ALL BE ZERO DUE AUTODETECT}
  38.   tgp.Dma:=0;
  39.   tgp.Device:=5;                        {5= AUTODETECT}
  40.  
  41.   TGP.INITPLYR(tgp.Device,tgp.port,tgp.Irq,tgp.Dma); {INITIALIZE PLAYER}
  42.  
  43.   TGP.OVLLOAD(62080);                   {LOAD FILE}
  44.              {62080 is the place of the MODFILE in your file !
  45.               One byte wrong=crash ! so .. do it carefully. With this
  46.               way you can compress your player and add the modfile afterwards.}
  47.  
  48.   TGP.INITCARD(180,tgp.device,tgp.port,tgp.irq);     {INITIALIZE CARD}
  49.  
  50.   TGP.STARTMUS;                                      {MUSIC! MAESTRO}
  51.  
  52.   tgp.pollbuffer;                                    {Poll before initstars}
  53.  
  54.   TGP.VOLUME(255);                                   {BLOW 't UP !}
  55.  
  56.   initstars;                            {Initialize star routines}
  57.  
  58.  repeat                                 {Start of Repeat}
  59.  
  60.   tgp.pollbuffer;                       {Poll the music before plotstar}
  61.                                         {with buffer, it will fill a buffer}
  62.                                         {of 4k with the music. tgp_pollmusic}
  63.                                         {does only fill 1k !, tgp.pollmusic}
  64.                                         {takes only more time !}
  65.  
  66.   plotstars;                            {plotstars by sinecure !}
  67.  
  68.  until port[$60]=1;                     {repeat until port $60 = 1 (faster }
  69.                                         {than keypressed}
  70.  
  71.    TGP.STOPMUS;
  72.    TGP.UNLOADMUS;                       {ALWAYS uninitialize !!!!!!!}
  73.  
  74.      asm                                {Mode 3h - TEXTMODE 80x25}
  75.       mov ax,3h
  76.       int 10h
  77.     end;
  78.  writeln('Optimization & music routines by: Freaker / TuC');
  79.  writeln('Starfield idea & main code by: SiNECuRE / TuC');
  80.  Writeln;
  81.  writeln('Beat this TrT-2001!');
  82. end.
  83.