PROGRAMMING
Many users ZX-Spectrum, who have mastered the package
programs "Animation" constantly
asked the same question.
How to connect your musical accompaniment in the derivation of
the cartoon?
For those who have a computer with
48Kb of RAM. Connection ringtones
involves great difficulties.
If multrolik take all the free space of RAM, then insert
musical accompaniment will be
impossible.
In this respect, very good
chances are users
computers with more RAM 128kb.i.
Musical accompaniment to these computers can be made to
any manufactured your cartoons, in addition you can load into
memory at once several blocks.
It will be seen as
almost osushestvit output
movie with music.
Velichutin NV
The program below will help anyone who wants to conclude
multrolika accompanied by playing music.
Limitations:
1. The presence of at least 128 kb. RAM
2. The presence of the musical process
Sor.
The program, which we now
consider, the melody is loaded
in the 4 th page of memory, but users will, of course, can use
any other page
Address the initialization of melody and
address given for playing
music editor ASM 1.12.
Note to Editors and Sound Tracker
Pro Tracker addresses should be replaced, respectively, at
49,152 and 49158. You can replace these
addresses and in the final compiled block by placing the
address initialization tunes at 25002 and the address of
playing tunes at 25,004. For example Basic'a of this can be
done typing the POKE 25002,0:
POKE 25003,192: POKE 25004,6: POKE
25005.192.
Address program start 25000.
START EQU 33150; address start
; Multrolika
BUF EQU 25344; buffer address
; Move on
; Vector transformation
; Closing the
BANK EQU 23388; syst. re
; Mennaya number
; Page RAM
ORG 25000
JR BEGIN
MISIN DEFW 49163; address INIC.
Song and
MUSIC DEFW 49166; address Player
; Closing the chalk.
BEGIN LD HL, (MUSIN)
LD (MUS1 +1), HL
LD (MUS2 +1), HL
LD HL, (MUSIC)
LD (MUS3 +1), HL
LD A, 20; connect
LD (BANK), A; 4 pages of RAM
LD BC, # 7FFD; record in
OUT (C), A; in port
MUS1 CALL 49163; initialized
; Zatsiya ME
; Lodii
LD BC, # 7FFD; connect
LD A, 16, 0 pages of RAM
LD (BANK), A
OUT (C), A
CALL IM2ON; include
; Interrupt
2-order
CALL START; launch
; Multrolika
CALL IM2OFF; include
; Interrupt
, 1 of the first kind
LD BC, # 7FFD
LD A, 20
LD (BANK), A
OUT (C), A
MUS2 CALL 49163
LD BC, # 7FFD
LD A, 16
LD (BANK), A
OUT (C), A
RET
; Handling routine PRAIRIE; VANY 2 of the first kind.
; Work of the subprogramme can be, but divided into 5 parts:
; 1.Sohranenie values on the stack
; All CPU registers
; 2.Pereklyuchenie page RAM
; 3.Proigryvanie ringtones
; 4.Pereklyuchenie page RAM
; 5.Vosstanovlenie all values
; Processor registers
OBRIM2 DI
PUSH HL
PUSH DE
PUSH BC
PUSH IX
PUSH IY
EXX
PUSH HL
PUSH DE
PUSH BC
PUSH AF
EX AF, AF '
PUSH AF
LD BC, # 7FFD; switch
LD A, 20; chenie page
OUT (C), A; RAM
PUSH BC
MUS3 CALL 49166; losing
; Of melody.
POP BC; switch
LD A, 16; chenie page
OUT (C), A; RAM
POP AF
EX AF, AF '
POP AF
POP BC
POP DE
POP HL
EXX
POP IY
POP IX
POP BC
POP DE
POP HL
EI
JP # 0038, switching to
; Cluster survey
; Viatury and
; Return
; Primary
; Program
; PROGRAMME ON interruption; equations second kind.
; In this program, initially under; be compiled buffer for the
transition, yes to interrupt vectors. ; Preparation of such a
buffer necessary, go for computers in which; ryh volatile data
bus. ; Set interrupt vector; tions to the address of the buffer.
; Since the transition will be Implemented; vlyatsya at # FFFF
then , This address is entered byte # 18
; (JR), and the relative transition
; # F3 taken from PZU.V address this, the phase transition is
stored byte # C3 ; (JP) and further address routines
; Interrupt handling.
IM2ON DI; ban prairie.
LD HL, BUF; a buffer for
LD DE, BUF +1; carry a number of
LD BC, # 0100; # FF - Address
LD (HL), # FF; move on
LDIR; vekt.preryv.
LD A, # 18; code JR
LD (# FFFF), A; to address
LD A, # C3; code JP
LD (# FFF4), A; to address
LD HL, OBRIM2; transition to
LD (# FFF5), HL; Subprogramme.
; Obr.preryv.
LD A, # 63, is established.
LD I, A; vector
; Interrupt
IM 2, includes
; Interrupt
2-order
EI
RET
; PROGRAMME ON interruption; equations first order.
IM2OFF DI
LD A, # 3F; establishes
LD I, A; Vai vector
; Interrupt
IM 1; include
; Interrupt
, 1 of the first kind
EI
RET
Sleduyushey placed on the page
code block of the program. To
use to copy the screen to prepare and compile music at
49152, and of course to make himself
multrolik.
I hope that the above
program will do multroliki bolle attractive.
*