Jump to content
  • entries
    39
  • comments
    57
  • views
    124,773

About this blog

Discussion of technical aspects of classic videogames

Entries in this blog

Ball Horizontal Counter

The final graphic element we need to look at is the ball. Like the score this is a pretty complex, but very clever circuit.   The first part of the circuit we will look at is the horizontal counter. This circuit controls the horizontal location, motion and size of the ball. Later we will look at a similar circuit that controls the vertical.     The main part of the circuit is a 9 bit counter composed of G7 and H7, which are synchronous counters, and G6. When the co

Guest

Guest

Score Segment Decoder

This is the final section of the score generation circuit, which I call the segment decoder. For each point on the screen, this circuit determines which of the seven digit segments should be enabled.     The segment outputs from 7448 are labeled ‘a’ through ‘g’ and go into the three input NAND gates (C4, D4, D5). Each of these outputs corresponds to a segment of the score as follows.     The other two inputs to each NAND gate will go high when the corres

Guest

Guest

Score hold out

The next portion of the score circuit we will look at is what I call the “hold-out” generator. The output of this circuit goes to the enable input of the seven segment decoder chip we discussed earlier. When the enable signal is low, all the outputs of the decoder are turned off. So the scores can only be displayed when the output of this circuit is high. The easiest way to describe how this circuit works is to show it graphically. If we take every point on the screen, feed the horizontal and ve

Guest

Guest

Score Part 2

Next we will look at where the digit inputs to the score decoder come from. As I mentioned before there are two, two digit scores displayed in Pong, one for each player. Since there is only one score decoder, there needs to be a way to select which digit is being fed to the decoder at each point on the screen. The circuit that performs this function is composed of two 4-line to 1-line data multiplexer chips:     The inputs to the multiplexers come from the score counters, wh

Guest

Guest

Score Part 1

The next section I am going to talk about is the score generation circuit. In Pong, each player has a two digit score that is displayed at the top of the screen on either side of the net. The circuit that generates the score display is a little complex, but I find it to be a very interesting design. I am going to start from the center of the circuit and work out.   At the heart of the score generator is as 7448 BCD to 7-segment decoder chip.     This chip is usuall

Guest

Guest

Paddles

There are two parts to the paddle generation circuit. There are two identical circuits (one for each player) that control the vertical position and height of the paddle, and a second circuit which controls the horizontal position and size.     The vertical circuit is based on the very versatile 555 timer chip (A9). In this case the 555 is configured in mono-stable mode. In this mode the OUT pin will go high when the TRIG input goes low, and will stay high for a period of tim

Guest

Guest

Vertical Counter

The next section is the vertical counter which works just like the horizontal counter. The input to the counter is the HRESET signal from the horizontal counter, so the vertical counter will increment once per horizontal scanline. The vertical counter, resets just like the horizontal, but on a count of 262, 256V + 4V + 1V + 1 (VRESET latched on the next clock pulse).  

Guest

Guest

Horizontal counter

