home *** CD-ROM | disk | FTP | other *** search
- PROGRAM EXAMPLE_3;
-
- {Example by Freaker / STARFIELD by Sinecure Copyright (c)1995 by TuC }
-
- {This example shows you how to play a file copied binary to your executable }
- {file. You can do it manually by looking to the filesize, then do a OVLLOAD }
- {with the exact filesize of the execute (check again !), then perform a }
- {binairy copy, and you will get the same like this example ! }
- { }
- {A binairy copy can be performed by doing
- COPY EXAMPLE3.EXE/B+MODFILE.MOD/B TEST.EXE
-
- OR use COPY_BIN, also supplied in this package, you can see to the exact
- size you must add in the pascalfile, and the program will append any modfile
- to the executable. Remember: You must: - FIRST CHECK THE EXE SIZE
- - CHANGE THIS IN THE PROGRAM
- - APPEND THEN THE MODFILE ! }
-
- {Then you will see the file will be played from position 62080 (size of this}
- {executable file! - you can add more than one modfile, just do the same, and}
- {change the location of the file. Just DON'T forget to unload every modfile!}
-
-
- {$M 4096,0,8192} {This directive is NECESSARY for the mod-load}
-
- {MUSIC ROUTINES}
- { V }
- USES TUCGPLAY,TUC_DEMO;
- { ^ }
- {EXAMPLE GFX}
-
-
- begin
- TGP.FILENAME:='TUCGPLAY.MOD'+chr(0);
-
- tgp.port:=260; {PORT, DMA, ETC...}
- tgp.Irq:=0; {MAY ALL BE ZERO DUE AUTODETECT}
- tgp.Dma:=0;
- tgp.Device:=5; {5= AUTODETECT}
-
- TGP.INITPLYR(tgp.Device,tgp.port,tgp.Irq,tgp.Dma); {INITIALIZE PLAYER}
-
- TGP.OVLLOAD(62080); {LOAD FILE}
- {62080 is the place of the MODFILE in your file !
- One byte wrong=crash ! so .. do it carefully. With this
- way you can compress your player and add the modfile afterwards.}
-
- TGP.INITCARD(180,tgp.device,tgp.port,tgp.irq); {INITIALIZE CARD}
-
- TGP.STARTMUS; {MUSIC! MAESTRO}
-
- tgp.pollbuffer; {Poll before initstars}
-
- TGP.VOLUME(255); {BLOW 't UP !}
-
- initstars; {Initialize star routines}
-
- repeat {Start of Repeat}
-
- tgp.pollbuffer; {Poll the music before plotstar}
- {with buffer, it will fill a buffer}
- {of 4k with the music. tgp_pollmusic}
- {does only fill 1k !, tgp.pollmusic}
- {takes only more time !}
-
- plotstars; {plotstars by sinecure !}
-
- until port[$60]=1; {repeat until port $60 = 1 (faster }
- {than keypressed}
-
- TGP.STOPMUS;
- TGP.UNLOADMUS; {ALWAYS uninitialize !!!!!!!}
-
- asm {Mode 3h - TEXTMODE 80x25}
- mov ax,3h
- int 10h
- end;
- writeln('Optimization & music routines by: Freaker / TuC');
- writeln('Starfield idea & main code by: SiNECuRE / TuC');
- Writeln;
- writeln('Beat this TrT-2001!');
- end.
-