Adventurer #09
30 апреля 1999
  Железо  

Iron - Sound card with direct access to: DMA Sound Card (description schemes and programming).

<b>Iron</b> - Sound card with direct access to: DMA Sound Card (description schemes and programming).
     (C) Inozemtsev A. aka Stranger

     (C) David Willis (add)



     SOUND CARD WITH DIRECT ACCESS



     Before you offer your
the attention of the author's description text, I want to
immediately noticed that the proposed development is not a 
regular fantasy, and already exists in many copies and

sufficiently supported by the software. So
anyone who wants to build himself a musical card that exceeds 
the capabilities of General Sound, and the proposed next 
article. In the best position are the owners of the 
Pentagon-512 - for they have a complete description of the 
assembly, setting up and connecting. To connect to

other models of the Spectrum to little to understand the 
organization of memory your computer.




     A bit of history.



     Long ago, when the land is still walking the pioneers (and 
Komsomol), when the ultimate dream musician was electric and 
when the computer just published their first squeaks, even then 
there were people who are thinking: "Why not

get the computer to play some
melody? ". ... And made since
computer (under the "computer music"
often involve the entire synth music, but here refers only to 
the music performed on a computer without external 
synthesizers, MIDI, etc.) became invariable attribute of games 
and demonstrations. As someone said of the great "good music is 
able to raise a trivial program to the level of an 
extraordinary and excellent to the level of sensational. "With 
the development of computers and improved techniques

sound. And here there have been two
basic method.

     The first method - FM-synthesis has its
beginning of the first "spikernyh" muzychek. In
through it - the addition of several oscillations of various 
forms and frequencies. Here than more folded frequencies 
(elementary oscillators), the closer to the natural sound. In 
professional synthesizers using a 32 or more oscillator per 
voice. Naturally, such a thing is worth a lot money, and 
therefore in sound cards are usually used from 1 to 4 
oscillators. For example AY8910/12 uses a 3 oscillator 
rectangular envelope + sawtooth or triangular shape. In 
addition, in many sound cards there a set of "tools", ie,

frequency table for adding recorded in
ROM cards, which often sound
This card is limited. Such, for example, Adlib / Sound Blaster 
for PC or SEGA Genesis / Megadrive. Advantages

This method of synthesis are small amounts of memory for music 
and data flow, but a set of sounds is very limited. Therefore, 
this method is increasingly supplanted by a different method 
sampling. 

     The second method is based on playing
