Hola! amaweks
I have tested on the Speccy simulator with a ZX48K machine and the AY8910 PSG chip. It worked. I hope it does on your hardware. Good luck.
Aquí lo tienes:
Instalación:
Debes descomprimir el archivo
ZX48AY.rar (374.69 KB) en tu directorio Suite ZX.
ZX48AY Creará para ti lo siguiente:
Crea las carpetas Assembly, Sound y Tools con todo lo necesario para que esto funcione.
Crea un nuevo Build.bat y reserva la copia del original.
Instrucciones:
Crea tus músicas con Vortex Tracker para conseguir guardarlas en formato pt3. Llámalas music01.pt3 music02.pt3 y así sucesívamente.
Guárdalas en el directorio Sound que hemos creado.
Edita el archivo PlayerZX48KAY.asm con cuidado para des comentar o añadir código en las tres secciones que te indico a continuación:
Primera sección:
;-------Selected_Multisong_Check-------
cp 1
call z,Set_Tune1_Address
cp 2
call z,Set_Tune2_Address
;
cp 3
;
call z,Set_Tune3_Address
;...etc
Por cada música (N=1,2,3,…) que quieras incluir en tu juego deberás añadir este patrón:
Cp N
Call z,Set_TuneN_Address
Segunda sección:
;-------Selected_Multisong_Set-------
Set_Tune1_Address:
ld hl,Tune1_Address
ret
Set_Tune2_Address:
ld hl,Tune2_Address
ret
;
Set_Tune3_Address:
;
ld hl,Tune3_Address
;
ret
;...etc
De la misma manera, por cada patón añadido anteriormente (N=1,2,3,…) debes añadir también este otro:
Set_TuneN_Address:
ld hl,TuneN_Address
ret
Tercera sección:
;-------Selected_Multisong_Address------
Music_Start_Addres:
Tune1_Address:
incbin "../Sound/Music01.pt3"
Tune2_Address:
incbin "../Sound/Music02.pt3"
;Tune3_Address:
;
incbin "../Sound/Music03.pt3"
;...etc
Por último, completa el tercer pedazo de código para completar las otras dos piezas y que todo funcione:
TuneN_Address:
incbin "../Sound/Music0N.pt3"
(Nota: si N=5 entonces: TuneN_Address se convierte en Tune5_Address)
Edita tu juego en tu evento favorito así:
Música en bucle infinito:
sound 1 ; PLAY SONG 1, pro defecto se reproduce en bucle infinito (Loop ON)
Música una sola vez:
sound 1 ; PLAY SONG 1, pro defecto se reproduce en bucle infinito (Loop ON)
sound 0 ; Turn Loop Off
Música parando el juego (por ejemplo: Death song):
sound 1 ; PLAY SONG 1, pro defecto se reproduce en bucle infinito (Loop ON)
sound 0 ; Turn Loop Off
Sound 36 ; monitor: A=1 mientras la música está sonando.
WHILE A = 1
DELAY 2 ; sincronización
SOUND 96 ; play next note
Sound 36 ; monitor
ENDWHILE
Parar la música:
SOUND 18 ; stop the player
Música en el menú de inicio. Caso especial por que no hay Sincronización en juego:(Ejemplo Gezzer)
EVENT INTROMENU
INK 15
PAPER 0
CLS
AT 4 9
LET CONTROL = 99
WHILE CONTROL >= 99
CLS
AT 5 9
PRINTMODE 1
PRINT "DIAMOND GEEZER"
PRINTMODE 0
AT 9 10
PRINT "1. KEYBOARD"
AT 11 10
PRINT "2. KEMPSTON"
AT 13 10
PRINT "3. SINCLAIR"
LET CONTROL = 99
SOUND 1 ; play music 1
WHILE CONTROL = 99
DELAY 2 ; NECESARIO PARA VSYNC UNICAMENTE EN MENU DE INICIO
SOUND 96 ; PLAY NEXT NOTE
IF KEY OPTION1
LET CONTROL = 0
ENDIF
IF KEY OPTION2
LET CONTROL = 1
ENDIF
IF KEY OPTION3
LET CONTROL = 2
ENDIF
ENDWHILE
SOUND 18 ; stop the player
ENDWHILE
CLS
Here it is:
Installing:
You must unzip the file
ZX48AY.rar (374.69 KB) in your ZX Suite directory.
ZX48AY will create for you the following:
Create the Assembly, Sound and Tools folders with everything you need to make this work.
Create a new Build.bat and reserve the copy of the original.
Instructions:
Create your music with Vortex Tracker to save them in pt3 format.
Save them in the Sound directory that we have created. Call them music01.pt3 music02.pt3 and so on.
Edit the PlayerZX48KAY.asm file carefully to uncomment or add code in the three sections below:
First section:
;-------Selected_Multisong_Check-------
cp 1
call z,Set_Tune1_Address
cp 2
call z,Set_Tune2_Address
;
cp 3
;
call z,Set_Tune3_Address
;...etc
For each music (N=1,2,3,…) that you want to include in your game you must add this pattern:
Cp N
Call z,Set_TuneN_Address
Second section:
;-------Selected_Multisong_Set-------
Set_Tune1_Address:
ld hl,Tune1_Address
ret
Set_Tune2_Address:
ld hl,Tune2_Address
ret
;Set_Tune3_Address:
;
ld hl,Tune3_Address
;
ret
;...etc
In the same way, for each pattern previously added (N=1,2,3,...) you must also add this other:
Set_TuneN_Address:
ld hl,TuneN_Address
ret
Third section:
;-------Selected_Multisong_Address------
Music_Start_Addres:
Tune1_Address:
incbin "../Sound/Music01.pt3"
Tune2_Address:
incbin "../Sound/Music02.pt3"
;Tune3_Address:
;
incbin "../Sound/Music03.pt3"
;...etc
Finally, complete the third piece of code to complete the other two pieces and get things working:
TuneN_Address:
incbin "../Sound/Music0N.pt3"
(Note: if N=5 then: TuneN_Address becomes Tune5_Address)
Edit your game in your favorite event like so:
Infinite loop music:
sound 1 ; PLAY SONG 1, by default it plays in infinite loop (Loop ON)
Music one time:
sound 1 ; PLAY SONG 1, by default it plays in infinite loop (Loop ON)
sound 0 ; Turn Loop Off
Music stopping the game (for example: Death song):
sound 1 ; PLAY SONG 1, by default it plays in infinite loop (Loop ON)
sound 0 ; Turn Loop Off
Sound 36 ; monitor: A=1 while music is playing.
WHILE A = 1
DELAY 2 ; sincronización
SOUND 96 ; play next note
Sound 36 ; monitor
ENDWHILE
Stop the music:
SOUND 18 ; stop the player
Music in the start menu. Special case because there is no Synchronization in play:(Gezzer sample)
EVENT INTROMENU
INK 15
PAPER 0
CLS
AT 4 9
LET CONTROL = 99
WHILE CONTROL >= 99
CLS
AT 5 9
PRINTMODE 1
PRINT "DIAMOND GEEZER"
PRINTMODE 0
AT 9 10
PRINT "1. KEYBOARD"
AT 11 10
PRINT "2. KEMPSTON"
AT 13 10
PRINT "3. SINCLAIR"
LET CONTROL = 99
SOUND 1 ; play music 1
WHILE CONTROL = 99
DELAY 2 ; NECESARIO PARA VSYNC UNICAMENTE EN MENU DE INICIO
SOUND 96 ; PLAY NEXT NOTE
IF KEY OPTION1
LET CONTROL = 0
ENDIF
IF KEY OPTION2
LET CONTROL = 1
ENDIF
IF KEY OPTION3
LET CONTROL = 2
ENDIF
ENDWHILE
SOUND 18 ; stop the player
ENDWHILE
CLS