;
; MFF0 PLAYER - PLAYS A SPECIFIC AREA OF AUX OR MAIN MEMORY
;
;
         ORG $0800
;
ENTRYPTS JMP AUXSETUP        ;COPY CODE TO AUX MEM 
         JMP PLAYMAIN        ;PLAY FROM MAIN MEMORY        
         JMP PLAYAUX         ;PLAY FROM AUX MEMORY
         JMP DOAUXMV         ;FOR USER - TO DO AUXMOVE
         JMP DOXFER          ;FOR USER - TO XFER
;----------------
; PARAMETERS
;----------------
PLAYSTRT DW $2000  ;STARTING ADDRESS OF PLAYBACK - SET BY CALLER
PLAYSTOP DW $7800  ;ENDING ADDRESS OF PLAYBACK+1 - SET BY CALLER
PHASE    DFB $00   ;CURRENT PHASE OF PROCESSING
ENDOFTRK DFB $00   ;SIGNALS THAT END OF TRACK (00 FF 2F 00) REACHED
;----------------
; USER PARAMETERS FOR AUXMOVE
;----------------
SRCMAINL DFB $00
SRCMAINH DFB $00
ENDMAINL DFB $00
ENDMAINH DFB $00
TGTAUXL  DFB $00
TGTAUXH  DFB $00
TOAUX    DFB $00
;----------------
; USER PARAMETERS FOR TRANSFER
;----------------
XFERADRL DFB $00
XFERADRH DFB $00
XFTOAUX  DFB $00
USEAUXZP DFB $00
;--------
LYRICS   DFB $01   ;PRINT LYRICS
PRNTSPED DFB $00   ;PRINT SPEED
PIANOSCR DFB $01   ;PIANO DISPLAY ON
DISPMODE DFB $01   ; 00 = UPPERCASE SHARPS, NONZERO = LOWERCASE FLATS
MASKDRUM DFB $01   ; DISPLAY CHANNEL 9 (DRUMS) WITH *
USEINVRS DFB $00   ; WHETHER TO USE INVERSE LETTERS - FOR PIANO DISPLAY
KARALOOK DFB $00   ; WHETHER TO USE KARAOKE LOOKAHEAD
RESOLUTN DFB $00,$F0 ; RESOLUTION FROM MIDI HEADER -USED FOR TEMPO CHGS
SPEEDINC DFB $00   ; USER'S AMOUNT TO ADD OR SUBTRACT FROM SPEED
DOTMPOCG DFB $01   ; PROCESS TEMPO CHANGES
METRDISP ASC 'MM'  ;METRONOME DISPLAY
METRTMP1 ASC '1'   
METRTMP2 ASC '2'
METRTMP3 ASC '0'
METRFILL ASC ' SP'
METRSPD1 ASC '0'
METRSPD2 ASC '2'
METRSPD3 ASC '7'
KEYSIGP1 ASC '('
KEYSIGP2 ASC 'C'
KEYSIGP3 ASC ' '
KEYSIGP4 ASC 'M'
KEYSIGP5 ASC ')'
;-------------------
; INTERNAL VARIABLES
;-------------------
INBYTE   DFB $00   ;VALUE OF CURRENT BYTE
PAUSEFLG DFB $00
DELTATIM DFB $00,$00,$00,$00
DELTACTR DFB $00,$00
LASTSTAT DFB $00
DBYTES   DFB $00
XMITMSG  ASC 'X'
XMITSTS  DFB $00
XMITBYT1 DFB $00
XMITBYT2 DFB $00
XMITBYT3 DFB $00
SYSXLEN  DFB $00
TEXTEVT  DFB $00
METALEN  DFB $00
;---------------------
PLAYPTR  EQU $06   ;POINTER TO CURRENT BYTE BEING READ
SPEED    EQU $FF   ;SPEED OF PLAYBACK - USED IN $FCA8 WAIT ROUTINE
;
COUT     EQU $FDF0 ;USE MONITOR OUTPUT ROUTINE BECAUSE MAY PRINT FROM AUX MEM
MONWAIT  EQU $FCA8 ;MONITOR DELAY ROUTINE
AUXMOVE  EQU $C311 ;AUX MEM MOVE
AUXXFER  EQU $C314 ;AUX MEM TRANSFER CONTROL
MONRTS   EQU $FF58 ;ADDRESS OF RTS INSTRUCTION USED TO SET OVERFLOW FLAG
;------------
; PROGRAM PHASE NAMES:
;------------
DELTA0   EQU $00
DELTA1   EQU $01
DELTA2   EQU $02
DELTA3   EQU $03
GETINST  EQU $04
DATA1    EQU $05
DATA2    EQU $06
DATA2B   EQU $07
DATA3    EQU $08
SYSX0    EQU $09
SYSX1    EQU $0A
SYSX2    EQU $0B
META0    EQU $10
META1    EQU $11
META2    EQU $12
TEMPO1   EQU $13
TEMPO2   EQU $14
TEMPO3   EQU $15
TEMPO4   EQU $16
KEYSIG1  EQU $17
KEYSIG2  EQU $18
KEYSIG3  EQU $19
;-------------------
         CHN MFF0DRVR.SC0
