Main > Main Forum
How do I build... Pong?
Stingray:
If you are in some way insinuating that Pong is not a "top-notch high-end gaming rig", then I'm going to have to ask you to step outside! ;)
-S
Dav:
--- Quote from: Procyon on March 26, 2004, 11:02:15 am ---Thanks for your responses guys, but unfortunately, that's not quite was I was looking for. I guess what I'm really more interested in is how people like Ralph and Nolan figured out how to wire up the circuitry to make a Pong game. What knowledge of discrete logic was used to create the game. The chips came about as a result of advancing technology, but only after the general concept had been designed. So I'm really curious about the origin of the development of Pong, not so much the refinements that came later. How did they know how to make an H and V sync generator? How did they know how to wire up a circuit that controlled the balls movement? How did they detect collisions between the ball and the paddle? Those kinds of things. Anyone know a good place to find that sort of information?
--- End quote ---
The manuals for the early boards were very detailed back then. Covering theory and everything. There's an extremely detailed manual for tank by Kush N' Stuff Amusment Electronics if you look for it.
Dave
paigeoliver:
Yes, I agree, get the manual to just about ANY pre "Tv Games chip" Pong game. Preferably an Atari/Kee one. Those things are like 100 pages and explain the functioning of EVERYTHING.
My Shark Jaws, Sprint, and Stunt Cycle manuals were so detailed that they basically included enough information to both bootleg the game with off the shelf hardware, AND to change things around as well.
I suggest looking for a manual to Pong Doubles, Quadrapong, or Elimination, as they are old enough to not have the TV games chip, but are new enough that they should have the uber-detailed manuals.
Druin:
Since I'm awake early on a Saturday morning and I would like to know myself as well, I'll now open those scanned pong magazine pages in another window and see if I can translate. Given that it's a magazine article and not just a schematic, it may be an easier task to find out how it works. RIght now I have no idea...
First, a trip to the coffee maker...
ok on to the article...
Alright, so far I've read part 1 and part 2. This section speaks of two ramp generators, Line and Field. Basically they are using a lot of technical terms like "Emitter Follower" and "High/Low Impedance input/output" and "the leading edge of the pulse is differentiated by this resistor and capacitor" etc.
Here's generally what's going on. They are hacking into a television, literally....I think it's like some sort of coupling technique (I didn't pay close attention to the TV parts, I am only interested in the logic theory). This is really old school stuff! Today you can just build a circuit to take a video signal from Coax or composite or whatever and you can figure out when the fields and lines are occurring etc, but I guess back in the day you had to do it "manually".
So without also knowing or caring too much about television theory, let's say a Field is one vertical scan period of a tv picture (I think two fields make a solid picture frame, one field interlaces another so 2 successsive fields make a frame). And a Line is clearly one line on the tube.
They are hacking the TV to steal pulses that show when a single line of the tube has been just drawn (or beginning?) and another signal tapped in to show when an entire screen field has just been drawn (or beginning). So you several hundred pulses of the Line signal as each line is drawn on screen, then you eventually get a Field pulse when the whole thing's been drawn.
They talk about a monostable circuit next. This is a manual pulse generator which requires some sort of input trigger (a switch, or a stolen TV line or field pulse indicator) and it will generate a fresh (safe isolated) digital pulse for each manual input received....*(vs an Astable circuit which will just keep auto-generating pulses on its own (oscillator)*).
Ok I'll try to keep the next part simple, but it may not come out simple. At this point the theory is the same on the Line and the Field signals, just that the line occurs faster and more often than the field. What they are doing with the freshly generated and isolated pulse...is....they are using it to make a sort of timer, in non technical terms...they are going to start a timer at the beginning of a TV line draw, and based on how much time has passed, they'll know proportionally where they are positioned along the tv line. Say the timer lasts 10mS, well they know that if 5mS have passed, they are half way across the screen along the current line. I haven't read far enough ahead yet but I'm guessing that there's going to be ultimately some sort of TV drawing circuit that just simply is an on/off pixel control, and this game circuit is going to tell the pixel controller when to go on or off, and as these timers are running to tell you where you are along the line, and along the vertical field, you have complete control of the X-Y tv grid and you can generate a screen of game info pixel by pixel just by knowing when to fire the final TV generator.
So that's why all the circuits shown end up just going to a logic gate and feed on to some other part of the circuit, all you need to know is when to turn something on or off, so it all comes down to one gate in the end of it all. If you need pixels turned on to draw a box in the corner, you'll just have a bunch of these timers to know when you're in the proper vertical and horizontal region, and when you are, the single output gate is going to be high or low or whatever to indicate this, and the tv generator will just fire and not fire blindly based on your timing. The TV has its own constantly running horizontal and vertical drive circuits that will be running all the time, it's just up to you to tell it when to start making the image or not, so you're hacking into the line and field TV pulses to know where the TV is at, and then you're hoping you can time it properly in your circuti and tell the generator to go NOW and make a pixel...
Ok. Back to the more technical aspect of these timers. So they talk about line and field RAMP generators. THis is the timer....a ramp is a straight line showing the increase of voltage as time goes on. When you sense the end of a line, the ramp generator is reset so you have 0volts or whatever it is, and this resistor/capacitor circuit begins to charge. Voltage increases as time goes on, so you get this voltage ramp rising. Thus you know that when you have a certain voltage level, that a certain amount of time has passed since you last reset, or reached the end of a TV line. This is how the timer is done.
So you've stolen the TV line and field signals, scaled them down to safe levels and re-generated digital versions, used that to charge up a capacitor which generates a voltage ramp, and based on the voltage level, you know the position across the screen (or down the screen). Again they get into technical terms like the emitter followers and high/low impedance this and that. They are saying that you can't just hook something else now up to that ramp generator or else you'll load it down, interfere with it, drain the level of the ramp, so they put a buffer there with high input impedance. High impedance input means a very high resistance on the circuit you're adding to tap into the ramp, so it doesn't drain the capacitor's achieved voltage level. Well maybe in a few days it would but the time constant of that new added resistance combined with the timing capacitor..may be a long long time required to discharge that capacitor...vs the other resistor used to do the timing on the ramp, so it virtually has no impact when you add your next stage with the buffer separating it.
The next stage happens to be the part where it all comes together to generate this digital final pulse that indicates where along the screen you want a TV generator to draw something. You have an isolated ramp now that is going to sit there rising in voltage from (say) 0volts up to 5volts, then drop back to 0volts and rise up to 5v again, over and over, as each line is drawn. So what you do now is make use of this to tell the TV gen. when to fire along the line. This is where the joystick comes in.
Moving a little forward, this ramp signal and the joystick interaction is going to feed to a logic gate (they mention schmitt trigger, this just means that the crossover point between logic high and logic low on the gate, is not a single point such as 2.5volts where if you're less than 2.5 it's low, more than 2.5 it's high, schmitt trigger will change that trigger point, say you are low, and you rise up to 3volts, finally the gate senses logic high, the schmitt trigger input will then make the new setpoint say 1volt, so if you drop below 3v, you don't go low again, you have to go WAY down to 1volt before a low is registered, it creates a wide window rather than just a single voltage level for high/low distinction. This is for noise immunity, if you had a noisy signal, then you reach 2.5v and you're going to flicker from 2v to 3v and keep triggering highs and lows when really you're only trying to get one transition...so schmitt will change the set point and help prevent false triggers).
As I was saying, now that schmitt trigger is talked about, they take the joystick and ramp parts and use them to trigger a gate high and low, which ultimately tells the tv Gen when to fire/not fire. Let's forget the schmitt thing and go back to 2.5v as the switch point between logic high and low. Anything more than 2.5 is high, less than 2.5 is low. You have that ramp hookedup to the gate input, so it's running from 0v to 5v and starting over. When it reaches 2.5v it will set the gate high (I don't know what the circuit actually is, just using theory now), and when the ramp starts over at 0v the gate is again low until the ramp gets up to 2.5v. So you'd have this TV Gen going on and off as the lines are drawn on the TV. By adding that joystick part to the circuit, which is a pot and transistor, they are using the pot to control how much a transistor is turned on or off, which ultimately varies the voltage where this circuit merges with the ramp generator....so you have a sort of mixer effect. If the ramp is at 3 volts, the gate should be high, but if you use that joystick and set the transistor so that it's manipulating the voltage level down to only 1volt, then the gate really is still low. That means at this joystick position, you would need the ramp to almost reach the full 5volts before the final voltage appearing at the gate input actually hits the 2.5volt trip level and goes high....so you move the joystick to the right, which causes a voltage manipulation and the ramp has to reach 5volts (extreme end of a line drawn on screen) before the gate tells the TV Gen. to finally fire.
Likewise if you turn the joystick far left so you're adding more voltage to this mess, the ramp is only at 1volt but you're imposing 3volts with the transistor, you really have 4volts now and the gate is on, TV gen starts drawing on screen, and yet the ramp has only just started up at the beginning of the line on screen.
So by using these ramps, then manipulating their levels and using this as a means to turn a gate on/off at any point in time that you decide with a joystick....you control the pixels being drawn. Same with the Field ramp, you turn the ultimate single TV Gen on when you are at the proper X-Y region on the screen, it's all based on timing in the broken down circuit theory, all the stolen pulses from the TV, generating new pulses based on time delays from the original pulses, and telling the gun when to fire.
Ok so now we know how to blindly draw on the screen at the proper locations, hopefully. I'll post this much and go refill the coffee maker and keep reading.
Druin:
Hey! Wow. In order to detect collisions of game characters, it's very easy when you make note of the theory presented in my last post on how to use the ramps and timing to feed into that final schmitt trigger gate, which will give an output change when the desired positions are met.
If you consider just horizontal motion, suppose you have a ball flying around, and a character that has a fixed horizontal position (the pong paddle moves up and down and stays in the same horizontal location)...this paddle is being drawn on the screen at a fixed point in the ramp timer that tells it to start drawing along the lines of TV space, so this means that somewhere in the hardware there is a gate that is going high for as long as the tv is currently drawing pixels at this paddle location.
Likewise there is another gate going high for as long as a ball is being drawn at some other location on the screen..
Say the paddle is along the left of the TV going vertical up and down, presently located in the top left of the screen. A ball is flying towards the paddle, and is presently located in the center of the screen. When the TV starts drawing the next picture frame, while the TV is drawing line 1 at the top, there is going to be a "Line" gate and a "Field" gate for the paddle that will have high outputs for the duration that the tv is drawing those sections of the top corner of the screen. The ball is supposed to show up later on down the screen so those ball Line and Field gates are still low, nothing is drawn. Then the TV is working on the middle area of the screen, the paddle has already been drawn so its Line and Field gates are low, no paddle pixels are instructed to fire. But when the TV gets to the ball location, its Line and Field gates will go high as necessary to fire pixel generation as the Tv scans past the middle of the screen. While the ball isn't being drawn, the gates go low again.
So you have 4 gates to work with, field and line ball, field and line Paddle. If you run those signals through another AND gate, the output will go high when the coordinates for paddle and ball match. Then you know you have a collision.