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 5 & TGP is Copyright (c)1994,95 by Gunther Voet - aka Freaker / TuC│
- ├───────────────────────────────────────────────────────────────────────────┤
- │ Starfield:Sinecure/Optimization:Freaker/Music:Alive (by ??) │
- └───────────────────────────────────────────────────────────────────────────┘
- ∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞TuC∞}
-
-
- PROGRAM EXAMPLE_5;
-
-
- {Example by Freaker / STARFIELD by Sinecure Copyright (c)1995 by TuC }
-
- {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. }
- {With autodetect GUS or SB . }
-
-
- {$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}
-
-
-
- {MUSIC ROUTINES}
- { V }
- USES TGP,TUC_DEMO;
- { ^ }
- {EXAMPLE GFX}
-
-
- begin
- tgp.readcards; {Read all [active] cards}
-
- tgp.forceall:=true; {Force ALL options, no errorchecking}
- {DEBUG MODE AUTOMATICALLY DISABLED !}
-
- {All records are structured this way:
- tgp.info.detect.device[x].present (* is device[x] present ? >boolean *)
- .irq (* irq port [not used with GUS] >byte *)
- .dma (* dma port [not used with GUS] >byte *)
- .port (* port address *) >word *)
- }
-
- if tgp.info.detect.device[6].PRESENT then
- begin
- tgp.device:=6;
- tgp.musport:=tgp.info.detect.device[6].port;
- end else
- if tgp.info.detect.device[5].PRESENT then
- begin
- tgp.device:=5;
- tgp.musport:=tgp.info.detect.device[5].port;
- tgp.irq:=tgp.info.detect.device[5].irq;
- tgp.dma:=tgp.info.detect.device[5].dma;
- end else
- if tgp.info.detect.device[4].PRESENT then
- begin
- tgp.device:=4;
- tgp.musport:=tgp.info.detect.device[4].port;
- tgp.irq:=tgp.info.detect.device[4].irq;
- tgp.dma:=tgp.info.detect.device[4].dma;
- end else
- if tgp.info.detect.device[3].PRESENT then
- begin
- tgp.device:=3;
- tgp.musport:=tgp.info.detect.device[3].port;
- tgp.irq:=tgp.info.detect.device[3].irq;
- tgp.dma:=tgp.info.detect.device[3].dma;
- end else
- begin
- Writeln('No valid soundcards found ! [ no GUS or SB found ! ]');
- halt;
- end;
-
-
-
-
- TGP.INITPLAYER(tgp.Device,tgp.musport,tgp.Irq,tgp.Dma);
- {INITIALIZE PLAYER}
-
- TGP.LOADFILE('EXAMPLE5.MOD'); {LOAD FILE}
-
- TGP.INITCARD; {Initialize & reset soundcard}
-
- TGP.STARTMUS; {MUSIC! MAESTRO}
-
- initstars; {Initialize star routines}
-
- repeat {Start of Repeat}
-
- {You can eventually call "TGP.POLLMUSIC" or "TGP.POLLBUFFER"
- if you experience problems using TGP with interrupt dependent tasks.}
-
- plotstars; {plotstars by sinecure !}
-
- until port[$60]=1; {repeat until port $60 = 1 (faster }
- {than keypressed}
-
- TGP.STOPMUS;
- TGP.UNLOADMUS; {ALWAYS uninitialize !!!!!!!}
-
- uninit_demounit; {mode 3h (textmode) and endtext !}
- end.
-