
           Adrenalin module player  v 0.2   (22.03.1995)
                    By: Beta / Adrenalin

This program plays standard 4-12 channel protracker modules on GUS. ALL
sources are included, and are 99% TP.

This program is MAILWARE. You may use it in NON COMMERCIAL productions
IF you send me a postcard (or e-mail) from your hometown, and tell me
what you like of this program. You must also tell somewhere in your
program, that you are using this. Eg. "Sound system by Adrenalin".
For commercial purposes, please contact me.

You may distribute this freely IF you include all the sources and
docs. You may freely distribute any programs that use this player. You
may NOT distribute any modified versions of the sources!!! If you wish
to include this in shareware collection etc. you must contact me first.
If you find a bug, please notify me so that I can correct it. Better
yet correct it by yourself (if you can) and send the corrected version
to me :-)

Disclaimer:
If this thing breaks your hard disk, burns your house or does anything
else, I will NOT be responsible! You use this at you own risk! (Besides,
you can't prove anything. I have better lawyers than you ;-))

Thanks go to:

  Gravis for making such a great soundcard
  flap / Capacala for sending me "some" info
  Mark Feldham for PCGPE
  Mark Dixon for his GUS669 source
  Thunder for excellent info about mods
  Tran & Joshua C. Jensen for releasing ultradox

Greets are sent to:

  Wihannes / Nordic vision
  Solar / Hysteria
  Psyko / Acidface software
  TOP4.ZIP
  All users of Metropoli & Starport


       Included files;

ADNMOD.EXE     Compiled player
ADNMOD.TXT     This doc
ADNMOD.PAS     Player using modunit
ADNPIC.BIN     Cool background picture
ADNPIC.INC     Same, except packed
BIN2PACK.PAS   Pack your own background pic
MODUNIT.PAS    Playing routines
GUS.INC        GUS routines
EFFECT.TXT     Text file that compares ADNMOD & other players
MODTEST.PAS    VERY simple player... Just loads'n plays


       Keys while playing:

F1-F8      Mute channel
+ / -      Set amplify vol
p          Pause
<- / ->    Next/prev pattern
bkspc      Jump to start of current pattern
pgup/pgdn  Set speed
< / >      Sroll samples
, / .      Scroll channels
r          Stop/start playing
v          Toggle VBlank tempo
!          Shell to DOS. Warning: player consumes a LOT of mem.
"          Super shell. Volume bars on screen & dos shell.


       Supported effects:

0   Arpeggio
1 - Portamento up
2 - Portamento down
3 - Tone portamento
4 - Vibrato (incorrectly)
5 - Tone portamento & Vol slide
6 - Vibrato & Vol slide (bugs)
9 - Set sample offset
A - Volume slide
B - Position jump
C - Set volume
D - Break pattern
F - Set speed/tempo. Only tempos > 50 are supported.

E1 - Fine portamento up
E2 - Fine portamento down
E5 - Set finetune
E8 - Set MTM-pan  (0 left, 7 middle, 15 right)
E9 - Retrigger
EA - Fine vol slide up
EB - Fine vol slide down
EC - Notecut (bugs???)
ED - Note delay (bugs)

Ok, so what's left out:
7   Tremolo   - I haven't encountered many mods using this one. If I have
                time, I might implement it.
Ex            - These will propably never be added... Too bad :-(


      Technical stuff...

The sources are not very well documented, but there should be no need
because they are all TP. Only thing done in assembler are the GUS
routines, sample loading (for speed) & some display routines. TP 6.0
or greater is required for the inline assembly.

If you learn anything from this source, then all I ask you is to greet
us in your next production.

MODTEST.PAS is an example how to use modunit in your progs.
ADNMOD.PAS is a complete mod-player. See this for examples for other
variables & procedures.
For documentation of mods get yourself modform.txt & modfil10.txt.

Procedures:
--------------------------------------------------------------------------
procedure GUSFIND;

Detect & initialize gus.
You MUST call this even if you set the base address directly!!!
NOTE: This procedure tries to hardware detect the GUS. IT DOES NOT
LOOK FOR ULTRASND VARIABLE! Here's sample code to check the variable:

function findgus : word;  {returns gus base address if ultrasnd found}
var
n,c,i : word;
begin
  if getenv('ultrasnd') = '' then begin
    findgus := 0;
    exit;
  end;
  val(copy(getenv('ultrasnd'),1,3),n,c);
  if c <> 0 then begin
    findgus := 0;
    exit;
  end;
  case n of
    210 : i := $210;
    220 : i := $220;
    230 : i := $230;
    240 : i := $240;
    250 : i := $250;
    260 : i := $260;
    270 : i := $270;
  else begin
    findgus := 0;
    exit;
  end;
end;
findgus := i;
end;


begin
  if findgus > 0 then base := findgus;
  gusfind;
end.

--------------------------------------------------------------------------
function GUSFINDMEM : longint;

Returns how much memory your GUS has.

--------------------------------------------------------------------------
procedure GUSRESET;

Resets GUS.

--------------------------------------------------------------------------
procedure INIT_MOD;

Initializes player. Run this after GusReset

--------------------------------------------------------------------------
procedure LOAD_MOD(mod_name,debug_info)

Loads module. If debug_info is true, then displays progress of loading.
Returns possible errors in mod_error variable.

0   = no error
1   = wrong number of channels
2   = load error
3   = out of pattern memory
255 = other error

--------------------------------------------------------------------------
procedure START_PLAYING;

Wonder what this does...

--------------------------------------------------------------------------
procedure STOP_PLAYING;

Stops playing & restores interrupts where they were before init_mod.

--------------------------------------------------------------------------
procedure FREE_MOD;

Frees memory allocated for mod.

--------------------------------------------------------------------------
procedure GUSDEINIT;

Stops all voices. Call this at end of your program.

--------------------------------------------------------------------------


Variables:

base        - GUS address
amp_vol     - amplifying volume (0-18).
maxchn      - max # of channels in the mod. It reserves memory
              maxchn*6*64 bytes for each pattern. Lower this, if you
              run out of memory.
time_count  - Counter that gets incremented every 1/18.2 second while
              music is playing. Great for syncing with music.
time_count2 - Counter that gets incremented for every tick.
vrt_flag    - 1 if vertical retrace happened while doing interrupt.


           Stuff planned for the future releases

- Bug fixes!
- More octaves (as soon, as I get period values for different
                finetunes in octave 0)
- Better main volume (as soon, as I get a better volume table)
- More effects (at least 7, E7 & EE)
- Anything you can come up with :-)

   Beta / Adrenalin
   E-mail: beta@triplex.fipnet.fi
           antti.huovilainen@pcb.mpoli.fi
   Snail: Antti Huovilainen
          Kluuvintie 1 C2
          ESPOO 02180
          FINLAND

--- I'm a coder, so I make programs.
--- If I'd be a Guru, they would even work :-)

