Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Nick and Dave, with additional notes by IstvánV, machine translated
<body len="607545" style="text-align: left;"><p len="104"><a name="226" id="226" len="0"></a><b len="70"><font color="#000066" size="6" lang="en">Part X: Programming the Nick chip</font></b></p>
<p align="justify" len="188" style="text-align: left;"><font lang="en">Unlike most video devices that allow multiple modes across the entire screen, NICK allows multiple modes within an image. </font><font lang="en">Nick's main features are:</font></p>
<ul len="821">
<li len="20" lang="en">Mixed mode screen</li>
<li len="57" lang="en">64, 128, or 256 user-defined characters</li>
<li len="33" lang="en">8-bit color output (256 colors)</li>
<li len="52" lang="en">2.4, 16, and 256 colors per row, selected from 256 colors</li>
<li len="56" lang="en">Maximum resolution (using interface): 672 x 512</li>
<li len="44" lang="en">Cell-based graphics, bitmaps, and characters</li>
<li len="52" lang="en">Characters of any height between 1 and 256 pixels</li>
<li len="18" lang="en">256 frame colors</li>
<li len="58" lang="en">User-defined screen width and height</li>
<li len="50" lang="en">External color input (TV camera or ghost graphic)</li>
<li len="57" lang="en">Efficient RAM usage (also works with less than 1k of memory)</li>
<li len="36" lang="en">4 color pairs in 84-column text mode</li>
<li len="55" lang="en">Use bits specifically to increase color options</li>
<li len="64" lang="en">Pointer-based memory management to improve efficiency and speed</li>
</ul>
<p len="91"><a name="227" id="227" len="0"></a><b len="57"><font color="#000066" size="5" lang="en">1. Video RAM Addressing</font></b></p>
<p align="justify" len="511" style="text-align: left;"><font><font lang="en">The Nick chip can address 64K memory, called video RAM. </font><font lang="en">It consists of four segments: 0FCh to 0FFh. </font><font lang="en">This way, Nick can address the enterprise 64's entire internal memory, but not the expansions.</font></font><br len="0"><font><font lang="en"> The Nick chip addresses this 64k directly without using the Dave chip's sheet registers. </font><font lang="en">For example, for 04000h, you always see the 0FDh page, even if it is not paged. </font><font lang="en">This feature needs to be taken into account to avoid inconsistencies between Z80 addressing and Nick addressing.</font></font></p>
<p len="93"><a name="228" id="228" len="0"></a><b len="59"><font color="#000066" size="5" lang="en">2. Row parameter table</font></b></p>
<p align="justify" len="1240" style="text-align: left;"><font><font lang="en">The screen generated by Nick is based on a block of data called a row parameter table. </font><font lang="en">This consists of 16 bytes of long row parameters blocks. </font><font lang="en">The user simply loads the starting address of the row parameter table into a nick register and the image is generated automatically.</font></font><br len="0"><font><font lang="en"> Each row parameter block controls part of the screen called MODSOR. </font><font lang="en">The block contains the video mode modsor and the video RAM start address where the screen data begins. </font><font lang="en">MODSOR can contain rows between 1 and 256. </font><font lang="en">The Nick chip generates the lines for the given MODSOR and takes the row parameter block for the next MODSOR.</font></font><br len="0"><font><font lang="en"> The last row parameter block must have a special bit group indicating that the processing of blocks must start from the beginning of the image. </font><font lang="en">Normally, the row parameter table contains 312 rows (the entire TV screen). </font><font lang="en">For advanced effects or interfaces, the row parameter table can be larger.</font></font><br len="0"><font><font lang="en"> The Nick chip performs all horizontal timings, so the video parameters for each line will be correct. </font><font lang="en">Vertical timing can be controlled by the programmer.</font></font></p>
<p len="99"><a name="229" id="229" len="0"></a><b len="65"><font color="#000066" size="5" lang="en">3. Line parameter base indicator</font></b></p>
<p align="justify" len="1386" style="text-align: left;"><font><font lang="en">To generate the image, you need to load the starting address of the row parameter table into the Nick chip. </font><font lang="en">For this purpose, two 8-bit registers (LPL and LPH) are available, of which only the top 12 bits are used by the chip, since the table can only start at a address that can be divided by 16.</font></font><br len="0"><font><font lang="en"> If the user wants to display a new screen, all they have to do is change the start address of the row parameter table. </font><font lang="en">Nick then finishes the image that is currently being posted, loads the new value, and continues with the new row parameter table. </font><font lang="en">The user may reload the base pointer when Nick reloads its own. </font><font lang="en">In this case, one half of the address may be new and the other half may be an old address. </font><font lang="en">Nick's taking the line parameter board from the wrong place. </font><font lang="en">This problem can be solved by synchronizing the base address charging with the video interrupt.</font></font><br len="0"><font><font lang="en"> After turning on the Nick chip, it displays trash until the base pointer loads. </font><font lang="en">If you add a new value to this as you go, Nick will display the old image until you find the reload bit sequence in the row parameter table. </font><font lang="en">This way, the image will appear later than loading the new address. </font><font lang="en">To resolve this issue, two previously unused bits of the LPH register are used. </font><font lang="en">An immediate violent reload of the base address is available. </font><font lang="en">This bit of LPH is normally some people. </font><font lang="en">The violent reloading process is as follows:</font></font></p>
<ol len="281">
<li len="32" lang="en">Write the bottom 8 bits in the LPL.</li>
<li len="69" lang="en">Write the top 4 bits in the LPH and zero the bits 6 and 7.</li>
<li len="67" lang="en">Re-write the top 4 bits, put 6 in 1, zero in 7.</li>
<li len="64" lang="en">Re-write the top 4 bits, add one to 6 and 7.</li>
</ol>
<p align="justify" len="77" style="text-align: left;" lang="en">This procedure ensures that the new row parameter table takes effect immediately.</p>
<p len="93"><a name="230" id="230" len="0"></a><b len="59"><font color="#000066" size="5" lang="en">4. Row parameter block</font></b></p>
<p align="justify" len="124" style="text-align: left;"><font lang="en">Each row parameter block consists of 16 bytes, which nick reads during the horizontal retread. </font><font lang="en">The sixteen bytes are as follows:</font></p>
<table width="100%" border="0" cellspacing="2" cellpadding="2" len="4218">
<tbody len="4200"><tr len="180">
<td width="5%" valign="top" bgcolor="#CCCCCC" len="1" lang="en">0</td>
<td width="95%" len="94"><font lang="en"><b len="2">SC</b> - The number of lines in a given MODSOR in the form of a two-way complement form. </font><font lang="en">Zero means 256 rows.</font></td>
</tr>
<tr len="2169">
<td valign="top" bgcolor="#CCCCCC" len="1" lang="en">1</td>
<td len="2106"><p len="21" lang="en"><b len="2">MB</b> - Mode byte.</p>
<table width="90%" border="0" cellspacing="2" cellpadding="2" align="center" len="876">
<tbody len="850"><tr bgcolor="#FFFFCC" len="411">
<td len="28"><div align="center" len="2" lang="en">b7</div></td>
<td len="28"><div align="center" len="2" lang="en">b6</div></td>
<td len="28"><div align="center" len="2" lang="en">b5</div></td>
<td len="28"><div align="center" len="2" lang="en">b4</div></td>
<td len="28"><div align="center" len="2" lang="en">b3</div></td>
<td len="28"><div align="center" len="2" lang="en">b2</div></td>
<td len="28"><div align="center" len="2" lang="en">b1</div></td>
<td len="28"><div align="center" len="2" lang="en">b0</div></td>
</tr>
<tr bgcolor="#CCCCCC" len="365">
<td len="30"><div align="center" len="4" lang="en">Vint</div></td>
<td len="30"><div align="center" len="4" lang="en">colour</div></td>
<td len="29"><div align="center" len="3" lang="en">way</div></td>
<td len="30"><div align="center" len="4" lang="en">VRES</div></td>
<td colspan="3" nowrap="nowrap" len="43"><div align="center" len="17" lang="en">--- VIDEO MODE ---</div></td>
<td len="32"><div align="center" len="6" lang="en">Reload</div></td>
</tr>
</tbody></table>
<ul len="1090">
<li len="94" lang="en">VINT - If set, an interrupt is generated at the beginning of this MODSOR (see below).</li>
<li len="301"><font lang="en">COLOR MODE - Controls how screenbytes are translated into colorbytes. </font><ul len="191">
<li len="18" lang="en" style="">00 - Two-color mode</li>
<li len="19" lang="en">01 - Four-color mode</li>
<li len="17" lang="en">10 - 16 color mode</li>
<li len="18" lang="en">11 - 256 color mode</li>
</ul>
</li>
<li len="117" lang="en">VRES - Set to allow full vertical resolution, deleted only limited resolution in graphics modes.</li>
<li len="491"><font><font lang="en">VIDEO MODE - Comprehensive video mode. </font><font lang="en">Controls how screenbytes are read from video RAM. </font></font><ul len="353">
<li len="15" lang="en">000 - VSYNC mode</li>
<li len="15" lang="en">001 - PIXEL mode</li>
<li len="19" lang="en">010 - ATTRIBUTE mode</li>
<li len="15">011 - CH256 mód</li>
<li len="15" lang="en">100 - CH128 mode</li>
<li len="14" lang="en">101 - CH64 mode</li>
<li len="21" lang="en">110 - not used</li>
<li len="16" lang="en">111 - LPIXEL mode</li>
</ul>
</li>
</ul></td>
</tr>
<tr len="263">
<td valign="top" bgcolor="#CCCCCC" len="1" lang="en">2</td>
<td len="200"><b len="3" lang="en">Lm </b>
<ul len="172">
<li len="22"><font lang="en">b0 ... </font><font lang="en">b5 - left margin.</font></li>
<li len="44" lang="en">b6 - ALTIND1 - controls the additional colors</li>
<li len="39" lang="en">b7 - ALTIND0 - in two-tone character mode</li>
</ul></td>
</tr>
<tr len="261">
<td valign="top" bgcolor="#CCCCCC" len="1" lang="en">3</td>
<td len="198"> <b len="3" lang="en">Rm </b>
<ul len="169">
<li len="21"><font lang="en">b0... </font><font lang="en">b5 - right margin</font></li>
<li len="43" lang="en">b6 -LS BALT - controls additional colors</li>
<li len="38" lang="en">b7 -MS BALT - in two-tone graphics mode</li>
</ul></td>
</tr>
<tr len="118">
<td valign="top" bgcolor="#CCCCCC" len="1" lang="en">4</td>
<td len="55"><font lang="en"><b len="4">LD1L</b> - primary video data address. </font><font lang="en">(low byte)</font></td>
</tr>
<tr len="115">
<td valign="top" bgcolor="#CCCCCC" len="1" lang="en">5</td>
<td len="52"><font lang="en"><b len="4">LD1H</b> - primary video data address. </font><font lang="en">(high byte)</font></td>
</tr>
<tr len="118">
<td valign="top" bgcolor="#CCCCCC" len="1" lang="en">6</td>
<td len="55"><font lang="en"><b len="4">LD2L</b> - secondary video data address. </font><font lang="en">(low byte)</font></td>
</tr>
<tr len="115">
<td valign="top" bgcolor="#CCCCCC" len="1" lang="en">7</td>
<td len="52"><font lang="en"><b len="4">LD2H</b> - secondary video data address. </font><font lang="en">(high byte)</font></td>
</tr>
<tr len="75">
<td valign="top" bgcolor="#CCCCCC" len="1" lang="en">8</td>
<td len="12"><b len="5">COL 0</b></td>
</tr>
<tr len="75">
<td valign="top" bgcolor="#CCCCCC" len="1" lang="en">9</td>
<td len="12"><b len="5">COL 1</b></td>
</tr>
<tr len="76">
<td valign="top" bgcolor="#CCCCCC" len="2">10</td>
<td len="12"><b len="5">COL 2</b></td>
</tr>
<tr len="76">
<td valign="top" bgcolor="#CCCCCC" len="2">11</td>
<td len="12"><b len="5">COL 3</b></td>
</tr>
<tr len="76">
<td valign="top" bgcolor="#CCCCCC" len="2">12</td>
<td len="12"><b len="5">COL 4</b></td>
</tr>
<tr len="76">
<td valign="top" bgcolor="#CCCCCC" len="2">13</td>
<td len="12"><b len="5" lang="en">COL 5</b></td>
</tr>
<tr len="76">
<td valign="top" bgcolor="#CCCCCC" len="2">14</td>
<td len="12"><b len="5" lang="en">COL 6</b></td>
</tr>
<tr len="141">
<td valign="top" bgcolor="#CCCCCC" len="2">15</td>
<td len="77"><font lang="en"><b len="5">COL 7</b> - The first eight palette colors. </font><font lang="en">Not used in 256 color mode. </font></td>
</tr>
</tbody></table>
<p len="93"><a name="231" id="231" len="0"></a><b len="59"><font color="#000066" size="5" lang="en">5. Right and left margins</font></b></p>
<p align="justify" len="1145" style="text-align: left;"><font><font lang="en">Each horizontal row is divided into 57 sections. </font><font lang="en">Nick can scan two bytes in each stage. </font><font lang="en">The row parameter block is read below the first 8. </font><font lang="en">The last three sections are used to update video RAM. </font><font lang="en">46 sections remain for the screen.</font></font><br len="0"><font><font lang="en"> The right and left margin bytes determine which section has the left and right margins. </font><font lang="en">The area outside the margins will be framed. </font><font lang="en">In practice, some sections may be outside the visible screen due to the operation of the TV. </font><font lang="en">If you use a 42-section width image and set the left margin to 10 and the right margin to 52, you get a satisfactory result.</font></font><br len="0"><font><font lang="en"> For the active part between the margins, Nick reads the bytes from the video RAM. </font><font lang="en">Depending on the video mode, one or two bytes are read per section. </font><font lang="en">The conversion of bytes to pixels is already determined by the color mode.</font></font><br len="0"><font><font lang="en"> If you set the right margin to a lower value than the left margin, the entire row becomes framed. </font><font lang="en">Note that margin values have a special meaning in VSYNC mode, where vertical synchronous signals are generated based on this. </font><font lang="en">This is described in detail in the vertical synchronization section.</font></font></p>
<p len="106"><a name="232" id="232" len="0"></a><b len="72"><font color="#000066" size="5" lang="en">6. Color mode and palette registers</font></b></p>
<p align="justify" len="1245" style="text-align: left;"><font><font lang="en">Color mode determines how screenbytes are converted to colors. </font><font lang="en">The Nick chip has 8 gradients, it can generate up to 256 colors. </font><font lang="en">In 256 color mode, all bytes of video RAM are simply output as color bytes. </font><font lang="en">In each other color mode, the screen byte is divided into some parts and the color is selected from the 16 palette colors based on bit combinations. </font><font lang="en">We'll discuss converting colorbytes to real colors later.</font></font><br len="0"><font><font lang="en"> The first 8 bytes of palette colors are specified in the last 8 elements of the row parameter block. </font><font lang="en">Here you can have any of the 256 colors, and these eight bytes can be different for each MODSOR. </font><font lang="en">The remaining 8 colors (8 to 15) are generated as follows: Nick takes the bottom three bits of the palette color number and copies it to the top five bits of the FIXBIAS register. </font><font lang="en">FIXBIAS is a standalone register within Nick (port 080h) and is also used for other purposes. </font><font lang="en">Therefore, any 8 colors in any 32 color group can be used for the remaining 8 colors, but these eight colors will be the same on the full screen. </font><font lang="en">Unless you change the FIXBIAS register very frequently during interruptions!)</font></font><br len="0"><font lang="en"> In three color modes, you should pay particular attention to the bit order of the 16-color mode by converting screenbytes to image elements.</font></p>
<ul len="933">
<li len="368"><font><font lang="en">2 color mode - 8 pixels per byte. </font><font lang="en">Each bit selects palette 0 or 1. </font><font lang="en">(see also ALTINDO, ALTIND1, MSBALT and LSBALT for video mode selection)</font></font><br len="0">
<font face="Verdana, Arial, Helvetica, sans-serif" len="142" lang="en">b7 b6 b5 b4 b3 b2 b1 b0</font></li>
<li len="258"><font><font lang="en">4 color mode - 4 pixels per byte. </font><font lang="en">Each pair of bits selects a color from palettes 0, 1, 2, 3.</font></font><br len="0">
<font face="Verdana, Arial, Helvetica, sans-serif" len="74" lang="en">b3,b7 b2,b6 b1,b5 b0,b4</font></li>
<li len="270"><font><font lang="en">16 color mode - two pixels per byte. </font><font lang="en">Each four-bit group can select any of the 16 palette colors. </font><font lang="en">Notice the order of bits within pixels.</font></font><br len="0">
<font face="Verdana, Arial, Helvetica, sans-serif" len="40" lang="en">b1,b5,b3,b7 b0,b4,b2,b6</font></li>
</ul>
<p len="95"><a name="233" id="233" len="0"></a><b len="61"><font color="#000066" size="5" lang="en">7. Pixel graphics modes</font></b></p>
<p align="justify" len="1620" style="text-align: left;"><font><font lang="en">In PIXEL and LPIXEL graphics modes, the LD2 pointer is not used at all. </font><font lang="en">LD1 points to the first byte to be displayed in video RAM. </font><font lang="en">Bytes are read sequential from video RAM from the left margin of the screen bar to the right margin.</font></font><br len="0"><font lang="en"> If VRES is one, the next line will be read on the next byte of the video RAM.</font><br len="0"><font><font lang="en"> If VRES is set to zero, LD1 will return to the beginning of the already displayed line of video RAM, and the next screen line will be the same as the previous one. </font><font lang="en">This saves memory for repeating screen rows.</font></font><br len="0"><font><font lang="en"> The interpretation of the video RAM bytes also depends on the color mode you have set, as described above. </font><font lang="en">The difference between PIXEL and LPIXEL modes is that in PIXEL mode two bytes are read at once, while in LPIXEL mode only one. </font><font lang="en">In this way, LPIXEL only gives you half the horizontal resolution and requires only half the ram space.</font></font><br len="0"><font><font lang="en"> Two special control bits are used in two-color graphics mode. </font><font lang="en">MSBALT and LSBALT are the two top bits of the left margin byte. </font><font lang="en">In PIXEL mode, high-resolution text display is simulated and helps display characters of different colors.</font></font><br len="0"><font><font lang="en"> If MSBALT is set to 1, the 7th bit of each byte displayed is zero before display. </font><font lang="en">If bit 7 was 1 in the byte to be displayed, 3 and 4 will be used instead of 0 and 1 palette colors for the points specified by the byte.</font></font><br len="0"><font><font lang="en"> If LSBALT is set to 1, the 0th bit of each byte displayed is given a value of 0 before display. </font><font lang="en" style="">If the 0th bit of a given byte was 1, 4..7 is selected from the palette colors, not 0..3.</font></font></p>
<p len="104"><a name="234" id="234" len="0"></a><font color="#000066" size="5" len="39"><b lang="en">8. Character modes -64, 128, and 256</b></font></p>
<p align="justify" len="1757" style="text-align: left;"><font><font lang="en">In character mode, LD2 points to the character set, and LD1 points to the character to be shown. </font><font lang="en" style="">The character mode is scant and the corresponding point pattern is displayed per character location on the screen. </font><font lang="en">This way, you can display 42 characters in a row. </font><font lang="en">Vres must always be reset if you want to use character mode. </font><font lang="en">The three character modes differ only in the number of letters in the character set, and therefore naturally affect the character set's need for RAM. </font><font lang="en" style="">Character modes are described using character sets 128 as a model, and the other two can be defined in the same way.</font></font><br len="0"><font><font lang="en"> The character set must start with a memory address that can be divided by 128 for mode 128, stored in LD2. </font><font lang="en" style="">The address is divided by 128 (the top 9 bits of the 16-bit address are left). </font><font lang="en">The missing 7 bits of the address are generated by the NICk chip.</font></font><br len="0"><font><font lang="en"> The first 128 bytes in the character set are the top points row for each of the 128 characters. </font><font lang="en" style="">The second 128 bytes store the 2nd point row of characters, and so on...</font></font><br len="0"><font><font lang="en"> Character codes are read continuously from LD1, and an image of the character corresponding to the byte value is displayed on the screen. </font><font lang="en">The color of the byte to be displayed is generated in the same way as in graphical mode, taking into account the color mode set. </font><font lang="en" style="">Ascii character display in two-color graphics mode gives a normal character image, but in other color modes, if you want to display ASCII in graphical mode, the characters are made up of fewer points.</font></font><br len="0"><font><font lang="en"> You can use two control bits to display characters of different colors in two-color character mode. </font><font lang="en" style="">These are ALTIND0 and ALTIND1, which are the top two bits of the byte that defines the right margin. </font><font lang="en">In modes 64 and 128, use them only partially when the top bits of the character codes are not used.</font></font></p>
<ul len="258">
<li len="119" lang="en" style="">If ALTIND1 is set to 1, 3 and 4 are used instead of 0 and 1, depending on bit 7 of the character codes.</li>
<li len="114"><font lang="en">If ALTIND0 is set to 1, 0 ... </font><font lang="en">3 colors instead of 4 ... </font><font lang="en">7 will be chosen.</font></li>
</ul>
<p align="justify" len="98" style="text-align: left;"><a name="235" id="235" len="0"></a><b len="64"><font color="#000066" size="5" lang="en">9. Attribute graphic mode</font></b></p>
<p align="justify" len="464" style="text-align: left;"><font><font lang="en">In this mode, LD2 points to the two-color graphic bitmap data (dots), and LD1 points to the area where the colors of the points to be displayed are displayed. </font><font lang="en">When using attribute mode, you must always be in two-color mode, because if you select other modes, the colors will be undefined.</font></font><br len="0"><font lang="en"> The point data is read out in the two-color LPIXEL graphical mode as usual, but the corresponding attribute bytes tell you which two palette colors are selected:</font></p>
<table width="420" border="0" cellspacing="2" cellpadding="2" align="center" len="540">
<tbody len="522"><tr bgcolor="#CCCCCC" len="339">
<td len="28"><div align="center" len="2" lang="en">b7</div></td>
<td len="28"><div align="center" len="2" lang="en">b6</div></td>
<td len="28"><div align="center" len="2" lang="en">b5</div></td>
<td len="28"><div align="center" len="2" lang="en">b4</div></td>
<td len="28"><div align="center" len="2" lang="en">b3</div></td>
<td len="28"><div align="center" len="2" lang="en">b2</div></td>
<td len="28"><div align="center" len="2" lang="en">b1</div></td>
<td len="28"><div align="center" len="2" lang="en">b0</div></td>
</tr>
<tr bgcolor="#FFFFCC" len="125">
<td colspan="4" len="36"><div align="center" len="10" lang="en">background color</div></td>
<td colspan="4" len="34"><div align="center" len="8" lang="en">dot color</div></td>
</tr>
</tbody></table>
<p len="76" lang="en">The byte mapping of the attribute and the pixel databyte is determined by VRES.</p>
<ul len="308">
<li len="127" lang="en">If VRES is set to 1, there is a full mapping, meaning that the attribute is ingation requires the same amount of RAM as pixel ingation.</li>
<li len="156"><font lang="en">If VRES is set to 0, the attribute values are the same per line. </font><font lang="en">Thus, the number of attribute bytes is the same as the number of rows below each other.</font></li>
</ul>
<p len="113"><a name="236" id="236" len="0"></a><b len="79"><font color="#000066" size="5" lang="en">10. Vertical synchronization (VSYNC mode)</font></b></p>
<p align="justify" len="465" style="text-align: left;"><font><font lang="en">In VSYNC mode, no data is displayed on the screen, the video output is blank, and the margins determine the beginning and end of vertical synchronization. </font><font lang="en">Note that color is not possible under VSYNC either.</font></font><br len="0"><font><font lang="en"> During the active vertical synchronization period, normal horizontal synchronization is inverted so that it does not fall out of sync. </font><font lang="en">It is recommended that you reset the last 12 bytes of each LPB (row parameter block) and select the first four bytes as follows:</font></font></p>
<table width="480" border="0" cellspacing="2" cellpadding="2" align="center" len="621">
<tbody len="603"><tr len="139">
<td nowrap="nowrap" len="9" lang="en">DB 256-3,</td>
<td nowrap="nowrap" len="7" lang="en">VBLANK,</td>
<td nowrap="nowrap" len="30"><div align="right" len="5" style="text-align: left;" lang="en">63, 0</div></td>
</tr>
<tr len="139">
<td nowrap="nowrap" len="9" lang="en">DB 256-2,</td>
<td nowrap="nowrap" len="7" lang="en">VBLANK,</td>
<td nowrap="nowrap" len="30"><div align="right" len="5" style="text-align: left;" lang="en">6, 63</div></td>
</tr>
<tr len="140">
<td nowrap="nowrap" len="9" lang="en">DB 256-1,</td>
<td nowrap="nowrap" len="7" lang="en">VBLANK,</td>
<td nowrap="nowrap" len="31"><div align="right" len="6" style="text-align: left;" lang="en">63, 32</div></td>
</tr>
<tr len="139">
<td nowrap="nowrap" len="10" lang="en">DB 256-19,</td>
<td nowrap="nowrap" len="6" lang="en">pixel</td>
<td nowrap="nowrap" len="30"><div align="right" len="5" style="text-align: left;" lang="en">6, 63</div></td>
</tr>
</tbody></table>
<p align="justify" len="768" style="text-align: left;"><font><font lang="en">The first of the above LPBs gives you three blank rows. </font><font lang="en">Because the left margin is set to 63 - which it never achieves - synchronization remains off. </font><font lang="en">Synchronization is only turned on at the beginning of the second LPB and remains on during this time, as it never reaches the right margin of 63. </font><font lang="en">Synchronization is turned off halfway through the third LPB line. </font><font lang="en">The fourth LPB contains 19 blank rows, so you have 25 rows synchronized in total, but in two-color PIXEL mode, the color is re-enabled. </font><font lang="en">In this LPB, the left margin is set to 6 to make sure the frame color does not fall into it, and the palette must always be set to black.</font></font><br len="0"><font><font lang="en"> The LPBs above define 25 rows, so there are 287 rows left. </font><font lang="en">In practice, however, only 256 can be used because frame colors must be left out at the top and bottom.</font></font></p>
<p align="justify" len="95" style="text-align: left;"><a name="237" id="237" len="0"></a><b len="61"><font color="#000066" size="5" lang="en">11th Video Interruptions</font></b></p>
<p align="justify" len="781" style="text-align: left;"><font><font lang="en">If the VINT bit in the row parameter block is one, the Nick chip sets the VRIQ output to low while MODSOR runs. </font><font lang="en">The edge of the signal is inget to the Dave chip and causes an abort of =80, provided video interrupt is enabled. </font><font lang="en">The Dave chip's interrupt sensor is edge sensitive, causing only one interruption with two consecutive MODSOR VINT bits. </font><font lang="en">To trigger another interruption, you must include a MODSOR in which vint is deleted.</font></font><br len="0"><font><font lang="en"> If an abort occurred, it is stored in the Dave chip and must be deleted before the interrupt is re-enabled. </font><font lang="en">That's the general description. </font><font lang="en">If the interrupt is completed and further interruptions are enabled before MODSOR runs, further interruptions will not take effect because the Dave chip input is edge sensitive.</font></font></p>
<p len="98"><a name="238" id="238" len="0"></a><b len="64"><font color="#000066" size="5" lang="en">12. Definition of colours</font></b></p>
<p align="justify" len="473" style="text-align: left;"><font><font lang="en">The Nick chip generates colorbytes for all points on the screen, depending on the value of the video, color mode, and palette registers. </font><font lang="en">These 8-bit color values are converted to separate red, green, and blue symbols that are available on the monitor connector. </font><font lang="en">From there, they go to the PAL encoder and uhf modulator to make them a TV signal.</font></font><br len="0"><font><font lang="en"> 3-3 of the 8 bits define red and green, 2 determines blue, so red and green can be 8 shades, blue can be 4 shades. </font><font lang="en">(G=green, R=red, B=blue)</font></font></p>
<table width="480" border="0" cellspacing="2" cellpadding="2" align="center" len="754">
<tbody len="736"><tr bgcolor="#FFFFCC" len="339">
<td len="28"><div align="center" len="2" lang="en">b7</div></td>
<td len="28"><div align="center" len="2" lang="en">b6</div></td>
<td len="28"><div align="center" len="2" lang="en">b5</div></td>
<td len="28"><div align="center" len="2" lang="en">b4</div></td>
<td len="28"><div align="center" len="2" lang="en">b3</div></td>
<td len="28"><div align="center" len="2" lang="en">b2</div></td>
<td len="28"><div align="center" len="2" lang="en">b1</div></td>
<td len="28"><div align="center" len="2" lang="en">b0</div></td>
</tr>
<tr bgcolor="#CCCCCC" len="339">
<td len="28"><div align="center" len="2" lang="en">G2</div></td>
<td len="28"><div align="center" len="2" lang="en">R2</div></td>
<td len="28"><div align="center" len="2" lang="en">B1</div></td>
<td len="28"><div align="center" len="2" lang="en">G1</div></td>
<td len="28"><div align="center" len="2" lang="en">R1</div></td>
<td len="28"><div align="center" len="2" lang="en">B0</div></td>
<td len="28"><div align="center" len="2" lang="en">G0</div></td>
<td len="28"><div align="center" len="2" lang="en">R0</div></td>
</tr>
</tbody></table>
<p align="justify" len="150" style="text-align: left;"><font lang="en">The three bits form the colors according to the formula below. </font><font lang="en">B0, G0, R0 is the most valuable bit of any color, blue can only have 4 different values.</font></p>
<blockquote len="205">
<p len="194"><font face="Verdana, Arial, Helvetica, sans-serif" len="136"><font lang="en">full red = (R2+R1*2+R0*4)/7</font><br len="0"><font lang="en"> full green = (G2+G1*2+G0*4)/7</font><br len="0"><font lang="en"> full blue = (B1+B0*2)/3</font></font></p>
</blockquote>
<p align="justify" len="95" style="text-align: left;"><a name="239" id="239" len="0"></a><font color="#000066" size="5" len="30"><b lang="en">13. Control registers</b></font></p>
<p align="justify" len="201" style="text-align: left;"><font lang="en">Z80 ports are reserved for Nick chip registers from 080h to 08Fh, although currently only the first four (080h-083h) are used. </font><font lang="en">These registers can only be written and their values cannot be read back.</font></p>
<table width="100%" border="0" cellspacing="2" cellpadding="2" len="2012">
<tbody len="1994"><tr len="1161">
<td width="6%" bgcolor="#CCCCCC" valign="top" len="4" lang="en">080h</td>
<td width="94%" len="1072"><p len="14"><b len="7" lang="en">FIXBIAS</b></p>
<ul len="1033">
<li len="47"><font lang="en">b0 ... </font><font lang="en">b4 - Top 5 bits of palette colors 8-15.</font></li>
<li len="853"><font><font lang="en">b5 ... </font><font lang="en">b6 - EC0-EC3 priority of external gradient, 16 external ghosts allowed. </font><font lang="en">The outer color is selected only when the EXTC is low and the screen is active (not a frame). </font></font><ul len="644">
<li len="54" lang="en">= 00 - EC0-EC3 to select the appropriate palette color,</li>
<li len="117" lang="en" style="">= 01 - EC0-EC3 to select the appropriate palette color when the inner screen generates the palette color in COL8-COL15.</li>
<li len="170" lang="en" style="">= 10 - EC0-EC3 to select the appropriate palette color if the inner screen generates the palette color in COL8-COL15 or the outer color is in COL0-COL7 (EC3 low).</li>
<li len="184" lang="en">= 11 EC0-EC3 to select the appropriate palette color if the inner screen generates the palette color in COL8-COL15 or the outer color in COL0-COL3 or COL8-COL11 (EC2 low).</li>
</ul>
</li>
<li len="66"><font lang="en">b7 - Nick chip VC1 output. </font><font lang="en">Switches off the internal speaker.</font></li>
</ul></td>
</tr>
<tr len="150">
<td width="6%" bgcolor="#CCCCCC" valign="top" len="4">081h</td>
<td width="94%" len="61" lang="en"><b len="6">BORDER</b> - 8-bit color value, sets the frame color.</td>
</tr>
<tr len="193">
<td width="6%" bgcolor="#CCCCCC" valign="top" len="4">082h</td>
<td width="94%" len="104"><font lang="en"><b len="3">LPL</b> - Lower part of the line parameter base indicator (A4 ... </font><font lang="en">A11). </font><font lang="en">The bottom 4 bits are generated by the Nick chip.</font></td>
</tr>
<tr len="444">
<td width="6%" bgcolor="#CCCCCC" valign="top" len="4">083h</td>
<td width="94%" len="355"><p len="10"><b len="3" lang="en">LPH</b></p>
<ul len="320">
<li len="62"><font lang="en">b0 ... </font><font lang="en">b3 - Top 4 bits (A12... </font><font lang="en">A15) (row parameter base indicator)</font></li>
<li len="25"><font lang="en">b4 ... </font><font lang="en">b5 - Unused.</font></li>
<li len="73"><font lang="en">b6 - 1 = normal mode. </font><font lang="en">If 0, the line parameter counter clock is disabled.</font></li>
<li len="73"><font lang="en">b7 - 1 = normal mode. </font><font lang="en">If 0, the row parameter base pointer is reloaded.</font></li>
</ul></td>
</tr>
</tbody></table>
<p len="106"><a name="240" id="240" len="0"></a><b len="72"><font color="#000066" size="6" lang="en">Part XI: Programming the DAVE chip</font></b></p>
<p len="48" lang="en" style="">The DPC audio chip performs the following functions:</p>
<ol len="592">
<li len="50" lang="en" style="">Multifunctional "3 sound + noise" stereo sound generator.</li>
<li len="15" lang="en" style="">Memory page.</li>
<li len="78" lang="en" style="">Address decrypting for card-based RAM, ROM, and cartridges.</li>
<li len="112" lang="en" style="">Interrupt system, interrupts with 1 Hz and programmable timing, and two external interrupt inputs.</li>
<li len="65" lang="en" style="">Reset circuit, compatibility with Z80 and dynamic RAM.</li>
<li len="118" lang="en" style="">Input/output gate signals used for external storage circuits and tri-state drives.</li>
<li len="21" lang="en" style="">1 MHz system clock.</li>
<li len="36" lang="en">Z80 wait status generator.</li>
</ol>
<p align="justify" len="708" style="text-align: left;"><font><font lang="en">The DPC audio chip has 22 internal registers, 17 of which can only be written. </font><font lang="en" style="">16 of the registers are used for audio generation purposes, four write/readable registers manage memory and one write/readable register is used for interrupt control. </font><font lang="en">Use the write-only register 22 to configure the general system configuration. </font><font lang="en">There are also 3 additional internal decoded registers that provide read and write gate signals to be used for external containers and three-state drives on the data bus. </font><font lang="en">Reset deletes all 22 internal registers.</font></font><br len="0"><font lang="en" style=""> The 3 sound generators produce a rectangular signal whose frequency can be programmed from 30 Hz to 125 kHz and which can be modified in different ways:</font></p>
<ul len="676">
<li len="300">
<div align="justify" len="265" style="text-align: left;"><font lang="en">Distortion may be introduced to use the output frequency to sample H.F. (high frequency) polynomifiers. </font><font lang="en" style="">The PN counters you can select are 4-, 5-bit, or 7-bit. </font><font lang="en">The 7-bit PN counter can be replaced with a variable-length 17/15/11/9-bit PN counter.</font></div>
</li>
<li len="159">
<div align="justify" len="124" style="text-align: left;" lang="en">Each channel has a simple, permeable filter, clocked by the output of another channel.</div>
</li>
<li len="180">
<div align="justify" len="145" style="text-align: left;" lang="en">On each channel, a ring modulator effect is provided with the signal of another channel output, which is added to the other input of the channel in question.</div>
</li>
</ul>
<p align="justify" len="3390" style="text-align: left;"><font><font lang="en">Normally, a 17-bit PN counter with a 31 kHz clock speed and false white noise is produced by the noise channel. </font><font lang="en">The counter input can be reduced to the output of any of the 3 audio channels and the length of the PN counter to 15, 11 or 9 bits. </font><font lang="en">This counter can also be replaced with a 7-bit PN counter. </font><font lang="en">The resulting noise is then applied to top and bottom permeable filters, and then to the ring modulator, each controlled by the output of a different sound channel.</font></font><br len="0"><font><font lang="en"> The output of the 3 sound generators and the noise generator is connected to 2 amplitude control circuits (left and right). </font><font lang="en">Each amplitude controller contains four 6-bit write-only registers (one register for each sound) that are multiplexed to an external 6-bit D/A (digit/analog) resistance network. </font><font lang="en">In its own selected time slice, each channel issues a value in its own amplitude register if the sound is high, otherwise the output is zero.</font></font><br len="0"><font><font lang="en"> One or two audio output channels can be converted to 6-bit D/A output when values in amplitude registers of audio channel 0 are outputed as constant outputs. </font><font lang="en">This is controlled by the 2 bits in the record-only audio configuration register. </font><font lang="en">You can use three additional bits to synchronize audio generators, which will not allow them to continue until the synchronization bit is set to low.</font></font><br len="0"><font><font lang="en"> The memory management section consists of 4 readable/write registers. </font><font lang="en">This allows you to use a 256*16k sheet. </font><font lang="en">You can make the outputs very impedance with BREQ.</font></font><br len="0"><font><font lang="en"> There are four stored interrupts available: the 1Hz interrupt is used for timing, the source of the other interrupt can be switched between the outputs of sound generators 50 Hz, l, kHz between the outputs of sound generators 0 or 1, and there are two external negatively enjoyed interrupts. </font><font lang="en">Each interrupt store has its own enable and delete, which is controlled by an 8-bit write-only register. </font><font lang="en">When you read this register, the system specifies the state of the four interrupt stores and the two interrupt inputs, as well as two containers that turn off the timing interruptions. </font><font lang="en">Setting any interrupt container will bring the IRQ line low. </font><font lang="en">The 50 Hz/1 kHz sound generator interrupt is selected by the two bits in the sound configuration register.</font></font><br len="0"><font><font lang="en"> Selector signals are generated for ROM, cartridge, videoRAM, and video input/output. </font><font lang="en">A clock output with a frequency of 1 MHz is also available.</font></font><br len="0"><font><font lang="en"> The Z80 reset signal is provided by rst0, which is formed by the external RC network on the CAP or by the run-off signal to RSTI. </font><font lang="en">The latter generates a pulse of 1 ms length, which is synchronized to the edge of the M1 to prevent loss of data stored in dynamic RAM. </font><font lang="en">The RST0 output requires an external 74ALSO4 inverter, which drives the system wipe line at the correct speed.</font></font><br len="0"><font><font lang="en"> To set the system to 16/64k built-in RAM, 8/12 MHz input hours, and wait states, a write-only system configuration register is used. </font><font lang="en">The wait state generator can be programmed without giving wait states, only waiting for the instruction access cycle, or on hold for all memory access operations.</font></font><br len="0"><font lang="en"> Note that access to videoRAM is never generated by waiting, as this would conflict with the Z80 clock speed.</font></p>
<p len="90"><a name="241" id="241" len="0"></a><b len="56"><font color="#000066" size="5" lang="en">Register Repeat</font></b></p>
<p len="27" lang="en" style="">(W = writeable, R = readable)</p>
<table width="100%" border="0" cellspacing="2" cellpadding="2" len="9160">
<tbody len="9142"><tr len="233">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="8">R0 W A0h</td>
<td width="88%" len="123" lang="en">b7-b0 - The lower byte of the 12-bit backwards number used to set the period of audio channel 0.</td>
</tr>
<tr len="764">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="8">R1 W A1h</td>
<td width="88%" len="654"><ul len="645">
<li len="99"><font lang="en">b3-b0 Top 4 bits of the above counter</font><br len="0"><font lang="en"> F(<font size="-1" len="3">out</font>) = 125,000/(n+1) Hz</font></li>
<li len="323"><font>b5-b4 </font><ul len="287">
<li len="16" lang="en">00 = clear sound</li>
<li len="54" lang="en">01 = Enable 4-bit polynoma counter distortion</li>
<li len="54" lang="en">10 = enable 5-bit polynoma counter distortion</li>
<li len="54" lang="en">11 = enable 7-bit polynoma counter distortion</li>
</ul>
</li>
<li len="83" lang="en">b6 - 1 = Enable a super-peri-perier filter that uses sound channel 1 as an hour</li>
<li len="63" lang="en">b7 - 1 = enable the ring modulator with sound channel 2.</li>
</ul></td>
</tr>
<tr len="141">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="8">R2 W A2h</td>
<td width="88%" len="31" lang="en">Like R0, but channel 1.</td>
</tr>
<tr len="263">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="8">R3 W A3h</td>
<td width="88%" len="153"><font lang="en">Like R1, but channel 1, except:</font><br len="0"><font lang="en"> the high-pass filter uses sound channel 2, the ring modulator uses the noise channel.</font></td>
</tr>
<tr len="140">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="8" lang="en">R4 W A4H</td>
<td width="88%" len="30" lang="en">Like R0, but channel 2.</td>
</tr>
<tr len="255">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="8">R5 W A5h</td>
<td width="88%" len="145"><font lang="en">Like R1, but channel 2, except:</font><br len="0"><font lang="en"> the high-pass filter uses the noise channel, the ring modulator uses sound channel 0.</font></td>
</tr>
<tr len="1026">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="8" lang="en">R6 W A6h</td>
<td width="88%" len="916"><ul len="907">
<li len="264"><font lang="en">B1, b0 - the clock frequency of the noise is selected </font><ul len="188">
<li len="14" lang="en">00 = 31,25 kHz</li>
<li len="21" lang="en">01 = audio channel 0</li>
<li len="22" lang="en">10 = Audio Channel 1</li>
<li len="22" lang="en">11 = Audio Channel 2</li>
</ul>
</li>
<li len="232"><font lang="en">b3, b2 - the length of the polynomath counter is selected </font><ul len="152">
<li len="11" lang="en">00 = 17 bits</li>
<li len="11" lang="en">01 = 15 bits</li>
<li len="11" lang="en">10 = 11 bits</li>
<li len="10" lang="en">11 = 9 bits</li>
</ul>
</li>
<li len="55" lang="en">b4 - 1 = replaces 17-bit and 7-bit polynomium counters</li>
<li len="90" lang="en">b5 - 1 = use sound channel 2 as a clock to enable the low-pass filter on noise</li>
<li len="90" lang="en">b6 - 1 = allows the high-pass filter to be applied to the noise using the price of the sound channel 0</li>
<li len="63" lang="en">b7 - 1 = enables the ring modulator with sound channel 1.</li>
</ul></td>
</tr>
<tr len="980">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="8" lang="en">R7 W A7h</td>
<td width="88%" len="870"><ul len="861">
<li len="179"><font lang="en">b0 - sync to audio channel 0: </font><ul len="106">
<li len="36" lang="en">1 = keeping at preset value,</li>
<li len="9" lang="en">0 = running</li>
</ul>
</li>
<li len="41" lang="en">b1 - sync to audio channel 1</li>
<li len="41" lang="en">b2 - sync to audio channel 2</li>
<li len="88" lang="en">b3 - 1 = switch the left audio output to the D/A converter, giving the value in R8.</li>
<li len="90" lang="en">b4 - 1 = switch the right audio output to the D/A converter, giving the value in R12.</li>
<li len="273"><font lang="en">b6-b5 - interrupt speed is selected: </font><ul len="194">
<li len="10" lang="en">00 = 1 kHz</li>
<li len="10" lang="en">01 = 50 Hz</li>
<li len="42" lang="en">Sound generator 10 = 0, f = 250,000/(n+1)</li>
<li len="23" lang="en">11 = Sound generator 1</li>
</ul>
</li>
<li len="18" lang="en">b7 - undefined</li>
</ul></td>
</tr>
<tr len="272">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="8" lang="en">R8 W A8h</td>
<td width="88%" len="162"><ul len="153">
<li len="89" lang="en">b5-b0 - 0 audio channel left amplitude Additional data for left D/A if R7 bit 3 = 1</li>
<li len="23" lang="en">b7-b6 - undefined</li>
</ul></td>
</tr>
<tr len="222">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="8" lang="en">R9 W A9h</td>
<td width="88%" len="112"><ul len="103">
<li len="39" lang="en">b5-b0 - audio channel 1 left amplitude</li>
<li len="23" lang="en">b7-b6 - undefined</li>
</ul></td>
</tr>
<tr len="223">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="9" lang="en">R10 W AAh</td>
<td width="88%" len="112"><ul len="103">
<li len="39" lang="en">b5-b0 - Audio Channel 2 Left Amplitude</li>
<li len="23" lang="en">b7-b6 - undefined</li>
</ul></td>
</tr>
<tr len="217">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="9" lang="en">R11 W ABh</td>
<td width="88%" len="106"><ul len="97">
<li len="33" lang="en">b5-b0 - noise channel left amplitude</li>
<li len="23" lang="en">b7-b6 - undefined</li>
</ul></td>
</tr>
<tr len="289">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="9" lang="en">R12 W ACh</td>
<td width="88%" len="178"><ul len="169">
<li len="105"><font lang="en">b5-b0 - 0 audio channel better amplitude</font><br len="0"><font lang="en"> In addition, data for better D/A if R7 bit 4 = 1</font></li>
<li len="23" lang="en">b7-b6 - undefined</li>
</ul></td>
</tr>
<tr len="225">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="9" lang="en">R13 W ADh</td>
<td width="88%" len="114"><ul len="105">
<li len="41"><font lang="en">b5-b0 - audio channel 1. </font><font lang="en">right amplitude</font></li>
<li len="23" lang="en">b7-b6 - undefined</li>
</ul></td>
</tr>
<tr len="224">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="9" lang="en">R14 W AEh</td>
<td width="88%" len="113"><ul len="104">
<li len="40" lang="en">b5-b0 - Audio Channel 2 better amplitude</li>
<li len="23" lang="en">b7-b6 - undefined</li>
</ul></td>
</tr>
<tr len="218">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="9" lang="en">R15 W AFh</td>
<td width="88%" len="107"><ul len="98">
<li len="34" lang="en">b5-b0 - noise channel better amplitude</li>
<li len="23" lang="en">b7-b6 - undefined</li>
</ul></td>
</tr>
<tr len="174">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="11" lang="en">R16 R/W B0h</td>
<td width="88%" len="61" lang="en">b7-b0 - Page register output for A21-A14 if A15'-A14' = 00</td>
</tr>
<tr len="174">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="11" lang="en">R17 R/W B1h</td>
<td width="88%" len="61" lang="en">b7-b0 - Page register output for A21-A14 if A15'-A14' = 01</td>
</tr>
<tr len="174">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="11" lang="en">R18 R/W B2h</td>
<td width="88%" len="61" lang="en">b7-b0 - Sheet register output for A21-A14 if A15'-A14' = 10</td>
</tr>
<tr len="174">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="11" lang="en">R19 R/W B3h</td>
<td width="88%" len="61" lang="en">b7-b0 - Page register output for A21-A14 if A15'-A14' = 11</td>
</tr>
<tr len="611">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="9" lang="en">R20 W B4h</td>
<td width="88%" len="500"><ul len="491">
<li len="64" lang="en">b0 - 1 = enable 1 kHz (50Hz) sound generator interrupt</li>
<li len="65" lang="en">b1 - 1 = delete the 1 kHz (50Hz) audio generator interrupt storage</li>
<li len="45" lang="en">b2 - 1 = enable 1 Hz interrupt</li>
<li len="46" lang="en">b3 - 1 = delete 1Hz interrupt storage</li>
<li len="30" lang="en">b4 - 1 = enable INT1</li>
<li len="31" lang="en" style="">b5 - 1 = delete int1 container</li>
<li len="30" lang="en">b6 - 1 = enable INT2</li>
<li len="31" lang="en">b7 - 1 = delete int2 container</li>
</ul></td>
</tr>
<tr len="629">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" height="19" len="9" lang="en">R20 R B4h</td>
<td width="88%" height="19" len="494"><ul len="485">
<li len="93" lang="en">b0 - 1 = 1 kHz (50Hz) sound generator divider (f( int )/2<font size="-1" len="3">rectangular</font>wave)</li>
<li len="56" lang="en">b1 - 1 = setting the 1 kHz (50Hz) sound generator storage</li>
<li len="45" lang="en">b2 - 1 Hz divider (0.5 Hz rectangular wave)</li>
<li len="34" lang="en">b3 - 1 = 1 Hz storage setting</li>
<li len="23" lang="en">b4 - INT1 input point</li>
<li len="31" lang="en">b5 - 1 = SET INT1 container</li>
<li len="23" lang="en" style="">b6 - INT2 input point</li>
<li len="31" lang="en">b7 - 1 = SET INT2 container</li>
</ul></td>
</tr>
<tr len="154">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="9" lang="en">R21 W B5h</td>
<td width="88%" len="43" lang="en">Active low-level gate signal on WR0 line</td>
</tr>
<tr len="154">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="9" lang="en">R21 R B5h</td>
<td width="88%" len="43" lang="en" style="">Active low-level gate signal on RD0 line</td>
</tr>
<tr len="154">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="9" lang="en">R22 W B6h</td>
<td width="88%" len="43" lang="en" style="">Active low-level gate signal on WR1 line</td>
</tr>
<tr len="154">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="9" lang="en">R23 W B7h</td>
<td width="88%" len="43" lang="en" style="">Active low-level gate signal on WR2 line</td>
</tr>
<tr len="576">
<td valign="top" bgcolor="#CCCCCC" width="12%" nowrap="nowrap" len="9" lang="en">R31 W BFh</td>
<td width="88%" len="465"><ul len="456">
<li len="36" lang="en">B0 - Built-in RAM: 0 = 64k, 1 = 16K</li>
<li len="50" lang="en">b1 - Input clock frequency, 0 = 8 MHz, 1 = 12 MHz</li>
<li len="311"><font lang="en">b3-b2 </font><ul len="275">
<li len="74" lang="en" style="">00 = waiting for all memory access operations except video RAM</li>
<li len="52" lang="en">01 = wait only at M1, except for video RAM</li>
<li len="20" lang="en">10 = no waiting</li>
<li len="20" lang="en">11 = no waiting</li>
</ul>
</li>
</ul></td>
</tr>
</tbody></table>
<p len="92"><a name="242" id="242" len="0"></a><b len="58"><font color="#000066" size="5" lang="en">Select outputs</font></b></p>
<table width="100%" border="0" cellspacing="2" cellpadding="2" len="997">
<tbody len="979"><tr len="191">
<td width="12%" valign="top" bgcolor="#CCCCCC" len="3" lang="en">VIO</td>
<td width="88%" len="102"><font lang="en">Low level for 80-8Fh in/out access. </font><font lang="en">Gated with IORQ, RD, WR on video chip</font></td>
</tr>
<tr len="182">
<td width="12%" valign="top" bgcolor="#CCCCCC" len="3" lang="en">ruin</td>
<td width="88%" len="93"><font lang="en">Low level for memory access on pages 0-3. </font><font lang="en" style="">(0-0FFFFh). Externally gated with RD</font></td>
</tr>
<tr len="193">
<td width="12%" valign="top" bgcolor="#CCCCCC" len="4" lang="en">CART</td>
<td width="88%" len="103"><font lang="en">Low level for memory access on 4-7 tabs. </font><font lang="en">(10000-1FFFFh). Externally gated with RD, WR</font></td>
</tr>
<tr len="367">
<td width="12%" valign="top" bgcolor="#CCCCCC" len="4" lang="en">WRAM</td>
<td width="88%" len="277"><font lang="en">Low level for memory access on FC-FFh pages (3F0000-3FFFFFh) if R31 b0 = 0</font><br len="0"><font><font lang="en"> Low for all memory accesses that are not ROM or cartridges. </font><font lang="en">(20000-2FFFFFh) if R31 b0 = 1. </font><font lang="en">MREQ, RD, WR on video chip.</font></font></td>
</tr>
</tbody></table>
<p len="127"><a name="242a" id="242a" len="0"></a><strong len="81"><font color="#000066" size="5" lang="en">Some additions to dave documentation</font></strong></p>
<p align="justify" len="425" style="text-align: left;"><strong len="12" lang="en">A0h-A5h port</strong><br len="0"><font><font lang="en" style=""> How sound generators work: a 12-bit counter calculates backwards from the specified frequency at 250 kHz (this is for a 4 MHz machine if bfh port bit 1 is not set). </font><font lang="en" style="">When it overflows (i.e. -1 would follow after 0), the 12-bit value specified in the registers is re-entered instead of -1, and one of the following occurs, depending on the distortion of the polynoma counter:</font></font></p>
<ul len="566">
<li len="86" lang="en" style="">if there is no distortion, the flip-flop output simply flips over,</li>
<li len="455">
<div align="justify" len="420" style="text-align: left;"><font lang="en" style="">if there is distortion, the output is the current output of the selected polynoma counter (false number generator); </font><font lang="en" style="">polynomual counters run continuously at 250 kHz, which also means, for example, that if the set frequency is the intestreased multiple of the length of the polynom counter (e.g. 15-1, 30-1, 45-1, etc.) for a 4-bit counter, there is no sound because the reading is always the same when sampling.</font></div>
</li>
</ul>
<p align="justify" len="857" style="text-align: left;"><font><font lang="en">A pass-through filter means that the flip-flop output is set to 0 at the top of each run-off of the channel output used for the clock speed (including any distortion, filter, and ring modulation). </font><font lang="en" style="">Therefore, if the frequency of the clock channel is greater than that of the filtered channel, the frequency is also doubled.</font></font><br len="0"><font lang="en" style=""> Ring modulation occurs after the super-perilitated filter (if enabled) and performs an XNOR operation with the output of the other channel (possibly already distorted, filtered, ring modulated).</font><br len="0"><font><font lang="en" style=""> Interestingly, sound generators do not work at the highest (0) frequency, so it is not possible to produce a 125 kHz rectangle signal. </font><font lang="en" style="">The counter may still be running (e.g. for interrupting, but interrupting so fast doesn't make much sense) and there may be a sound when choosing a polynomi counter, but this should be checked on a real machine.</font></font></p>
<p align="justify" len="717" style="text-align: left;"><strong len="8">A6h port</strong><br len="0"><font><font lang="en"> The polynomi counter used for the noise channel is refreshed to the top of the clock channel output (possibly already distorted, filtered, ring modulated) and is not fixed at 250 kHz, as in sound channels. </font><font lang="en">The 31.25 kHz mode corresponds to the use of a 4-1 frequency clock channel.</font></font><br len="0"><font lang="en"> Setting up bit 4 (swapping 7-bit and 17-bit counters) means that the optional length (9/11/15/17-bit) counter can be used by audio channels instead of 7-bit (and in this case it will have a 250 kHz clock speed) or the polynom counter for the noise channel will be the 7-bit (250 kHz instead of the optional clock).</font><br len="0"><font lang="en"> For the noise channel, the sequence of effects (if allowed):</font></p>
<ol len="542">
<li len="263">
<div align="justify" len="228" style="text-align: left;" lang="en">low pass filter: only the output of channel 2 (distorted, filtered, etc.) is sampled on the run-off edges of the polynoma counter (but otherwise it still runs at the set frequency) instead of the clock edges.</div>
</li>
<li len="158" lang="en" style="">high pass filter: similar to sound channels: the output of the container is set to 0 on the running edges of Channel 0 until the next sampling of the polynomi counter.</li>
<li len="84" lang="en" style="">ring modulation: performs an XNOR operation with channel 1, similar to sound channels.</li>
</ol>
<p len="78"><strong len="17" lang="en">Polynomi counters</strong><br len="0"><font lang="en"> DAVE contains 4 polynoma counters:</font></p>
<ul len="709">
<li len="88" lang="en" style=""> a 4-bit that always runs at 250 kHz and can only be used by audio channels,</li>
<li len="87" lang="en" style="">a 5-bit that always runs at 250 kHz and can only be used by audio channels,</li>
<li len="226">
<div align="justify" len="191" style="text-align: left;" lang="en">a 7-bit clock that either clocks at 250 kHz and can be used by audio channels (A6h port bit 4 = 0) or the noise channel input (A6h port bit 4 = 1) at the clock speed set on the A6h port</div>
</li>
<li len="259">
<div align="justify" len="224" style="text-align: left;" lang="en">an optional length of 9/11/15/17 bits, which either clocks the noise channel input (A6h port bit 4 = 0) or operates at 250 kHz clock speed and can be used by audio channels (A6h port bit 4 = 1).</div>
</li>
</ul>
<p len="53" lang="en">How counters work when their output is refreshed:</p>
<ul len="224">
<li len="46" lang="en"> counter is moved one bit to the left</li>
<li len="114" lang="en">result of the XOR operation between the new bit 0 before two bits (selected for that counter) before the step</li>
<li len="27" lang="en" style="">the output will be the new bit 0</li>
</ul>
<p len="71" lang="en">The bits between which XOR operation is carried out, i.e. the binary "polynomial":</p>
<ul len="332">
<li len="35" lang="en" style=""> For 4-bit counters, bits 3 and 2</li>
<li len="34" lang="en">For 5-bit counters, bits 4 and 2</li>
<li len="34" lang="en">For 7-bit counters, bits 6 and 5</li>
<li len="34" lang="en">For 9-bit counters, bits 8 and 4</li>
<li len="36" lang="en">For 11-bit counters, bits 10 and 8</li>
<li len="37" lang="en" style="">For 15-bit counters, bits 14 and 13</li>
<li len="37" lang="en">For 17-bit counters, bits 16 and 13</li>
</ul>
<p align="justify" len="294" style="text-align: left;"><font lang="en" style="">The length of the false number sequence is 2^N-1 (i.e. 31 for a 5-bit counter), because the counter cannot be 0 because then the output could only be 0 in an infinite loop (0 XOR 0 = 0). </font><font lang="en">The starting value may be every bit = 1 when you turn it on, but you can't know that for sure, and it doesn't matter much.</font></p>
<p len="25"><strong len="8" lang="en">A7h port</strong></p>
<ul len="1137">
<li len="320"><font lang="en">b0-b2: turning on "synchronization" means: </font><ul len="240">
<li len="40" lang="en" style="">the counter for that audio channel is not running</li>
<li len="87" lang="en">keeps the counter continuously at the frequency set in the A0h-A5h registers</li>
<li len="52" lang="en" style="">sets the flip-flop output of the rectangle generator to 0</li>
</ul>
</li>
<li len="263">
<div align="justify" len="228" style="text-align: left;" lang="en">b3-b4: when D/A mode is turned on, the output has four times the volume set on the A8h or ACh port (i.e. the effect is as if the output of all four channels is continuously 1 and their volume is the same as channel 0)</div>
</li>
<li len="517">
<div align="justify" len="482" style="text-align: left;"><font lang="en" style="">5-b6: the interrupt here is not controlled by distorted, filtered, etc. output of sound generators, but by the counter of that sound generator directly, after which bit 0 of the B4h port is tipped over and bit 1 is adjusted (if allowed). </font><font lang="en">The 1 kHz interrupt corresponds to 250-1 sound generator frequencies and the 50 Hz interrupt corresponds to 5000-1, i.e. it is not the speed of the video interrupt, but exactly 80000 Z80 cycles (or 120000 if the BFh port bit 1 is set).</font></div>
</li>
</ul>
<strong len="9" lang="en">B4h port:</strong>
<ul len="171">
<li len="46" lang="en">bit 0-1: 50 Hz/1 kHz/sound generator interrupt</li>
<li len="25" lang="en">bit 2-3: 1 Hz interrupt</li>
<li len="26" lang="en">bit 4-5: video interrupt</li>
<li len="25" lang="en">bits 6-7: (not used ?)</li>
</ul>
<p align="justify" len="942" style="text-align: left;"><font><font lang="en">Bits 0, 2, 4, and 6 are always readable, even if the interrupt is disabled; </font><font lang="en">you can enable interrupt by writing '1' in these bits and by writing '0'.</font></font><br len="0"><font><font lang="en"> Bits 1, 3, 5, and 7 shall only work if the appropriate interrupt is permitted, otherwise it shall always be 0; </font><font lang="en">if interrupting is permitted, bits 1 and 3 shall be adjusted to each (up and down) edge of bits 0 and 2, and bits 5 and 7 shall be set only for the running edges of bits 4 and 6.</font></font><br len="0"><font><font lang="en"> For Z80, the interrupt request is the result of an OR operation between bits 1, 3, 5 and 7; </font><font lang="en">these bits can be deleted either by recalling '1' bits or by disabling the interrupt. </font><font lang="en">Otherwise, until all 4 bits are deleted, the Z80 generates a continuous interruption.</font></font><br len="0"><font><font lang="en"> Bit 4 comes from NICK and is a copy of the VINT bit read from the current LPB on that line; </font><font lang="en">I think NICK rereads this at the beginning of each line from LPB (but maybe it would be better to check it on a real machine)</font></font></p>
<p align="justify" len="221" style="text-align: left;"><font lang="en">This also shows that the video interruption occurs only at the beginning of the first line without VINT bits after the LPB that contains the interrupt request. </font><font lang="en">The same reason why there can be no video interruption in two consecutive rows.</font></p>
<p len="25"><strong len="8">B5h port</strong></p>
<p len="647"><font lang="en">DAVE 3 provides address decryption for external I/O devices, combined with read/write signals to simplify the design of the external device. </font><font lang="en">The 3 I/O ports are B5h, B6h, B7h, each with a separate control signal for read and write, the outputs of dave wr0/rd0, WR1/RD1, WR2/RD2, which are connected to the machine's various outputs and inputs (keyboard, recorder, printer, serial port, joystick). </font><font lang="en">RD2 is not even used! </font><font lang="en">(If this had been exploited, it would have been easy to build an 8-bit input into the machine. </font><font lang="en">E.g. by hooking up an A/D conversion chip to the tape recorder input and reading it by RD2, the digitizer could have been ready...)</font></p>
<p len="144"><font lang="en">For B5h write (WR0), 8 bits are stored in the U25 74LS273 IC container. </font><font lang="en">These 8 bits are used by multiple devices:</font></p>
<ul len="1239">
<li len="942">
<div align="justify" len="907" style="text-align: left;"><font lang="en">bit 0-3: Select keyboard matrix row (only in rows 0-9)</font><br len="0"><font><font lang="en"> This selects the matrix row for the keyboard. </font><font lang="en">This is done by the U26 74LS145 IC, a BCD set-top box with 10 enabling outputs. </font><font lang="en">If this 4-bit value is between 0h and 9h, the corresponding output is 0. </font><font lang="en">No outputs are active for values between Ah and Fh. </font><font lang="en">The 10 outputs are KB0-KB9 signals, which go to the 10-pin part of the foil connector, and are also deduced to the CONTROL 1/2 connectors, divided into control 1 connectors KB0-KB4, CONTROL 2 to KB5-KB9. </font><font lang="en">This would have allowed for development if the 4 bit had been fully decoded in later Enterprise models, which would have allowed for a more serious multi-key keyboard with a maximum of 16x8 or 128 buttons.</font></font><br len="0"><font lang="en"> The remaining 4 bits pass through an inverter, i.e. in each case a value of 1 activates the function:</font></div>
</li>
<li len="39" lang="en">bit 4: STROBE output to printer port</li>
<li len="65" lang="en">bit 5: turn off tape recorder sound (if bit 1, no tape recorder)</li>
<li len="66" lang="en">bit 6: Turn on REM1 (if bit 1 is turned on)</li>
<li len="66" lang="en">bit 7: Turn on REM2 (if bit 1 is on, REM2 is on)</li>
</ul>
<p len="101"><font lang="en">reading:</font><br len="0"><font lang="en"> Reads the selected line of the keyboard matrix via U27 74LS373 IC:</font></p>
<ul len="155">
<li len="142"><font lang="en">bit 0-7: the current state of the selected line of the keyboard matrix; </font><font lang="en">if a key is pressed, the matching bit is '0', otherwise '1'.</font></li>
</ul>
<blockquote len="5073">
<table width="680" border="1" cellpadding="2" cellspacing="0" len="4999">
<tbody len="4979"><tr len="174">
<td width="40" rowspan="2" bgcolor="#CCCCCC" len="20"><strong len="3" lang="en">line</strong></td>
<td colspan="8" bgcolor="#FFFFCC" len="46"><div align="center" len="20"><strong len="3" lang="en">bit</strong></div></td>
</tr>
<tr len="717">
<td width="80" bgcolor="#FFFFCC" len="44"><div align="center" len="18"><strong len="1" lang="en">0</strong></div></td>
<td width="80" bgcolor="#FFFFCC" len="44"><div align="center" len="18"><strong len="1" lang="en">1</strong></div></td>
<td width="80" bgcolor="#FFFFCC" len="44"><div align="center" len="18"><strong len="1" lang="en">2</strong></div></td>
<td width="80" bgcolor="#FFFFCC" len="44"><div align="center" len="18"><strong len="1" lang="en">3</strong></div></td>
<td width="80" bgcolor="#FFFFCC" len="44"><div align="center" len="18"><strong len="1" lang="en">4</strong></div></td>
<td width="80" bgcolor="#FFFFCC" len="44"><div align="center" len="18"><strong len="1" lang="en">5</strong></div></td>
<td width="80" bgcolor="#FFFFCC" len="44"><div align="center" len="18"><strong len="1" lang="en">6</strong></div></td>
<td width="80" bgcolor="#FFFFCC" len="44"><div align="center" len="18"><strong len="1" lang="en">7</strong></div></td>
</tr>
<tr len="405">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">0</strong></td>
<td len="27"><div align="center" len="1" lang="en">N</div></td>
<td len="27"><div align="center" len="1">\</div></td>
<td len="27"><div align="center" len="1" lang="en">b</div></td>
<td len="27"><div align="center" len="1" lang="en">C</div></td>
<td len="27"><div align="center" len="1" lang="en">v</div></td>
<td len="27"><div align="center" len="1" lang="en">x</div></td>
<td len="27"><div align="center" len="1" lang="en">z</div></td>
<td len="31"><div align="center" len="5" lang="en">SHF_L</div></td>
</tr>
<tr len="407">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">1</strong></td>
<td len="27"><div align="center" len="1" lang="en">H</div></td>
<td len="30"><div align="center" len="4" lang="en">lock</div></td>
<td len="27"><div align="center" len="1" lang="en">g</div></td>
<td len="27"><div align="center" len="1" lang="en">d</div></td>
<td len="27"><div align="center" len="1" lang="en">F</div></td>
<td len="27"><div align="center" len="1" lang="en">and</div></td>
<td len="27"><div align="center" len="1" lang="en">the</div></td>
<td len="30"><div align="center" len="4" lang="en">ctrl</div></td>
</tr>
<tr len="403">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">2</strong></td>
<td len="27"><div align="center" len="1" lang="en">u</div></td>
<td len="27"><div align="center" len="1" lang="en">Q</div></td>
<td len="27"><div align="center" len="1" lang="en">Y</div></td>
<td len="27"><div align="center" len="1" lang="en">R</div></td>
<td len="27"><div align="center" len="1" lang="en">T</div></td>
<td len="27"><div align="center" len="1" lang="en">this</div></td>
<td len="27"><div align="center" len="1" lang="en">W</div></td>
<td len="29"><div align="center" len="3" lang="en">Tab</div></td>
</tr>
<tr len="403">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">3</strong></td>
<td len="27"><div align="center" len="1" lang="en">7</div></td>
<td len="27"><div align="center" len="1" lang="en">1</div></td>
<td len="27"><div align="center" len="1" lang="en">6</div></td>
<td len="27"><div align="center" len="1" lang="en">4</div></td>
<td len="27"><div align="center" len="1" lang="en">5</div></td>
<td len="27"><div align="center" len="1" lang="en">3</div></td>
<td len="27"><div align="center" len="1" lang="en">2</div></td>
<td len="29"><div align="center" len="3" lang="en">Esc</div></td>
</tr>
<tr len="409">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">4</strong></td>
<td len="28"><div align="center" len="2" lang="en">F4</div></td>
<td len="28"><div align="center" len="2" lang="en">F8</div></td>
<td len="28"><div align="center" len="2" lang="en">F3</div></td>
<td len="28"><div align="center" len="2" lang="en">F6</div></td>
<td len="28"><div align="center" len="2" lang="en">F5</div></td>
<td len="28"><div align="center" len="2" lang="en">F7</div></td>
<td len="28"><div align="center" len="2" lang="en">F2</div></td>
<td len="28"><div align="center" len="2" lang="en">F1</div></td>
</tr>
<tr len="363">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">5</strong></td>
<td len="27"><div align="center" len="1" lang="en">8</div></td>
<td len="6">&nbsp;</td>
<td len="27"><div align="center" len="1" lang="en">9</div></td>
<td len="27"><div align="center" len="1">-</div></td>
<td len="27"><div align="center" len="1" lang="en">0</div></td>
<td len="27"><div align="center" len="1">^</div></td>
<td len="31"><div align="center" len="5" lang="en">Erase</div></td>
<td len="6">&nbsp;</td>
</tr>
<tr len="359">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">6</strong></td>
<td len="27"><div align="center" len="1" lang="en">J</div></td>
<td len="6">&nbsp;</td>
<td len="27"><div align="center" len="1" lang="en">K</div></td>
<td len="27"><div align="center" len="1">;</div></td>
<td len="27"><div align="center" len="1" lang="en">L</div></td>
<td len="27"><div align="center" len="1">:</div></td>
<td len="27"><div align="center" len="1">]</div></td>
<td len="6">&nbsp;</td>
</tr>
<tr len="422">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">7</strong></td>
<td len="30"><div align="center" len="4" lang="en">stop</div></td>
<td len="28"><div align="center" len="2" lang="en">down</div></td>
<td len="30"><div align="center" len="4" lang="en">right</div></td>
<td len="29"><div align="center" len="3" lang="en">up</div></td>
<td len="31"><div align="center" len="5" lang="en">PAUSE</div></td>
<td len="29"><div align="center" len="3" lang="en">left</div></td>
<td len="31"><div align="center" len="5" lang="en">Enter</div></td>
<td len="29"><div align="center" len="3" lang="en">alto</div></td>
</tr>
<tr len="413">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">8</strong></td>
<td len="27"><div align="center" len="1" lang="en">m</div></td>
<td len="29"><div align="center" len="3" lang="en">Del</div></td>
<td len="27"><div align="center" len="1">,</div></td>
<td len="27"><div align="center" len="1">/</div></td>
<td len="27"><div align="center" len="1">.</div></td>
<td len="31"><div align="center" len="5" lang="en">SHF_R</div></td>
<td len="31"><div align="center" len="5" lang="en">Space</div></td>
<td len="29"><div align="center" len="3" lang="en">Ins</div></td>
</tr>
<tr len="338">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">9</strong></td>
<td len="27"><div align="center" len="1" lang="en">i</div></td>
<td len="6">&nbsp;</td>
<td len="27"><div align="center" len="1" lang="en">0</div></td>
<td len="27"><div align="center" len="1">@</div></td>
<td len="27"><div align="center" len="1" lang="en">P</div></td>
<td len="27"><div align="center" len="1">[</div></td>
<td len="6">&nbsp;</td>
<td len="6">&nbsp;</td>
</tr>
</tbody></table>
</blockquote>
<p len="25"><strong len="8" lang="en">B6h port</strong></p>
<p len="144"><font lang="en">For B6h write (WR1), 8 bits are stored in the U24 74LS273 IC container. </font><font lang="en">This is the 8-bit output of the printer port.</font></p>
<p len="223"><font lang="en">reading:</font><br len="0"><font lang="en"> B6h is read (RD1) via U28 74LS373 IC, but the input of the B6h is already received from multiple locations.</font><br len="0"><font lang="en"> Bit 0-2: Control connectors Keyboard J, Keyboard L, Keyboard K inputs:</font></p>
<ul len="120">
<li len="107" lang="en">bit 0: joystick direction status ('0': active, '1': not active)</li>
</ul>
<blockquote len="2501">
<table width="120" border="1" cellspacing="0" cellpadding="2" len="1131">
<tbody len="1111"><tr len="124">
<td width="40" bgcolor="#CCCCCC" len="20"><strong len="3" lang="en">line</strong></td>
<td bgcolor="#FFFFCC" len="20"><strong len="3" lang="en">bit</strong></td>
</tr>
<tr len="109">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">0</strong></td>
<td bgcolor="#FFFFCC" len="18"><strong len="1" lang="en">0</strong></td>
</tr>
<tr len="79">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">1</strong></td>
<td len="6" lang="en">J1 fire</td>
</tr>
<tr len="79">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">2</strong></td>
<td len="6" lang="en">J1 up</td>
</tr>
<tr len="78">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">3</strong></td>
<td len="5" lang="en">J1 down</td>
</tr>
<tr len="79">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">4</strong></td>
<td len="6" lang="en">J1 left</td>
</tr>
<tr len="79">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">5</strong></td>
<td len="6" lang="en">J2 fire</td>
</tr>
<tr len="79">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">6</strong></td>
<td len="6" lang="en">J2 up</td>
</tr>
<tr len="78">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">7</strong></td>
<td len="5" lang="en">J2 down</td>
</tr>
<tr len="79">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">8</strong></td>
<td len="6" lang="en">J2 left</td>
</tr>
<tr len="96">
<td bgcolor="#CCCCCC" len="18"><strong len="1" lang="en">9</strong></td>
<td nowrap="nowrap" len="7" lang="en">J2 better</td>
</tr>
</tbody></table>
<p align="justify" len="1270" style="text-align: left;"><font><font lang="en" style="">How does the joystick work: for "conventional" machines, the 4 directions+fire are the inputs, the joy contacts connect them to the GND, so here the GND is the common line. </font><font lang="en">For EP, 4 directions+fire is 5 outputs, of which there are two doses for the two Control connectors, which correspond to the KB0-KB9 signals also used in keyboard matrix row selection, which is selected at level 0. </font><font lang="en">Common is an input, and if the joystick's contact connects it to the currently selected direction, it also costs 0.</font></font><br len="0"><font><font lang="en"> However, this can be done not only with the keyboard J input that is normally used, but also with the L and K inputs! </font><font lang="en">This allows you to query 3x5 contacts in a CONTROL connector, a total of 30 on the two connectors! </font><font lang="en">There was no problem making a joy converter that would connect 2 or 3 traditional joysticks to a CONTROL input, i.e. up to 6 external joysticks on an EP! </font><font lang="en">Or it could have been made with multi-button EP joysticks, e.g. for car or flight simulators. </font><font lang="en">The JOY function could easily handle 3,4,5,6 joysticks, it would be nothing but a different bit of the value read about B6h. </font><font lang="en">It is believed that the numeric tastture sold separately may have used the extra knowledge of the CONTROL port.</font></font></p>
</blockquote>
<ul len="412">
<li len="92" lang="en">bit 3: READY input from the printer port, 0 indicates when the printer is ready to communicate.</li>
<li len="51" lang="en">bit 4: Serial/Net Connector Data Input (DATA IN)</li>
<li len="57" lang="en">bit 5: Serial/Net Connector Status Input (STATUS IN).</li>
<li len="97"><font lang="en">bit 6: tape recorder input level (if there is no input, it is '1'; </font><font lang="en">'0' = high level, '1' = low level)</font></li>
<li len="54" lang="en">bit 7: tape recorder input (if no input, '1')</li>
</ul>
<p len="25"><strong len="8" lang="en">B7h port</strong></p>
<p len="97" lang="en">For B7h writing (WR2), only 2 bits are stored in the U30 74LS74 IC container:</p>
<ul len="134">
<li len="52" lang="en" style="">bit 0: Serial/Net Connector Data Output (DATA OUT)</li>
<li len="57" lang="en" style="">bit 1: Serial/Net Connector Status Output (STATUS OUT)</li>
</ul>
<p len="32" lang="en">B7h Reading (RD2) not used.</p>
<p len="25"><strong len="8" lang="en">BFh port</strong></p>
<p len="5" lang="en">writing:</p>
<ul len="1452">
<li len="158"><font lang="en">bit 0: built-in RAM size ('0': 64K, '1': 16K); </font><font lang="en">Normally, you should always write '0'. </font><font lang="en">If '1', only the FF segment will be decoded as video memory.</font></li>
<li len="422">
<div align="justify" len="387" style="text-align: left;"><font lang="en">bit 1: frequency divider: if not set, the aforementioned frequency "250 kHz" is 16th of the Z80 clock speed, otherwise it must be divided by 24. </font><font lang="en">So, if this is set, all DAVE frequencies (counters, sound generators, 1 Hz/50 Hz/1 kHz interrupt) will be 1.5 times lower, and on a turbocharged machine all frequencies will be multiplied proportionally to the Z80's changed clock speed.</font></div>
</li>
<li len="69" lang="en">bit 3: 1: disable memory waiting (no effect on video memory)</li>
<li len="118" lang="en">bit 2: memory waiting mode (only if it is not disabled with bit 3 and no access to video memory):</li>
<li len="46" lang="en">if 0, wait for all memory operations</li>
<li len="566">
<div align="justify" len="531" style="text-align: left;"><font><font lang="en">if 1, then wait only for M1 reading - this is the default mode. </font><font lang="en">Reading M1 is the first byte of the Z80 instructions; </font><font lang="en">For DDh, EDh, and FDh prefix, the instructionbyte after prefix is also considered M1 reading, and for CBh prefix, the following instructionbyte is M1 read only if there was no DDh or FDh prefix before CBh: </font></font><ul len="189">
<li len="2" lang="en">NN</li>
<li len="6" lang="en">CBh NN</li>
<li len="6" lang="en">DDh NN</li>
<li len="6" lang="en">EDh NN</li>
<li len="6" lang="en">FDh NN</li>
<li len="7" lang="en">DDh CBh</li>
<li len="7" lang="en">FDh CBh</li>
</ul>
</div>
</li>
</ul>
<p len="67" lang="en">the R register is also updated for M1 reads.</p>
<p align="justify" len="1134" style="text-align: left;"><font lang="en">The wait is 1 Z80 cycle on a normal 4 MHz machine and 2 Z80 <a href="http://www.translatoruser-int.com/translate?&amp;to=en&amp;csId=0d44cef7-bced-44f0-a7d0-c9f0a1436c7e&amp;usId=5eff2b38-d9a8-4790-a1ca-5bdfc82bbfcc&amp;dl=en&amp;ref=trb_ct&amp;ac=true&amp;dt=2021%2f6%2f16%2013%3a27&amp;h=wNoxJWghcgam609LQEzxQisCwdbKVI2B&amp;a=http%3a%2f%2fep128.hu%2fEp_Hardware%2fEp_Turbok.htm" len="6">cycles</a> on a turbocharged (6 or 7.119 MHz) machine. </font><font lang="en">Bit 1 has no effect on the level of anticipation. </font><font lang="en">For video RAM, the expectations that can be set here have no effect, since access to the frequency 889846 Hz must be synchronized. </font><font lang="en">The simple way to approach this on a 4 MHz machine is to add 1.5 to the number of Z80 cycles between the two video RAM or video I/O ports (because nick 80h-8Fh ports have such a wait), and then round it up to divide it if the result cannot be divided by 4.5. </font><font lang="en">The difference between this wait and the original cycle number (before adding 1.5) is 0.5 Z80 cycle units. </font><font lang="en">However, it is important to know exactly when memory operations occur within the instruction:</font></p>
<ul len="311">
<li len="83" lang="en"> M1 reading: total duration 4 cycles, reading time including 2.0 cycles,</li>
<li len="97" lang="en">normal memory reading and writing: total duration 3 cycles, memory operation time 2.5 cycles,</li>
<li len="94" lang="en">I/O port read and write: 4 cycles, including 3.5 cycles, the actual I/O operation occurs.</li>
</ul>
<p len="25"><strong len="8" lang="en">distortion</strong></p>
<p len="122"><font lang="en">"Distortion" generates virtually a short period of repetitive "noise" instead of a rectangular signal. </font><font lang="en">Here's exactly how it works:</font></p>
<ul len="397">
<li len="95" lang="en">the false number generator to be used for distortion runs continuously at a fixed high clock frequency</li>
<li len="277">
<div align="justify" len="242" style="text-align: left;" lang="en">the sound generator does not invert its output when it runs its counter (which would result in a normal rectangular signal), but instead probes the current output of the high frequency noise generator and the new output is the new output until the counter runs again.</div>
</li>
</ul>
<p len="20" lang="en">A detailed example:</p>
<ul len="269">
<li len="113" lang="en">The 4-bit polynomi counter repeats the 1000100110111 series in infinity at a clock frequency of 250 kHz.</li>
<li len="131" lang="en">The frequency code of the sound generator to be distorted is 8, i.e. the polynomium counter is sampled at a frequency of 250000 / (8 + 1) Hz.</li>
</ul>
<table width="760" border="0" align="center" cellpadding="2" cellspacing="2" len="943">
<tbody len="925"><tr len="163">
<td len="146"><font size="2" face="Courier New, Courier, mono" len="90" lang="en">100010011010111100010011010111100010011010111100010011010111100010011010111100010011010111</font></td>
</tr>
<tr len="563">
<td len="546"><font size="2" face="Courier New, Courier, mono" len="490">*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font></td>
</tr>
<tr len="165">
<td len="148"><font size="2" face="Courier New, Courier, mono" len="92" lang="en"> 111111111000000000000000000111111111000000000111111111000000000000000000111111111000000000 </font></td>
</tr>
</tbody></table>
<ul len="659">
<li len="289">
<div align="justify" len="254" style="text-align: left;"><font lang="en">Each character has a 250 kHz cycle. </font><font lang="en">The upper row shows the output of the polynominum counter, the time of sampling in the middle and the distorted sound generator output in the bottom (if there was no distortion, 9 "1" and 9 "0" would alternate).</font></div>
</li>
<li len="345">
<div align="justify" len="310" style="text-align: left;"><font lang="en">It is worth noting that only 5 bit-length series (10010) are repeated on the output instead of 15. </font><font lang="en">This is because the polynomath counter and the sampling period have a common divider (15 and 9, both divisible by 3). </font><font lang="en">In fact, there would be no audible sound during a sampling period of 15.</font></div>
</li>
</ul>
<p len="23"><strong len="6" lang="en">Filters</strong></p>
<p len="119" lang="en">DAVE filters have little to do with analog filters, in fact they are just plain binary operations:</p>
<ul len="465">
<li len="195" lang="en">The super througher filter sets the filtered channel output to 0 for the running edges of the channel used for the clock speed, so it effectively achieves a "permeable" effect by reducing the fill factor.</li>
<li len="127" lang="en">The low pass filter (only at the noise channel) samples its input at the run-off edges of the clock channel and stores it.</li>
<li len="106"><font lang="en">Ring modulation is XNOR gate. </font><font lang="en">This even corresponds to analog ring modulation between sign rectangular signals:</font></li>
</ul>
<table width="320" border="0" align="center" cellpadding="2" cellspacing="2" len="335">
<tbody len="317"><tr len="110">
<td width="50%" nowrap="nowrap" len="12" lang="en">0 XNOR 0 = 1</td>
<td width="50%" nowrap="nowrap" len="11" lang="en">-1 * -1 = 1</td>
</tr>
<tr len="54">
<td len="12" lang="en">0 XNOR 1 = 0</td>
<td len="11" lang="en">-1 * 1 = -1</td>
</tr>
<tr len="55">
<td len="13" lang="en">1 XNOR 0 = 0 </td>
<td len="11" lang="en">1 * -1 = -1</td>
</tr>
<tr len="52">
<td len="12" lang="en">1 XNOR 1 = 1</td>
<td len="9" lang="en">1 * 1 = 1</td>
</tr>
</tbody></table>
<p len="79"><strong len="62" lang="en">Detailed operation of DAVE 0-2, i.e. normal sound channels:</strong></p>
<ul len="1382">
<li len="440">
<div align="justify" len="405" style="text-align: left;"><font lang="en">The frequency code (0-4095) control a counter, which calculates from the value entered down to 0, i.e. produces a frequency of 250000/(N+1) Hz (the sound generators have a clock speed of 250 kHz, but if the BFh I/O port has an input clock speed of 12 MHz, it will be 166.67 kHz instead). </font><font lang="en">The 0 frequency code does not work reliably with sound generators, so the highest frequency cannot be produced on a real machine.</font></div>
</li>
<li len="400"><font lang="en" style="">The sound generator is essentially a flip-flop on which one of the following actions occurs each time the counter runs: </font><ul len="263">
<li len="109" lang="en">if there is no distortion, the output simply flips to the other state (125000 / (N + 1) Hz rectangle signal)</li>
<li len="111" lang="en">if there is distortion, it will sample the current output of the selected polynoma counter and will be the new output</li>
</ul>
</li>
<li len="227">
<div align="justify" len="192" style="text-align: left;" lang="en">If the synchronization bit is set for that channel on the A7h I/O port, it keeps the counter at programmed value (not running) and sets the flip-flop output to 0.</div>
</li>
<li len="177" lang="en">The high-pass filter sets the flip-flop output to 0 at the run-off edges of the channel used for its clock speed (this may double the frequency for a rectangular signal).</li>
<li len="77" lang="en">Ring modulation (XNOR gate) is the last operation on the output, if enabled.</li>
</ul>
<p align="justify" len="549" style="text-align: left;"><font lang="en">Each effect that performs an action with a different channel uses the final ring modulation (if any) output of the other channel.</font><br len="0"><font><font lang="en"> For the noise channel, the sequence of effects is: low-pass filter, high-pass filter, ring modulation. </font><font lang="en">The polynomi counter used for the noise channel does not run at a fixed 250 kHz, but at the selected noise clock speed (31.25 kHz or the running edges of the output of one of the audio channels).</font></font><br len="0"><font lang="en"> The sound generator interruption occurs when the sound generator counter runs, so it has no effect on the different effects.</font></p>
<p len="112"><a name="243" id="243" len="0"></a><b len="78"><font color="#000066" size="6" lang="en">ENTERPRISE Connection Point Information </font></b></p>
<p len="71" lang="en">The enterprise computer connection points are allocated as follows:</p>
<blockquote len="124">
<p len="113"><font lang="en">Looking towards the connector on the Enterprise:</font><br len="0"><font lang="en"> Point B1 at the top left</font><br len="0"><font lang="en"> A1 point at the bottom left</font></p>
</blockquote>
<p len="108" lang="en" style="">The edge connectors have a scale distance of 2.54 mm; some positions are unusable but taken into account.</p>
<p len="52"><b len="45"><font size="4" lang="en">Control 1 / Control 2</font></b></p>
<blockquote len="230">
<p len="219"><font lang="en">A1 - Keyboard J (Common)</font><br len="0"><font lang="en"> A2 - keyboard L</font><br len="0"><font lang="en"> A4 - KB4 (9) (right)</font><br len="0"><font lang="en"> A5 - KB2 (7) (down)</font><br len="0"><font lang="en"> A6 - KB0 (5) (fire)</font><br len="0"><font lang="en"> B1 - 0V</font><br len="0"><font lang="en"> B4 - +5V</font><br len="0"><font lang="en"> B5 - KB3 (8) (left) B6 - KB1 (6) (up)</font></p>
</blockquote>
<p align="justify" len="118" style="text-align: left;"><font lang="en">The numbers in parentheses refer to control 2. </font><font lang="en">All signals are TTL-level. </font><font lang="en">Use multiple shielded cables.</font></p>
<p len="54"><b len="47"><font size="4" lang="en">Serial peripherals / networks</font></b></p>
<blockquote len="127">
<p len="116"><font lang="en">A1 Reference</font><br len="0"><font lang="en"> A3 - RTS</font><br len="0"><font lang="en"> A4 - CTS</font><br len="0"><font lang="en"> B1 - 0 V</font><br len="0"><font lang="en"> B3 Data Output</font><br len="0"><font lang="en"> B4 Data Input</font></p>
</blockquote>
<p len="40" lang="en">Hateres shielded cable should be used.</p>
<p len="33" lang="en">Signal levels per 0V:</p>
<blockquote len="35">
<p len="24"><font lang="en">0 = 0 V</font><br len="0"><font lang="en"> 1 = +12V</font></p>
</blockquote>
<p len="45" lang="en">Signal levels for the reference line:</p>
<blockquote len="34">
<p len="23"><font lang="en">0 = -5V</font><br len="0"><font lang="en"> 1 = +7V</font></p>
</blockquote>
<p align="justify" len="314" style="text-align: left;"><font lang="en">For network use, for the purpose of designing the "control rail", the "RTS" shall be connected to the "CTS" and the "data-rail" shall be connected to the "data output" for the design of the "data rail". </font><font lang="en">The "reference" is actually a traded "earth" voltage that we may not be able to allow for certain equipment configurations.</font></p>
<p len="37"><b len="30"><font size="4" lang="en">printer</font></b></p>
<blockquote len="390">
<p len="379"><font lang="en">A1 - 0V</font><br len="0"><font lang="en"> A2 - door sign (/strobe)</font><br len="0"><font lang="en"> Data 3</font><br len="0"><font lang="en"> Data line A5 - 2 (Data 2)</font><br len="0"><font lang="en"> Data Line A6 - 1 (Data 1)</font><br len="0"><font lang="en"> Data line A7 - 0 (Data 0)</font><br len="0"><font lang="en"> B1 - 0V</font><br len="0"><font lang="en"> B2 - Ready</font><br len="0"><font lang="en"> B5 - Data 4</font><br len="0"><font lang="en"> Data line B6 - 5 (Data 5)</font><br len="0"><font lang="en"> B5 - Data 6</font><br len="0"><font lang="en"> B6 - Data 7</font></p>
</blockquote>
<p align="justify" len="72" style="text-align: left;"><font lang="en">Twelve-force flexible tape cable is used. </font><font lang="en">All signals are TTL-level.</font></p>
<p len="38"><b len="31"><font size="4" lang="en">The monitor</font></b></p>
<blockquote len="371">
<p len="360"><font lang="en">A1 - green color mark</font><br len="0"><font lang="en"> A2 - 0V</font><br len="0"><font lang="en"> A3 - monochromatic composite video signal</font><br len="0"><font lang="en"> A4 - /HSYNC (horizontal synchronous signal)</font><br len="0"><font lang="en"> A5 - /VSYNC (vertical synchronous signal)</font><br len="0"><font lang="en"> A7 - left voice signal</font><br len="0"><font lang="en"> B2 - 0V</font><br len="0"><font lang="en"> B3 - blue color mark</font><br len="0"><font lang="en"> B4 - red color mark</font><br len="0"><font lang="en"> B5 - /CSYNC</font><br len="0"><font lang="en"> B6 - mode switch (peritel)</font><br len="0"><font lang="en"> B7 - right-hand sound signal</font></p>
</blockquote>
<p align="justify" len="147" style="text-align: left;"><font lang="en">Use multiple shielded cables. </font><font lang="en">All sync marks are TTL-level. </font><font lang="en">Green, blue and red marks are linear from 0 to 4 volts (non-TTL signals).</font></p>
<p align="right" len="328" style="text-align: left;"><a href="http://www.translatoruser-int.com/translate?&amp;to=en&amp;csId=0d44cef7-bced-44f0-a7d0-c9f0a1436c7e&amp;usId=5eff2b38-d9a8-4790-a1ca-5bdfc82bbfcc&amp;dl=en&amp;ref=trb_ct&amp;ac=true&amp;dt=2021%2f6%2f16%2013%3a27&amp;h=QhNIvQoxIvdjNzDerAddKgp_hkYMEy-L&amp;a=http%3a%2f%2fep128.hu%2fEp_Konyv%2fEP_Konyv.htm" len="6" lang="en">back</a></p>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment