home *** CD-ROM | disk | FTP | other *** search
- {∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞
- ┌───────────────────────────────────────────────────────────────────────────┐
- │EXAMPLE 7 & TGP is Copyright (c)1994,95 by Gunther Voet - aka Freaker / TuC│
- ├───────────────────────────────────────────────────────────────────────────┤
- │ Music:TGR (phew) [EXAMPLE2.MOD] and MUSTAFA EROGLU (intro) [EXAMPLE6.MOD] │
- └───────────────────────────────────────────────────────────────────────────┘
- ∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞}
-
-
- PROGRAM EXAMPLE_7;
-
- {This example shows you how to use the low level procedures to load a file }
- {by setting the port, irq, dma and device specified by yourself. If you }
- {define the wrong information the player will crash. If you want to load a }
- {new modfile, you must unload the modfile, and reload from memory. }
- {Herein is also shown how to load 2 modfiles with fade out and in. }
-
-
- {$M 4096,0,8192} {This directive is NECESSARY for the mod-load}
- {2000 bytes heap & stacksize is REQUIRED for the player}
- {4096 bytes heap / 9128 stack is RECOMMENDED}
-
-
- USES TGP,CRT; {This time no starfield :)}
-
- var i,
- xold,
- yold : byte;
-
- Const Cardtypes : Array[1..6] of string =
- ('SPEAKER',
- 'DAC',
- 'SOUNDBLASTER',
- 'SOUNDBLASTER / PRO',
- 'SOUNDBLASTER / ASP16 & AWE32',
- 'GUS & GUS/MAX');
-
- begin
- tgp.device:=tgp.bestcard;
- tgp.musport:=tgp.info.bestcard.port;
- tgp.Irq:=tgp.info.bestcard.irq;
- tgp.Dma:=tgp.info.bestcard.dma;
- TGP.INITPLAYER(tgp.Device,tgp.musport,tgp.Irq,tgp.Dma);
-
- Writeln('Device used : ',tgp.device);
- Writeln('Description : ',cardtypes[tgp.device]);
- Writeln('Port used : $',tgp.info.bestcard.port);
- Writeln('Interrupt used : IRQ',tgp.irq);
- Writeln('DMA channel used : DMA',tgp.dma);
-
- Writeln;Writeln;
-
-
- textattr:=$0F;
- Writeln('Loading "EXAMPLE2.MOD"');
- TGP.LOADFILE('EXAMPLE2.MOD');
- textattr:=$0E;
-
- gotoxy(1,13);
- Write('[Init #s1] ');
- TGP.INITCARD;
-
- gotoxy(20,13);
- Write('[Volume 254] ');
- TGP.VOLUME(254);
-
- gotoxy(40,13);
- Write('[Startmus #s1] ');
- TGP.STARTMUS;
-
- gotoxy(60,13);
- Write('[Pos #s1:(');
- xold:=wherex;
- yold:=wherey;
- repeat {Start of Repeat}
- gotoxy(xold,yold);
- write(tgp.position(curpos),')] ');
- until keypressed; {repeat until port $60 = 1 (faster }
-
-
- gotoxy(1,14);
- Write('[Qloc #s1:(',tgp.position(curpos),')]');
-
- gotoxy(20,14);
- Write('[Clearkbd ] ');
- mem[0:$41A]:=mem[$0:$41C];
-
- gotoxy(40,14);
- Write('[Fadeout #s1:(');
- xold:=wherex;
- yold:=wherey;
- FOR I:=64 downto 0 do
- begin
- delay(5);
- gotoxy(xold,yold);
- write(TGP.VOLUME(i),')] ');
- end;
-
-
-
- gotoxy(1,17);
- textattr:=$0F;
- Writeln('Loading "EXAMPLE6.MOD"');
- TGP.LOADFILE('EXAMPLE6.MOD');
- textattr:=$0E;
-
- gotoxy(1,18);
- Write('[Stopmus #s1] ');
- TGP.STOPMUS;
- Writeln;
-
- gotoxy(20,18);
- Write('[Init ] ');
- TGP.INITCARD;
-
- gotoxy(40,18);
- Write('[Startmus #s2] ');
- TGP.STARTMUS;
-
- gotoxy(60,18);
- Write('[Fadein #s2(');
- xold:=wherex;
- yold:=wherey;
- FOR I:=0 to 254 do
- begin
- delay(5);
- gotoxy(xold,yold);
- write(TGP.VOLUME(i),')] ');
- end;
-
- gotoxy(1,19);
- Write('[Pos #s1:(');
- xold:=wherex;
- yold:=wherey;
- repeat
- gotoxy(xold,yold);
- write(tgp.position(curpos),')] ');
- until keypressed;
-
- gotoxy(20,19);
- Write('[Qloc #s2:(',tgp.position(curpos),')]');
-
- gotoxy(40,19);
- Write('[Stop #s2] ');
- TGP.STOPMUS;
-
- gotoxy(60,19);
- Write('[Unload #s2]');
- TGP.UNLOADMUS;
-
- gotoxy(1,22);
- textattr:=$0B;
- Writeln('Done playing example 7 ...');
-
- end.
-