home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / dos / fr / hardball / include / goldplay.doc next >
Text File  |  1994-05-30  |  12KB  |  347 lines

  1. ───────────────────────────────────────────────────────────────────────────────
  2.                              GoldPlay ver 1.00
  3. ───────────────────────────────────────────────────────────────────────────────
  4.  
  5.      Programmed by
  6.            Sourcer of The CodeBlasters (Stein Norheim)
  7.  
  8.      Betatested and Bugfixed by
  9.            Robban of The SkyHawks (Robert Adolfsson)
  10.  
  11.      'DIGITAL.MOD' is composed by
  12.            Infinity of The CodeBlasters (Arttu Kataja)
  13.  
  14. ───────────────────────────────────────────────────────────────────────────────
  15.  
  16. GoldPlay 1.00 is distributed as SMILEWARE. That means that you may use and
  17. share this utility if :
  18.                      * You write who made the soundsystem
  19.  
  20.                      * You not make any changes in the package
  21.  
  22.                      * You send us a postcard from the town where you live.
  23.                        (our address is here below)
  24.  
  25. ───────────────────────────────────────────────────────────────────────────────
  26.  
  27. Send the postcard to :
  28.  
  29.                       Stein Norheim
  30.                       Klippvägen 15
  31.                       S-756 52 Uppsala
  32.                       SWEDEN
  33.  
  34. Feel free to write to us if you have any questions.
  35. You can also drop us a FAX at : +46-18 32 48 53  (in sweden: 018-32 48 53).
  36.  
  37. ───────────────────────────────────────────────────────────────────────────────
  38. ───────────────────────────────────────────────────────────────────────────────
  39. GoldPlay Documentation                                               Page 2
  40. ───────────────────────────────────────────────────────────────────────────────
  41.  
  42. 1.00 The Archive
  43.  
  44.    The Archive should consist of these files :
  45.  
  46.    GOLDPLAY.OBJ          The Assembler-Object-file
  47.    GOLDPLAY.TPU          The TPascal-Unit (6.0)
  48.    GOLDPLAY.OVL          The TPascal-Overlay-file
  49.    GOLDPLAY.DOC          This Documentation
  50.    TESTPLAY.PAS          Demo-Program for TPascal
  51.  
  52. 1.01 Assembler..... of course !
  53.  
  54.    GoldPlays main-parts are all 100% pure Assembler-Code.
  55.  
  56. 1.02 The Overlay-File.... WHY ?
  57.  
  58.    GOLDPLAY.OVL is needed by the TPascal-version of GoldPlay. It consists
  59.    of some data to the player.
  60.  
  61. ───────────────────────────────────────────────────────────────────────────────
  62. GoldPlay Documentation                                               Page 3
  63. ───────────────────────────────────────────────────────────────────────────────
  64.  
  65. 2.00 The Procedures
  66.  
  67.    Here comes all procedures in GoldPlay, one by one.
  68.  
  69. ───────────────────────────────────────────────────────────────────────────────
  70. LOADOVL
  71. ───────────────────────────────────────────────────────────────────────────────
  72. Loads the overlay-file in the TPascal-version.
  73.  
  74. TPascal-Syntax:
  75.          LOADOVL(Filename:String);
  76.  
  77. TPascal-Example:
  78.  
  79.      Begin;
  80.      LoadOvl('GoldPlay.Ovl');         { Load the overlay into memory }
  81.  
  82.      ... {Play the module here}
  83.  
  84.      RemoveOvl;                       { Remove the overlay from memory }
  85.      End.
  86.  
  87. * Procedure is not needed in the assembler-version *
  88.  
  89. ───────────────────────────────────────────────────────────────────────────────
  90. REMOVEOVL
  91. ───────────────────────────────────────────────────────────────────────────────
  92. Loads the overlay-file in the TPascal-version.
  93.  
  94. TPascal-Syntax:
  95.      LOADOVL(Filename:String);
  96.  
  97. TPascal-Example: see LOADOVL
  98.  
  99. * Procedure is not needed in the assembler-version *
  100.  
  101. ───────────────────────────────────────────────────────────────────────────────
  102. ASKINIT                                                              Page 4
  103. ───────────────────────────────────────────────────────────────────────────────
  104. Asks the user for the soundsystem-setup.
  105.  
  106. TPascal-Syntax:
  107.      LOADOVL;
  108.  
  109. TPascal-Example:
  110.  
  111.      LoadOvl('GOLDPLAY.OVL');       { Load the overlay }
  112.      AskInit;                       { Ask user for setup }
  113.      Initialize;                    { Initialize the soundsystem }
  114.        ...
  115.  
  116. Assembler-Example:
  117.  
  118.      Call AskInit                   ; Ask use for setup
  119.      Call Initialize                ; Initialize the soundsystem
  120.  
  121. ───────────────────────────────────────────────────────────────────────────────
  122. INITIALIZE
  123. ───────────────────────────────────────────────────────────────────────────────
  124. Initializes the soundsystem for chosen setup.
  125.  
  126. Note : The soundsystem must be re-initialized every time you change the
  127. preferences.
  128.  
  129. Examples : See ASKINIT
  130.  
  131. ───────────────────────────────────────────────────────────────────────────────
  132. SETSYS
  133. ───────────────────────────────────────────────────────────────────────────────
  134. Allowes the programmer to set the preferences without using askinit
  135.  
  136. Note : This procedure is not needed when using the assembler-version.
  137.  
  138. Note : The variables SBDMA, SBIRQ, and SBPORT should be set to 1,7,220 when
  139.        not used. In the Assembler-version, these variables are by default
  140.        set to 1,7 and $220.
  141.  
  142. TPascal-Syntax:
  143.      SetSys(SoundDevice,Timerspeed,SBDMA,SBIRQ,SBPORT);
  144.  
  145. TPascal-Example:
  146.      SetSys(4,75,1,7,220); {Set Internal Honker at 16 kHz}
  147.      Initialize;
  148.  
  149. Assembler-Example:
  150.      Mov  Ax,Seg SoundDevice
  151.      Mov  Es,Ax                  ; Makes ES point to the player-segment
  152.  
  153.      Mov  Es:SoundDevice,4       ; Set Internal Honker
  154.      Mov  Es:TimerSpeed,75       ; Set 16 kHz (1193182/16000=75)
  155.  
  156.      ; No Need to set SBDMA, SBIRQ, SBPORT, because we are playing at the
  157.      ; Internal honker.
  158. ───────────────────────────────────────────────────────────────────────────────
  159. LOADMODULE                                                            Page 5
  160. ───────────────────────────────────────────────────────────────────────────────
  161. Allocates memory for a module, and loads it.
  162.  
  163. Note : In the Assembler version, Ds:Dx must point to and ASCIIZ-String with
  164.        the filename.
  165.  
  166. Note : In the TPascal-version, reduce the Pascal-Heap, so the module gets some
  167.        memory to live in. You do this with : {$M $4000,0,40000}
  168.  
  169. TPascal-Syntax:
  170.      LoadModule(Filename);
  171.  
  172. TPascal-Example:
  173.      Askinit;
  174.      Initialize;
  175.      LoadModule('Digital.Mod');      { File not found if ERROR<>0 }
  176.      StartPlaying;
  177.  
  178. Assembler-Example:
  179.  
  180.      .Data
  181.      Filename Db 'Digital.Mod',0
  182.      .Code
  183.      Mov  Ax,_Data
  184.      Mov  Ds,Ax
  185.  
  186.      Call Askinit
  187.      Call Initialize
  188.      Mov  Dx,Offset FileName
  189.      Call LoadModule                ; Carry set if error
  190.      Call StartPlaying
  191.  
  192. ───────────────────────────────────────────────────────────────────────────────
  193. STARTPLAYING
  194. ───────────────────────────────────────────────────────────────────────────────
  195. Starts playing the module.
  196.  
  197. Note : This procedure revectores IRQ0, it is therefore recommended to turn
  198.        the moduleplayer off before doing any floppy-disc-access.
  199.        DON'T DO MORE INTERRUPTS THAN YOU NEED WHEN YOU ARE PLAYING. DOING THIS
  200.        WILL LOWER THE REPLAYRATE DRASTICLY.
  201. TPascal-Syntax:
  202.      StartPlaying;
  203.  
  204. TPascal-Example:
  205.      StartPlaying;
  206.      Port[$21h]:=$5C;                  {Turns off IRQ 2,3,4, and 6}
  207.      Repeat until Port[$60]=1;         {Wait until ESCAPE is pressed}
  208.      Port[$21h]:=0;                    {Let all IRQ's live}
  209.      StopPlaying;
  210.  
  211. Assmebler-Example:
  212.      Call StartPlaying
  213.      Mov  Al,01011010b                 ; 5Ch
  214.      Out  21h,Al                       ; Turn off IRQ 2,3,4 and 6
  215.  
  216.      WaitESC:
  217.      In   Al,60h
  218.      Cmp  Al,1
  219.      Jne  WaitESC                      ; Wait for ESCAPE to be pressed
  220.  
  221.      Xor  Al,Al
  222.      Out  21h,Al
  223.      Call StopPlaying
  224. ───────────────────────────────────────────────────────────────────────────────
  225. STOPPLAYING                                                           Page 6
  226. ───────────────────────────────────────────────────────────────────────────────
  227. Stops playing the module, and restores IRQ0.
  228.  
  229. TPascal-Syntax:
  230.      StopPlaying;
  231.  
  232. Examples: See StartPlaying
  233.  
  234. ───────────────────────────────────────────────────────────────────────────────
  235. DEALLOC
  236. ───────────────────────────────────────────────────────────────────────────────
  237. Removes the module from the memory and deallocate the memory where the module
  238. was.
  239.  
  240. Note : You MUST ALWAYS deallocate and remove the old module before loading a
  241.        new.
  242.  
  243. TPascal-Syntax:
  244.       DeAlloc;
  245.  
  246. TPascal-Example:
  247.       Loadmodule('Digital.Mod');        { Load the module }
  248.       Dealloc;                          { Remove it again }
  249.  
  250. Assembler-Example;
  251.       Lea  Dx,FileName
  252.       Call LoadModule                   ; Load the module
  253.       Call DeAlloc                      ; Remove it
  254.  
  255. ───────────────────────────────────────────────────────────────────────────────
  256. MASTERVOLUME
  257. ───────────────────────────────────────────────────────────────────────────────
  258. Sets the mastervolume of the module.
  259.  
  260. Note : The mastervolume must be a value from 0 to 64.
  261.  
  262. TPascal-Syntax:
  263.      Mastervolume(Gain);
  264.  
  265. TPascal-Example;
  266.      For I:=64 downto 0 do              {Fade the volume down}
  267.      Begin;
  268.      MasterVolume(I);
  269.      Delay(10);                         {Wait 10 milliseconds}
  270.      End;
  271.  
  272. Assembler-Example;
  273.      Mov  Ax,Seg SoundDevice
  274.      Mov  Es,Ax                 ; Make ES Point to the PlayerSegment
  275.  
  276.      Mov  Cx,64
  277.      FadeDown:
  278.      Push Cx
  279.      Mov  Es:MasterVolume,Cx
  280.      Mov  Cx,300
  281.      Dummy:
  282.      Db   90h,90h,90h,90h         ; Four NOP's
  283.      Loop Dummy
  284.      Pop  Cx
  285.      Loop FadeDown
  286. ───────────────────────────────────────────────────────────────────────────────
  287. BOPBAR                                                                Page 7
  288. ───────────────────────────────────────────────────────────────────────────────
  289. Returns the 'BAR'-Value....  Nice for doing VU-Meters and so on.
  290.  
  291. Note : In the Assembler-version, there is no BOPBARS-function. You must access
  292.        the variables named BAR1, BAR2, BAR3 and BAR4 directly.
  293.  
  294. TPascal-Syntax:
  295.      I := BopBar(Channelnumber);
  296.  
  297. TPascal-Example:
  298.      BarHeight := BopBar(2);       { Returns the height of bar 2}
  299.  
  300. Assembler-Example:
  301.      Mov  Ax,Seg SoundDevice
  302.      Mov  Es,Ax                    ; Make ES Point to the PlayerSegment
  303.      Mov  Bx,Es:Bar2               ; Set BX to the height of bar 2
  304.  
  305. ───────────────────────────────────────────────────────────────────────────────
  306.  
  307. Remember to send your GOLDPLAY-Productions to us.
  308.  
  309. Hi's and Ho's goes to :
  310.  
  311.     ALL The CodeBlasters and The SkyHawks-members
  312.  
  313.                          AND
  314.  
  315.     Cascada, The SpacePigs, The Future-Crew, DCE, Ultra-Force, The Bogeyman,
  316.     The Scream Team, The Physical Crew, Skull, The Phoney Coders,
  317.     The Neoteric Crew, Maelstrom, SMA, and those I've forgotten.
  318.  
  319. Remember to send the postcard.....
  320.  
  321. ╓────────────────────────────────────────────────────────────────────────────╖
  322. ║ The Sounddevices:                                                          ║
  323. ║────────────────────────────────────────────────────────────────────────────║
  324. ║                        01  Soundplayer/Covox at LPT1  (Mono)               ║
  325. ║                        02  Soundplayer/Covox at LPT2  (Mono)               ║
  326. ║                        03  SoundBlaster               (Mono)               ║
  327. ║                        04  Internal Honker            (Mono)               ║
  328. ║                        05  Two Soundplayers LPT1+2    (Stereo)             ║
  329. ║                        06  SoundBlaster Pro           (Stereo)             ║
  330. ║                        07  Stereo SoundPlayer in LPT1 (Stereo)             ║
  331. ║                        08  Stereo SoundPlayer in LPT2 (Stereo)             ║
  332. ╙────────────────────────────────────────────────────────────────────────────╜
  333.  
  334. P.S. Have understanding for all spelling/grammattic-errors... It's hard to
  335.      think clear at 5 o'clock in the morning.... D.S.
  336.  
  337.  
  338.  
  339.  
  340.  
  341.  
  342.  
  343.  
  344.  
  345.  
  346. / Sourcer of The CodeBlasters, September the 30th, 1992
  347.