A Description of the Bally Professional Arcade Video Hardware and Associated Coin-Operated Hardware Introduction This description of how the B PA vide o hardwa re works wa s produc ed in an effort to dispel the rum or that a Bally Professional Arcade (BPA) can display commercial resolution video. Entire contents Copyright © 2001 by Anthony J. M iller. Sources of Information In the preparation of this docu ment I have mainly relied on four inform ation sources: The Nutting Manual This paper borrows heavily from the Nutting Manual, and will include references to certain pages of it. The N utting Man ual was origina lly written by emp loyees of D ave Nutt ing Associates, a research and development group for Midway Manufacturing, Inc., (a subsidiary of Bally Manufacturing and the company which ac tually produced the B ally Arcade) as a guide for internal a nd external BPA game developers. This group actually designed the BPA , and prog rammed the majority o f game casse ttes offered. U.S. Patents 4,301,503 and 4,475172 Both patents cov er the chip set. I have read the former extensively, and looked at the latter enough to realize that it is a re-issue of the former, with additional claims (which are totally irrelevant to this d ocumen t). The inven tor is listed as Jeff Frederiksen, and the assignee is Bally Manufacturing. Midway Mfg. SeawolfII This is the first Midway coin-operated game using the custom chips. You can download the schematic from: http://www.hypertech.com/arcad e/manuals.asp along with manuals and data schematics of several other Midway games using the chip set. This schematic is the easiest to follow, since everything is on one sheet of paper, unlike the card rack system deve loped later . The Bally Service Manual which is available from: http://www.classicgaming.com/ballyalley/misc_docs/bally_service_manual.pdf This manual contains the schematic of the BPA I have mad e every attem pt to make this description as accurate a s possible. Dave Nutting Associates was purchased by Bally and became an internal development group. Dave Nutting Associates consisted of four gro ups: The Bally Ar cade Video System 2 Industrial Design: Headed by Dave Nutting, who did the console and handgrip design. Dave was also responsib le for the design of the Excalibur kit automobile, for another company. Dave had at least one other engineer working for him (Ken ....) , who was responsible for the mechanic al design of the BPA Add-on cabinet. Hardware Design: Headed by Jeff Frederiksen, who was Dave’s partner, Vice President of Engineering, and Main Associate. Je ff was an Electric al Engineer , and along w ith Terrenc e Colem an, did the design of the three cus tom chips u sed in the BPA. Coleman also designed the circuitry on the BPA PC Board. I (Ton y Miller) also worked in th is group, and designed th e early version of the Add-on. Software Design: Headed by Jay (now Jamie) Fenton, whose primary responsibility was the implementation of the operating system, called HVGSYS ( Home Video Game SYStem) internally. I believe Jay also did the Scribbling game. There were several people in the Software group, each was responsib le for a separate game cassette. The following individuals had primary responsibility for the ‘bundled’ games: Gunfight: Alan M cNeil Checkmate: Lou ... Calculator: Jeff Frederiksen PC Design: Headed by Jim Hemmer, who did the PC design for the BPA. The design was so ld to a com pany by the na me of Astro vision, Inc., som e time in 1982. I believe that the game sold under this name was identical to that sold as the Bally Professional Arcade. Block Diagram A block diagram of the BPA appears below. T his diagram is based on the one shown on page 108 of the Nutting Manual (hereafter referred to as NM108, etc). Bally Professional A rcade Video Hardware Descript ion 3 Figure 1: BPA Block Diagram Other circuits which control the various blocks are not shown in the diagram above. Note, however, that the Z80 Address and data busses are shown as separate busses connecting the Z80, System ROM, Cassette ROM, and Expansion Connector. The Microcycler Block is used to combine the 16 bits of address and 8 bits of data from these busses into a time-multip lexed M icrocycle b us, which then c onnects to the three custom chips. This was done (NM109) to save pins o n the custom chips. The Ad dress Chip is used to gen erate Screen Refresh, memory refresh, and Z80 Access address cycles to the Screen RAM , which also d ouble s as ScratchPad mem ory for the system. This part also captures the sc reen refresh address when a light pen signal is detected , to generate the Light Pen In terrupt to the Z80. What is meant by the terms Screen Refresh, Memory Refresh, and Z80 Access cycles will be described in a forthcoming paragraph. The Data chip handles data functions for Z80 S creen and Scratch me mory acce sses, Mag ic Memory writes, and Parallel to Serial formatting of screen data (in consum er mode ) to be output to the video m odulator. This chip also handles color loo k-up table functions to convert serial pixel data to color/brightness index data, and the generation of Video, sync, and the color components (R-Y, B-Y) for the video modulator. The I/O chip is responsible for the sound generation function, and control handle interface. It will not be described in this article. Bally Professional A rcade Video Hardware Descript ion 4 Screen M emory For the BPA, eight 4096 (4K) x 1 Dynamic Random Access Memories (DRAMs) were used. This gives a total of 4096 Bytes of Read/W rite memory, which was organ ized as a 160 pixel wide by 102 pixel tall frame buffer. Each pixel occupied two bits, for a total of four simultaneous colors on the screen. Four pixels occupy one byte of screen RAM. The Data chip implemented several features to make it appear as through there were many more simultaneous colors ava ilable. How this was acco mplished w ill be covere d later in the D ata Chip sec tion. This was one of the first imp lementation s of the frame b uffer architecture in a consumer (or coin-operated, for that matter) gam e. The co ntempor aneous A tari 2600 used very little memory - a line or two of pixels in memory, and required the microprocessor to generate video just ahead of it being displayed. The BPA frame buf fer uses an entire frame of pixe l memory, wh ich the proc essor can up date ahea d of time for d isplay. The screen origin is the upper left corner of the video screen, at Z80 address 0x4000. T here are actually four pixels at this address. Pixel 3 (the left-most of the four) occupies bits[7:6], pixel two bits[5:4], pixel one bits[3:2], and pixel 0 (the righ tmost of the fou r) occupie s bits[1:0]. T his relationship is used throughout the rest of the screen. The figure following is for the consumer game and is identical to the one on NM86: Therefore, the first (left) pixel on the second line (line 1, where the first line is line 0) occupies bits 7:6 of address 0x4028, the last pixel (right) on line 1 occupies bits 1:0 of 0x404F, the first pixel on line 100 occupies bits 7:6 of 0x40A0 and the last pixel on line 100 is in bits 1:0 of 0x4FC7. Figure 2: Consumer Resolution Screen Map The commercial version has a resolution of 320 by 204. See the following illustration, identical to the one on NM87: Bally Professional A rcade Video Hardware Descript ion 5 Here, the leftmost pixel of line 1 (i.e., the second line of video) occupies bits[7:6] of 0x4050, the rightmost pixel of l i n e 1 o c c u p ie s bits[1:0] of 0x 409F, the leftmost pixel of line 202 occupies bits[7:6] of 0x7F20, and the rightmost pixel of line 202 occupies bits[1:0] of 7F6F. Since the commercial screen resolution is doubled in each direction, the amount of memory required is increased by a factor of four, to 16,384 bytes. Due to the architecture of t h e system, t h is Figure 3: Commercial Resolution Screen Map required the use of 32 4K x 1 DRA Ms, in four b anks of eight ea ch. In consumer mode, each line is scanned twice per field (the second time immediately after the first), to give 204 active lines of video. The remaining 58 ½ lines of video (each NTSC field is 262 ½ lines) is made up of blanking and sync lines. In comm ercial mod e, each line is sca nned onc e per field, with 58 ½ b lanking and sync lines. Bo th systems output video at the sa me timing, co nforming to N TSC sp ecifications. Each fram e consists of two fields, scanned in an interlaced format, at 60 fields (or 30 frames) per second. NTSC stands for National Television Standards Committee, which sets the standar ds for video broadc asting in this country, but some would say that it actually means Never Twice the Same Color. Dynamic RAMs I b e li ev e th e firs t D RA M (Dynamic Random Access M emory) to use the multiplexed address approach was the 4K x 1 DRAM, used in the BPA. DRAM s have a major advantage over the SRAM or Static Random Access M emory. That is, a memory cell can be made of a single transistor and capacitor. The capacitor is the actual memory element. Depending upon design, a charged capacitor may signify a logical 1 and a discharged capacitor may signify a logical 0, or vice-versa. The transistor is used to connec t or isolate the ca pacitor from the rest of the circu itry. An equivalent SRAM cell requires at least six transistors, so a DRAM uses about six times less chip area than an equ ivalent- sized SRAM . One of the m ain cost factor s in a memo ry is the amoun t of chip area used. T he smaller the area, the cheaper the chip, since more chips can fit on a single wafer. The cost of processing a wafer is roughly constant, so more die (chips) on a wafer, the cheaper each chip is. Another factor affecting the cost of a chip is the package. More pins on a package means a larger package, and more connections between the die inside and the package pins. For these r e aso ns, a DRA M is ch eap er than th e same-size d SR A M . To save on package pins and to make it possible to get more memories on a board, the multiplexed address technique w as invented. T o addre ss 4096 bits of memory, 12 address lines (212 = 4096) are required. Along with the Bally Professional A rcade Video Hardware Descript ion 6 required Chip Sele ct (CS# w here # me ans active low ), Write E nable (WE#), Data In (DI), Data Out (DO) and the four power supplies (+5 Vo lts, -5 Volts, +15 Volts, and ground), this means a 20 pin package. At the time, 14- an d 16-pin DIPs (Dual Inline P ackages) w ere the chea pest, so the m ultiplex techniq ue was used to get this memory into a 16-pin package. Under this sc heme, six pin s are used fo r addressin g. First, the most sign ificant addresses (called the Row Addresses) are applied, and the Row Address Strobe (or RAS#) is asserted to lo gical 0 to latch th ese addre sses into an internal register. Next, the least significant addresses (called the Colum n Addresses) are appli ed, and the Column Address Strobe (or CAS#) is asserted to latch these addresses into another internal latch. If the C S# input is log ical 0 at the falling edge of CAS# , the chip is selected for either a write or a read, as determined by the state of the WE# input. If the WE# pin is at logical 0 during this time, the operation is a write, and the data appearing on the DI line is saved in the memory. Otherwise the operation is a read and the data at the addressed location appears on the DO line. If the CS# line is at logical 1 during this process, the memory is not selected: No location will be written and no location will be read, a nd the DO line will be off. RAM Read, Write, and Refresh Timing Typical Read, Write, and Refresh timing waveforms appear in the figure following: Figure 4: DRAM Read, Write, and Refresh Timing DR A M s have some disa dvantages as comp ared to SRAMs. They are slower, which means that it takes longer to read or write them, primarily due to the m ultiplexed address schem e. They also need to be refreshed. Since the storage element is a capacitor, the charge w ill dissipate ove r a period of time, usually me asured in m illiseconds. T his means that the capacitor charge (or lack thereof) h as to be re-es tablished p eriodically. Any read or write will cause the capacitor to be recharged, so if the application regularly reads or writes ALL row addresses, the memory will retain valid data. This is a fairly time-consuming process, since for this memory usually 64 row s have to be refreshed ev ery 2 millisecond s, and the refre sh process usually takes aro und a micro second p er row. Bally Professional A rcade Video Hardware Descript ion 7 All of the RAMs made by a given supplier must conform to that supplier ’s published specifications, otherwise, they cannot be sold as premium product. One of the biggest problems with these early RAMs was that they could net meet the refresh specification. If, however, they were refreshed mo re often that all 64 rows every 2 millisecond s, they would function perfectly normally. As production continued , each RA M man ufacturer gath ered their refre sh reject pa rts in barrels on the factory floor. Periodically, they would salvage these parts, since they contained small amounts of gold, which could be recovered. But the BPA regularly reads from each row of each memory, since it must read the memory many times each second to refresh the screen. This fact mak es it possible to use these otherwise refresh-reject pa rts. So, Midway was able to get large quantities of very cheap DRAMs, since they were all officially reject parts. But they were perfe ctly suited for use in the BPA frame buffer. The normal DRAM refresh cycle shown above is not used in the BPA, since CAS# runs all the time and RAS# and CS# are connected together. Therefore what passes as a memory refresh cycle for the BPA is actually a memory read, with the Row and Column addresses set to the same value , a value deter mined by the Z80 lowe r address b us bits while the Z80 R FSH# output is asserted to lo gical 0. The pinout of a typical DRAM used in the BPA appears following: Notice that for this generation of DRAM, three power supplies were used. The BPA used a +15 VDC supply for the RAMs, while the later coin-op games used +12 VDC. Later BPA s may have used the +12 VDC supply, since the DRAM suppliers later moved over to a fabrication process w hich could use a +12 VDC supply. Later generations of DRA Ms eli minated both the positive high voltage supply and the negative sup ply, so only a sing le +5 VDC supp ly was required. The next generation 16 K x 1 DRAM replaced the CS# pin with a seventh ad dress line (A6). This line was used during both the RAS and CAS accesses, so that it, too, brought in two add ress lines. Figure 5: 4K x 1 DRAM Pinout RAM Addressing As touched on above, the DRAMs require a multiplexed Row/Column A ddress bus to select the correct memory location. T hese add resses com e from one of three sourc es, in order o f priority: Memory refresh: As detailed above, all 64 rows of the memo ry must be refre shed every 2 milliseconds . This process has the highest priority, but only during blanking time (when the v ideo signal is blanked for retrace, at the end of each line and for a longer period at the end of each video field). Screen Refresh: In order to ke ep an imag e on the scre en, the Scree n memor y must be co ntinuously read out and the data serialized for output to the RF modulator. Horizontal and vertical counters are implemented in the Address chip, which keep track of the current position of the screen address in the Screen memory. These are used to provide the memory address for each Screen refresh cycle. Z80/Ma gic Access: For the BPA, the Scre en RAM is the only RAM which exists, so Z80 Scratch memory also resides in the Screen RAM. T he coin-op machine s used separate mem ories for Scratch, so the entire DRAM (except for the small portion left unused from 0x7FBF through 0x7FFF) is available to display screen images. Read or Write addresses are provided by the Z80, through the Microc ycler Bus. The primary function of the A ddress chip is to generate the Screen Refresh address, gather together all addresses Bally Professional A rcade Video Hardware Descript ion 8 for Screen memory access, and multiplex them to generate the R ow/C olumn Addre ss es to the Sc ree n RA M . In addition, the Light Pen, Line interrupt, memory Read/Write control, and Z80 Wait# control are implemented n the Address chip. The Ad dress Chip A block diagram of the Address chip is at left. Each block will be described below. Microcycle Address Decoder The M icrocycle Address Decoder reconstruc ts the twelve least sign ificant bits (i.e., A[11:0]) from the multiplexed Z80Address Bus. The four most significant Address bits (A[15:12]) are input to the chip directly, due to timing requirements. As stated in the text (NM111), they would arrive too late in the memory cycle if brought in through MXD [7:0]. The 12 Address LSBs are directly input to MUX I, and are also used to selec t the appro priate I/O register during an I/O cycle. The six LSBs of this bus are also used in mem ory refresh cyc les. I/O Registers Address chip registers are tabled below. The column labeled I/O defines whether the register is an input or an output of the Z80. Figure 6: Address Chip Block Diagram Address I/O Name/Description 0x08 O Consumer/Co mmercial. The A ddress chip needs this bit to determ ine the address organizatio n of the mem ory, and ho w often to pe rform Scre en Refresh m emory acc esses. This register is duplicated in the Data chip. 0x0A O Vertical Blank. The Address chip needs this register to determine the scan line below which Scre en Refresh is n o longer ne eded. T he Data ch ip must dup licate this register to determine when to turn on the border color. 0x0C O Magic R egister. The Address chip need s this register to de termine wha t kind of M agic Memory ac cess is in progress: Write, or Re ad/Mod ify/Write. The Data chip must duplicate this register to control the data path for m agic writes. Bally Professional A rcade Video Hardware Descript ion 9 Address I/O Name/Description 0x0E I/O Interrupt Enable and Mode/Vertical Line Feedback. On write, this register enables the two interrupts and determines the interrupt mode of each. On read, this register contains the vertical line number that a Light Pen Interrupt was received on. 0x0F I/O Interrupt Line/Horizontal Address Feedback. On write, this register sets the scan line number on which to generate a line interrupt back to the Z80. On read, this register contains the horizontal address (i.e., position in the line) that a Light Pen Interrupt was received on. MUX I MUX I is controlled by the Memory Cycle Generator, and determines which set of twelve addresses will be applied to the Scree n Mem ory. During a Z80/Magic Memory access, the addresses come from the Microcycler Decoder. During Screen Refresh memory reads, the addresses come from the Scan Address Generator. MUX II MUX II takes the output of MUX I and time division multiplexes the address lines from 12 lines down to 6, to be outp ut to the Scree n Mem ory. Scan Address Generator This block contains the counters used for Screen Refresh Address generation. It consists of a 12-bit counter which is reset to 0x000 each time the Address chip input Ver Dr. is asserted to logical 1, at the beginning of a frame of video. Starting a few clocks after the Addre ss chip input H or Dr. is asse rted to logica l 1, this counter w ill increment to point to the next memory location to read for Screen Refresh. The counter operates d ifferently when the c hip is operating in Comm ercial (hi-res) m ode. Consumer Mode: In Consumer Mode, each Screen Refresh cycle reads four pixels (one byte) at a time. Thus, the counter will increment every fourth PX (pixel) Clock, and a Screen Memory Refresh read is performed to access the next four pixels. This means that the memory is unavailable to the Z80 half the time when active video (i.e., when the screen is not blanked and not in th e border color area). Signal PX runs at twice the rate of the Z80 clock M. A Z80 access consists of at least four (T1, T2, Tw, T3) and as many as 5 (T1, T2, T w, Tw, T3) M clock cycles. Since the Screen Refresh has higher priority, if the Z80 timing ends up such that the Screen Refresh is currently using memory, an extra wait state will be generated to the Z80. A Z80 access cycle to this memory always results in at least one wait state. The Scan Address counter will increment forty times (bytes) per line. If this line is the first of the two line duplicate display, the counter will reset to its current count minus 40 at the next Hor Dr. Otherwise it will increment to the next address. Consumer Mode: In Commercial Mode, each Screen Refresh cycle reads sixteen pixels (fo ur bytes) at a time. These p ixels are loaded into an external shift register and shifted at the 7M (7 MHZ) clock rate into the Data chip Ser[1 :0] inputs . Thus, the counter will increment every eighth PX Clock (recall that pixels are shifted at twice the {consumer} PX clock rate), and a Screen Memory access read is performed to access the next sixteen pixels. In this case, the memory is unavailable to the Z80 only one fou rth the time. The Scan Address counter will increment twenty times per line. An external counter is used to calculate the correct time to load the Bally Professional A rcade Video Hardware Descript ion 10 shift register. This c ounter is synch ronized b y the Hor D r. signal. In order to facilitate Memory refresh using the internal Z80 refresh address counter, the least-significant Z80 and Screen refresh counter addresses become Row addresses to the memory, and the most-significant addresses become the column address. This is contrary to the ‘normal’ way DRAMs were connected. The fact that sixteen pixels are read simultaneou sly in Commercial mode means that the memories are organized in a non-obvious manner. This will be discussed in detail later. The Scan Generator counter contents are made available to the I/O Registers section and also the Interrupt g enerator. Interrupt Generator The Interrupt Generator can be pr ogramm ed to generate two interrupts, the line a nd Light Pe n Interrupts. B it 3 of the Interrupt Enable port (0x0E) when set enables line interrupts, while bit 1 of the same register enables the Light Pen interrupt. The Scan address counter contents are compared with the content of the Interrupt Line register. If the line interrupt is enabled, an interrupt to the Z80 will occur when the line portion of the counter contains the line number stored in the In terrupt Line re gister. If the Light Pen Interrupt Ad dress chip in put is asserted to logical 1, the current Scan Generator contents are latched into the Ve rtical Line and Horizon tal Address registers, which can be read by the Z80 following a Light Pen interrup t. The Z80 respond s to an interrupt by simultaneously asserting its IORQ# and M1# outputs. Memory Cycle Generator This block is responsible for arbitrating between memory refresh, screen refresh, and Z80/Magic memory accesses. It also controls the timing of the resulting memory access, along with the generation of the RAS and Multiplexed Address (M A[5:0]) bits. Z80 inputs to this block include: MREQ#, RD# M 1# and RFSH# , along with the four Most Significant Address bus bits. Also input to this block is a signal originating in the Scan Address Generator to request a memory access every four PX clock cycles to refresh the scr een in consumer mode. This block outputs the four RAS signa ls to memory, the row/column Memory Address Multiplexer control signal, WAIT# to the Z80, and the WRCTL # and LTCHDO control signals to the Data chip. This circuit operates quite differently as determined by the setting of the con sumer/com mercial bit. In consumer mode , the screen or ganization is stra ightforward . There is on ly one bank of memo ry. Pixels 0 through 3 occupy the first address of the Screen RA M, pix els 4 thro ugh 7 oc cup y the sec ond add ress , etc . Fro m th e Z8 0's perspective, the screen is a c ontiguous se t of addresse s, starting from 0 x4000 at the upper left corner and incrementing as you go to the right across the screen. Once you reach the right side, increment again to move to the left side at the second line. The table b elow maps the Z80 addresses into Screen a ddresses: Memory Row Column Address RAS#/CS# Asserted when A[15:12] = 0x4 MA5 A5 A11 MA4 A4 A10 MA3 A2 A9 MA2 A2 A8 MA1 A1 A7 Bally Professional A rcade Video Hardware Descript ion 11 Memory Row Column Address MA0 A0 A6 As can be seen, the maximum address (lower right corner of the screen, but below the blanking line) is 0x4FFF. In commercial mode, the screen is organized such that (starting from the left-most pixel of a line) pixels 0 through 3 come from the RAMs controlled by RAS0, pixels 4 through 7 come from the RAMs controlled by RAS1, pixels 8 th ro u gh 1 1 co me fro m the R AM s controlled by RAS2 , and pixels 12 through 15 come from the RAMs controlled by RAS3. For these 16 pixels, the row and column addresses applied to all 32 RAMs are identical. Pixel 16 starts over again from RAS0, at the nex t greater address. There fore the address applied to RAM s for these first 16 pixels at upper left corner of the screen is row = 000000 b, column = 000000 b, with RAS0 asserted to logical 1 for pixels 0 through 3, RAS1 for pixels 4 through 7, etc. But from the Z80's perspective, the line is still a contiguous set of addresses, starting from 0x400 0 for the upp er left corner and incrementing from there. So, how is the Z80 address mapped into Screen RAM addresses? The table below shows the mapping for Commercial mode: Memory Row Column Address RAS0# Asserted when A[15:14] = 0x1 and A[1:0] = 0 x0 RAS1# Asserted when A[15:14] = 0x1 and A[1:0] = 0 x1 RAS2# Asserted when A[15:14] = 0x1 and A[1:0] = 0 x2 RAS3# Asserted when A[15:14] = 0x1 and A[1:0] = 0 x3 MA5 A7 A13 MA4 A6 A12 MA3 A5 A11 MA2 A4 A10 MA1 A3 A9 MA0 A2 A8 Screen Refresh memory addressing is simpler, since all RAS#s are simultaneously asserted, and the address counter outputs simply increment at one-fourth the rate of consumer mode. Referring to the Seawolf II schematic, all 32 DRAMs are located at the upper right, in four columns of eight DR AMs each. The 32 Data out (D0 [7:0], D1 [7:0], D2 [7:0], and D3[7:0 ]) are conn ected to a se t of four, 4/1 d ata multiplexers (74LS253 at chip locations U41 through U 44). These parts are used to multiplex the read data from the selected DRAM (via RASX where X is 0 to 3) onto an eight-bit bus so that it can be read b y the Data ch ip. This pa th IS NOT used for the screen refresh. A simultaneous read of 16 pixels (i.e., all 32 DRAM s) is performed for screen refresh, and the data is latched into the four eight-bit parallel-in/serial-out shift registers at the bottom right of the page. These are 74LS1 66 shift registers. T he shifters are sho wn in screen p ixel order, so odd-num bered D ata out lines (D07, D05, D03, etc.,) connect to the left two shifters (U37 and U38) and even-numbered Data out lines connect to the two right shifters (39 and U40). The rightmost shifter of each pair o(U 38 and U 40) outp uts data on its Q h pin, which is connected to the SI pin of the leftmost shifter of the pair (U37 and U39). The Qh pin of the leftmost shifter is connected to a D flip-flop (U26, type 74LS74) which delays the shifted data by a clock. The outputs of these flip-flops connect Bally Professional A rcade Video Hardware Descript ion 12 to the Ser[1] (D07, D05, etc.,) and Ser[0] (D06, D04, etc.,) inputs of the Data chip. This is how commercial resolution data is input to the Data chip, since the MD[ 7:0] data p ath of the data chip is not wid e enough to handle all 32 bits simultaneously. Note that these same pins (Serial1/0) are connected to ground in the BPA. B ecause of this, the BPA cannot display at commercial r esolution without serious changes to the PC board. The shifters and D flip-flop are clocked by the 7 MHZ clock, therefore commercial resolution data is shifted into the Data chip at twice the rate of the consumer version. This makes sense, since the horizontal resolution of the commercial version is twice that of consumer, but the line timing is the sam e. The shifters a re loaded with data whe never their S/L # pin is at logical 0, which occurs once every 16 7 MHZ clocks, as determined by U25, a 74LS161 hexadecimal counter. Otherwise, data is shifted to the left, from A tow ard H. T hus, a screen r efresh read s 16 horizo ntally adjace nt pixels (2 bits per pixel from 32 D RAMs) simultaneou sly, loads this data into two 16-bit shift registers, and shifts this data into the Data chip Serl[1:0] pins at a 7 MHz rate. This means that all four RAS signals are asserted simultaneously for a screen refresh. Since the Z80 trea ts the sixteen pixels as occupyi ng four success ive addresses, it follows that RAS0 corresponds to A[1:0] = 0x0, RAS1 corresponds to A[1:0] = 0x1, etc. It follows, then, that if a system were to be designed for commercial resolution using the Data chip, it would require 32-bit wide RAMs, or a narrower but significantly faster RAM and additional hardware to capture the successive screen re fresh reads and serialize them for input to the D ata chip Ser[1:0] pins. Memory Timing The diagrams below detail the timing of read and write (with and without extra WAIT states) accesses. They are based on the Nutting diagrams, with more waveforms included to (hopefully) clarify timing issues left uncertain by the original timing diagrams. Memory Reads The diagram a t left details both types of memory read accesses, using a single Wait state (a) and using two Wait states (b): The illustration is similar to thos e on NM126 and NM127, except that several more wav eforms of interest are included. These w a v e f or m s s h o w t h e relationship between clocks 7M , PX, and M, and also show the contents of the Microc ycle bus (MX[7:0]) at each instant of the access cycle. T he i m p o r t a nt relationship between the RAS output of the Address chip and the RAS/CS# signal to the DRAMs is also shown, a l o n g w i t h t h e vi t a l relationship between RAS/CS#, CAS#, MA[5:0], and LTCH DO. Note that Figure 7: Me m or y R e ad C yc le T im in g D iagr am s CAS# runs all the time. This Bally Professional A rcade Video Hardware Descript ion 13 adds to the power dissipated by the power supply regulators, helping to keep the cabinet nice and warm. Since CAS# is free-running, memory accesses are required to be in specific time slots as determined by the CAS# timing. A memory access time slot starts and ends w ith the falling edge of M. The control signals MC[1:0] go from 0x0 to 0x1 to 0x3 during a read, connecting first the Z80 A[7:0] (which will become row addresses on MA[5:0] during the row time), followed by Z80 A[15:8] (which will become column addresses on MA[5:0] during the column time), and finally, the data read from the DRAMs. The DRAM read data beco mes valid at the DO pin of each DRAM slightly after the falling edge of CAS#. Since DATEN# is logical 1 during this time, the MD[7:0] bus buffer (BPA chip U23) is on, U11 inverts DATEN#, applying a lo gical 0 to U23), driving this data back toward the Data chip. This data will be valid on MX[7:0] around halfway through the time when signal LTCHDO (LaTCH Data Out) is at logical 1, an d will remain va lid (since it is latched in the Data chip) until the cycle ends when MC[1:0] return to 0x0.The Data chip also latches data read from the DRA Ms for a p ossible forthc oming M agic write. Since in consumer mode, Screen Refresh cycles occur on every other possible R AS timeslo t, there is a 50% chance that an extra Wait state will be inserted for any Z80 Screen memory access cycle during active video time. Memory W rites The diagram below details both types of mem ory read ac cesses, using a sin gle Wa it state (a) and usin g two W ait states (b): Again, this illustration is similar to NM 124 and NM125, with additional waveforms included. Close inspection of the diagram will reveal several important differences as compared to the read cycle. First, the write to the DR AMs occurs a full Z80 clock cycle later. Second, the states of the Mic rocycler are different. The first and second states are identical in that the Z80 A[7:0] is applied first followed by Z80 A[15:8] . But now, the data from the Z80 appears on the Micro cycle bus, instead of data to the Z80. The A ddress chip asserts signal WR CTL# to logical 0 as shown. The Data chip responds by sending da ta out on the MD[7:0] bus, and asserting its DATEN# output signal to logical 0 . DATEN# at logical 0 turns the M D bus buffer off. The inverted DATEN# is also applied to NAND gate U12 wh ich comb ines this signal with the inversion of CAS# to produce WE #, the write enable signal to the DRAM s. The da ta appearing on MD[7:0] is written Figure 8: Mem or y W r ite Cycle Tim ing D iagr am s into the DRAMs on the falling edge of WE#. Bally Professional A rcade Video Hardware Descript ion 14 Screen Refresh Reads The timing of a Screen Refresh read is identical to any other read. A M emory refresh cycle is identical t o a Screen Refresh read cycle, except that the data is discarded. There are several differences between Consumer and Commercial Screen Refresh cycles, as shown in the timing diagram below: This diagram is similar to NM132, except that it shows RAS/CS# to the DRAM s, and the waveforms for a Commercial resolution system. As can be seen, the PX and M clocks stall at the beginning of each line, to re-synchronize M to make up for the non-integer relationship between it and 7M . This diagram, like NM132, shows Hor Dr. and Ver Dr occurring simultaneou sly. This only happens once per field, since Ver Dr occurs only once per field. Hor Dr and the clock stall occur at the beginning of every horizontal line. As you can seen, the Consumer Screen R efresh RAS occurs on every other M clock. Screen refresh data for Figure 9: Screen Refresh Cycle Timing Diagram the consumer system is latched into an internal Data chip shift register, then shifted through the Data chip color lookup table at the PX clock rate. For the commercial system, the first Screen Refresh RAS occurs at the same time as the one for consumer, but it occurs only half as often, making three times as many RAS cycles available for Z80 accesses. Each commercial Screen Refresh access reads 16 pixels, and loads them into an external (to the Data chip) shift register. For Seawolf II, D flip- flop U28 detects the PX clock stall at the beginnin g of the line. Pin 8 of this flip-flop goe s to logical 1 at this time as shown above. The U28 output is combined with PX# in NAND gate U18 to generate the logical 0 pulse (U18.3), which loads hexadec imal counte r U25 to value 0xB . This coun ter is used to ge nerate an S/L# pulse to the shift registers every 16 7M clocks, to load the data read from the DRAMs. The counter outputs a logical 1 pulse on its TC pin (not shown above) which is inverted by U22 to form signal Comm S/L#. The numbers/letters above and below the Comm. U25 waveform are the hexadecimal values in the counter at each instant of time. Loading v alue 0xB when Co mm. U1 8.3 is at logical 0 will insure that Comm. S/L# goes to 0 at the correct time, during the Screen Refresh RAS# cycle, when read data is valid. T he left-most pixe l of the data read will be valid at the shift register output when S/L# returns to logical 1, followed by the next pixel, etc., at each successive 7M positive edge. The serialized pixel data is delayed by one more 7M clock by D flip-flop U26 before being applied to the Ser[1:0] inputs of the data chip. This data is then shifted through the Data chip color lookup table like the consumer version. The difference here is that the data is shifted at twice the rate (7M). The D ata Ch ip The following is a block diagram of the Data chip. It is similar to, but more detailed than the one on NM116. As can be seen, the Block Diagram is rearranged somewha t, which hope fully makes it muc h easier to understand. Bally Professional A rcade Video Hardware Descript ion 15 Figure 10: Data Chip Block Diagram Microcycle Address Decoder Similar to the Address chip, the Microcycle Address Decoder reconstructs the Z80 address from the multiplexed Z80Address Bus. These addresses are used to select the appropriate I/O register during an I/O cycle. I/O Registers Address chip registers are tabled below. The column labeled I/O defines whether the register is an input or an output (or both) of the Z80. Bally Professional A rcade Video Hardware Descript ion 16 Address I/O Name/Description 0x00 O Color Register 0. This register defines the color (bits [7:3]) and Brightness (bits [2:0]) of pixels whose content is 0x0 and which are to the right of the color boundary as defined by the register at I/O address 0x09. 0x01 O Color R egister 1. Simila r to Color R egister 0, exce pt that this register affec ts pixels whose content is 0x1. 0x02 O Color R egister 2. Simila r to Color R egister 0, exce pt that this register affec ts pixels whose content is 0x2. 0x03 O Color R egister 3. Simila r to Color R egister 0, exce pt that this register affec ts pixels whose content is 0x3. 0x04 O Color R egister 4. Simila r to Color R egister 0, exce pt that this register affec ts pixels whose contents is 0x0 and are to the left of the color boundary as defined by the register at I/O address 0x09. 0x05 O Color R egister 5. Simila r to Color R egister 4, exce pt that this register affec ts pixels whose content is 0x1. 0x06 O Color R egister 6. Simila r to Color R egister 4, exce pt that this register affec ts pixels whose content is 0x2. 0x07 O Color R egister 7. Simila r to Color R egister 4, exce pt that this register affec ts pixels whose content is 0x3. 0x08 I Intercept Feedback. See text for definition. 0x08 O Consumer/Co mmercial. The D ata chip needs this bit to determine ho w the Screen Refresh Data is handled. This register is duplicated in the Address chip. When written to 0x0, the system is in consu mer resolutio n. Writing this re gister to 0x1 puts the system into commercial resolution mode, assuming there is sufficient Screen memory and other hardware (shift registers, multiplexers, etc.) to support this mode. 0x09 O Background color (bits [7:6]), Horizontal color boundary (bits 5:0]). The color boundary is byte (not pixe l) addresse d, and de fines the byte imm ediately to the left o f the bound ary. For Bytes 0 to (color boundary -1), Color registers 4 through 7 contents will be used. For bytes color boundary to 0x27 (consumer) or 0x4F (commercial), Color registers 0 through 3 will be used . The B ackgroun d color use s the same reg ister definition as a bove for le ft and right of the color bo undary. 0xA O Line numb er below w hich the bac kground color is disp layed. This m akes it possib le to use the underlying Screen RA M as Scratch. T his register is duplicated in the Address chip. 0xB O A block tra nsfer to this register w ill load Colo r registers 7 thro ugh 0 (in that o rder) with the data written to this address. 0xC O Magic register. See text for explanation. 0xD I/O Interrupt feed back registe r. Upon I nterrupt Ac knowledg e by the Z80 , the previou sly- written contents of this register are driven back to the Z8 0 through the Micro cycle bus. 0x19 O Expand register. See text for explanation. Bally Professional A rcade Video Hardware Descript ion 17 MUX I and the Shift Register In consumer mode, a Screen Refresh access is made to Screen memory for one out of every two Z80 clocks during active video time. The data, input on the MD[7:0] bidirectional Data bus between the Data chip and the Screen RAMs, is latched into the shift register, where it is shifted out, two bits at a time at the PX c lock rate to one input p air of MUX I. Bits [7:6] are shifted out first, followed by bits [5:4], etc. Just prior to the fourth pixel (bits [1:0]) shifted out, another Screen Refresh Access occurs to reload the Shift Register. In commercial mode, the serialized pixels are routed from input chip pins Ser[1:0] through MUX I. The output of MU X I is a two bit pixel, applied to MUX II. MUX II MUX II uses the serialized pixel, the left/right boundary and blank signals coming from the Sync Gen erator to determine which 8-bit pixel value to output. These values come from the Color and Background registers as determined by the table below: In Border area of Left of Horizontal Border register Pixel contents Color register Screen? Color Boundary? bits[7:6] [1:0] contents output from M UX II Yes Yes 0x0 don’t care 0x4 Yes Yes 0x1 don’t care 0x5 Yes Yes 0x2 don’t care 0x6 Yes Yes 0x3 don’t care 0x7 Yes No 0x0 don’t care 0x0 Yes No 0x1 don’t care 0x1 Yes No 0x2 don’t care 0x2 Yes No 0x3 don’t care 0x3 No Yes don’t care 0x0 0x4 No Yes don’t care 0x1 0x5 No Yes don’t care 0x2 0x6 No Yes don’t care 0x3 0x7 No Yes don’t care 0x0 0x0 No Yes don’t care 0x1 0x1 No Yes don’t care 0x2 0x2 No Yes don’t care 0x3 0x3 Video Generator The output of MUX II is an 8-bit pixel, with bits [7:3] defining one of 32 co lors, and bits [2:0] defining 1 of Bally Professional A rcade Video Hardware Descript ion 18 8 intensities. This 8 -bit bus is connected to the Video Generator, which combines these signals with the Sync and Blank signals outpu t by the Sync G enerator to generate the v ideo outp ut signals Vide o, R-Y, B -Y, and 2.5 V. B-Y, R-Y and +2.5 V Outp uts A simplified schematic of the R-Y, B-Y, and 2.5 V output generation circuitry appears in the following diagram: As can be seen, the five color b its output from MUX II connect to both decode rs, along with sync, blank, and burst flag inputs fro m the sync generator. These last three inputs are used to force the B-Y and R-Y to specific voltages during the time when these signals are asserted, which is during horizontal b lanking. The sequence of syng signal assertions are as follows: End Active Video->Start Blank->Start Sync->End Sync->Start Burst->End Burst->End Blank->Start Active Video B-Y and R-Y are forced to specific voltage levels during burst flag, to inform the video modulator that color burst must be inserted into the signal at this time. The color output circuitry is based on a resistor ladder network, consisting of a series connection of 16 resistors, between +5 Volts and Ground. The resistors are not of equal value, but are symmetrical about the center connection, which is at 2.5 VDC. This connection is brought out of the chip to act as a reference voltage for the video modulator. It is also used as the center reference for the Video output, which will be covered later. The resistor values are weighted such that there is little voltage change going up from ground or down from +5 V olts, and the vo ltage difference increases as you approach the center of the network from either end. The choice of resistor values gives a reasonable distribution of colors which can be displayed on a typical TV set. Each decoder will activate one and o nly one of its outp uts for any combination of input values. The selected output turns on the appropriate switch, connecting the selected voltage from the resistor network to the output pin. Figure 11: B-Y, R-Y , and 2.5 V o utput C ircuitry Bally Professional A rcade Video Hardware Descript ion 19 Video Output As shown at right, the V ideo Ou tput is similar to the R-Y, B-Y outputs, but co nsists of only eight resistors. It functions in a simila r manner to that described for the B- Y, R-Y, and + 2.5 V outputs. Sync Generator The Sync Generator consists of counters and flip- flops which generate standard NTSC comp osite sync and blank waveforms. These are used to force the outputs of the Video Generator to specific voltages which can be decoded by a TV set into the correct horizontal and vertical scanning waveforms required to display a picture. The Sync Generator also outputs Hor Dr and Ver Dr, which are used to synchronize a similar counter running in the Ad dress chip. This latter counter is used to determine when to perform Screen Refresh cycles, along with generating the proper Screen RAM addresses to refresh the Screen from. The Sync Generator circuitry also generates the correct Load/Sh ift controls to the Data ch ip Shift Register, used to shift pixels through MUX I and MU X II in consumer resolution mode, and to control which sets of color and border registers are used in MUX II in both resolution modes. Clock Generator The Clock Generator takes the 7 M, 7M # inputs and divides them by two to gener ate the PX clock outp ut. Figure 12: Video O utput C ircuitry 7M and 7M# are again divided by two to generate MG, the clock to the Z80. Both PX and MG are stalled for three cycles of 7M at the beginning of each horizo ntal line so that there will be an intege r number ( 113) of MG clocks per horizontal line. PX is stalled to keep it synchronous with MG. Microcycle Generator The Microc ycle Gene rator is used to generate the MC[1:0] signals at the correct times to control activity on the Microcycle bus. The following truth table comes directly from NM109 and NM123: RFSH# MC1 MC0 MX[7 :0] Contents 0 0 0 A[7:0] from Z80 0 0 1 A[7:0] from Z80 0 1 0 A[7:0] from Z80 0 1 1 A[7:0] from Z80 1 0 0 A[7:0] from Z80 Bally Professional A rcade Video Hardware Descript ion 20 RFSH# MC1 MC0 MX[7 :0] Contents 1 0 1 A[15:8] from Z80 1 1 0 D[7:0] from Z80 1 1 1 D[7:0] to Z80 Not docume nted in the tab le above is a special cycle which occurs in response to a Z80 Interrupt Acknowledge. When the Z80 is acknowledging an interrupt, it simultaneously asserts its IORQ# and M1# ou tputs. This is detected by the data chip, which responds by asserting MC[1:0] to 0x3, and outputting the contents of its Interrupt Feedback Register (I/O address 0 x0D) o nto the Microcycle Bus. The control of MC[1:0] is done internal to the Data chip, but the additional control provided by the Z80 RFSH# signal is implemented externally. The following schematic details the Z80-sid e connections to the M icrocycle Bus. The Microc ycle bus was implemented to save on chip pins for the three custo m chips. It time-multiplexes the 1 6 -bit address and 8-bit data bus down into a b i d i r e c t io n a l 8 - b it m u l t i p l e xe d b u s . Wha t information the bus contains at any instant of time is controlled by the Data chip MC[1:0] outputs, and the Z80 RFSH# signal, as detailed in the table above. The preceding illustration gives the circuit details. Two quad 2-1 multiplexers (BPA U8 and U9, which are type 74LS257) are used to switch in the Z80 address bus. Each has eight data inputs (B[3:0] and A[3:0]) which are connected to the Address bus, four d ata outp uts (Y[3:0]) which are connected to the MX bus, and a pair of control inputs, En (Enable) and S (Select). Control input En, when at logical 0 turns the outputs on, so that they ma y drive the MX bus from the selected address input. The S input se lects which set of inputs connect to the outputs. If S is logical 0, inpu ts A[3:0] are connected to outputs Y[3:0] (assuming E n is logical 0). Otherwise with S at logical 1, inputs B[3:0] a re connec ted to outputs Y [3:0], respe ctively. Figure 13: Micro cyle Bu s Circu it Details Bally Professional A rcade Video Hardware Descript ion 21 The data connection between the Microcycle bus and the Z80 is provided by BPA U10 which originally was type DP8304, and was replaced by the 74LS245, a chip which is functionally and pin-for-pin compatible. This chip has eight identical bi-directional drivers, which are controlled by the En (Enable) and Dir (Direction) inputs. Like the En input of the 74LS 257, this chip is enabled o r ‘on’ when E n is logical 0. W hen En is log ical 1, the chip will not drive da ta in either direction. With En at logical 0, the Dir pin controls the direction of data flow. When both En and Dir are at logical 0, data is driven from the B pins to the A pins. When En is logical 0 and Dir is at logical 1, data is driven from the A pins to the B pins. The three-input NAND gate U13 and inverter U6 combine M C[1:0] and RFSH# to co ntrol the action of the Microc ycle bus. When both MC1 and M C0 are at logical 0, both NAND gate outputs are forced to logical 1. Inverters U6 invert the signals to apply logica l 0 signals to both U8 and U9 En and S pins. Therefore the multiplexers are on (En is 0) and the A[3:0] inputs connect to outputs Y[3:0]. Thus, Z8 0 Addr ess bus bits A [7:0] con nect to M X[7:0]. N ote that if RFSH # is logical 0, the identical con ditions exist. When MC1is at logical 0 and MC0 is at logical 1, the multiplexers are still enabled (U6 pin 6 is at logical 0 and U6 pin 8 is at logical 1), but the S inputs are now at logical 1. This connects the B[3:0] inputs to the Y[3:0] outputs. Z80 Address bus bits A[15:8] now appear on M X[7:0]. With MC1 at logical 1and Z80 signal RFSH# at logical 1, U8 and U9 are disabled in that the En pin of each is at logical 1 (U6 pin 6 is now at logical 1). Under this condition, U10 m ay be enab led, too, since one of the inp uts to the lower gate o f U13 (the 74LS1 0 whose o utput is connected to the En pin o f U10) is at lo gical 1. In ord er for U1 0 to be on, all three inputs of the U13 gate w hose output is on pin 12 must be at logical 1. The gating shown at the top of the drawing co ntrols this, as doe s signal BU ZOFF #, which co mes from the Expansio n Conne ctor. The gates at the top of the illustration will be covered first. NOR gates U11 and one gate of NAND gate U12 combine Z80 signals A[15:14], MREQ# and RD# such that pin 13 of NOR U 11 will go to logical 1 during a memory read when A[15:14] are 0x0. In other wor ds, this output w ill go high when the Z80 reads from System or Cassette ROM. This signal is input to two gates of NAND U14. Other inputs to these gates include Z80 A13 and A13# (from inverter U6 pin 10), SYSEN and CASEN from the Expansion Connector. If A13 is logical 0, A13# is at logical 1. D uring a System memory re ad, U11 pin 1 will be 1 and A13# w ill be 1. If nothing is connected to SYSEN, resistor R21 will pull the other input to U14 to logical 1 and U 13 pin 12 will go to logical 0, chip-selecting the System RO Ms. The RO Ms will now output the co ntents of the addr essed loca tion onto the Z80 Data bus. SYSEN, if pulled to a logical 0, will prevent the System ROM contents from appearing on the Z80 Data bus. CASEN woks similarly, except that A13 must be logical 1, and Expansion Connector signal CASEN is used to disable the Cassette chip select. During normal operation this pin, like SYSEN, is left open and R20 provides the logical 1 to permit the CS# to the Cassette ROMs to occur. Both chip selects are combined in NAND gate U12 such that pin 3 of this chip will go to logical 0 when either the System ROMs or the Cassette ROMs are selected. This input to U13 prevents pin 12 from going to logical 0, keeping U10 off. With U10 off, the current M C[1:0] state is irrelevant and the data read from ROM s will bot be disrupted by anything occ urring on the Microc ycle bus. The final control signa l which affects U10 Enable is the Expansion Connector signal BUZOFF#. This signal was adde d late in the de sign when it was realized that reads from the Expansion Connector address space had no way of preventing Microcycle bus contents from disrupting the data coming from the Expansion Connector. Any tim e BUZ OFF# is asserted to logical 0, D ata bus to M icrocycle Bus buffer U10 is turned off. When enabled, the direction of data flow for U10 is as follows: when MC0 and RFSH# are both logical 1, data will flow from the B pins to the A pins, from the Microcycle bus to the Z80 data bus. When MC0 is logical 0, data flows from the Z80 data bus to the custom chips. Note: this is all signal BUZO FF# does. Memory Control and Bidirectional Buffer The Memory Control block takes the input signals WRCTL# and LTCHD O generated by the Address chip and uses them to control when data is latched internally or when the various buffers are enabled. The signal WRCTL# Bally Professional A rcade Video Hardware Descript ion 22 asserted to logical 0 indicates that the memory access is a write. If a standard memory write is in progress (i.e., the address is between 0x4000 and 0x7FFF) the bidirectional buffer is enabled to drive data from the Microcycle bus to the memory data (MD[7:0]) bus. If a Magic memory write is in progress (i.e., the write address is between 0x0000 and 0x3FFF) the output of the Magic function generator is enabled on the MD bus. In either ev ent, output D ATE N# is asserted to logical 0 to perform a memor y write. If a memory re ad is in prog ress, LTC HDO will be asserted . This will enable the b idirectional b uffer to drive data fro m the MD bus to the M icrocycle b us, so that it can be forwarded to the Z80. The read data will also b e latched in the Magic F unction generator, if the Magic register bits were set for a forthcoming OR or XOR function. Reads keep DAT EN# at logical 1 so that the MD bus buffer (U23) will be enabled to drive memory data back toward the Data chip. Magic Function Generator The Magic Function Generator is used to perform the various ma nipulations to the data goin g to memo ry. Since the memory from address 0x0000 through 0x 3FFF is Read-Only, memory writes to this address range writes data to the equivalent Screen M emory ad dress (Ad dress written + 0x400 0), but with the m agic functio n a pplie d. The Magic Function generator uses a pair of registers, expand (I/O Address 0x19), and the Magic register itself (I/O Address 0xC). This latter register only contains 7 bits, which are defined below: Bit[7]: Not used Bit[6]: Flop. If set to logical 1, the data written to RAM will be flopped: Pixel 3 (bits[7:6]) will be swapped with Pixel 0 (bits[1:0]) and pixel 2 (bits[5:4]) will be swapped with pixel 1 (bits[3:2]). Bit[5]: XOR. If set to logical 1, the data written to RA M will be the bitwise logical X OR of d ata just read fro m this memory location, and the data coming from the Z80. I f the pixel content in one of the currently addressed pixels was non-zero (i.e., 0x1, 0x2, or 0x3) and the new pixel to be written is also non-zero, a bit corresponding to the pixel position in the Intercept register will be written to logical 1. Bit[4]: OR. If set to logical 1, the data written to R AM will be the bitwise logic al OR of d ata just read fro m this memory location, and the data coming from the Z80. An Intercept will be generated under the conditions stated above for XO R writes. Bit[3]: Expand. If set to logical 1, an expand write will take place. This permits ROM savings by expanding single bits of ROM storage into tw o-bit pixels. T he expan d function is assu med to consist of at least two memory writes, after the set-up wr ite of the Ma gic register. T he first, third, etc., write wil l expand bits[7:4] of the incoming byte, and the second, fourth, etc., write will expand bits[3:0] of the incoming b yte. The set-up write clears a flip-flop which is toggled be each su ccessive M agic Add ress write. On th e first Magic A ddress write following the set-up, bits[7:4] of the data written will be used as look-up v alues into the E xpand re gister to determine what the final MD bus content will be for the write. A bit in the incoming nyb ble at logical 1 will result in bits contained in the E xp and regis te r bits [3:2] appea ring in the equiva le nt pixe l-pos ition of the MD bus. Bits set to 0 in the incoming nybble use bits [1:0] of the expand register. For the first and each subsequent odd-numbered write, bit[4] of the incoming nybble maps to bits[1:0] of the data written, etc. For even- numbered writes, bit[0] of the incoming nybble maps to bits[1:0], etc. Bit[2]: Rotate. When set to logical 1, a process is enabled which will rotate the data written to memory by 90 degrees in the clockwise direction. It takes a total of eight Z80 write cycles to write 16 rotated pixels, and this function only works in c ommerc ial mode. T his function op erates as follow s: 1. Write the first byte to a location in M agic memo ry. This results in inte rmediate d ata written to memory, but this will be ov er-written in the fou rth cycle by the rota ted data. The first 4 of the 16 rotate registers internal to the Data chip are written with the properly-formatted data. Bally Professional A rcade Video Hardware Descript ion 23 2. Write the second byte to the first address + 80 (0x5 0). This, too results in intermediate data written to memory which will be over-written in the fifth cycle. Now eigh t of the 16 ro tate registers co ntain the properly-formatted data. 3. Write the third byte to th e first address + 160 (0x A0). This, too re sults in the intermediate data write. Now twelve of the 16 rotate registers contain the properly formatted data. 4. Write the fourth byte to the first address + 240 (0x F0). Interm ediate data is again written to m emory, and all sixteen rotate registers now contain the correctly formatted data. 5. Write the fifth byte to the or iginal addre ss. The da ta written by the Z80 is ignored, and the rotated data is written to the Screen memory 6. Write the sixth byte to the first address + 80. The data written by the Z80 is ignored, and the rotated data is written to th e Screen m emory. 7. Write the seventh byte to the original address + 160. The Z80 da ta is again ignored, and the rotated data is written to th e Screen m emory. 8. Finally, write th eighth byte to the orig inal addres s + 240. T he Z80 d ata is ignored, and the rotated data is written to th e Screen m emory. The following shows pre-and post rotated data: Figure 14: Before and After Ro tated Data Bits[1:0] Shift. Writing data with bits[1:0] greater than 0x0 results in that data being written to Screen RAM but shifted to the right by one, two, or three pixels as determined by the contents of this field. Successive shifted writes must follow at incremental addresses. The following shows examples o f shifted and flopped data: Bally Professional A rcade Video Hardware Descript ion 24 Figure 15: Examples of Shifter and Flopper Operation When performing Magic functions, Shifting and Flopping cannot be enabled at the same time, nor can OR and XOR be enabled at the same time. The Intercept register (I/O Address 0x8) contains several flag bits which save the result of previous OR or XOR Magic Memory writes. If any of bits[3:0] are set, this indicate s that the previo us write to the corresponding pixel (bit[3] = pixel[3], etc.,) wrote a non-zero pixel with a non-zero value. Bits[3:0] track the last M agic memo ry write, while bits[7:4] track any write to the corresponding pixel (bit[7] = pixel[3], etc.,) since the last time the Intercept register was read. Thus, once any of bits[7:4] are set to logical 1, they will remain that way until the register is read, at which time these bits will be cleared to logical 0. Summary of BPA Operation In commercial mode, pixels read during Screen R efresh mem ory reads a re latched into a shift register which is external to the Data chip, and shifted into Data chip inputs Ser[1:0] at the 7M clock rate, for twice the horizontal resolution of consume r mode. In the BPA , inputs Ser[1 :0] are con nected to ground (logical 0), and there is no external shift register. The refore, the BPA will never display commercial resolution graphics, without major changes to the Printed Circuit board. A Note ab out the B lue RAM Accessory Several po sts to the Bally Alley Astrocade Discussion Group have mentioned using the Perkins Engineering Blue Ram Accessory to somehow magically display commercial resolution graphics on an otherwise normal BPA. The schematics a re available a t: http://www.classicgaming.com/ballyalley/perkins/blue_ram_schematics.pdf These schematics are a bit difficult to follow, since they are split up into five pages, and the outputs of ce rtain gates are shown connected to a three-bit bus, but nothing indicates what gate output drives what bit. The Blue Ram seems to be a 16K or 32K RAM/PROM Add-on which uses the BPA Expansion con nector. This accessory also h as a ZIF (Zero-Insertion-Force) socket into which an optional keyboard or other accessory can be connected, and a chip which implemen ts a pair of eight-bit I/O p orts to which o ther device s can be attac hed. Onc e loaded , it appears as though the expansion memory can be write-protected. There are several connections (or lack thereof) to the Arcade Expansion Bally Professional A rcade Video Hardware Descript ion 25 connector which will be covered below: Video In/Video Out: these are NOT CONNECTED (NC, as called out on the schematic) to anything on the Blue Ram board. Therefore there is no video generated by this board. Note that the Expansion connector pins Video In and Video Out connect to opposite ends of BPA R33, which connects between the Video output of the Data chip and the video input of the RF modulator. This pin only has video brightness informa tion, and contains NO COLOR DATA. This means that anything connected to these pins cannot generate color video, and could conceivably damage the Data chip if an incorrect level were applied to the Video Out pin. 7 M, PX C lk, Vert Dr, Hor Dr these are also NOT CON NECTE D to anything on the Blue Ram board. T hese signals would be necessary to generate any video on this board, since any video generated must be synchronized to that generated by the BP A in order to overlay any BPA video. It should now be obvious that this board does not generate any video. BUSREQ#, BUSACK these are also NOT CONNECTED, which means that nothing in the Blue Ram can take over control of the Z80 bu s. CASE N, SYS EN, BUZOFF# these are connected to 74LS09 gates. A 74LS09 is an open-collector AND gate. The text above discusses ho w all three inputs work, but I’ll repeat it here. A logical 0 o n CASE N will stop any Cassette RO M from driving data onto the Z8 0 data bu s. A logical 0 on SYSE N will stop a System ROM from driving data onto the Z80 da ta bus. A logic al 0 on B UZO FF# will turn off BPA U10, preventing it from driving data onto the Z80data bus, or anything from driving data onto the M icrocycle bus. No amount of magic (software or otherwise) on the Blue Ram board will result in a BPA display commercial resolution graphics. A Note ab out the R & L 64K RAM Ac cessory This accessory fun ctions similarly to the Blue Ram. Differences are that there is no I/O chip, and all 64 K of Z80 address space can b e po p ulated w ith RA Ms or PROMs. The signals CASEN, SYSEN, and BUZO FF# are driven in a similar manner to the Blue RAM, exc ept that since there are more soc kets for memories, wider (i.e., more inp uts) gates are used to generate the control signals, and a 74125 tri-state buffer actually drives the signals back to the BPA. Therefore, the R & L 64K RA M will not get the BPA to display commercial resolution video, either.