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

Pong Project


DanBoris

4,486 views

I've been working on a Pong related project and I thought I would post a screen shot:

 

blogentry-184-1178237227_thumb.jpg

 

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", Node("L"), Node("MISSED"), Node(132)))
Me.AddPart(New IC7490_4bit("C7", Node(132), Node("SRST"), Node("SRST"), Node("SCORE1_1"), Node("SCORE1_2"), Node("SCORE1_4"), Node("SCORE1_8")))
Me.AddPart(New IC74107("C8A", Node(1), Node(1), Node("SCORE1_8"), Node("/SRST"), Node("SCORE1_10"),Node("/SCORE1_10")))              
Me.AddPart(New NAnd3("D8A", Node("SCORE1_1"), Node("SCORE1_4"), Node("SCORE1_10"), Node("/STOPG1")))

 

So, can you actually play Pong on this? You would be able to except for the problem of speed which I always knew would be a major hurdle to logic level simulation. Currently the program takes about 15 seconds to render each frame on an Athlon 64 3000+, and although this performance can probably be increased it's a long way from being truly playable.

 

My goals on the project are two fold. First to provide a proof of concept that other people may be able to take and optimize to get better performance. Second to provide an accurate way of simulating these old discrete logic arcade games so we can see how they looked and behaved, and possibly use this information to write accurate ports of the games that run at full speed.

 

I still have a lot of cleanup work to do on the program but then I plan to release the source and executable. After that I'd like to add some more games to it, possibly Breakout next.

 

Dan

4 Comments


Recommended Comments

I don't see chip-level simulations as being very useful for playing these old arcade games. Most of the circuitry in PONG isn't doing anything 99.9% of the time, so why simulate it continuously? During vertical blank, the ball will move by amounts that are determined entirely by things that have happened earlier in the frame. The appearance of the net never changes, and the appearance of score digits only changes when certain specific events occur. Processing these things as display overlays rather than as logic would speed things considerably without affecting the user experience one iota (except by allowing the simulation to run real-time).

 

What I do see the simulations as useful for would be validating software emulators. Someone who studies the PONG schematic carefully should be able to produce a pixel-perfect rendition, but a failure to understand how something works could cause the look-alike to behave differently from the real thing. Even if it can only run at a frame per second or so (or even slower), it should be possible to set up a simulation script to compare the screens generated by full logic simulation with those generated by the look-alike program. Such a project could improve the acceptance of MAME simulations of hard-wired games.

Link to comment

Simply awesome.

 

I think it would be grand to convert your PONG circuit description to VHDL and thus create a circuit for circuit replica of PONG on a 'single' chip.

 

It's similar to the FGA arcade

 

It would certainly run considerably faster than 0.067 frames per second.

Link to comment
I don't see chip-level simulations as being very useful for playing these old arcade games. Most of the circuitry in PONG isn't doing anything 99.9% of the time, so why simulate it continuously? During vertical blank, the ball will move by amounts that are determined entirely by things that have happened earlier in the frame. The appearance of the net never changes, and the appearance of score digits only changes when certain specific events occur. Processing these things as display overlays rather than as logic would speed things considerably without affecting the user experience one iota (except by allowing the simulation to run real-time).

 

What I do see the simulations as useful for would be validating software emulators. Someone who studies the PONG schematic carefully should be able to produce a pixel-perfect rendition, but a failure to understand how something works could cause the look-alike to behave differently from the real thing. Even if it can only run at a frame per second or so (or even slower), it should be possible to set up a simulation script to compare the screens generated by full logic simulation with those generated by the look-alike program. Such a project could improve the acceptance of MAME simulations of hard-wired games.

 

Actually the technique I use to simulate the circuit only re-evalutes a chip when one or more of it's inputs have changed. Even with this the performance still isn't greate.

 

This was exactly my intention, as a tool for validating simulations of these machines. Perfect example of this was the Pong driver that was in MAME a while back. Althought pretty accruate it totally missed the fact that the ball keeps moving in attract mode. Even when I had studied the schematics I didn't relize this, and it wasn't until someone described the behavior of the real game was I able to correctly decipher the schematics to see how the ball behaved during VBLANK.

 

Dan

Link to comment

Excellent Blog, Dan! :)

 

I am currently restoring a real Pong PCB, and your descriptions here really help me in finding faulty parts. So far, I have replaced 2 TTL's (7400, 74161 (as a 9316 replacement)) and the game runs perfect now.

 

Great work with the simulator! However, I noticed some differences between the real Pong and all simulations:

 

- The graphics are mixed through resistors, which means that all elements are bright grey, and everything which overlaps with the ball is white.

 

- I have to investigate it further, but it seems that on the original, the second paddle is displayed 4 more pixels to the right

 

Again, great work! Shame that on some entries, the pictures are slowly vanishing...

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...