The next stage is the horizontal counter.       The 7 MHz clock signal enters F8 which is a 4-bit binary counter. The clock is divided in half producing the 1H signal which is the low bit of the horizontal counter. Each stage of F8 divides the signal in half again producing 2H, 4H, and 8H. F9 continues the division producing 16H, 32H, 64H and 128H. Finally the clock is divided in half one more time by F6 to produce 256H and an inverted version called /256H. (I use the ‘

Guest

Guest

Main Clock

The heart of Pong, and any of the discrete logic games is the horizontal and vertical counter. These counters continuously step through each horizontal and vertical position on the screen. The output of the counters is fed to all the other logic of the game which ultimately determines if each pixel should be on or off (or what color it should be in the case of color graphics).   Everything begins here     This is the main clock generator in Pong. The crystal (which

Guest

Guest

OSS Action!

One of my favorite programming languages for the Atari 8-bit computers is OSS Action!. Action is a compiled, structured programming language similar to C or Pascal. One of the impressive features of Action is it’s very fast an efficient compiler. Not only does it compile programs quickly, it produced pretty tight machine code executables. I thought it would be interesting to take a look at some of the machine code that the compiler produces.   First lets look at the classic “Hello World” prog

DanBoris

DanBoris

Pong Circuit Analysis

One of the things that I have always enjoyed about classic videogames, and classic arcade games in particular is learning how the actually operated. I have spent many an hour studying schematics of these machines to figure out exactly how they work.   Of particular interest are the earliest arcade games, since these did not have microprocessors. The graphics, sound and even game logic where implemented using just discrete logic circuits. What the designers of these machines managed to achieve

Guest

Guest

Pong Project

I've been working on a Pong related project and I thought I would post a screen shot:     Yes, this may look like any one of 1000 different Pong simulation programs that people have written, but this one it a little bit different. The screen shot you see here was generated by doing a chip level simulation of the Pong circuit using a general purpose digital logic simulation engine. Here a little sample of the code used to define one of the score counters:   Me.AddPart(New Nor2("F3B",

DanBoris

DanBoris

Telengard

One of the games I remember from the good old days with my Atari 800 computer is the dungeon crawler Telengard by Avalon Hill. The game was written in Basic so I thought it would be interesting to take a look at the code for the game. One of the most interesting parts is the way the maze if generated. The dungeon in the game is very large, it has 50 level and each level is 200 by 200 rooms. The dungeon is also the same every time you play so you can map it out as you go along. I was really curio

DanBoris

DanBoris

Ball Horizontal Control Proposal 2

Here is the other proposal supercat made for the ball horizontal control circuit. This one actually appears to work exactly like the real circuit, providing 3 different ball speeds and saves at least 2 chips.  

DanBoris

DanBoris

Ball Horizontal Proposal

In the discussion of the ball horizontal control circuit, supercat proposed a simplified circuit that would perform the same function. This is the circuit I believe he is describing:   starfire.zip   It actually comes pretty close to working, and it does use less chips, but instead of generating 3 speeds it generates 4.   The VSYNC input will make sure the circuit is only enabled for the first four lines on the screen. For each count on the hit counter the MOVE signal will be enabled for

DanBoris

DanBoris

Ball Horizontal Control Part 2

As supercat observed in my last entry, I totally missed this part the first time around. Better late then never...   _pesco_pacman_v8.zip   For anyone who has played Pong, you may remember that the more times you volley the ball back and forth, the faster the ball will move. This counter counts those volleys. Each time the ball is hit by either player the counter will increment until it reaches a count of 12, at which point it will be disabled by NAND gate E1. The counter is reset by the RST

DanBoris

DanBoris

Hit Sound

It's been a while since I did an update to my Pong circuit analysis, but I just get distracted by other project far to easily!   The next section is the hit sound, the sound made when the ball is hit.   _corrected_pesco_pacman_roms_v6a.zip   When the ball hits either paddle the /HIT signal will go low which will clear C2 and set the /Q output high. For /HIT to go low VPOS256 has to be high, so there won’t be another positive edge on VPOS256 to clock the counter until the next frame. On the

DanBoris

DanBoris

Score Sound

The next couple of circuits are used to generate the sounds for the game. The first sound circuit is for the score sound. This sound is played whenever either player misses the ball.       When a player misses the ball the /MISS signal will go low which will trigger the 555 timer G4. When triggered the output of G4 will go high and stay high for 242ms at which point the output will return low. When the output of the timer is high the 32V signal will be allowed to pass through NAND C3 to the

DanBoris

DanBoris

Game Control 2

The reply to my last entry explaining the transistor portion of the game control circuit allowed me to work out the complete opertation of this section.   When the coin switch is activated it momentarily pulls /SRST low which resets the score counters. The two C9 inverters generating an active high reset signal which is also used to reset the score counters. When /SRST goes low it pulls the base of Q2 low which turns on Q2, which pulls the base of Q1 high turning Q1 on. With Q1 on the base of

DanBoris

DanBoris

Vertical Ball Pt II

The ball vertical motion is controlled by a slip counter just like the horizontal.       The counter is clocked by the /HSYNC signal so it will increment once per line. Since /VBLANK goes to the ENT input of B3 it will stop the count during VBLANK. When the two stages of the counter reach 255 the load signal will be triggered by B2. The upper stage of the counter is loaded with 0, and the lower portion is loaded with the output of the vertical control circuit. The values from the vertical c

DanBoris

DanBoris

Game Control

I am hoping that I can get a little help figuring this section out. I am pretty good with digital analysis, but my transistor theory is a little (ok a lot) rusty. The purpose of this section is to control the game state. Here are the things that I do know about this circuit:   - When either /STOPG1 or /STOPG2 goes low, indicating that one of the score counters has reached the game ending score, the output of B3 (STOP G) will go high which stops the game. The high on STOP G will also set /ATRAC

DanBoris

DanBoris

Score Counter

The first step in counting the score is to determine when one player or the other has missed the ball. This turns out to be very easy to detect because the only graphic object that can move off the visible screen is the ball. The circuit shown below ANDs the horizontal component of the video with the HBLANK signal to create the /MISS signal. Whenever there are graphics being displayed during horizontal blank, /MISS will go low indicating that the ball went off the screen. /MISS next passes throu

DanBoris

DanBoris

Vertical Ball Control

Now that we have looked at the horizontal component of the ball we will look at the vertical portion. The vertical is based on a slip counter just like the horizontal so we will cover the slip counter control first. The vertical motion of the ball is influenced by two things, hitting the top or bottom of the screen, or hitting one of the paddles. When the ball hits the top or bottom of the screen, it will reverse direction, but keep the same speed. When the ball hits the paddle the effect on the

Guest

Guest

Ball Horizontal Control (Part 1)

The purpose of this circuit is to generate the Aa and Bb signals that go into the horizontal ball counter. I will describe what this circuit does first, and then go into the details of how it does it. There are three valid states for Aa,Bb:   Bb Aa 0 1 - move left 1 0 - stationary 1 1 - move right   Normally the Aa/Bb outputs will be in the stationary state, because we only want the ball to move a little bit on each frame, so for most of the horizontal lines the ball is not m

Guest

Guest

The net

Now that we have covered the horizontal and vertical counters we can start talking about how the graphics for the game are actually generated. We will start with the simplest part, the net.       At the start of each horizontal line, /256 is high which gets clocked through F3 to one of the inputs of G3. Since the other input of G3 is connected to 256H (which is low), the output of G3 will be high thus turning the net off. When the horizontal counter reaches 256, 256H goes high, and the

Guest

Guest

×
×
  • Create New...