advance the digitization of sounds (sample'ov).
It requires much more memory, but
but access to any sounds. The main options here - bit digital 
to analog converters (DAC), the number of channels, sampling 
frequency. Standard de-facto standard for such cards is AMIGA.

It includes four eight-channel
sampling rate of 3. 54 MHz. Except
addition, the volume of each channel can
programmatically set from 0 to 64 arb.
units. SoundBlaster / PC and SEGA have an eight-bit channel 
with a sampling rate to 44 kHz, and are therefore used mainly 
for playing digitization effects in games. The best options is 
GUS / PC. It has 2 shestnadtsatibitnyh channel with 44 kHz and

own processor and memory on the motherboard.
All of the above devices are
active, ie, does not require CPU time. In addition, there
mass of passive devices such as Covox, etc.
e. DAC on any port. Here to talk about some parameters does not 
make sense, since the sound of a "map" depends heavily on CPU 
performance, the type of mixing, stability, sampling, 
programming environments, etc., etc. n.


     And what about the ZX SPECTRUM? So far we have
witnessing sluggish process of connecting
Covox 's, which are unlikely to satisfy
computer fans sound. Truth in St. Petersburg designed sound 
card General Sound. I'm not in any way want to offend

developers of this card, but option 4
eight-channel sampling rate of 37. 5 kHz hardly could plunge
amizhnikov into a trance, and pisishnikov in shock. Not
argue, the sound can be good, but
Amiga, as we see, far away. The advantages of this
card is complete independence from
Spectrum, but multiplied
requirements for embedded software, which is completely 
available for either study, nor to change the programmer. Thus, 
we see the typical approach to pisishny sound of "here's a" 
black box ", the game under He has what you want? ". However,

yet rarely any borrowing from the PC
was a success on the Spectrum (remember the IS-DOS
or CGA-like video modes).

     Therefore, one of the main objectives of this
development is the maximum approximation to the equipment 
AMIGA, as a standard for digital audio. We describe in more 
detail how the Amiga playing sound. Data for each channel are 
transferred directly accessible from memory. Discrete sampling 
is 0. 28 microseconds (which corresponds to frequency 3. 54 
MHz). Array passed to data can have a length of 2 bytes to 128

kb, in addition, the transfer of an array can
to be fixated with arbitrary place. All
channels are completely independent. To play music is used to 
interrupt frequency of 13 to 102 Hz, during which the selected 
music, reprogrammed channels, etc.


     As you can see for normal music playback requires DMA
memory access (DMA) and interrupt controller. Unfortunately, 
neither one nor the other in Spectrum no. Therefore, the author 
proposes another device. Its main purpose - to play a 4-channel

8-bit music. Those who are interested in
other options - see
"Perspectives."


     Description.


     The device consists of 3 functional blocks: the controller 
of DMA, interrupt controller, the unit DAC. Device has 4 
independent 8-bit sound channel direct memory access. Each

channel has a 6-bit volume control. Discreteness of the sample 
on channel 0. 28 ms (3. 5 MHz). This is slightly different

by Amiga (3. 54 MHz), but on this Amiga
value is not constant, but depends on the type of
VPU (PAL or NTSC), and secondly, the difference is about 1%. 
Direct access is carried out in all the memory, which is in the 
Spectrum (128, 256, 512, 1024 kb), and does not depend on the 
port configuration, the maximum length of the transmitted an 
array of 64K. Interrupt controller handles interrupt four 
types: the end of the cycle of direct access, two independent 
timer interrupts and a standard HR interrupt. Each type of 
interrupt is identified by a bit in the interrupt vector, each 
type of interruption in the including recruiting, may be 
disguised in a mask register. To reset the line access and all 
interrupts, except for personnel, prohibited.


     Decoder port is made on DD1,
DD2. Signals CSD, CST1, CST2, CSP and CSI
choose the controller DMA, 1st timer, 2nd
timer register banks DMA and interrupt mask register. Signals 
CSV1-CSV4 selected registers the volume of channels. 

     Controller direct access DD6 generates the necessary 
signals to request bus issuance 16ti bits addresses and sample

external device. DD3 off signals RD and WR from the DMA 
controller and in association with a DD4.1 signal MREQ forms in 
the cycle direct access. Permission to address the issue

direct access points to signal AEN
(Adress ENabled).

     DD7 switches the address lines for
In order to move the port addresses, and DMA controller to 
provide addressability through port with a fixed lower half

address.

     Register banks made on DD8.1,
DD8.4 and DD9. We explain the terminology: usually the memory 
bank and memory page is treated as equivalent concepts. 
However, we consider these concepts a little differently. Page 
includes conventional memory page ZX128, but the bank will be 
called four consecutive reaching the memory page starting with 
the one number is divisible by 4m. Since the 0-th bank

consists of # 10, # 11, # 12 and # 13 pages
Third of # 54, # 55, # 56 and # 57, etc. (Pages given to the 
Pentagon-512, for machines with two ports of the memory 
management facilities pages will be specified differently, but

the general principle remains the same). For each DMA channel 
memory bank specified independently. 

     Programmable timers, DD10, DD11
generates, you must specify the frequency for
request channel DMA (Channels 1 and 2) and interrupt (channel 
3). All channels operate in 2-m mode (frequency divider).


     DD12 generates recording signals bytes
Data in the DAC register in a cycle of direct access. Software 
DAC register is not available. 

     Buffer register remains DD13
upper half DMA address at the beginning of the cycle and then 
issue it to the address bus. Note that the signals A14 ', A15 
'is not in a Z80, and the multiplexers RAM. 

     DD14 generates DMA request signal
necessary duration. Because a signal
DRQ is necessary to maintain active until
confirm the occurrence of a signal DACK, and
DD10, DD11 form the pulse 0. 28 microseconds.

     Due to the fact that K1810VT37 autoload (unlike AMIGA) 
possible only the base address, ie, it is impossible to loop a 
sample of arbitrary addresses, so the sample is used for 
looping the end of the vector interrupt transmission of DMA. 

     Interrupt controller is assembled on DD5.
6, DD8.2-3, DD4.1-3, DD15-DD19. DD18
is interrupt mask register. It allows software to allow or 
prohibit certain types of interruptions. DD16 - Register

interrupt vector. Interrupting device resets the corresponding 
bits later in the cycle interrupt confirmation

DD17 issues on the data bus interrupt vector, the four most 
significant bits which are set or reset depending on what 
devices are put in a request interrupts. Such a decision would 
do without hardware control priorities. All interrupts have 
equal priority, and while the parish and two more interruptions 
changing the interrupt vector (see Programming). After 
confirmation of the vector interrupt register is cleared (set 
to 1). 

     The trigger is used to query DD15.2
