home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 24
/
CD_ASCQ_24_0995.iso
/
dos
/
prg
/
tucgp10b
/
examples
/
example2.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-05-07
|
2KB
|
68 lines
PROGRAM EXAMPLE_2;
{Example by Freaker / STARFIELD by Sinecure Copyright (c)1995 by TuC }
{This example shows you how to play a file straigth without a fast load from}
{INITPLYR and INITCARD get the same port, dma and irq. Else the player will }
{crash. Also don't forget to unload the modfile before you load a new one. }
{You can use all routines with one example, like using the fastinit with the}
{lowlevel routines. }
{$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.FILELOAD(Addr(tgp.filename[1])); {LOAD FILE}
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.