Changes

Jump to: navigation, search

PROTRACKER372 PT3PLAY H

1,201 bytes added, 20:15, 8 March 2020
no edit summary
PT3Play C���_�`�*;Vortex Tracker II v1.0 PT3 player for ZX Spectrum;(c)2004,2007 S.V.Bulba <vorobey@mail.khstu.ru>;http://bulba.untergrund.net (http://bulba.at.kz) ;Release numberRelease="7" IFN ?IdId=1ENDIF ;Features;--------;-Can be compiled at any address (i.e. no need rounding ORG; address).;-Variables (VARS) can be located at any address (not only after;code block).;-INIT subroutine detects module version and rightly generates; both note and volume tables outside of code block (in VARS).;-Two portamento (spc. command 3xxx) algorithms (depending of; module version).;-New 1.XX and 2.XX special command behaviour (only for PT v3.7; and higher).;-Any Tempo value are accepted (including Tempo=1 and Tempo=2).;-Fully compatible with Ay_Emul PT3 player codes.;-See also notes at the end of this source code. ;Limitations;-----------;-Can run in RAM only (self-modified code is used). ;Warning!!! PLAY subroutine can crash if no module are loaded;into RAM or INIT subroutine was not called before. ;Call MUTE or INIT one more time to mute sound after stopping;playing ; ORG #C000 ;Test codes (commented); CALL START; EI;_LP HALT; CALL START+5; XOR A; IN A,(#FE); CPL; AND 15; JR Z,_LP; JR START+8 TonA=0TonB=2TonC=4Noise=6Mixer=7AmplA=8AmplB=9AmplC=10Env=11EnvTp=13 ;ChannelsVars; STRUCT CHP;reset groupPsInOr=0PsInSm=1CrAmSl=2CrNsSl=3CrEnSl=4TSlCnt=5CrTnSl=6TnAcc=8COnOff=10;reset group OnOffD=11 ;IX for PTDECOD here (+12)OffOnD=12OrnPtr=13SamPtr=15NNtSkp=17Note=18SlToNt=19Env_En=20Flags=21 ;Enabled - 0,SimpleGliss - 2TnSlDl=22TSlStp=23TnDelt=25NtSkCn=27Volume=28; ENDSCHP=29 ;Entry and other points;START initialization;START+3 initialization with module address in HL;START+5 play one quark;START+8 mute;START+10 setup and status flags;START+11 pointer to current position value in PT3 module;;After INIT (START+11) points to Postion0-1 (optimization) START LD HL,MDLADDR JR INIT JP PLAY JR MUTESETUP DB 0 ;set bit0 to 1, if you want to play without looping ;bit7 is set each time, when loop point is passedCrPsPtr DW 0 IFN Id;Identifier DB "=VTII PT3 Player r.",Release,"=" ENDIF CHECKLP LD HL,SETUP SET 7,(HL) BIT 0,(HL) RET Z POP HL LD HL,DelyCnt INC (HL) LD HL,ChanA+NtSkCn INC (HL)MUTE XOR A LD H,A LD L,A LD (AYREGS+AmplA),A LD (AYREGS+AmplB),HL JP ROUT_A0 INIT;HL - AddressOfModule  LD (MODADDR),HL LD (MDADDR2),HL PUSH HL LD DE,100 ADD HL,DE LD A,(HL) LD (Delay),A PUSH HL POP IX ADD HL,DE LD (CrPsPtr),HL LD E,(IX+102-100) ADD HL,DE INC HL LD (LPosPtr),HL POP DE LD L,(IX+103-100) LD H,(IX+104-100) ADD HL,DE LD (PatsPtr),HL LD HL,169 ADD HL,DE LD (OrnPtrs),HL LD HL,105 ADD HL,DE LD (SamPtrs),HL LD HL,SETUP RES 7,(HL) ;note table data depacker LD DE,T_PACK LD BC,T1_+(2*49)-1TP_0 LD A,(DE) INC DE CP 15*2 JR NC,TP_1 LD H,A LD A,(DE) LD L,A INC DE JR TP_2TP_1 PUSH DE LD D,0 LD E,A ADD HL,DE ADD HL,DE POP DETP_2 LD A,H LD (BC),A DEC BC LD A,L LD (PT3Play C���_�`�* ;Vortex Tracker II v1.0 PT3 player for ZX Spectrum ;(c)2004,2007 S.V.Bulba <vorobey@mail.khstu.ru> ;http://bulba.untergrund.net (http://bulba.at.kz) ;Release number Release="7" IFN ?Id Id=1 ENDIF ;Features ;-------- ;-Can be compiled at any address (i.e. no need rounding ORG ; address). ;-Variables (VARS) can be located at any address (not only after ;code block). ;-INIT subroutine detects module version and rightly generates ; both note and volume tables outside of code block (in VARS). ;-Two portamento (spc. command 3xxx) algorithms (depending of ; module version). ;-New 1.XX and 2.XX special command behaviour (only for PT v3.7 ; and higher). ;-Any Tempo value are accepted (including Tempo=1 and Tempo=2). ;-Fully compatible with Ay_Emul PT3 player codes. ;-See also notes at the end of this source code. ;Limitations ;----------- ;-Can run in RAM only (self-modified code is used). ;Warning!!! PLAY subroutine can crash if no module are loaded ;into RAM or INIT subroutine was not called before. ;Call MUTE or INIT one more time to mute sound after stopping ;playing ; ORG #C000 ;Test codes (commented) ; CALL START ; EI ;_LP HALT ; CALL START+5 ; XOR A ; IN A,(#FE) ; CPL ; AND 15 ; JR Z,_LP ; JR START+8 TonA=0 TonB=2 TonC=4 Noise=6 Mixer=7 AmplA=8 AmplB=9 AmplC=10 Env=11 EnvTp=13 ;ChannelsVars ; STRUCT CHP ;reset group PsInOr=0 PsInSm=1 CrAmSl=2 CrNsSl=3 CrEnSl=4 TSlCnt=5 CrTnSl=6 TnAcc=8 COnOff=10 ;reset group OnOffD=11 ;IX for PTDECOD here (+12) OffOnD=12 OrnPtr=13 SamPtr=15 NNtSkp=17 Note=18 SlToNt=19 Env_En=20 Flags=21 ;Enabled - 0,SimpleGliss - 2 TnSlDl=22 TSlStp=23 TnDelt=25 NtSkCn=27 Volume=28 ; ENDS CHP=29 ;Entry and other points ;START initialization ;START+3 initialization with module address in HL ;START+5 play one quark ;START+8 mute ;START+10 setup and status flags ;START+11 pointer to current position value in PT3 module; ;After INIT (START+11) points to Postion0-1 (optimization) START LD HL,MDLADDR JR INIT JP PLAY JR MUTE SETUP DB 0 ;set bit0 to 1, if you want to play without looping ;bit7 is set each time, when loop point is passed CrPsPtr DW 0 IFN Id ;Identifier DB "=VTII PT3 Player r.",Release,"=" ENDIF CHECKLP LD HL,SETUP SET 7,(HL) BIT 0,(HL) RET Z POP HL LD HL,DelyCnt INC (HL) LD HL,ChanA+NtSkCn INC (HL) MUTE XOR A LD H,A LD L,A LD (AYREGS+AmplA),A LD (AYREGS+AmplB),HL JP ROUT_A0 INIT ;HL - AddressOfModule LD (MODADDR),HL LD (MDADDR2),HL PUSH HL LD DE,100 ADD HL,DE LD A,(HL) LD (Delay),A PUSH HL POP IX ADD HL,DE LD (CrPsPtr),HL LD E,(IX+102-100) ADD HL,DE INC HL LD (LPosPtr),HL POP DE LD L,(IX+103-100) LD H,(IX+104-100) ADD HL,DE LD (PatsPtr),HL LD HL,169 ADD HL,DE LD (OrnPtrs),HL LD HL,105 ADD HL,DE LD (SamPtrs),HL LD HL,SETUP RES 7,(HL) ;note table data depacker LD DE,T_PACK LD BC,T1_+(2*49)-1

Navigation menu