storage interrupt request. If at the time of arrival interrupt 
any source of interrupt processing in the processor is 
prohibited (using DI), the trigger request is reset to 0 and 
is, so long as the processor is not allowed to interrupt 
processing (using EI), and only in the loop interrupt 
confirmation again set to 1. This is necessary in order to 
avoid skip interrupts that come in

when their treatment is prohibited
(DI). Moreover, if during the period of prohibition
it's two different interrupts (both optional), then the program 
is will look like two types of interruption came at the same 
time immediately after the EI. All this does not apply to 
personnel (standard) termination, which has the same duration, 
phase, etc. before. If any type of interrupt is masked in the 
mask register, then He completely ignored.



     Programming.



     All ports of the device are younger
byte of address # 77. High bytes of address are:

     Controller DMA - # 0C, # 1C, # 2C, # 3C,

                      # 4C, # 5C, # 6C, # 7C,

                      # 8C, # 9C, # AC, # BC,

                      # CC, # DC, # EC, # FC

     First timer - # 3D, # 7D, # BD, # FD

     Second timer - # 3E, # 7E, # BE, # FE

     Banks Channel - # 07, # 17, # 27, # 37

     Volume channel # 3F, # 7F, # BF, # FF

     Mask interrupt - # F7


     To work with sound controller must be programmed in a 
single mode of transmission, the priority of channels can be 
both simple and cyclical. 

     Timers set the sampling rate of the DMA channels and 
interrupts. Channels 1 and 2 timers clocked at 3. 5 MHz, and 
channel 3 at 1. 75MGts. Channels 1 and 2 of the first timer, 
set the frequency at 1 and 2 channel DMA, channels 1 and 2 
second timer determine the frequency at 3 and 4 channel DMA. All

Channels timers must work in the second
mode.

     Registers banks establish bank
memory, which will be shared. Registers banks contains 
significant bits page number, the younger two bits are direct 
access URLs. For example, need to pass an array, which is # 16 
page address # d8e7. The younger two bits of a page number% 10, 
for DMA address it will be two high-order bits.

Thus, we obtain bank DMA # 01 address
# 98e7. Fig. 1 illustrates the transformation
page number in the address and phone number of the bank for
Pentagon-512 and Profit 1024:



     Pentagon-512


     # 7ffd Address

7 6 5 4 3 2 1 0 f e d c b a 9 August .... 0



     3 2 1 0 f e d c b a 9 August .... 0


       Bank Address



     Profi-1024

 # Dffd # 7ffd Address

2 1 0 7 6 5 4 3 2 1 0 f e d c b a. 0

                                    .

                                     .

                                     .

                                     .

                                     .

            3 2 1 0 f e d c b a. 0


             Bank Address


     Fig. Converting a paging
address in the address of DMA


     The array can not cross the border
4 pages, ie, it can be in
# 10, # 11, # 12, # 13 pages, but can not
located at # 13 and # 14 page, such
arrays must be passed over twice, using an interrupt end 
transmission or align along the boundary of 4 pages.


     Registers the volume of channels set the volume in the 
range from 0 (complete no sound) to 63 (maximum

volume). Registers have the volume capacity of 6 bits, so the 
value 64 is equal to 0 in contrast to the Amiga, where 64 - the 
maximum volume. 

     Interrupt controller in the loop verification issues the 
interrupt vector which indicates which device sent interrupt 
request. Interrupt vector has the following structure:


     Bit 7 - set to 1 if
it is recruiting an interrupt, otherwise
If cleared;

     Bit 6 - reset to 0 if it is interrupted by a 2-second 
timer, otherwise it is set; 

     bit 5 - set to 0 if it is interrupted by a second timer, 
otherwise it is set; 

     Bit 4 - resets to 0 if it is interrupted the transfer is 
to kakomlibo channel DMA, otherwise installed. In order to 
determine which channel has completed the transfer, you must 
read the status register controller DMA; 

     Bits 3 - 0 is always set to 1.

     If you arrive at the same time several
interrupt, then a few bits are set properly, regardless. For 
example: 

     # FF - HR interruption;

     # 3F - interrupt 2-second timer;

     # 5F - interrupt 1 timer;

     # 6F - interrupt the end of the transfer;

     # BF - HR interrupt and 2-nd
timer;

     # EF - HR interrupt and interrupts the transmission end, 
etc. A vector # 7F does not correspond to any device, but

experience has shown that the average time in
Five minutes is a vector "slips" and
it is also necessary to handle it. It corresponds to the 
termination of personnel, which comes at a command EI.


     Mask register can mask
certain types of interrupts. The layout of bits is as follows:

 7 6 5 4 3 2 1 0

