Título: Uso de PT3Player para música en el PSG Publicado por: CBM64 en 09 de Noviembre de 2008, 06:11:25 pm Holas a todos ...
Estoy intentando programar con música en el MSX, y voy a utilizar el Vortex Tracker II para generar ficheros .PT3 de música. Lo que pasa es que quiero hacer que suenen en el MSX, he encontrado esta utilidad PT3Player de Dioniso, pero no sé como relacionar este programa con una canción .PT3. http://bulba.untergrund.net/progr_e.htm (http://bulba.untergrund.net/progr_e.htm) ;Vortex Tracker II v1.0 PT3 player for MSX ;Adapted by Alfonso D. C. aka Dioniso <dioniso072@yahoo.es> ;09-Jan-05 ;From: ;Vortex Tracker II v1.0 PT3 player for ZX Spectrum ;(c)2004 S.V.Bulba <vorobey@mail.khstu.ru> http://bulba.at.kz Llega esta parte del código, y no sé qué tengo que hacer: MDLADDR: .equ $ ;Place your song here. ¿Algún cable? De todas maneras, para hacer juegos con música, ¿voy bien encaminado? Título: Re: Uso de PT3Player para música en el PSG Publicado por: Dioniso en 09 de Noviembre de 2008, 06:29:56 pm Pues sólo tienes que incluir la canción tras la etiqueta "MDLADDR: .equ $ ;Place your song here."
Por ejemplo: INCBIN "song.pt3" Después inicializas la canción con un CALL INIT y la tocas en un loop después de un HALT con el comando CALL PLAY. Una advertencia... bueno, dos: 1-Ese código tiene un error que fue corregido. 2-Si utilizas el asMSX, alguien de por aquí ::) adaptó el código para el mismo. Si tienes algún problema, escríbeme por privado, si quieres. Un saludo. Título: Re: Uso de PT3Player para música en el PSG Publicado por: ARTRAG en 09 de Noviembre de 2008, 06:40:12 pm Hi CBM64, look here!!
http://z80st-software.blogspot.com/ Sapphire ported the PT3 player for asmsx His version is: 1) correct 2) ROM ready 3) Integrated with the ayFX player for SFX (!!!) 4) you find also his ayFX player on the same site Título: Re: Uso de PT3Player para música en el PSG Publicado por: Dioniso en 09 de Noviembre de 2008, 06:42:51 pm Bueno... a ver si no soy tan perro. Mira, éste es el código del reproductor arreglado y un poco retocado para el tniASM:
Código: 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 CHECKLP: LD HL,SETUP SET 7,(HL) BIT 0,(HL) RET Z POP HL LD HL,DelyCnt INC (HL) LD HL,ChanA+CHNPRM_NtSkCn INC (HL) MUTE: XOR A LD H,A LD L,A LD (AYREGS+AR_AmplA),A LD (AYREGS+AR_AmplB),HL JP ROUT_A0 INIT: ;HL - AddressOfModule LD DE,100 SBC HL,DE LD (MODADDR),HL LD (MDADDR2),HL PUSH HL 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) LD HL,VARS LD (HL),A LD DE,VARS+1 LD BC,VAR0END-VARS-1 LDIR INC A LD (DelyCnt),A LD HL,$F001 ;H - CHNPRM_Volume, L - CHNPRM_NtSkCn LD (ChanA+CHNPRM_NtSkCn),HL LD (ChanB+CHNPRM_NtSkCn),HL LD (ChanC+CHNPRM_NtSkCn),HL LD HL,EMPTYSAMORN LD (AdInPtA),HL ;ptr to zero LD (ChanA+CHNPRM_OrnPtr),HL ;ornament 0 is "0,1,0" LD (ChanB+CHNPRM_OrnPtr),HL ;in all versions from LD (ChanC+CHNPRM_OrnPtr),HL ;3.xx to 3.6x and VTII LD (ChanA+CHNPRM_SamPtr),HL ;S1 There is no default LD (ChanB+CHNPRM_SamPtr),HL ;S2 sample in PT3, so, you LD (ChanC+CHNPRM_SamPtr),HL ;S3 can comment S1,2,3; see ;also EMPTYSAMORN comment JP ROUT_A0 ;pattern decoder PD_OrSm: LD (IX-12+CHNPRM_Env_En),0 CALL SETORN LD A,(BC) INC BC RRCA PD_SAM: ADD A,A PD_SAM_: LD E,A LD D,0 SamPtrs: equ $+1 LD HL,$2121 ADD HL,DE LD E,(HL) INC HL LD D,(HL) MODADDR: equ $+1 LD HL,$2121 ADD HL,DE LD (IX-12+CHNPRM_SamPtr),L LD (IX-12+CHNPRM_SamPtr+1),H JR PD_LOOP PD_VOL: RLCA RLCA RLCA RLCA LD (IX-12+CHNPRM_Volume),A JR PD_LP2 PD_EOff: LD (IX-12+CHNPRM_Env_En),A LD (IX-12+CHNPRM_PsInOr),A JR PD_LP2 PD_SorE: DEC A JR NZ,PD_ENV LD A,(BC) INC BC LD (IX-12+CHNPRM_NNtSkp),A JR PD_LP2 PD_ENV: CALL SETENV JR PD_LP2 PD_ORN: CALL SETORN JR PD_LOOP PD_ESAM: LD (IX-12+CHNPRM_Env_En),A LD (IX-12+CHNPRM_PsInOr),A CALL NZ,SETENV LD A,(BC) INC BC JR PD_SAM_ PTDECOD: LD A,(IX-12+CHNPRM_Note) LD (PrNote+1),A PD_LOOP: LD DE,$2010 PD_LP2: LD A,(BC) INC BC ADD A,E JR C,PD_OrSm ADD A,D JR Z,PD_FIN JR C,PD_SAM ADD A,E JR Z,PD_REL JR C,PD_VOL ADD A,E JR Z,PD_EOff JR C,PD_SorE ADD A,96 JR C,PD_NOTE ADD A,E JR C,PD_ORN ADD A,D JR C,PD_NOIS ADD A,E JR C,PD_ESAM ADD A,A LD E,A PUSH DE LD DE,$DF20 LD HL,SPCCOMS ADD HL,DE POP DE ADD HL,DE LD E,(HL) INC HL LD D,(HL) PUSH DE JR PD_LOOP PD_NOIS: LD (Ns_Base),A JR PD_LP2 PD_REL: RES 0,(IX-12+CHNPRM_Flags) JR PD_RES PD_NOTE: LD (IX-12+CHNPRM_Note),A SET 0,(IX-12+CHNPRM_Flags) XOR A PD_RES: LD (PDSP_+1),SP LD SP,IX LD H,A LD L,A PUSH HL PUSH HL PUSH HL PUSH HL PUSH HL PUSH HL PDSP_: LD SP,$3131 PD_FIN: LD A,(IX-12+CHNPRM_NNtSkp) LD (IX-12+CHNPRM_NtSkCn),A RET C_PORTM: RES 2,(IX-12+CHNPRM_Flags) LD A,(BC) INC BC ;SKIP PRECALCULATED TONE DELTA (BECAUSE ;CANNOT BE RIGHT AFTER PT3 COMPILATION) INC BC INC BC LD (IX-12+CHNPRM_TnSlDl),A LD (IX-12+CHNPRM_TSlCnt),A LD DE,NT_ LD A,(IX-12+CHNPRM_Note) LD (IX-12+CHNPRM_SlToNt),A ADD A,A LD L,A LD H,0 ADD HL,DE LD A,(HL) INC HL LD H,(HL) LD L,A PUSH HL PrNote: LD A,$3E LD (IX-12+CHNPRM_Note),A ADD A,A LD L,A LD H,0 ADD HL,DE LD E,(HL) INC HL LD D,(HL) POP HL SBC HL,DE LD (IX-12+CHNPRM_TnDelt),L LD (IX-12+CHNPRM_TnDelt+1),H LD E,(IX-12+CHNPRM_CrTnSl) LD D,(IX-12+CHNPRM_CrTnSl+1) LD A,(BC) ;SIGNED TONE STEP INC BC EX AF,AF' LD A,(BC) INC BC AND A JR Z,NOSIG EX DE,HL NOSIG: SBC HL,DE JP P,SET_STP CPL EX AF,AF' NEG EX AF,AF' SET_STP: LD (IX-12+CHNPRM_TSlStp+1),A EX AF,AF' LD (IX-12+CHNPRM_TSlStp),A LD (IX-12+CHNPRM_COnOff),0 RET C_GLISS: SET 2,(IX-12+CHNPRM_Flags) LD A,(BC) INC BC LD (IX-12+CHNPRM_TnSlDl),A LD (IX-12+CHNPRM_TSlCnt),A LD A,(BC) INC BC EX AF,AF' LD A,(BC) INC BC JR SET_STP C_ENGLS: LD A,(BC) INC BC LD (Env_Del),A LD (CurEDel),A LD A,(BC) INC BC LD L,A LD A,(BC) INC BC LD H,A LD (ESldAdd),HL RET C_DELAY: LD A,(BC) INC BC LD (Delay),A RET SETENV: LD (IX-12+CHNPRM_Env_En),E LD (AYREGS+AR_EnvTp),A LD A,(BC) INC BC LD H,A LD A,(BC) INC BC LD L,A LD (EnvBase),HL XOR A LD (IX-12+CHNPRM_PsInOr),A LD (CurEDel),A LD H,A LD L,A LD (CurESld),HL C_NOP: RET SETORN: ADD A,A LD E,A LD D,0 LD (IX-12+CHNPRM_PsInOr),D OrnPtrs: equ $+1 LD HL,$2121 ADD HL,DE LD E,(HL) INC HL LD D,(HL) MDADDR2: equ $+1 LD HL,$2121 ADD HL,DE LD (IX-12+CHNPRM_OrnPtr),L LD (IX-12+CHNPRM_OrnPtr+1),H RET SPCCOMS: dw C_NOP dw C_GLISS dw C_PORTM dw C_NOP dw C_NOP dw C_NOP dw C_NOP dw C_NOP dw C_ENGLS dw C_DELAY CHREGS: XOR A LD (Ampl),A BIT 0,(IX+CHNPRM_Flags) PUSH HL JP Z,CH_EXIT LD (CSP_+1),SP LD L,(IX+CHNPRM_OrnPtr) LD H,(IX+CHNPRM_OrnPtr+1) LD SP,HL POP DE LD H,A LD A,(IX+CHNPRM_PsInOr) LD L,A ADD HL,SP INC A CP D JR C,CH_ORPS LD A,E CH_ORPS: LD (IX+CHNPRM_PsInOr),A LD A,(IX+CHNPRM_Note) ADD A,(HL) JP P,CH_NTP XOR A CH_NTP: CP 96 JR C,CH_NOK LD A,95 CH_NOK: ADD A,A EX AF,AF' LD L,(IX+CHNPRM_SamPtr) LD H,(IX+CHNPRM_SamPtr+1) LD SP,HL POP DE LD H,0 LD A,(IX+CHNPRM_PsInSm) LD B,A ADD A,A ADD A,A LD L,A ADD HL,SP LD SP,HL LD A,B INC A CP D JR C,CH_SMPS LD A,E CH_SMPS: LD (IX+CHNPRM_PsInSm),A POP BC POP HL LD E,(IX+CHNPRM_TnAcc) LD D,(IX+CHNPRM_TnAcc+1) ADD HL,DE BIT 6,B JR Z,CH_NOAC LD (IX+CHNPRM_TnAcc),L LD (IX+CHNPRM_TnAcc+1),H CH_NOAC: EX DE,HL EX AF,AF' LD L,A LD H,0 LD SP,NT_ ADD HL,SP LD SP,HL POP HL ADD HL,DE LD E,(IX+CHNPRM_CrTnSl) LD D,(IX+CHNPRM_CrTnSl+1) ADD HL,DE CSP_: LD SP,$3131 EX (SP),HL XOR A OR (IX+CHNPRM_TSlCnt) JR Z,CH_AMP DEC (IX+CHNPRM_TSlCnt) JR NZ,CH_AMP LD A,(IX+CHNPRM_TnSlDl) LD (IX+CHNPRM_TSlCnt),A LD L,(IX+CHNPRM_TSlStp) LD H,(IX+CHNPRM_TSlStp+1) LD A,H ADD HL,DE LD (IX+CHNPRM_CrTnSl),L LD (IX+CHNPRM_CrTnSl+1),H BIT 2,(IX+CHNPRM_Flags) JR NZ,CH_AMP LD E,(IX+CHNPRM_TnDelt) LD D,(IX+CHNPRM_TnDelt+1) AND A JR Z,CH_STPP EX DE,HL CH_STPP: SBC HL,DE JP M,CH_AMP LD A,(IX+CHNPRM_SlToNt) LD (IX+CHNPRM_Note),A XOR A LD (IX+CHNPRM_TSlCnt),A LD (IX+CHNPRM_CrTnSl),A LD (IX+CHNPRM_CrTnSl+1),A CH_AMP: LD A,(IX+CHNPRM_CrAmSl) BIT 7,C JR Z,CH_NOAM BIT 6,C JR Z,CH_AMIN CP 15 JR Z,CH_NOAM INC A JR CH_SVAM CH_AMIN: CP -15 JR Z,CH_NOAM DEC A CH_SVAM: LD (IX+CHNPRM_CrAmSl),A CH_NOAM: LD L,A LD A,B AND 15 ADD A,L JP P,CH_APOS XOR A CH_APOS: CP 16 JR C,CH_VOL LD A,15 CH_VOL: OR (IX+CHNPRM_Volume) LD L,A LD H,0 LD DE,VT_ ADD HL,DE LD A,(HL) CH_ENV: BIT 0,C JR NZ,CH_NOEN OR (IX+CHNPRM_Env_En) CH_NOEN: LD (Ampl),A BIT 7,B LD A,C JR Z,NO_ENSL RLA RLA SRA A SRA A SRA A ADD A,(IX+CHNPRM_CrEnSl) ;SEE COMMENT BELOW BIT 5,B JR Z,NO_ENAC LD (IX+CHNPRM_CrEnSl),A NO_ENAC: LD HL,AddToEn ADD A,(HL) ;BUG IN PT3 - NEED WORD HERE. ;FIX IT IN NEXT VERSION? LD (HL),A JR CH_MIX NO_ENSL: RRA ADD A,(IX+CHNPRM_CrNsSl) LD (AddToNs),A BIT 5,B JR Z,CH_MIX LD (IX+CHNPRM_CrNsSl),A CH_MIX: LD A,B RRA AND $48 CH_EXIT: LD HL,AYREGS+AR_Mixer OR (HL) RRCA OR %10000000 AND %10111111 LD (HL),A POP HL XOR A OR (IX+CHNPRM_COnOff) RET Z DEC (IX+CHNPRM_COnOff) RET NZ XOR (IX+CHNPRM_Flags) LD (IX+CHNPRM_Flags),A RRA LD A,(IX+CHNPRM_OnOffD) JR C,CH_ONDL LD A,(IX+CHNPRM_OffOnD) CH_ONDL: LD (IX+CHNPRM_COnOff),A RET PLAY: XOR A LD (AddToEn),A LD (AYREGS+AR_Mixer),A DEC A LD (AYREGS+AR_EnvTp),A LD HL,DelyCnt DEC (HL) JR NZ,PL2 LD HL,ChanA+CHNPRM_NtSkCn DEC (HL) JR NZ,PL1B AdInPtA: equ $+1 LD BC,$0101 LD A,(BC) AND A JR NZ,PL1A LD D,A LD (Ns_Base),A LD HL,(CrPsPtr) INC HL LD A,(HL) INC A JR NZ,PLNLP CALL CHECKLP LPosPtr: equ $+1 LD HL,$2121 LD A,(HL) INC A PLNLP: LD (CrPsPtr),HL DEC A ADD A,A LD E,A RL D PatsPtr: equ $+1 LD HL,$2121 ADD HL,DE LD DE,(MODADDR) LD (PSP_+1),SP LD SP,HL POP HL ADD HL,DE LD B,H LD C,L POP HL ADD HL,DE LD (AdInPtB),HL POP HL ADD HL,DE LD (AdInPtC),HL PSP_: LD SP,$3131 PL1A: LD IX,ChanA+12 CALL PTDECOD LD (AdInPtA),BC PL1B: LD HL,ChanB+CHNPRM_NtSkCn DEC (HL) JR NZ,PL1C LD IX,ChanB+12 AdInPtB: equ $+1 LD BC,$0101 CALL PTDECOD LD (AdInPtB),BC PL1C: LD HL,ChanC+CHNPRM_NtSkCn DEC (HL) JR NZ,PL1D LD IX,ChanC+12 AdInPtC: equ $+1 LD BC,$0101 CALL PTDECOD LD (AdInPtC),BC Delay: equ $+1 PL1D: LD A,$3E LD (DelyCnt),A PL2: LD IX,ChanA LD HL,(AYREGS+AR_TonA) CALL CHREGS LD (AYREGS+AR_TonA),HL LD A,(Ampl) LD (AYREGS+AR_AmplA),A LD IX,ChanB LD HL,(AYREGS+AR_TonB) CALL CHREGS LD (AYREGS+AR_TonB),HL LD A,(Ampl) LD (AYREGS+AR_AmplB),A LD IX,ChanC LD HL,(AYREGS+AR_TonC) CALL CHREGS ; LD A,(Ampl) ;Ampl = AYREGS+AR_AmplC ; LD (AYREGS+AR_AmplC),A LD (AYREGS+AR_TonC),HL LD HL,(Ns_Base_AddToNs) LD A,H ADD A,L LD (AYREGS+AR_Noise),A AddToEn: equ $+1 LD A,$3E LD E,A ADD A,A SBC A,A LD D,A LD HL,(EnvBase) ADD HL,DE LD DE,(CurESld) ADD HL,DE LD (AYREGS+AR_Env),HL XOR A LD HL,CurEDel OR (HL) JR Z,ROUT_A0 DEC (HL) JR NZ,ROUT Env_Del: equ $+1 LD A,$3E LD (HL),A ESldAdd: equ $+1 LD HL,$2121 ADD HL,DE LD (CurESld),HL ROUT: XOR A ROUT_A0: LD C,$A0 LD HL,AYREGS LOUT: OUT (C),A INC C OUTI DEC C INC A CP 13 JR NZ,LOUT OUT (C),A LD A,(HL) AND A RET M INC C OUT (C),A RET DB 0 EMPTYSAMORN: EQU $-1 DB 1,0,$90 ;delete $90 if you don't need default sample ;vars from here can be stripped ;you can move VARS to any other address VARS: ;ChannelsVars ;struc CHNPRM ;reset group CHNPRM_PsInOr: equ 0 ;RESB 1 CHNPRM_PsInSm: equ 1 ;RESB 1 CHNPRM_CrAmSl: equ 2 ;RESB 1 CHNPRM_CrNsSl: equ 3 ;RESB 1 CHNPRM_CrEnSl: equ 4 ;RESB 1 CHNPRM_TSlCnt: equ 5 ;RESB 1 CHNPRM_CrTnSl: equ 6 ;RESW 1 CHNPRM_TnAcc: equ 8 ;RESW 1 CHNPRM_COnOff: equ 10 ;RESB 1 ;reset group CHNPRM_OnOffD: equ 11 ;RESB 1 ;IX for PTDECOD here (+12) CHNPRM_OffOnD: equ 12 ;RESB 1 CHNPRM_OrnPtr: equ 13 ;RESW 1 CHNPRM_SamPtr: equ 15 ;RESW 1 CHNPRM_NNtSkp: equ 17 ;RESB 1 CHNPRM_Note: equ 18 ;RESB 1 CHNPRM_SlToNt: equ 19 ;RESB 1 CHNPRM_Env_En: equ 20 ;RESB 1 CHNPRM_Flags: equ 21 ;RESB 1 ;Enabled - 0,SimpleGliss - 2 CHNPRM_TnSlDl: equ 22 ;RESB 1 CHNPRM_TSlStp: equ 23 ;RESW 1 CHNPRM_TnDelt: equ 25 ;RESW 1 CHNPRM_NtSkCn: equ 27 ;RESB 1 CHNPRM_Volume: equ 28 ;RESB 1 CHNPRM_Size: equ 29 ;RESB 1 ;endstruc ChanA: ds CHNPRM_Size ChanB: ds CHNPRM_Size ChanC: ds CHNPRM_Size ;struc AR AR_TonA: equ 0 ;RESW 1 AR_TonB: equ 2 ;RESW 1 AR_TonC: equ 4 ;RESW 1 AR_Noise: equ 6 ;RESB 1 AR_Mixer: equ 7 ;RESB 1 AR_AmplA: equ 8 ;RESB 1 AR_AmplB: equ 9 ;RESB 1 AR_AmplC: equ 10 ;RESB 1 AR_Env: equ 11 ;RESW 1 AR_EnvTp: equ 13 ;RESB 1 ;endstruc ;GlobalVars DelyCnt: db 0 CurESld: dw 0 CurEDel: db 0 Ns_Base_AddToNs: Ns_Base: db 0 AddToNs: db 0 AYREGS: VT_: ;Volume Table db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01 db $00,$00,$00,$00,$01,$01,$01,$01,$01,$01,$01,$01,$02,$02,$02,$02 db $00,$00,$00,$01,$01,$01,$01,$01,$02,$02,$02,$02,$02,$03,$03,$03 db $00,$00,$01,$01,$01,$01,$02,$02,$02,$02,$03,$03,$03,$03,$04,$04 db $00,$00,$01,$01,$01,$02,$02,$02,$03,$03,$03,$04,$04,$04,$05,$05 db $00,$00,$01,$01,$02,$02,$02,$03,$03,$04,$04,$04,$05,$05,$06,$06 db $00,$00,$01,$01,$02,$02,$03,$03,$04,$04,$05,$05,$06,$06,$07,$07 db $00,$01,$01,$02,$02,$03,$03,$04,$04,$05,$05,$06,$06,$07,$07,$08 db $00,$01,$01,$02,$02,$03,$04,$04,$05,$05,$06,$07,$07,$08,$08,$09 db $00,$01,$01,$02,$03,$03,$04,$05,$05,$06,$07,$07,$08,$09,$09,$0A db $00,$01,$01,$02,$03,$04,$04,$05,$06,$07,$07,$08,$09,$0A,$0A,$0B db $00,$01,$02,$02,$03,$04,$05,$06,$06,$07,$08,$09,$0A,$0A,$0B,$0C db $00,$01,$02,$03,$03,$04,$05,$06,$07,$08,$09,$0A,$0A,$0B,$0C,$0D db $00,$01,$02,$03,$04,$05,$06,$07,$07,$08,$09,$0A,$0B,$0C,$0D,$0E db $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0A,$0B,$0C,$0D,$0E,$0F EnvBase: equ VT_+14 NT_: ;Note Table (2) dw $0D10,$0C55,$0BA4,$0AFC,$0A5F,$09CA,$093D,$08B8,$083B,$07C5,$0755,$06EC dw $0688,$062A,$05D2,$057E,$052F,$04E5,$049E,$045C,$041D,$03E2,$03AB,$0376 dw $0344,$0315,$02E9,$02BF,$0298,$0272,$024F,$022E,$020F,$01F1,$01D5,$01BB dw $01A2,$018B,$0174,$0160,$014C,$0139,$0128,$0117,$0107,$00F9,$00EB,$00DD dw $00D1,$00C5,$00BA,$00B0,$00A6,$009D,$0094,$008C,$0084,$007C,$0075,$006F dw $0069,$0063,$005D,$0058,$0053,$004E,$004A,$0046,$0042,$003E,$003B,$0037 dw $0034,$0031,$002F,$002C,$0029,$0027,$0025,$0023,$0021,$001F,$001D,$001C dw $001A,$0019,$0017,$0016,$0015,$0014,$0012,$0011,$0010,$000F,$000E,$000D ;local var Ampl: equ AYREGS+AR_AmplC VAR0END: equ VT_+16 ;INIT zeroes from VARS to VAR0END-1 VARSEND: equ $ MDLADDR: equ $ ;Place your song here. Como verás, esta optimizado para la tabla 2 de notas (frecuencias), que es la que tienes por defecto. Si has compuesto la canción en el Vortex Tracker II con otra tabla, tendrás que cambiarla en el reproductor. Las 4 tablas posibles son: Código: NT_: ;Note Table (0) dw $0C22,$0B73,$0ACF,$0A33,$09A1,$0917,$0894,$0819,$07A4,$0737,$06CF,$066D dw $0611,$05BA,$0567,$051A,$04D0,$048B,$044A,$040C,$03D2,$039B,$0367,$0337 dw $0308,$02DD,$02B4,$028D,$0268,$0246,$0225,$0206,$01E9,$01CE,$01B4,$019B dw $0184,$016E,$015A,$0146,$0134,$0123,$0112,$0103,$00F5,$00E7,$00DA,$00CE dw $00C2,$00B7,$00AD,$00A3,$009A,$0091,$0089,$0082,$007A,$0073,$006D,$0067 dw $0061,$005C,$0056,$0052,$004D,$0049,$0045,$0041,$003D,$003A,$0036,$0033 dw $0031,$002E,$002B,$0029,$0027,$0024,$0022,$0020,$001F,$001D,$001B,$001A dw $0018,$0017,$0016,$0014,$0013,$0012,$0011,$0010,$000F,$000E,$000D,$000C NT_: ;Note Table (1) dw $0EF8,$0E10,$0D60,$0C80,$0BD8,$0B28,$0A88,$09F0,$0960,$08E0,$0858,$07E0 dw $077C,$0708,$06B0,$0640,$05EC,$0594,$0544,$04F8,$04B0,$0470,$042C,$03FD dw $03BE,$0384,$0358,$0320,$02F6,$02CA,$02A2,$027C,$0258,$0238,$0216,$01F8 dw $01DF,$01C2,$01AC,$0190,$017B,$0165,$0151,$013E,$012C,$011C,$010A,$00FC dw $00EF,$00E1,$00D6,$00C8,$00BD,$00B2,$00A8,$009F,$0096,$008E,$0085,$007E dw $0077,$0070,$006B,$0064,$005E,$0059,$0054,$004F,$004B,$0047,$0042,$003F dw $003B,$0038,$0035,$0032,$002F,$002C,$002A,$0027,$0025,$0023,$0021,$001F dw $001D,$001C,$001A,$0019,$0017,$0016,$0015,$0013,$0012,$0011,$0010,$000F NT_: ;Note Table (2) dw $0D10,$0C55,$0BA4,$0AFC,$0A5F,$09CA,$093D,$08B8,$083B,$07C5,$0755,$06EC dw $0688,$062A,$05D2,$057E,$052F,$04E5,$049E,$045C,$041D,$03E2,$03AB,$0376 dw $0344,$0315,$02E9,$02BF,$0298,$0272,$024F,$022E,$020F,$01F1,$01D5,$01BB dw $01A2,$018B,$0174,$0160,$014C,$0139,$0128,$0117,$0107,$00F9,$00EB,$00DD dw $00D1,$00C5,$00BA,$00B0,$00A6,$009D,$0094,$008C,$0084,$007C,$0075,$006F dw $0069,$0063,$005D,$0058,$0053,$004E,$004A,$0046,$0042,$003E,$003B,$0037 dw $0034,$0031,$002F,$002C,$0029,$0027,$0025,$0023,$0021,$001F,$001D,$001C dw $001A,$0019,$0017,$0016,$0015,$0014,$0012,$0011,$0010,$000F,$000E,$000D NT_: ;Note Table (3) dw $0CDA,$0C22,$0B73,$0ACF,$0A33,$09A1,$0917,$0894,$0819,$07A4,$0737,$06CF dw $066D,$0611,$05BA,$0567,$051A,$04D0,$048B,$044A,$040C,$03D2,$039B,$0367 dw $0337,$0308,$02DD,$02B4,$028D,$0268,$0246,$0225,$0206,$01E9,$01CE,$01B4 dw $019B,$0184,$016E,$015A,$0146,$0134,$0123,$0112,$0103,$00F5,$00E7,$00DA dw $00CE,$00C2,$00B7,$00AD,$00A3,$009A,$0091,$0089,$0082,$007A,$0073,$006D dw $0067,$0061,$005C,$0056,$0052,$004D,$0049,$0045,$0041,$003D,$003A,$0036 dw $0033,$0031,$002E,$002B,$0029,$0027,$0024,$0022,$0020,$001F,$001D,$001B dw $001A,$0018,$0017,$0016,$0014,$0013,$0012,$0011,$0010,$000F,$000E,$000D Al darle a publicar he visto que alguien ya te ha indicado el link al código de Sapphire. De todos modos te pongo éste también, que sólo se ejecuta desde RAM. Título: Re: Uso de PT3Player para música en el PSG Publicado por: CBM64 en 09 de Noviembre de 2008, 06:47:06 pm Gracias amigos !!!
Thank you folks !!! Título: Re: Uso de PT3Player para música en el PSG Publicado por: SapphiRe_MSX en 09 de Noviembre de 2008, 10:58:59 pm Thanks AR for the links ;) ;)
2) ROM ready Actually the one who adapted the self-modify code to use the replayer in a ROM was MSX-Kun as I state on the asm file (ROM part). I only ported the code to asMSX, did some changes to minimize the size of the code and made it publicily available. Citar 3) Integrated with the ayFX player for SFX (!!!) 4) you find also his ayFX player on the same site The ayFX replayer you can find on my blog was coded from 0 by me, after a little research on the ayFX sound format. The idea is to use this sound replayer with the PT3 replayer or another music replayer that changes every frame the AY registers. |