System Description Introduction ------------ The Bally Professional Arcade is a full-color video game system based on the mass-ram-buffer technique. A mass-ram-buffer system is one in which one or more bits of RAM are used to define the color and intensity of a pixel on the screen. The picture on the screen is defined by the contents of RAM and can easily be changed by modifying RAM. The system uses a Z-80 Microprocessor as it's main control unit. The system ROM has software for four games: Gunfight, Checkmate, Scribbling, and Calculator. Additional ROM can be accessed through the cartridge connector. Three custom chips are used for the video interface, special video processing functions, keyboard and control handle interface, and audio generation. The system exists in both high-resolution and low-resolution models. The three custom chips can operate in either mode. The mode of operation is determined by bit 0 of output port 8H. It must be set to 0 for low-resolution and 1 for high-resolution. This bit is not set to 0 at power up and must be set by software before any RAM operations can be performed. 81 System Description Memory Map ---------- In both the low and high resolution models, the operating system ROM is in the first 8K of memory space. The cartridge ROM is in the space from 8K to 16K. The standard screen RAM begins at 16K. In the low-resolution unit, standard screen RAM is 4K bytes; in the high-resolution unit it is 16K bytes. Magic screen RAM begins at location 0. It is the same size as standard screen RAM. All memory above 32K is available for expansion. In the low-resolution unit, memory space 20K - 32K is available for expansion. When data is read from a memory location between 0 and 16K the data comes from the ROM. When data is written in a memory location (X) between 0 and 16K, the system actually writes a modified form of the data in location X+16K. The modification is performed by the magic system in the Data Chip and Address Chip. Thus the RAM from 0 to 16K is called Magic Memory. 82 System Description Memory Map - Low-Resolution --------------------------- 83 System Description Memory Map - High-Resolution ---------------------------- 84 System Description Screen Map ---------- In the Bally Professional Arcade, two bits of RAM are used to define a pixel on the screen. One 8-bit byte of RAM therefor defines four pixels on the screen. In the low-resolution model there are 40-bytes used to define a line of data. This gives a horizontal resolution of 160 pixels. The vertical resolution is 102 lines. The screen therefor requires 102 X 40 = 4,080 bytes. The remaining 16 bytes of the 4K RAM are used for scratch pad. More of the RAM may be used for scratchpad by blanking the screen before the 102nd line. This will be described later. In the High-resolution model there are 80 bytes and 320 pixels per line. The 204 lines require 16,320 bytes of RAM. 64 bytes of the 16K RAM are left for scratch pad. In both models the first byte of RAM is in the upper left-hand corner of the screen. As the RAM address increases, the position on the screen moves in the same directions as the TV scan; from left-to-right and from top-to-bottom. The four pixels in each byte are displayed with the least significant pixel, the one defined by bits 0 and 1, on the right. 85 System Description Screen Map - Low Resolution --------------------------- 86 System Description Screen Map - High Resolution ---------------------------- 87 System Description Color Mapping ------------- Two bits are used to represent each pixel on the screen. These two bits, along with the LEFT/RIGHT bit which is set by crossing the horizontal color boundary, map each pixel to one of eight different color registers. The value in the color register then defines the color and intensity of the pixel on the screen. The intensity of the pixel is defined by the three least significant bits of the register, 000 for darkest and 111 for lightest. The color is defined by the five most significant bits. The color registers are at output ports 0 through 7; register 0 at port 0, register 1 at port 1, etc. The color registers can be accessed as individual ports or all eight can be accessed by the OTIR instruction. The OTIR instruction is to port BH (register C=BH) and register B should be set to 8. The eight bytes of data pointed to by HL will go to the color registers. HL --> Memory Location X Color Register 7 X+1 Color Register 6 X+2 Color Register 5 X+3 Color Register 4 X+4 Color Register 3 X+5 Color Register 2 X+6 Color Register 1 X+7 Color Register 0 The horizontal color boundary (bits 0-5 of port 9) defines the horizontal position of an imaginary vertical line on the screen. The boundary line can be positioned between any two adjacent bytes in the low- resolution system. The line is immediately to the left of the byte whose number is sent to bits 0-5 of port 9. For example, if the horizontal color boundary is set to 0, the line will be just to the left of byte 0; if it is set to 20, the line will be between bytes 19 and 20 in the center of the screen. 88 System Description If a pixel is to the left of the boundary, its LEFT/RIGHT bit is set to 1. The LEFT/RIGHT bit is set to 0 for pixels to the right of the boundary. Color registers 0-3 are used for pixels to the right of the boundary and registers 4-7 are used for pixels to the left of the boundary. In the high-resolution system, the boundary is placed in the same position on the screen but between different bytes. If the value X is sent to the horizontal color boundary, then the boundary will be between bytes 2X and 2X-1. If the value 20 is sent, the boundary will be between 39 and 40, in the center of the screen. To put the entire screen, including the right side background, on the left side of the boundary, set the horizontal color boundary to 44. BACKGROUND COLOR ---------------- On most televisions the area defined by RAM is slightly smaller than the screen. There is generally extra space on all four sides of the RAM area. The color and intensity of this area is defined by the background color number (bits 6 and 7 of port 9). These two bits, along with the LEFT/RIGHT bit point to one of the color registers which determines the color and intensity. 89 System Description VERTICAL BLANK -------------- The Vertical Blank Register (output port AH) contains the line number on which vertical blanking will begin. In the low-resolution system bit 0 should be set to 0 and the line number should be in bits 1-7. In the high-resolution system the line number is in bits 0-7. The background color will be displayed from the vertical blank line to the bottom of the screen. This allows the RAM that would normally be displayed in that area to be used for scratch pad. If the vertical blank register is set to 0 the entire RAM can be used for scratch pad. In a low-resolution system the register must be set to 101 or less; in a high-resolution system it must be set to 203 or less. SUMMARY ------- The following color register map shows which color registers are used to define colors in different areas of the screen. The map assumes the background color is set to 0. If it were set to 1 then color registers 1 and 5 would be used for background instead of 0 and 4. In the low- resolution system the color boundary is between bytes X and X-1. In the high-resolution system the boundary is between bytes 2X and 2X-1. 90 System Description COLOR REGISTER MAP ------------------ 91 System Description INTERRUPT FEEDBACK ------------------ When the Z-80 acknowledges an interrupt it reads 8 bits of data from the data bus. It then uses this data as an instruction or an address. In the Bally Professional Arcade this data is determined by the contents of the interrupt feedback register (output port DH). In responding to a screen interrupt the contents of the interrupt feedback register are placed directly on the data bus. In responding to a light pen interrupt the lower four bits of the data bus are set to 0 and the upper four bits are the same as the corresponding bits of the feedback register. INTERRUPT CONTROL BITS ---------------------- In order for the Z-80 to be interrupted the internal interrupt enable flip-flop must be set by an EI instruction and one or two of the external interrupt enable bits must be set (output port EH). If bit 1 is set, light pen interrupts can occur. If bit 3 is set, screen interrupts can occur. If both bits are set, both interrupts can occur and the screen interrupt has higher priority. The interrupt mode bits determine what happens if an interrupt occurs when the Z-80's interrupt enable flip-flop is not set. Each of the two interrupts may have a different mode. In mode 0 the Z-80 will continue to be interrupted until it finally enables interrupts and acknowledges the interrupt. In mode 1 the interrupt will be discarded if it is not acknowledged by the next instruction after it occurred. If mode 1 is used the software must be designed such that the system will not be executing certain Z-80 instructions when the interrupt occurs. The opcodes of these instructions begin with CBH, DDH, EDH, and FDH. The mode bit for the light pen interrupt is bit 0 of port EH and the mode bit for screen interrupt is bit 2 of EH. 92 System Description SCREEN INTERRUPT ---------------- The purpose of the screen interrupt is to synchronize the software with the video system. The software must send a line number to the interrupt line register (output port FH). In the low-resolution system bit 0 is set to 0 and the line number is sent to bits 1-7. In the high- resolution system the line number is sent to bits 0-7. If the screen interrupt enable bit is set, the Z-80 will be interrupted when the video system completes scanning the line in the interrupt register. This interrupt can be used for timing since each line is scanned 60 times a second. It can also be used in conjunction with the color registers to make as many as 256 color-intensity combinations appear on the screen at the same time. LIGHT PEN INTERRUPT ------------------- The light pen interrupt occurs when the light pen trigger is pressed and the video scan crosses the point on the screen where the light pen is. The interrupt routine can read two registers to determine the position of the light pen. The line number is read from the vertical feedback register (input port EH). In the high-resolution system the line number is in bits 0-7. In the low resolution system the line number is in bits 1-7, bit 0 should be ignored. The horizontal position of the light pen can be determined by reading input port FH and subtracting 8. In the low resolution system the resultant value is the pixel number, 0 to 159. In the high-resolution system the resultant must be multiplied by two to give the pixel number, 0 to 358. 93 System Description MAGIC REGISTER -------------- As described earlier, the Magic System is enabled when data is written to a memory location (X) from 0 to 16K. A modified form of the data is actually written in memory location X+16K. The magic register (output port CH) determines how the data is modified. The purpose of each bit of the magic register is shown below. Bit 0 LSB of shift amount 1 MSB of shift amount 2 Rotate 3 Expand 4 OR 5 XOR 6 Flop The order in which magic functions are performed is as follows: Expansion is done first; rotating or shifting; flopping; OR or XOR. As many as four can be used at any one time and any function can be bypassed. Rotate and shift as well as OR and XOR cannot be done at the same time. 94 System Description EXPAND ------ The expander is used to expand the 8 bit data bus into 8 pixels (or 16 bits). It expands a 0 on the data bus into a two-bit pixel and a 1 into another two-bit pixel. Thus, two-color patterns can be stored in ROM in half the normal memory space. During each memory write instruction using the expander, either the upper half or the lower half of the data bus is expanded. The half used is determined by the expand flip-flop. The flip-flop is reset by an output to the magic register and is toggled after each magic memory write. The upper half of the data bus is expanded when the flip-flop is 0, and the lower half when the flip-flop is 1. The expand register (output port 19H) determines the pixel values into which the data bus will be expanded. A 0 on the data bus will be expanded into the pixel defined by bits 0 and 1 of the expand register. A 1 on the data bus will be expanded into the pixel defined by bits 2 and 3 of the expand register. The pixels generated by bit 0 or 4 of the data bus will be the least significant pixel of the expanded byte. The most significant pixel will come from bit 3 or 7. 95 System Description SHIFTER ------- The shifter, flopper, and rotater operate on pixels rather than bits. Each byte is thought of as containing four pixels, each of which has one of four values. The four pixels are referred to as P0, P1, P2, and P3. P0 is composed of the first two bits of the byte. The shifter shifts data 0, 1, 2, or 3 pixels to the right. The shift amount is determined by bits 0 and 1 of the magic register. The pixels that are shifted out of one byte are shifted into the next byte. Zero's are shifted into the first byte of a sequence. The shifter assumes the first byte of a sequence is the first magic memory write after an output to the magic register. Each sequence must be initialized by an output to the magic register and data cannot be sent to the magic register in the middle of a sequence. FLOPPER ------- The output of the flopper is a mirror image of it's input. Pixel 0 and 3 exchange values as do pixel 1 and 2. The diagrams on the following page show examples of shifting and flopping. 96 System Description SHIFTER - FLOPPER ----------------- 97 System Description ROTATOR ------- The rotater is used to rotate a 4 X 4 pixel image 90 degrees in a clock- wise direction. The rotator is initialized by an output to the magic register and will re-initialize itself after every eight writes to magic memory. To perform a rotation, the following procedure must be performed twice. Write the top byte of the unrotated image to a location in magic memory. Write the next byte to the first location plus 80, the next byte to the first location plus 160, and the last byte to the first location plus 240. After eight writes the data will appear in RAM and on the screen rotated 90 degrees from the original image. The rotator can only be used in commercial mode. The diagram on the following page shows an example of rotating. 98 System Description ROTATOR ------- 99 System Description OR AND XOR ---------- These functions operate on a byte as 8-bits rather than four pixels. When the OR function is used in writing data to RAM, the input to the OR circuit is ORed with the contents of the RAM location being accessed. The resultant is then written in RAM. The XOR function operates in the same way except that the data is XORed instead of ORed. INTERCEPT --------- Software reads the intercept register (input port 8H) to determine if an intercept occurred on an OR or XOR write. An intercept is defined as the writing of a non-zero pixel in a pixel location that previously contained a non-zero pixel. A non-zero pixel is a pixel with a value of 01, 10, or 11. A 1 in the intercept register means an intercept has occurred. Bits 0 - 3 give the intercept information for all OR or XOR writes since the last input from the intercept register. An input from the intercept register resets these bits. A bit is set to 1 if an intercept occurs in the appropriate position and will not be reset until after the next intercept register input. Bit 0 Intercept in pixel 3 in an OR or XOR write since last reset 1 Intercept in pixel 2 in an OR or XOR write since last reset 2 Intercept in pixel 1 in an OR or XOR write since last reset 3 Intercept in pixel 0 in an OR or XOR write since last reset 4 Intercept in pixel 3 in last OR or XOR write 5 Intercept in pixel 2 in last OR or XOR write 6 Intercept in pixel 1 in last OR or XOR write 7 Intercept in pixel 0 in last OR or XOR write 100 System Description PLAYER INPUT ------------ The system will accommodate up to four player control handles at once. Each handle has five switches and a potentiometer. The switches are read by the Z-80 on input ports 10H - 13H and are not debounced. The switches are normally open and normally feedback 0's. The signals from the potentiometers are changed to digital information by an 8-bit Analog-to-Digital Converter. The four pots are on input ports 1CH - 1FH. All 0's are fedback when the pot is turned fully counter- clockwise and all 1's when turned fully clockwise. The 24-button keypad is read on bits 0-5 of ports 14H-17H. The data is normally 0 and if more than one button is depressed, the data should be ignored. The keypad will not send back the proper data if any of the player control switches are closed. Here again, the buttons are not debounced. Player control inputs are shown on the following page. 101 System Description PLAYER INPUT ------------ 102 System Description MASTER OSCILLATOR ----------------- The frequency of the master oscillator is determined by the contents of several output ports. Port 10H sets the master frequency. It is given by the following formula: 1789 F_m = ------------ Khz PORT 10H + 1 If bit 4 of output port 15H is set to 1, the master oscillator frequency will be modulated by noise. The amount of modulation will be set by the 8-bit noise volume register, output port 17H. If bit 4 of output port 15H is set to 0, the frequency of the master oscillator will be modulated by a constant value to give a vibrato effect. The amount of modulation will be set by the vibrato depth register (the first 6 bits of output port 14H). The speed of the modulation is set by the vibrato speed register (upper 2 bits of output port 14H); 00 for fastest and 11 for slowest. Frequency modulation is accomplished by adding a modulation value to the contents of port 10H and sending the result to the master oscillator frequency generator. In noise modulation, the modulation value is an 8-bit word from the noise generator. If a bit in the noise volume register is set to 0, the corresponding bit in the modulation value word will be set to 0. In vibrato modulation, the modulation value alternates between 0 and the contents of the vibrato volume register. Modulation can be completely disabled by setting the master volume to 0 if noise modulation is being used, or by setting the vibrato depth to 0 when vibrato is used. 103 System Description TONES ----- The system contains three tone generators each clocked by the same master oscillator. The frequency of Tone A is set by output port 11H, Tone B by output port 12H, and Tone C by output port 13H. The frequency is given by the following formula: F_m 894 F_. = ----------------------------- = ----------------------------------- Khz 2(contents of TONE PORT + 1) (PORT 10H+1) (contents of TONE PORT+1) Proofing Note: 'F_.' = 'F Subscript Up-Arrow' The tone volumes are controlled by the output ports 15H and 16H. The lower 4 bits of port 16H set Tone A Volume, the upper 4 bits set Tone B Volume. The lower 4 bits of port 15H set Tone C Volume. Noise can be mixed with the tones by setting bit 5 of port 15H to 1. In this case the noise volume is given by the upper 4 bits of port 17H. In all cases a volume of 0 is silence and a volume of all 1's is loudest. SOUND BLOCK TRANSFER -------------------- All 8 bytes of sound control can be sent to the audio circuit with one OTIR instruction. Register C should be sent to 18H, register B to 8H, and HL pointing to the 8 bytes of data. The data pointed to by HL goes to port 17H and the next 7 bytes of data goes to ports 16H through 10H. HL -> Memory Location X Data-to-port 17H X+1 Data-to-port 16H X+2 Data-to-port 15H X+3 Data-to-port 14H X+4 Data-to-port 13H X+5 Data-to-port 12H X+6 Data-to-port 11H X+7 Data-to-port 10H 104 System Description AUDIO GENERATOR BLOCK DIAGRAM ----------------------------- 105 System Description OUTPUT PORTS ------------ PORT NUMBER FUNCTION ----------- -------- 0H Color Register 0 1H Color Register 1 2H Color Register 2 3H Color Register 3 4H Color Register 4 5H Color Register 5 6H Color Register 6 7H Color Register 7 8H Low/High Resolution 9H Horizontal Color Boundary, Background Color AH Vertical Blank Register BH Color Block Transfer CH Magic Register DH Interrupt Feedback Register EH Interrupt Enable and Mode FH Interrupt Line 10H Master Oscillator 11H Tone A Frequency 12H Tone B Frequency 13H Tone C Frequency 14H Vibrato Register 15H Tone C Volume, Noise Modulation Control 16H Tone A Volume, Tone B Volume 17H Noise Volume Register 18H Sound Block Transfer 19H Expand Register 106 System Description INPUT PORTS ----------- PORT NUMBER FUNCTION ----------- -------- 8H Intercept Feedback EH Vertical Line Feedback FH Horizontal Address Feedback 10H Player 1 Handle 11H Player 2 Handle 12H Player 3 Handle 13H Player 4 Handle 14H Keypad Column 0 (right) 15H Keypad Column 1 16H Keypad Column 2 17H Keypad Column 3 (left) 107 System Description SYSTEM BLOCK DIAGRAM -------------------- 108 System Description MICROCYCLER ----------- The purpose of the microcycler is to combine the 16-bit Address Bus and the 8-bit Data Bus from the Z-80 into one 8-bit Microcycle Data Bus to the Data Chip, Address Chip, and I/O Chip. This was done to reduce the pin count on the custom chips. The Microcycle Data Bus can be in any of four modes. Its mode is controlled by MC0 and MC1 coming from the Data Chip and RFSH# from the Z-80. The modes are shown below. RFSH# MC0 MC1 Microcycle Data Bus Contents ----- --- --- ---------------------------- 0 0 0 A0 - A7 from Z-80 0 0 1 A0 - A7 from Z-80 0 1 0 A0 - A7 from Z-80 0 1 1 A0 - A7 from Z-80 1 0 0 A0 - A7 from Z-80 1 0 1 A8 - A15 from Z-80 1 1 0 D0 - D7 from Z-80 1 1 1 D0 - D7 to Z-80 MC0 and MC1 change 140 usec after the rising edge of Phi. Their changes are shown in the timing diagrams of various instruction cycles. 109 System Description MICROCYCLER BLOCK DIAGRAM ------------------------- 110 System Description ADDRESS CHIP DESCRIPTION ------------------------ The Microcycle Decoder generates twelve bits of Z-80 address from the 8-bit Microcycle Data Bus. This address is then fed through MUX I and MUX II to MA0-5 which go to the RAM. The Scan Address Generator generates a 12-bit address which is used to read video data from the RAM. This address goes from 0 to FFFH once every frame (1/60 sec.). MUX I sends either the Scan Address or Z-80 Address to its 12 outputs. An output of the Scan Address Generator controls MUX I. If the Scan Address Generator and the Z-80 request memory cycle at the same time, the Scan Address Generator will have higher priority and the Z-80 will be required to wait (by the WAIT# output). The Scan Address Generator never requires the memory for more than one consecutive memory cycle, so the Z-80 is never required to wait for the memory for more than one cycle. HORIZ DR and VERT DR synchronize the Scan Address Generator with the Data Chip and the TV Scan. The purpose of MUX II is to multiplex its 12 inputs to the six address bits in the two time slices required for 4K x 1 16 pin RAMS. The Memory Cycle Generator controls memory cycles generated by either the Z-80 or Scan Address Generator. MREQ#, RD#, M1#, RFSH#, and A12-A15 are from the Z-80. A12-A15 are fed directly from the Z-80 because if they were brought out of the microcycle decoder, they would arrive too late in the memory cycle. The RAS0 - RAS3 outputs are used to activate memory cycles. In the consumer game, only RAS0 is used to one bank of RAM (4K x 8). In the commercial game, all four RAS's are used to control four banks of RAM (16K x 8). WRCTL and LTCHD0 are control signals to the Data Chip. WRCTL tells the Data Chip when to place data to be written to memory on the memory data bus. LTCHD0 tells the Data Chip when valid data from RAM is present on the memory data bus. 111 System Description As mentioned earlier, WAIT# is generated when the Z-80 and Scan Address Generator both request memory at the same time. WAIT# is also generated for one cycle every time the Z-80 requests a memory access, even if there is no conflict with the Scan Address. This is because the microcycler slows down Z-80 memory accesses. The Z-80 address bus and data bus must time share the microcycle bus so the Z-80 data reaches the microcycle bus very late in the memory cycle. The INT Generator generates two types of interrupts to the Z-80; Light Pen and Screen interrupts. A screen interrupt is generated when screen interrupts are enabled and the TV scan completes a certain line on the screen (from 0 to 255). The line at which the interrupt will occur is determined by the Z-80. This interrupt can be used for timing since the TV rescans every line once every 1/60th sec. A light pen interrupt occurs when the light pen interrupt is enabled and LIGHT PEN# goes low. The current scan address is saved in latches in the Scan Address Generator. The Z-80 can read the contents of these latches to determine the scan address at the time LIGHT PEN# was activated and thus the position of the light pen on the screen. The I/O Decode circuit is used during Z-80 input and output instructions. Z-80 input instructions are used to read the scan address after light pen interrupts. Output instructions are used to enable the two interrupts and set the line number for screen interrupts. 112 System Description ADDRESS CHIP BLOCK DIAGRAM -------------------------- 113 System Description DATA CHIP DESCRIPTION --------------------- The TV Sync Generator uses 7M and 7M# (7.159090 Mhz square waves) to generate NTSC standard sync and blank to be sent to the Video Generator. It also generates HORIZ DR and VERT DR for synchronization with the Address Chip. HORIZ DR occurs once every horizontal line (63.5 usec), and VERT DR occurs once every frame (16.6 msec). The Shift Register loads parallel data from the memory data bus (MD0 - MD7) and shifts it out of its two serial outputs. The TV Sync Generator controls when data is loaded or shifted. In a consumer game, the two outputs of the shift register are sent through MUX I to MUX II. In a commercial game, SERIAL 0 and SERIAL 1 are sent through MUX I and MUX II. The two bits from MUX I select 8 bits to be sent through MUX II to the Video Generator. These 8 bits then determine the analog voices of VIDEO, R-Y, and B-Y. 2.5V is a 2.5V D C reference level. The Clock Generator generates 0G and PX# from 7M. These are the clocks for the rest of the system. The Frequency of PX# is half that of 7M and the frequency of 0G is half that of PX#. The Microcycle Generator generates the microcycle control bits, MC0 and MC1 from IORQ#, MREQ#, RD#, and M1#, all from the Z-80. In memory write cycles WRCTL is activated and the Memory Control circuit generates DATEN#. The Magic Function Generator takes the data from the Z-80 on MUXD0 - D7 and transfers it to MD0 - MD7. If a Magic write is being done, the Magic Function Generator will modify the data as required before it places it on the memory data bus. 114 System Description A Magic write is a memory write cycle in which data is written to a location, (X) from 0 to 16K. All memory from 0 to 16K is ROM and cannot be modified. The data is modified by the Magic Function Generator and is written to location X + 16K. The way in which the data is modified is determined by the 7 bits coming from the I/O registers. In memory reads, data is transferred from MD0 - MD7 to MUXD0 - MUXD7. Also, LTCHD0 is activated which causes the data from RAM to be latched up in a register in the Magic Function Generator. This latched data is used in some magic functions. The I/O registers are loaded by output instructions from the Z-80 just as in the Address Chip. 115 System Description DATA CHIP BLOCK DIAGRAM ----------------------- 116 System Description I/O CHIP DESCRIPTION -------------------- The Z-80 communicates with the I/O Chip through input and output instructions. The state of an 8 x 8 switch matrix can be read through the Switch Scan circuit. When an input instruction is executed, one of the SO0-SO7 lines will be activated. When a line is activated, the switch matrix will feed back eight bits of data on SI0-SI7. This data is in turn fed to the Z-80 through MUXD0 - MUXD7. The Z-80 can read the position of four potentiometers (pots) through the A-D Converter circuit. The pots are continuously scanned by the A-D Converter and the results of the conversions are stored in a RAM in the A-D Converter circuit. The Z-80 simply reads this RAM with input instructions. The Z-80 loads data into the Music Processor with output instructions. This data determines the characteristics of the audio that is generated. The Music Processor is described in detail below. 117 System Description I/O CHIP BLOCK DIAGRAM ---------------------- 118 System Description MUSIC PROCESSOR --------------- The music processor can be divided into two sections. The first section generates the Master Oscillator Frequency and the second section uses the Master Oscillator Frequency to generate tone frequencies and the analog audio output. The contents of all registers in the Music Processor are set by output instructions from the Z-80. Master Oscillator Frequency is a square wave whose frequency is determined by the 8 binary inputs to the Master Oscillator. This 8-bit word is the sum of the contents of the Master Oscillator Register and the output of the MUX. The MUX is controlled by MUX REG. If MUX REG contains 0, then data from the Vibrato System will be fed through the MUX. The two bits from the Vibrato Frequency Register determine the frequency of the square wave output of the Low Frequency Oscillator. The 6-bit word at the output of the AND gates oscillates between 0 and the contents of the Vibrato Register. The frequency of oscillation is determined by the contents of the Vibrato Frequency Register. The 6-bit word, along with two ground bits are fed through the MUX to the Adder. This causes the Master Oscillator Frequency to be modulated between two values thus giving a Vibrato effect. If MUX REG contains 1, then data from the Noise System will be fed through the MUX. The 8-bit word from the Noise Volume Register determines which bits from the Noise Generator will be present at the output of the AND gates. 119 System Description If a bit in the Noise Volume Register is 0, then the corresponding bit at the output of the AND gates will be 0. If a bit in the Noise Volume Register is 1, then the corresponding bit at the output of the AND gates will be noise from the Noise Generator. This 8-bit word is sent through the MUX to the Adder. The Master Oscillator Frequency is modulated by noise. In the second part of the Music Processor, the square wave from the Master Oscillator is fed to three Tone Generator circuits which produce square waves at their outputs. The frequency of their outputs is determined by the contents of their Tone Generator Register and Master Oscillator Frequency. The 4-bit words at the output of the AND gates oscillate between 0 and the contents of the Tone Volume Register. These 4-bit words are sent to D-A Converters whose outputs oscillate between GND and a positive analog voltage determined by the contents of the Tone Volume Register. One Noise bit and four Noise Volume bits from the first section of the Music Processor are fed to a set of AND gates. This set of AND gates operates the same way as the AND gates for the tones, except that the Noise AM Register must contain a 1 for the outputs of the AND gates to oscillate. The analog outputs of the four D-A Converters are summed to produce the single audio output. 120 System Description MASTER OSCILLATOR BLOCK DIAGRAM ------------------------------- 121 System Description TONE GENERATORS --------------- 122 System Description CUSTOM CHIP TIMING ------------------ The following diagrams show the relationship of various signals in the system during different types of operations. Delays are shown to be zero nsec from the clock edge which cause the transition. The actual delay is given in "Electrical Specifications for Midway Custom Circuits." MUXD0 - MUXD7 is an 8-bit bidirectional address and data bus for the custom chips. By using this technique, 16 bits of address and 8 bits of data can be sent to the custom chips on 8 wires. The state of the bus is determined by MC0 and MC1 from the data chip and RFSH# from the Z-80. RFSH# MC1 MC0 ----- --- --- L L L A0 - A7 to custom chips L L H A0 - A7 to custom chips L H L A0 - A7 to custom chips L H H A0 - A7 to custom chips H L L A0 - A7 to custom chips H L H A8 - A15 to custom chips H H L D0 - D7 to custom chips H H H D0 - D7 from custom chips 123 System Description MEMORY WRITE WITHOUT EXTRA WAIT STATE ------------------------------------- 124 System Description MEMORY WRITE WITH VIDEO WAIT STATE 125 System Description MEMORY READ WITHOUT EXTRA WAIT STATE 126 System Description MEMORY READ WITH VIDEO WAIT STATE --------------------------------- 127 System Description I/O READ FROM PORT 10H - 17H ---------------------------- 128 System Description I/O READ FROM OTHER THAN PORT 10H - 17H --------------------------------------- 129 System Description I/O WRITE --------- 130 System Description VIDEO TIMING ------------ The frequency of PX# is half that of 7M and the 0 is one-fourth 7M. There are 455 cycles of 7M per horizontal line and 133 3/4 Phi cycles per line. Because of the extra 3/4 cycle, 0 must be resynchronized at the beginning of each line. This is done by stalling 0 for 3 cycles of 7M. PX# is also stalled for the same amount of time. The timing relationship is shown below. The diagram also shows the relationship of VERT DR to HORIZ DR. The two RAS pulses shown are the first two video RAS signals of a line, each line contains forty. 131 System Description RELATIONSHIP BETWEEN 7M, HORIZ DR, VERT DR, PHI G, PX AND RAS ------------------------------------------------------------- 132 System Description RELATIONSHIP BETWEEN HORIZ DR, HORIZ BLANK, HORIZ SYNC AND COLOR BURST ---------------------------------------------------------------------- 133 System Description RELATIONSHIP BETWEEN VERTICAL SYNC, VERTICAL BLANK AND VERTICAL DRIVE --------------------------------------------------------------------- 134 System Description - Electrical Specification For Midway Custom Circuits - 1 - ELECTRICAL SPECIFICATION FOR MIDWAY CUSTOM CIRCUITS --------------------------------------------------- I. GENERAL SYSTEM PARAMETERS | REVISIONS: | --------- I. A. Power Supplies | 1/14/77 N/C -------------- | 1/27/77 A 135 | 3/25/77 B 1. VDD=+5.0V +/- 5% | 7/6/77 C 2. VGG=+10.0V +/- 5% 3. VSS=0.0V I. B. Timing Signals -------------- 1. 0 & 0#; Period = 560nsec, High time^* 240nsec to 260nsec. 0 & 0# have zero level crossover +1 volt -0 volts. t_r, t_f^* less than 20nsec 2. 7M & 7M#; Period = 140nsec, High time^+ 50nsec to 70nsec 7M & 7M# have zero level crossover +1 volt -0 volt t_r, t_f^+ less than 15nsec Dead time <= 5nsec Max C Load = 20pf +Note 1) High time is time clock at >=.6V. 2) Rise time from zero level to one level. 135 System Description - Electrical Specification For Midway Custom Circuits - 2 - I. B. (Continued) *Note: 1. High time is time between 50% points. 2. Clock signals are generated by low power Shottky Logic (series 74LS). Full level swing on clock signals to be achieved through external resistor to V_DD. Zero level .7V to 0V. 3. Rise time from zero level to .9V_DD. I. C. Z80 Data Bus (MUXD0-MUXD7) -------------------------- 1. Z80 Data Bus interface requires a three-state output/input buffer. The three states are defined below. 2. Logic 0: .5V + noise generated by chip, noise for address chip is .15V @ -430uA 3. Logic 1: 2.7V @ +70uA 4. High Impedance: Leakage at either logic 0 or 1 to be less than 5uA. 5. Transient Response: Transition from High Impedance to 0 or 1 will be complete within 442nsec of the 90% point of 0# of the last wait state of input cycle or 442nsec of the 90% point of the 0 of the second wait state of the interrupt acknowledge cycle. The maximum load will be 80pf. This includes 14pfd for two custom chips. 6. Exception: The path through the Data chip connecting the RAM bus with the Z80 bus shall introduce a maximum of 160nsec of delay. 7. The low address byte will be valid on the Z80 Data Bus at least 62nsec before 0#. The high address byte will be valid at least 79nsec before 0#. The data byte will be valid 55nsec before 0#. 136 System Description - Electrical Specification For Midway Custom Circuits - 3 - I. D. RAM Data Bus (MD0-MD7) - Home Game ---------------------- 1. The RAM Data Bus will require three state logic buffers. 2. Logic 0: .5V @ -25uA 3. Logic 1: 2.7V @ +25uA 4. High Impedance: 5uA maximum leakage at either logic 0 or 1. 5. Transient Response: The outputs shall transition from High Impedance to 0 or 1 within 120nsec of 7M. The outputs shall transition from 1 or 0 to high impedance within 20nsec of 7M. Maximum load will be 20pf. I. E. RAM Data Bus (MD0-MD7) - Commercial Game ---------------------- 1. The RAM Data Bus will require three state logic buffers. 2. Logic 0: .5V @ -200uA 3. Logic 1: 2.7V @ +25uA 4. High Impedance: 5uA maximum leakage at either logic 0 or 1. 5. Transient Response: The outputs shall transition from High Impedance to 0 or 1 within 120nsec of 7M. The output shall transition from 1 or 0 to High Impedance within 2nsec of 7M. Maximum load will be 10pf. I. F. Ambient operating temperature >= 0'C, <= 55'C I. G. Storage temperature >= -65'C, <= 150'C. I. H. Packing 40 pin plastic. II. CUSTOM CIRCUIT SPECIFICATION This specification defines the terminal characteristics for each of the custom circuits. These specifications shall take precedence in case of conflict. All 0 references refer to the 0 and 0# inputs to the address and I/O chip. 137 System Description - Electrical Specification For Midway Custom Circuits - 4 - II. A. Data Chip --------- 1. Input Pin List V0 V1 t_d (Low)^1 t_d (High)^1 Ref. -- -- ----------- ----------- ---- (V) (V) (nsec) (nsec) MREQ# .5 2.45 132 6 7M RD# .5 2.45 12 6 7M IORQ# .5 2.45 112 126 7M 7M See Section I.B. 7M# See Section I.B. WRCTL# .5 3.1 82 82 7M M1# .5 2.45 12 82 7M LTCHDO .5 3.1 120 120 7M Serial 0 .5 2.45 30 30 7M Serial 1 .5 2.45 30 30 7M 2. Power Supplies See Section I. A. 3. Bus Connections MXD0 See Z80 Data Bus Spec. Section I.C. MXD1 " " MXD2 " " MXD3 " " MXD4 " " MXD5 " " MXD6 " " MXD7 " " MD0 See RAM Data Bus Spec Section I.D. MD1 " " MD2 " " MD3 " " MD4 " " MD5 " " MD6 " " MD7 " " 138 System Description - Electrical Specification For Midway Custom Circuits - 5 - 4. Outputs V0 I0 V1 I1 CAP t_p Ref. -- -- -- -- --- ---- ---- (V) (uA) (V) (uA) (pf) (nsec) VIDEO* * 10 100 7M R-Y* * 10 600 B-Y* * 10 600 HORIZ DR Note 4 400 2.7 20 20 20 7M VERT DR Note 4 400 2.7 20 20 20 7M 2.5V^6 -- -- -- -- -- DC 0 Note 4 400 2.7 20 10 100 7M PXCLK# Note 4 400 2.7 20 10 100 7M MC0 Note 4 400 2.7 20 10 120 7M MC1 Note 4 400 2.7 20 10 120 7M DATEN# Note 4 400 2.7 20 10 90 7M *Video, R-Y, B-Y are analog outputs at 140nsec rate. Video, must switch from 10% to 90% of black to white in 140nsec. R-Y and B-Y transitions not to exceed .6usec. 1 t_d (Low) and t_d (High) is maximum time in nsec except where a minimum is shown. 2 For IORQ# Ref. to 0# t_d (Low)=132nsec t_d (High)=6nsec. 3 Serial 0 and Serial 1 will operate at 7MHz 4 .5 + noise generated by chip. 5. Tap on both resistor chains for a capacitor. Will become test input with voltage applied > 8V. 6 The Z80 0 is generated by this signal with a clock driver which introduces a delay of <20nsec. 139 System Description - Electrical Specification For Midway Custom Circuits - 6 - II. B. I/O Chip -------- 1. Input Pin List V0 V1 Ref t_d (High) t_d (Low) -- -- --- --------- --------- (nsec) (nsec) Reset .5 2.45 MONOS Note 1 RD# .5 2.45 0 or 0# 166 172 0 or 0# IORQ# .5 2.45 0^6 146 0# 132 0 0 See Section I.B. 0# See Section I.B. SI0 .5 3.3 Note 3 SI1 .5 3.3 Note 3 SI2 .5 3.3 Note 3 SI3 .5 3.3 Note 3 SI4 .5 3.3 Note 3 SI5 .5 3.3 Note 3 SI6 .5 3.3 Note 3 SI7 .5 3.3 Note 3 TEST .5 5.0 DC 2. Power Supplies See Section I.A. 3. Bus Connections MUXD0 See Z80 Data Bus Spec Section I.C. MUXD1 " " MUXD2 " " MUXD3 " " MUXD4 " " MUXD5 " " MUXD6 " " MUXD7 " " 4. Outputs V0 I0 V1 I1 -- -- -- -- (V) (uA) (V) (uA) Audio Note 4 Fmax - 20KHz Discharge Note 5 .5V 4V SO0 Note 3 Note 7 200 4V 1650 SO1 Note 3 Note 7 200 4V 1650 SO2 Note 3 Note 7 200 4V 1650 SO3 Note 3 Note 7 200 4V 1650 SO4 Note 3 Note 7 200 4V 1650 SO5 Note 3 Note 7 200 4V 1650 SO6 Note 3 Note 7 200 4V 1650 SO7 Note 3 Note 7 200 4V 1650 POT 0 Note 2 5 V_DD-.5 50 POT 1 Note 2 5 V_DD-.5 50 POT 2 Note 2 5 V_DD-.5 50 POT 3 Note 2 5 V_DD-.5 50 140 System Description - Electrical Specification For Midway Custom Circuits - 7 - Note 1 MONOS triggers at 2.1 volts +/- 2% +/- noise voltage when the supply is 5.25V. Note 2 Open source-Voltage measured with 0.2ma. Note 3 Time from load of address into microcycle register to date valid on MUX data bus from SI inputs (data path through address decoder, out on SO outputs, through closed switch and isolation diode, into SI input to MUX Data Bus) shall be 2usec max. Drop of isolation diode will be 0.7V max. SO must drive 2kohm in the high level. Max C load of SO shall be 300 pf. SI input shall kill device enabled by INPUT#. Note 4 Audio voltage oscillates between 0V and one of the following voltages; .33, .67, 1.00, 1.33, 1.67, 2.00, 2.33, 2.67, 3.00, 3.33, 3.67, 4.00, 4.33, 4.67, and 5.00. These voltages should be +/- 6%. The load shall be 1000pf and 100kohm. Note 5 Discharge is open drain to V_SS. Discharges .01ufd capacitor to .2V in 144usec. Note 6 For IOREQ# Ref. to 0# t_d (Low)=152nsec t_d(High)=166nsec. Note 7 .5V + noise generated by I/O chip. Miscellaneous Timing -------------------- Time for MO Adder - 20 max 141 System Description - Electrical Specification For Midway Custom Circuits - 8 - II. C. Address Chip ------------ 1. Input Pin List V0 V1 t_pd (Low) t_pd (High) REF -- -- ---------- ---------- --- (V) (V) (nsec) (nsec) RFSH# .5 2.45 222 0 216 0 MREQ# .5 2.45 152 0# 166 0 or 0# RD# .5 2.45 172 0 or 0# 166 0 or 0# MI# .5 2.45 176 0 242 0 A12^1 .5 2.45 0 A13^1 .5 2.45 0 A14^1 .5 2.45 0 A15^1 .5 2.45 0 IORQ# .5 2.45 132 0 146 0#^2 LIGHT PEN# .5 2.45 Asyn TEST# .5 5.0 DC HORIZ. DR. .5 2.45 Note 3 0# VERT. DR. .5 2.45 Note 4 0 0 See Section I.B. 0# See Section I.B. 2. Power Supplies See Section I.A. 3. Bus Connections MXD0 See Z80 Data Bus Spec Section I.E. MXD1 " " MXD2 " " MXD3 " " MXD4 " " MXD5 " " MXD6 " " MXD7 " " 4. Output V0 I0 V1 I1 CAP T_pd(Low) T_pd(High)REF -- -- -- -- --- --------- --------- --- (V) (uA) (V) (uA) (pf) (nsec) (nsec) LATCHD0 Note 7 Note 6 3.1 Note 6 10 280 140 0#^ WAIT# Note 7 400 2.4 20 25 490 490 0# MA0-MA5 Note 7 400 2.4 20 20 242 240 0# or 0 INT# Note 7 400 2.4 20 25 490 572 0 RAS0-RAS3Note 7 400 2.4 20 20 382 382 0# WRCTL# Note 7 Note 6 3.1 Note 6 10 382 382 0# 1. Time from High Impedance to 1 or 0 is 200nsec. (from 0_1 of T_1) 2. For IORQ# Ref to 0# t_d (Low)=152nsec t_d (High)=166nsec. 0 3. Horizontal Drive time from low to high is 40nsec after 0#. Time from high to low is 100nsec before rising edge of 0. 4. Vertical Drive will transition from low to high 40nsec after falling edge of 0. Its width will be 2.1 usec max, 1.54usec min. It will go from high to low 100nsec before falling edge of 0. 5. Reference t_pd (High) is 0. 6. MOS to MOS signal. 7. .5V + noise generated by Address Chip (.15V) = .65V 142 System Description - Electrical Specification For Midway Custom Circuits - 9 - III. I/O MODE DECODE I/O Parts --------- HEX OUT INPUT --- --- ----- 0 Color 0 Right 1 Color 1 Right 2 Color 2 Right 3 Color 3 Right 4 Color 0 Left 5 Color 1 Left 6 Color 2 Left 7 Color 3 Left 8 Consumer/Commercial Intercept Feedback 9 Horiz Color Bndry A Vertical Blank B Color Block TX C Magic Reg D Interrupt Feedback E Interrupt Mode Vertical Addr Feedback F Interrupt Line Horizontal Addr Feedback 10 Tone Master OSC SW Bank 0 11 Tone A SW Bank 1 12 Tone B SW Bank 2 13 Tone C SW BANK 3 14 Tremolo SW BANK 4 15 Tone C Volume SW BANK 5 16 Tone A,B Volume SW BANK 6 17 Noise Volume SW BANK 7 18 Sound Block TX 19 1A 1B 1C Pot 0 1D Pot 1 1E Pot 2 1F Pot 3 20 21 22 23 24 . . 2F End of 'Nutting' Manual - Continues with ROM Source 143