x x x x 0 1 1 1


                     enables interrupt

                     end of transmission;

                     enables interrupt

                     1-second timer;

                     enables interrupt

                     2-second timer;

                     authorizes personnel

                     break;


     Unlike the other interrupts
personnel are allowed not to 1, and 0.


     Problems.



     1) Main problem - K580VI53 who consistently do not want to 
work in turbo mode with a short IORQom and have a maximum 
frequency of 2MHz CLK. The best solution is the application of 
import 8253 but this is a terrible deficit. As for VI53,

then, as practice shows, they are from
scratch, but kept the clock 3. 5MHz.
But do not make short IORQ on turbo -
Pentagon.

     2) In some computers, you ensure that blocking port # 77 
(in Scorpio responds to this address port

attributes that best cut
at all).

     3) It is theoretically possible the card with a 128-m 
Spectrum, but practically, for full disclosure of all 
possibilities, you need a car with a storage capacity not less 
than 512K. First, the average amount of musical modules 120 - 
250 kb, and only unit volume is more than 400K, ie,

You can listen to, and use 99%
ready-made modules, and secondly, if the embed music in any 
ready-made programs, the entire 128-I memory cue rammed these 
same programs, but few use the memory above 128K (and RAMdisks

Other resident nonsense does not count), and
Third, if we assume that the Spectrum - the platform will 
evolve, moving to a model with memory> 128K inevitable, and if 
we assume that ZX128 + BETA DISC + AY limit, then what we are 
here with you talking about?


     4) To mix of channels used by a simple resistive mixer, but
perhaps any active or correcting the mixer would be better.

     5) must be voltage-12V (you can use the converter such as 
in ATM). 


     Prospects.



     The author understands that the manufacturer and
connection of this card is associated with a rather more 
difficult, but it consequence of the problems that can not be 
solved the past decade. Despite the "freaks" in the latest 
models (the Scorpion, Pro atm), these questions still remained 
unanswered. Therefore, this development not only gives great 
sound, but also points to ways of solving problems that 
previously were solved by the "eh, Z80, uhnem! Or not resolved.



     1) You can connect up to four
I / O devices. It can be
ADC digitizers, multicards, video processors and much more. The 
main advantage - the CPU is completely unloaded and from the I 
/ O operations, and the expectation result. So the 
"Winchester", connected through pisishnuyu multicards will send 
data direct access and can programmed for its own termination.



     2) may be cascaded
another controller DMA (+3 chips)


     3) Ability to forward memory-memory.


     With regards to board ... This is the most sensitive 
