home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 4
/
FreshFish_May-June1994.bin
/
bbs
/
may94
/
mus
/
play
/
delitracker.lha
/
DeliTracker
/
Files
/
developer.lha
/
Developer
/
Developer.doc
next >
Wrap
Text File
|
1994-04-15
|
31KB
|
761 lines
$VER: Developer.doc V2.00 (10.04.1994)
Copyright 1994 by Delirium Softdesign
(Peter Kunath and Frank Riffel)
DeliTracker Development Documentation
1.OVERVIEW
2.PLAYERS
2.1 Normal Players
2.2 Custom Modules
2.3 Interrupts
3.GENIES
3.1 Generic Kind
3.2 Converter
3.3 Decruncher
3.4 NotePlayer
4.TAGS
5.DELITRACKER SUPPORT FUNCTIONS
1.OVERVIEW
DeliTracker can be extended with external code. From DOS sight external
code for DeliTracker is nothing else than an executable object file
that contains a characteristic structure at the beginning of first code
hunk. When DeliTracker has loaded such external code it evaluates this
structure. It consists of three parts: one longword of code, two longs
used as identifier and at last a pointer to a taglist. The first long
usually contains a moveq #-1,d0 and a rts instruction. This prevents a
system crash if a user accidentally tries to run a normal genie or player
from shell. To get a program that works without DeliTracker, too, you
can change this to a bra.w to your own startup code. You should use the
PLAYERHEADER macro from 'deliplayer.i' to create this structure. It has
two parameters: a pointer to the tag array and a pointer to the optional
startupcode.
PLAYERHEADER <tagarray>,[startup]
tagarray Pointer to a tag array, terminated with TAG_DONE.
startup Pointer to optional startup code. Only set if you
need to make the code run without DeliTracker.
Note: In case the startup code is called you have
to do anything by your own! The startup option
does not make sense in most cases. Use rarely.
This taglist contains all informations that DeliTracker must know. We
have choosen to use a tag array because it is extremely flexible and
extensible. For the other direction the external code has the limited
ability to check the internal program state by looking at the DeliTracker
Global structure. It can also take advance of inbuild support functions.
At the moment DeliTracker knows two different types of external code:
1) Players they have the task to identify and play a modules.
2) Genies can perform several other things. This includes module
conversion, extended decrunch support and information display.
Both forms can run synchronusly or asynchronusly. The term synchronuns
means that the player or the genie is not running as seperate task.
DeliTracker will communicate with the genie or player using real fuction
calls (jsr). In asynchronus mode DeliTracker will spawn an own process
for the player or genie. Now DeliTracker uses a message based interface
to "call" the functions of the external code. In general genies tend to
run asynchronus whereas player run synchronous. If a player or genie is
running asynchronously a CTRL-C signal must terminate it. As you see
DeliPlayers and DeliGenies are very similiar. Indeed DeliTracker handles
them in the same way but of course in two sperate lists. All external
code that has set the DTP_CustomPlayer, DTP_Check1 or DTP_Check2 tag is
a player. The rest is threated as genie.
If a player or genie has a GUI it should offer the following menu items:
Project
About A ? Displays a short info
==============
Save Prefs A S Save the current settings as default
==============
Hide A H Hide the GUI
==============
Quit A Q Remove the Player/Genie (same as CTRL-C)
Settings
Activate A A Activates the window if the GUI is opened
Popup A P Opens the GUI after loading
==============
Other settings Other genie specific settings, see the
·············· particular genie documentation.
Some general things:
A good point to start with is to read the supplied example sources. To
get an idea how DeliTracker calls the player routines see 'Testplayer.s'.
Configuration files should not be saved to ENV:. Instead they should be
stored in DeliTracker's default configuration directory. The path of this
directory can be found in the 'DeliConfig' ENV-Variable. If this variable
is not set the configuration should be saved to 'PROGDIR:DeliConfig'.
Your player should not change the LED (Filter) state because DeliTracker
will handle this. Besides the interrupt routine any other subroutine may
trash any register. When DeliTracker calls a player function (exept the
interrupt routine) a5 will contain the address to the global player data
structure (Base).
2.PLAYERS
It is not difficult to adapt a player if you have the replayroutine.
You only need to write some interfacecode. DeliTracker has some helpful
builtin routines that will make this job a lot easier. To adapt a new
soundsystem you need the replayroutine of that soundsystem, and some
modules for testing the adaption. At the beginning of an external
player you can find the characteristic playerstructure. DeliTracker
distinguishes between two kinds: normal players and custom modules.
2.1 Normal Players
Normal players identify and play modules. They must allways have a
check routine. This is the schematic structure of a normal player:
{ player header } identifies the objectfile
{ tag array } description of the playerfuntions.
{ interfacecode } playername/registerconversion/checkcode...
{ replaycode } replay code itself
{ optional data } optional data
In order to recognize different moduleformats every player must contain
a specific routine, that tells DeliTracker if the player can play this
module or not. This routine has the task to check certain positions in
the module that are identical in every module (like 'M.K.' at offset
$438 in NoiseTracker modules) or significant assembler instructions (if
the module contains the player). Testing against one or two branches or
jumps is NOT enough, cause many modules with player have branchtables at
the beginning of the module. If the player recognizes a wrong module, it
is likely that a system crash will result! So be very careful with the
ckeck routine. There are two different types of check functions but your
player must use exactly one check routine.
a) DTP_Check1: The check function is called after DeliTracker has
loaded 1K of the file. This has the advantage that you can implement
players that can load the module by itself. The disadvantage is that
you don't profit from the internal packsupport and of course it is
more complex to write such players. Use this type only where you must
load the module by yourself!
b) DTP_Check2: The check function is called after the module is loaded
and decrunched. This is the easy way. All memory allocation, loading
and decrunching is done by DeliTracker.
Regardless of the playertype the checkfunction must return d0.l=0 if
the player can handle this module or d0.l<>0 if not.
2.2 Custom modules
This is a very special thing: Custom modules contain replay and sound
data, both relocatable. They don't contain a check routine. With the
custom module interface you can adapt almost every module. If you have
more modules with the same replay routine we suggest to write an own
player for this moduleformat.
{ player header } identifies the objectfile
{ tag array } description of the playerfuntions.
{ interfacecode } playername/registerconversion/checkcode...
{ replaycode } replay code itself
{ optional data } optional data
{ SOUND DATA } music data (the module)
2.3 Interrupts
Players can be divided in two categories:
a) Player that uses the internal ti