home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 5
/
FreshFish_July-August1994.bin
/
bbs
/
mus
/
delitracker-2.01.lha
/
DeliTracker
/
Files
/
developer.lha
/
Developer
/
Include
/
misc
/
DeliPlayer.i
next >
Wrap
Text File
|
1994-04-17
|
13KB
|
374 lines
**
** $Filename: misc/DeliPlayer.i $
** $Release: 2.0 $
** $Revision: 2.01$
** $Date: 17/04/94$
**
** Definitions and Macros for creating DeliTracker Playermodules
**
** (C) Copyright 1991, 1992, 1993, 1994 Delirium Softdesign
** All Rights Reserved
**
IFND DELITRACKER_PLAYER_I
DELITRACKER_PLAYER_I SET 1
IFND EXEC_PORTS_I
INCLUDE "exec/ports.i"
ENDC
IFND EXEC_TYPES_I
INCLUDE "exec/types.i"
ENDC
IFND UTILITY_TAGITEM_I
INCLUDE "utility/tagitem.i"
ENDC
;----------------------------------------------------------------------------
DELIVERSION EQU 16 ; Current Version of DeliTracker
DELIREVISION EQU 2 ; Current Revision of DeliTracker
;------------------------ Player Function Offsets ---------------------------
STRUCTURE DeliTrackerPlayer,0
STRUCT dtp_RTS_code,4 ; RTS for security (private !)
STRUCT dtp_ID,8 ; Identifier (private !)
APTR dtp_TagArray ; pointer to TagItem array
LABEL dtp_SIZE
* The TagItem ID's (ti_Tag values) for the player interface follow.
DTP_TagBase EQU TAG_USER+"DT"
ENUM DTP_TagBase ; TagBase
EITEM DTP_InternalPlayer ; obsolete
EITEM DTP_CustomPlayer ; player is a customplayer
EITEM DTP_RequestDTVersion ; minimum DeliTracker version needed
EITEM DTP_RequestKickVersion ; minimum KickStart version needed
DTP_RequestV37 EQU DTP_RequestKickVersion ; obsolete
EITEM DTP_PlayerVersion ; actual player version & revision
EITEM DTP_PlayerName ; name of this player
EITEM DTP_Creator ; misc string
EITEM DTP_Check1 ; Check Format before loading
EITEM DTP_Check2 ; Check Format after file is loaded
EITEM DTP_ExtLoad ; Load additional files
EITEM DTP_Interrupt ; Interrupt routine
EITEM DTP_Stop ; Clear Patterncounter
EITEM DTP_Config ; Config Player
EITEM DTP_UserConfig ; User-Configroutine
EITEM DTP_SubSongRange ; Get min&max subsong number
EITEM DTP_InitPlayer ; Initialisize the Player
EITEM DTP_EndPlayer ; Player clean up
EITEM DTP_InitSound ; Soundinitialisation routine
EITEM DTP_EndSound ; End sound
EITEM DTP_StartInt ; Start interrupt
EITEM DTP_StopInt ; Stop interrupt
EITEM DTP_Volume ; Set Volume
EITEM DTP_Balance ; Set Balance
EITEM DTP_Faster ; Incease playspeed
EITEM DTP_Slower ; Decrease playspeed
EITEM DTP_NextPatt ; Jump to next pattern
EITEM DTP_PrevPatt ; Jump to previous pattern
EITEM DTP_NextSong ; Play next subsong
EITEM DTP_PrevSong ; Play previous subsong
;--- functions in revision 14 or higher (distributed as Release 1.35) ---
EITEM DTP_SubSongTest ; Test, if given subsong is vaild
;--- functions in revision 16 or higher (distributed as Release 2.01) ---
EITEM DTP_NewSubSongRange ; enhanced replacement for DTP_SubSongRange
EITEM DTP_DeliBase ; the address of a pointer where DT
; stores a pointer to the DeliGlobals
EITEM DTP_Flags ; misc Flags (see below)
EITEM DTP_CheckLen ; Length of the Check Code
EITEM DTP_Description ; misc string
EITEM DTP_Decrunch ; pointer to Decrunch Code
EITEM DTP_Convert ; pointer to Converter Code
EITEM DTP_NotePlayer ; pointer to a NotePlayer Structure
EITEM DTP_NoteStruct ; the address of a pointer to the
; NoteStruct Structure
EITEM DTP_NoteInfo ; a pointer where DT stores a pointer
; to the current NoteStruct Structure
EITEM DTP_NoteSignal ; pointer to NoteSignal code
EITEM DTP_Process ; pointer to process entry code
EITEM DTP_Priority ; priority of the process
EITEM DTP_StackSize ; stack size of the process
EITEM DTP_MsgPort ; a pointer where DT stores a pointer
; to a port to send its messages
EITEM DTP_Appear ; open your window, if you can
EITEM DTP_Disappear ; go dormant
EITEM DTP_ModuleName ; get the name of the current module
EITEM DTP_FormatName ; get the name of the module format
*** end of player interface enumeration ***
; --- various flags ---------------------------------------------------------
BITDEF PLY,CUSTOM,0 ; player is a customplayer
BITDEF PLY,SONGEND,1 ; player supports songend
; --- DeliTracker message ---------------------------------------------------
STRUCTURE DeliMessage,MN_SIZE
ULONG DTMN_Function ; function pointer
ULONG DTMN_Result ; store the result here
LABEL DTMN_SIZE
;------------------------------ Player Header -------------------------------
;
; Here is the MACRO for creating the player header structure. Use this MACRO !!!
; Note: Macro68 users could have problems when assembling this macro!
PLAYERHEADER MACRO
IFC '\2',''
moveq #-1,d0 ; this should return an error
rts ; in case someone tried to run it
ELSEIF
bra.w \2 ; branch to startupcode
ENDC
dc.b 'DELIRIUM' ; identifier
dc.l \1 ; ^tagitem array
ENDM
;------ When a subroutine in the player is called, A5 will contain
;------ the pointer to the DeliTrackerGlobals, the only exeption is
;------ of course the interrupt routine.
;------ The interruptroutine is called every 1/50 sec (via timerint).
;------ When Check is called, supply d0=0 if the format is ok
;------ else d0<>0.
;------ Check1 is called before loading the complete file, you can
;------ check in the first 1024 Bytes of the file. If the file is
;------ smaller than 1kB, the remaining space will contain zero.
;------ Check2 is called after the complete file is loaded, you
;------ can use dtg_ChkSize to determine the length of the file.
;------ If you supply this tag the file can be crunched.
;------ ExtLoad: routine for loading additional files (instruments).
;------ If successful, you must return d0=0 else d0<>0. In case of
;------ an error DeliTracker frees all memory used for this module.
;------ InitPlayer: Here you should allocate the audio channels.
;------ In case the player supports multi-modules, you must set here
;------ dtg_SndNum to the minimal subsong number (not necessary if
;------ you have supplied a DTP_SubSongRange routine!).
;------ If successful, you must return d0=0 else d0<>0.
;------ EndPlayer: Here you should free the audio channels.
;------ InitSound: If you want to use the internal interrupt but don't
;------ need the default 50 Hz frequency, you can write another timer
;------ value into dtg_Timer.
;------ It is recommended to use DTP_SubSongRange/DTP_SubSongTest
;------ instead of DTP_NextSong/DTP_PrevSong.
;------ Volume usually only copies the values dtg_Volume, dtg_SndLBal
;------ and dtg_SndRBal to an internal buffer. The interrupt code has
;------ access to this buffer and can set the volume correct.
;------ CheckLen: This tag is only allowed for players. If you supply
;------ this tag, the player will be unloaded by DeliTracker in low
;------ memory situations. When needed, it will be loaded again
;------ automatically.
;------ Decrunch: Supply d0=0 if you could decrunch the file else
;------ d0<>0.
;------ Convert: Supply d0=0 if you converted the file to another
;------ format, else d0<>0.
;------ Appear: Supply d0<>0 if the window was already opend, else
;------ d0=0.
;------ Disappear: Supply d0=0 if the window was already closed, else
;------ d0<>0.
;------ ModuleName: This tag is only allowed for players. It contains
;------ the address of a pointer to the module name (must be null
;------ terminated).
;------ FormatName: This tag is only allowed for convert genies. It
;------ contains the address of a pointer to the name of the module
;------ format (must be null terminated).
;------ Note: the Player can consist of more Hunks. That means you
;------ can seperate CHIP DATA form CODE (and you should do this!).
;---------------------------- Global Variables ------------------------------
STRUCTURE DeliTrackerGlobals,0
;------ if you use dtg_AslBase, make sure that
;------ DTP_RequestDTVersion is at least 13 !
APTR dtg_AslBase ; librarybase don't CloseLibrary()
APTR dtg_DOSBase ; librarybase -"-
APTR dtg_IntuitionBase ; librarybase -"-
APTR dtg_GfxBase ; librarybase -"-
APTR dtg_GadToolsBase : librarybase -"- (NULL for Kick 1.3 and below)
APTR dtg_ReservedLibraryBase ; reserved for future use
APTR dtg_DirArrayPtr ; Ptr to the d