issue. There is no subscription ... I'm currently doing on 
"Fish" (Spalax, "" airplane, "and so on) and This is 
understandable. If you have any suggestions on this topic, they 
will gladly heard. Maybe there is someone who can dissolve a 
fee of 40 housing for all spektrumistov, and the magazine will 
publish its Adventurer. 


     I repeat, card is fully
REGARDLESS OF THE PORT OF EXPANDED MEMORY.
That is, at least you have the Scorpion, although the Pentagon, 
anything else - all is one, since card has its memory banks by 
64K and their registers to access them. But!

Before something to play, it is necessary that something
load. And there is already a concern for the program, as 
rastasovat on the pages sample data. Naturally, the program 
must switch these very pages for loading data, and, naturally, 
on each machine to do it differently. After load port 
configuration becomes theoretically, unnecessary, and the player

can only use 48-in memory (and
that should be around 6K for the player (so far) and kilobytes 
on each pattern). 

     Now for millitsionerov, customs and tax police ... This is 
an active SOUND CARD! This is not COVOX, not

SOUNDRIVE and not something else in the same spirit.
Music played an interrupt!
The player takes an average of 1000
tacts for INT and at the peak until 9000. Any
sound fx are played all over the background and
Up to four pieces at once.

     As for software ...

     There is a complete player
Amiga MOD 's (chetyhkanalnyh). It supports all functions and 
commands, MS-DOS wheels 720 and 800 KB, Kempston mouse, plus

another 460 KB of free memory (512-x machines). There are a 
couple of toys. Adapted Editor DIGITAL STUDIO v1. 12, but it

clearly not, although it is best that as long as there is. 
Written full-length editor. The interface is going to be like 
Digital Studio, and in concept to ProTracker

(ZX-SPECTRUM). Can yield some
utilities, which then enter the editor.


     The quality of sound you can not worry about the sound 
level, and at very high. When compared to pisishnymi cards I 
can confidently say - just AWE 32 approximately below the level 
of my card. Everything Else - Sound Blaster,

Sound Blaster Pro, Vibra 16 (not to mention
Chinese Ski Rocket, Miss Melody, etc.)
Sounds very much worse.



      Assembly, connection and debug

             sound card.


     Unfortunately, no computer
has the possibility to connect any device with access to more 
than 64K of memory, any device, intercepting INT. Therefore, 
without soldering, alas, can not do ... In computer must be 
possible to transfer to a third state high address lines A14 ', 
A15', A16 ', A17', A18 '. This table shows no address lines

CPU does not output configuration registers, and address lines 
that go directly to the multiplexers RAM. 


     By the Pentagon card is connected as follows: Signals D0 
.. D7, A0 .. A15,-MREQ,-IORQ,-RD,-WR,-BUSRQ,

-BUSAC,-INT ',-M1,-RES is taken directly from the
Z80.


     Signal INT is broken:


                  1916-INT

      .. X..



                         Z80

    -INT-INT '


     At the Pentagon, 25 foot Z80 (-BUSRQ)
connected to +5 V through a 10K resistor.
Resistor can be left, and if 25/Z80
goes directly to +5 V, then it should pull out.

     CLK1 (. 3 5 MHz) is taken from 8 feet
D1;

     CLK2 (1. 75 MHz) - with 11D2;

     AEN signal instead of the land served by
15D61, from the same place (D61) signals are taken
A14 ', A15', A16 '(4, 7 and 9 feet resp.)


     The board should be upgradeable to 512K
make the following changes: to connect 7
and 9, 6 and 10, 5 and 11, 4 and 12, 3 and 13 feet
KP12, 15 cut from the land and apply for
She AEN, 1 must submit-AEN, a cut from LE1 5D18 and apply for 
A17i, to 5D18 submit A17 '. INT must be cut off from the 16Z80 
and INT file for the device file 16Z80

INT 'from the device.

     For clarity, bring the scheme
changes in the Plateau Upgrade to 512K.
Changes painted double lines,
wires marked "x", should be
break, the signals are in parentheses filed with the
sound card, and the rest - with the board the Pentagon. On the 
motherboard the computer no changes are made, except by giving 
to the AEN (direct) on 15DD61 instead of land and cutting INT'a.



                       2
6DD63 o 1 January

                       3 O x to 5D18


     / 1K to (A17 ')

    / O> +5 B to LE1 (A17'i)


   KD522o TM2
___ January 13
RES <o OR TT OR TT 9

           2 Q 12 Q
D6 D D7 D

           March 1911
13DD64 o C - 6 C -

           4 Q 10 Q

            OS OS


            > +5 B> +5 B



                    KP12

               10

                  B0 MS

      LE1 September 11

    5 B14 B1 YB

      1 April 1912

    6 O B2

               13

          38DD13 B3

      (AEN) 15

              x OSB

                14

         C14 0

                 2

         C23 1

                 6

                   A0

                 May 7

     B14 A1 YA

                 4

  (A18 ') A2

                 3

  38DD13 A3

    ___ 1

   (AEN) OSA


         AT 1-E RU7 <



     As for the other models
ZX-SPECTRUM, then I can not afford
give a recipe, for lack of basic circuits. But the principle 
remains that the same - to provide an opportunity to transfer 
to a third state of the VJ address bus (not just the processor

A0-A15, but also addresses EXPANDED OVER 64K
memory that are used for MULTIPLEXERS
RAM). Unfortunately, it faces various
circuit design perversion. Since the scheme
Scorpio (?), Which I caught a glimpse of
one of the ZX-REVIEW 'nis, the controller
extended memory was KP16 .. Who
It occurred to her to put? It will
vykusit, throw it away and put on her
KP11 place. And only after that will
the ability to translate address lines
A14 ', A15', A16 'and A17' in a third state.

     More changes on the expansion card up to 512 Kbytes. They 
are for the option which is called the "Scheme of the VM, the 
output of 2. expandable memory up to 512 KB in computers with a 
total field of memory. "Unfortunately, the only advantage of 
this options - Easy. This scheme (512 kb)

generates two addresses A17 '(comes with 12 feet
LE1 and denoted as A9 ') and A18' (is
with 4 feet LE1 and no labeling is
a 12 foot KP12).

     Currently there are no DMA, everything is going well, but
as soon as the DMA, appear
problems.

     In a series of direct access to sound
map exhibits the lines A0 ... A13,
A14 '... A18 'own 19-bit address (that
allows her to address 512 KB), at
This line AEN level appears
log. 1 (in log-AEN respectively. 0). In
this time the processor takes the address bus
in a third state, and the line A14 '... A18 '
be translated into that with. "Manually".

     For A14 '... A16 'do this just
DD61 at the Pentagon (KP11) has tons of. And
Here on the expansion card memory are LE1
not so with., here and have subverted.
A17'prosto "broken" on LP8 a sound card, and to switch the A18 
'used by the second section KP12 expansion cards. She repeats 
the first, except that the A18 'comes from the map.

AEN (direct) is served by 15 KP12 and-AEN
(Inverted) at 1 KP12.


     In total, the map is 44 Governors
+ 4 signal wires to the power wires + 2 (sound AY), and goes 3 
signals (AidioL, AudioR, GND). On SC is desirable

supply connector SNP-64, and all signals are fed through it.



     How to tune your sound card.



     First, connect only
DD21-DD28, DA1-DA12. Instead of / CSC1-/CSC4,
/ CSV1-/CSV4 the signals to add. Products 555ID7, which 
connects the following way: 



          A4 1 A0 Q0 15 / CSC1

          A5 2 A1 Q1 1914 / CSC2

          A6 3 A2 Q2 1913 / CSV1

                    Q3 1912 / CSV2

       / IORQ 4 V1 Q4 1911 / CSC3

         / WR 5 V2 Q5 10 / CSC4

  A7 or GND 6 V3 Q6 9 / CSV3

                    Q7 7 / CSV4



     After that, you will have "Super
Sound Drive ", ie" Sound Drive "+ volume registers (RG) on each 
channel. 

     Ports are as follows:

     Channels - # 0F, # 1F, # 4F, # 5F

     WP - # 2F, # 3F, # 6F, # 7F

     This is the first debugging scheme (if not
Like that it will squeak in
TR-DOS 'e, then 4 feet instead of ID7 / IORQ
submit / OIORQ (with on-board 6DD85 Pentagon).

     After assembly, you can test
channels such program in BASIC 'e:


     10 LET C = 15: LET V = 47: REM 1st Channel

     20 FOR I = 0 TO 6: READ A

     30 FOR J = 0 TO 7: LET B = 2 ^ J: PRINT A,
B: OUT V, A

     40 IF INKEY $ = "" THEN OUT C, B: OUT
C, 0: GO TO 40

     50 NEXT J: NEXT I

     1960 DATA 0, 1, 2, 4, 8, 16, 32


     Recruit, run and listen. Sound
must be, if both numbers
different from 0. If one of the numbers on the screen is 0, 
then necessarily be silence.


     For Channel 2, we substitute C = 31,
V = 63, etc. Here, I hope, nothing complicated.

     Further, the interim otpaivaem ID7,
solder in DD1 (except the pin. 12, 15), DD4.1,
DD4.2, DD10 (except the pin. 10, 13, 17)
DD11 (except the pin. 10, 13, 17).

     We collect debugging program
BASIC 'e:


     10 LET C = 64887: LET W = 52: LET
P = 15735: LET F = 100

     20 OUT C, W: OUT P, F-256 * INT (F/256
): OUT P, INT (F/256)

     30 PRINT AT 0, 0; IN (P) +256 * IN (P):
IF INKEY $ = "" THEN GO TO 30


     After starting the program on a monitor
should zamelkat numbers from 0 to 100, and
if you have an oscilloscope, then 10DD10 should be observed 
pulses with a frequency of 35 kHz.



     Then checked the other five generators. To this end, a 
10-line contains the following parameters:


C = 64,887, W = 116, P = 32119; pulses 13DD10
C = 64,887, W = 180, P = 48503; ---"--- 17DD10
C = 65,143, W = 52, P = 15991; ---"--- 10DD11
C = 65,143, W = 116, P = 32375; ---"--- 13DD11
C = 65,143, W = 180, P = 48759; ---"--- 17DD11


     The parameter F determines the frequency of the output 
pulses, it is 3. 5MHz / F (for 17x pin. it is equal to 1. 75 / 
F). 

     Serve different values ​​of F (1 to
65535) and make sure that the frequency varies
sootvstvenno. Yes, if you K580VI53, then
All this must be done if you disable Turbo mode. There's 
nothing you can do, not wants to work in a 580 series turbo and 
all ... The only solution - is to find imports

8253 (with any numeric and alphabetic indices), or in extreme 
cases 1810VI54. 


     Next payayutsya DD2, DD3, DD4.4, 15 and
12 feet DD1, DD5.1-DD5.5, DD6, DD7,
DD8.1, DD8.4, DD9, DD12, DD13, DD14, 10
and 13 feet DD10 and DD11. They'll change in the computer 
(except for / INT). 

     After that, turn the computer and
Look, whether he has earned. If not, then
Consider the signals AEN and / AEN. At AEN should
be stable log. 0 on / AEN - log. 1.
If all is true, then that got it wrong
on-board expandable to 512 Kbytes.


   On / BUSRQ must log. 1

     A17 'must be such as
A17'i.

     Other signals that come in
computer, should not change.

     Well, usually all at once begins
work with a probability of 99%.

     Further examples will be used in assembly
it's easier.

     Check if the controller DMA:


     LD BC, # 8C77

     XOR A

     OUT (C), A

     LD B, # 0C

     LD DE, 11111

     OUT (C), E

     OUT (C), D

     IN A, (C)

     CP E

     JR NZ, ERR

     IN A, (C)

     CP D

     JR NZ, ERR

     JP OK; okay
ERR .... ; Error, we must look DD1,

          ; DD3, DD4, DD6


     The next stage - a test cycle. In
this program, I'll immediately suspended 4 values ​​for some 
EQU-operators, they resp. 4 channels. First substitute

The first value, then the second, etc.



     LD BC, TCR

     LD A, TCW

     OUT (C), A

     LD BC, TDR

     LD HL, 10

     OUT (C), L

     OUT (C), H

     LD BC, # 8C77

     XOR A

     OUT (C), A

     LD BC, # BC77

     LD A, DCW

     OUT (C), A

     LD BC, ADR

     LD HL, # 8000

     OUT (C), L

     OUT (C), H

     LD BC, LNR

     LD HL, # 100

     OUT (C), L

     OUT (C), H

     LD BC, # FC77

     LD A, MSK

     OUT (C), A

     RET
TCR EQU # FD77; # FD77; # FE77; # FE77
TCW EQU # 34, # 74, # 34, # 74
TDR EQU # 3D77; # 7D77; # 3E77; # 7E77
DCW EQU # 50, # 51, # 52, # 53
ADR EQU # 0C77; # 2C77; # 4C77; # 6C77
LNR EQU # 1C77; # 3C77; # 5C77; # 7C77
MSK EQU # 0E; # 0D; # 0B; ​​# 07



  1 channel

  2 channel

  3 y Cajal

  Channel 4


     Run a program, your computer should work steadily, but it 
must be some fairly noticeable decline speed (more than a 
quarter). 

     At 7 and 10 feet VT37 should be pulses with a frequency of 
350 kHz. 

     If the delay is, then they are there
there really is. If not, then we should look.

     If you start the computer resets or hangs, or memory is 
filled with nonsense, then we must look to the board expansion 
of 512 KB. 

     All this should be tested 4 times
for each channel separately. If all
OK, you can try to extract
sound:

     LD HL, # 8000
M1 LD (HL), L

     INC L

     JR NZ, M1

     LD BC, TCR

     LD A, TCW

     OUT (C), A

     LD BC, TDR

     LD HL, 120

     OUT (C), L

     OUT (C), H

     LD BC, # 8C77

     XOR A
     OUT (C), A

     LD BC, # CC77

     OUT (C), A

     LD BC, # BC77

     LD A, DMW

     OUT (C), A

     LD BC, PGR

     LD A, 0

     OUT (C), A

     LD BC, ADR

     LD HL, # 8000

     OUT (C), L

     OUT (C), H

     LD BC, LNR

     LD HL, # FF

     OUT (C), L

     OUT (C), H

     LD BC, VLR

     LD A, # 3F

     OUT (C), A

     LD BC, # FC77

     LD A, MSK

     OUT (C), A

     RET
DMW EQU # 58; # 59; # 5A; # 5B
PGR EQU # 0777, # 1777, # 2777, # 3777
VLR EQU # 3F77; # 7F77; # BF77; # FF77
TCR EQU # FD77; # FD77; # FE77; # FE77
TCW EQU # 34, # 74, # 34, # 74
TDR EQU # 3D77; # 7D77; # 3E77; # 7E77
ADR EQU # 0C77; # 2C77; # 4C77; # 6C77
LNR EQU # 1C77; # 3C77; # 5C77; # 7C77
MSK EQU # 0E; # 0D; # 0B; ​​# 07



  1 channel

  2 channel

  3 y Cajal

  Channel 4


     Once launched, must resound the sound
with a frequency of 114 Hz, resembling an envelope
C for AY, but on 12DA5 signal must be
Behold this form:


     / | / | / | / | / | | \ | \ | \ | \ | \

    / | / | / | / | / | Or | \ | \ | \ | \ | \


     Sound must be absolutely clean and
does not change depending on what
makes the processor.

     If the sound is distorted, it may not
soldered R1 and R2.

     If the sound is reminiscent of a disorderly
pischanie, then we must look DD7, DD9,
DD13.

     If there is no sound at all, and 12DA5
also there is no signal, then we must look DD3,
DD4, DD12.

     If the 12DA5 is a normal signal, then we must look DD2.


     Once all 4 will be tweaked
channel will work adapted Editor Digital Studio.


     Now you can collect the rest.


     On testing the interrupt controller to tell the next time.


     The author of this sound card and software for
She, as well as descriptions - Inozemtsev A.
aka Stranger.

     Prepared this article from disparate sources specifically 
for the magazine Adventurer - Chupak RV aka David

Willis.


     P. S. If anyone will achieve any success in the production 
of maps - share with the people, with some glitches you 
encountered in the process of connecting. Because myself I have 
collected on the cardboard. Card playing, but buggy - samples 
not played to the end and break off, whenever they want. 
Hopefully, together we can overcome Zapara. Write to me about 
everything or Adventurer. My address is:



     320130

     Dnepropetrovsk, Ukraine

     Donetsk shosse, 97a, kv. 25.

     Chupak Roman


     tel. (0562) 725-83-69


*** SPECCY RULEZ FOREVER AND EVER! ***





Other articles:

From the authors - The authors of the magazine.

From the authors - Adventurer - the section of the popular magazines heritage.

Presentation - A new program for collecting tunes: UniPlayer v1.0

Presentation - a new graphical editor 3Color Studio.

Presentation - an unusual boot: Program Box version 2.0

Presentation - a new quest: Full Shit.

Presentation - a level editor for games Raven Black: Black Raven Editor v1.0

Presentation - the new editor for digital music: EARACHE v1.0

Interface - Letters from readers: Dawid Willis, Ivan Roshchin, Cav Inc. (Competition for the best name for your sound card, glitches in HRUST v1.0 and XAS v9.06 +)

Interface - How do we (CPU) were FunTop'e.

Interface - Opinion: on acquaintance with the PC.

Interface - branded cheats for the games: Midnight Resistance, Chase HQ2, Havoc, Turbo Girl, Fast Bredd, Turbo Boat.

System - An overview of new sistemok: Sprite Maker v4.0, Turbo Copier v2.0, Sample Studio, Art Works 1, Burst Eyes v1.2, Excess Sample Editor v1.4.25, Excess Deluxe Paint v1.1, Graphic Station, BA v1.0, Global Commander v1.31, Quick Commander v2.3, Stall Spriter v0.1, AGA v1.0, Ultra Sonic v0.1, Universal Sprite Studio v1.0, HRUST v1.1, STORM v1.3.

Review - Overview of gaming innovations: Leprekon, Fuck Communistov, Sherwood, GOAT, Kill PC 2, Chainick: Horror in the flat.

Review - Review of the demos: Black Raven 2 v0.000, Crime Santa Clause Deja VU, Awaken, Japan Crossword, Pussy: Love story from Titanic.

Guests - An Interview with Nicodim'om from Yaroslavl (the author of Prince of Persia and the Pirates).

Guests - An interview with a group of Rybinsk Expirience (authors kvecta Full Shit).

Guests - CPU on the life and future plans.

Promotion - A strategy game: Sword OF Bane.

Promotion - parsing the game of Rock Star: Rock Star ate my Hamster.

Exchange of experience - Rapid procedure for finding the root of the number and Testing Kempston-port of SerzhSoft'a.

Exchange of experience - The procedure for generating sine.

Exchange of experience - spinner - izvraschalka (Zoom Rotator).

Exchange of experience - SerzhSoft'a report on the regional Olympiad in Informatics in 1998.

Exchange of experience - TR-DOS: the disk included with interrupts.

Ottyag - 23 things you can do with the program hanging. Symbols - grimassy in the program notes. 20 things you can do if ochen want to drink, but you have no money. Verse of the monk.

Ottyag - Competition test: Test: What you need a computer? Test for the Communists. Test: Can I rely on you? Quiz: Who are you Spektrumist? (User or lamer).

Ottyag - Terminator 3 sleigh day (or the truth again, somewhere in there).

Iron - Sound card with direct access to: DMA Sound Card (description schemes and programming).

News - News from local groups: Volume 4, Groboclone, Surdakar, Di-Tech Labs, Auryn, Rainbow Dreams, Experience.

Advertising - advertising and announcements from spektrumistov.


Темы: Игры, Программное обеспечение, Пресса, Аппаратное обеспечение, Сеть, Демосцена, Люди, Программирование

Similar articles:
Iron - MIDI interface for the ZX-Spectrum-compatible computers (continued).
Introduction - On the control interface of the newspaper.
Feedback - contact the publisher.

В этот день...   3 May