Classic 70's TV game reproduced on the Arduino/AMTEGA328

Hi.
Thought you might be interested in one of my projects.
The aim of this is to faithfully (as accurately as possible) recreate all four paddle games (Tennis, Soccer, Squash and Solo) that were on the 70's "pong"-type game consoles.
Here are actual screenshots of it in operation...

Full details and sourcecode is to be found on my page here:
http://searle.hostei.com/grant/AVRPong/index.html

Please also see my main page for other projects and collections here:
http://searle.hostei.com/grant/index.html

The display routine is a modified version of the TV out library file, the game code is all my own work.
I have spent a lot of time with datasheets and screenshots to make this game as accurate as possible. I will be tweaking it a little bit over the next week or so to increase accuracy, but any timing changes will be tiny - you won't notice, I just want to be accurate.

As it is on a free hosting service, the site occasionally goes down. If the links don't work then please try a bit later.

BTW. All diagrams are hand-drawn by me using Visio.

Hope it's of use to you.

Regards.

Grant

This is really nice!

I took a look around your site - man, I've always wanted to try my hand at something like your simple 6809 or Z80 (or CP/M!) projects, but the thing that stops me is not owning an EPROM burner (I've probably got all the chips, otherwise).

I wouldn't have any real use for such a system, other than to say "I did it" - though I think building such systems would help me understand other things I own better, to an extent. For instance, my first computer system (which I still own - and it still works) from when I was a kid (30 years ago when I was 10) was my TRS-80 Color Computer 2. I also have an Altair 8800 that needs a bunch of TLC to get it running again (and it has the Z80 upgrade - sadly, I didn't get one with an 8080, but I'm not really complaining). I think simple computer system projects like you have posted would help me to better understand how these other systems I own are put together.

...anyhow - thanks for the Pong project, and all the others; it's nice to see these things still being collected and cared about!

but the thing that stops me is not owning an EPROM burner (

You could probably emulate an EPROM with a Mega at 1970's microprocessor clock speeds :slight_smile:

AWOL:

but the thing that stops me is not owning an EPROM burner (

You could probably emulate an EPROM with a Mega at 1970's microprocessor clock speeds :slight_smile:

Well - I could probably emulate nearly the whole thing; the thing is, I have a ton of old 1970s era components - when I find them, I grab 'em - I probably have 10 Z-80 processors, for instance, and more than a few 6809 processors. I also have many of the old EPROMs - 2716, 2732, 2764, 27128, 27256 - I just don't have a way to program them. I have tons of 74LSxxx logic too; basically I believe I have everything I need to build some old 1970s era microcomputer (not counting my Altair or my Heathkit 6800 trainer) - except for an EPROM programmer.

One of these days I'm just going to have to break down and either build one, or purchase an old used one (for a bit of money - it seems those things have kept their value somewhat over the years).

I knocked up my programmer a few years ago - it's still running on a solderless breadboard. It programs 2764 up to the big 32 pin ones. It's running on a PIC16F877 (could be done on a 40-pin ATMEL device instead, though).

It's driven at 115200 baud via the serial port, and is menu driven.
To upload, simply paste the contents of the HEX file to the terminal window.

I need to knock up a schematic of what I did (away for some of the next few weeks, but will do when I get spare time).

Grant

programmer.jpg

I've got a stack of old 6809s and Z80s too...I'm getting twitchy asm fingers.
However, before I could program my EPROMs (for which I'd have to build a programmer), I'd have to erase them.
I wonder if UV LEDs would do the trick?

AWOL:
I wonder if UV LEDs would do the trick?

I'm looking at a datasheet for the 2732 (specifically the M2732A) that has a section on erasure - says that direct sunlight would take a week of exposure to erase the device; it goes on to read "The recommended erasure procedure for the M2732A is exposure to shortwave ultraviolet light which has a wavelength of 2537 Å."

2537 Angstroms is called "UV-C" ultraviolet light; it is used for sanitization purposes (among others) - so if you can find a UV LED that will emit at such a wavelength, it would probably work. The datasheet goes on to read:

"The integrated dose (i.e. UV intensity x exposure time) for erasure should be a minimum of 15 W-sec/cm2. The erasure time with this dosage is approximately 15 to
20 minutes using an ultraviolet lamp with 12000 ?W/cm2 power rating. The M2732A should be placed within 2.5 cm of the lamp tubes during erasure. Some lamps have a filter on their tubes which should be removed before erasure."

I'm not sure whether you'd be able to find a UV LED with the needed power at that wavelength - the wikipedia article on UV and UV LEDs:

...seems to indicate that such LEDs don't readily exist - but then again, I've seen home-use UV LED based sanitization wands...?

Maybe if you found such LEDs, and arranged them so that the output of a few such LEDs was right up against the window of the EPROM - it might work...?

Hmm - reading this forum's thread:

http://www.electronicspoint.com/can-uv-leds-erase-eproms-t25584.html

...would seem to indicate the answer to be "no"...

In fact - as I was looking around for UV LEDs - even though they weren't of the proper wavelength - most seemed to have an output of 200 uW/cm2 - even if they were of the proper wavelength, you'd need 60 of them to equal what is recommended by that datasheet.

That said - there seem to be plenty of low-cost UV-C 253.7nm (sometimes sold as "254nm") bulbs out there for UV sterilization purposes - though finding out what their "coverage" is seems more difficult.

cr0sh:
the thing that stops me is not owning an EPROM burner (I've probably got all the chips, otherwise).

You could probably make one with an Arduino.

Anyway, to reclaim this thread and get back on topic ( :stuck_out_tongue: )...
I have updated the software so that the screen now displays two resolutions on the screen... 80x115 for the main playfield and 80x230 (double the vertical resolution) for the 5 lines that contain the ball.

This now allows the ball to move very smoothly, the same as the original chips.

The resolution switching is dynamic at the time of screen drawing so the ball part is always at the double resolution wherever it is on screen.

Also changes made to make the left and right edges dotted, as in the original (again, during screen draw, effectively doubling the vertical resolution for the edges).

Some diagrams and text on this is on the page.

Have fun!

http://searle.hostei.com/grant/AVRPong/index.html

Regards.

Grant
http://searle.hostei.com/grant/index.html

AWOL:
I've got a stack of old 6809s and Z80s too...I'm getting twitchy asm fingers.
However, before I could program my EPROMs (for which I'd have to build a programmer), I'd have to erase them.
I wonder if UV LEDs would do the trick?

The wavelength for UV erasers is 253.7nm. I don't think you can get LEDs with those wavelengths.

Other wavelengths will work but it will take longer to erase.

cr0sh:
...seems to indicate that such LEDs don't readily exist - but then again, I've seen home-use UV LED based sanitization wands...?

I've seen home-use ultrasonic mosquito repellants and UV-led mosquito zappers on sale. It doesn't mean they actually work.

PS: Is there anything they don't sell ultrasonic repellants for? Rats, cockroaches...I've seen those too. None of them work BTW.

I used some 3W UV LEDs to light up a room last Halloween. I'm sure one of those placed right on the EPROM window would do something to it. You'd have to experiment to find out how long it takes to erase using one of those.

Further updates (source code and wiring) now online.

I've moved the version selection from Arduino pin 13 (PB5, ATmega chip pin 19) to Arduino pin 12 (PB4, ATmega chip pin 18) to avoid a conflict with the power-up LED boot flash if using the Arduino bootloader. Also, the player potentiometers on schematic have been turned around so that clockwise = up, anticlockwise = down, as on the original consoles.

http://searle.hostei.com/grant/AVRPong/index.html

My page gives the required Arduino pin numbers to connect to, but I've now got a UNO board so I'll probably add the equivalent wiring and pic for those using a board.

All source is in one file, no additional libraries are needed, so just load up and program :slight_smile:

Grant
http://searle.hostei.com/grant/

cr0sh:
I took a look around your site - man, I've always wanted to try my hand at something like your simple 6809 or Z80 (or CP/M!) projects, but the thing that stops me is not owning an EPROM burner (I've probably got all the chips, otherwise).

Just take a look at this little project: Maintenance - Wartungsmodus
It's still in development, but already able to write and read EEPROMs. There are also a lot of information about it in the 6502.org forum (6502.org • View topic - 28Cxxx EEPROM Programmer)
There is also a GIT repository meanwhile to have the sourcecode available for public: GitHub - mkeller0815/MEEPROMMER: EEPROM / EPROM programmer based on Arduino hardware

zx80nut:
Hi.
Thought you might be interested in one of my projects.

Just built one this afternoon. Thanks Grant! You do some really nice stuff. I'm jealous.

BTW, I have the changes required to run this on NTSC. If your interested I will up-load the lines of your code that need to be changed.

EDIT and OT - Oh, a few years back I built one of your UK101 SBCs. Well almost. I made a small change to the glue logic, and with the same number of chips it can run the UK101/OSI BASIC, Tiny BASIC, or EhBASIC. The change fills in some of the holes in the memory map so that you can have more ROM. Let me know if you'd like that too.

@Dirt Biker:

Did you make the changes as a conditional compile; Or, just an edit? If just a few lines, be nice to see the diff.

Thx

Just edited the values. Did not even rename the defines.

Here they are:

const char FIELD_HEIGHT=100;          //Was 115
const char SOCCER_EDGE_HEIGHT=20;     //Was 25
beginVideo(80,100);          //Was (80,116)
#define _TIME_VERT_SYNC			60         //Was 58.85
#define _PAL_TIME_SCANLINE	        63.625     //Was 64
#define _PAL_TIME_OUTPUT_START		11         //Was 12.5
#define _PALLine_FRAME			282        //Was 312
#define _PALLine_START_VSYNC		0          //NC
#define _PALLine_STOP_VSYNC		3          //NC
#define _PALLine_DISPLAY		220        //Was 260

Thanks for your comments on this - most appreciated - glad the page has been of use.
I'll take the values for NTSC and put them in the code. I intend to utilise a spare pin to say if the chip is to be in NTSC or PAL mode, as is done for the chip type. That way, only one code is needed for all.

I'm aiming for accuracy as much as possible, and I have been able to do side-by-side comparisons with the original chips (uncluding the annoying beeps :wink: ). Currently I only have PAL versions of the chip, but I intend to get an NTSC version from eBay so that I can check that the field height, goal sizes etc. for it is exact.

DirtBike - OT stuff... yes, please feel free to send me any enhancements :slight_smile: Not sure if yo have seen it, but I have recently put online a much simpler 6502 design (because it didn't need to fit in with the original UK101 memory map)
http://searle.hostei.com/grant/6502/Simple6502.html
It also runs OSI/UK101 BASIC. I do like ehBASIC (have used it previously) and that is easily ported as well.

Best regards.

Grant.
http://searle.hostei.com/grant/index.html

@zx80nut

Using a free pin for NTSC would be a great idea. My values were an educated guess on what would work. I'm sure they'll have to be tweaked for authenticity.

OT from here -:

Yes, I saw your new minimal 6502. Not bad at all. If you use a 1.8432mHz oscillator (and not call it an IC) and use a 65C51 ACIA I think you could get it down to 5 chips (or 4 with the USB cable).

I'm really keen on that CP/M machine though. If I get some spare time I'll build one of those.

I've attached a .png of my decode circuit for the UK101.

PS: The guy's name in the file is not me, just the guy who did up the schematic from my hand scrawl.

Thanks all for the feedback here. I've ordered an NTSC version of the original chip from the US, so as soon as I get it I'll hook it up (assuming it works!) and set up mine to have the NTSC option pin so that it can switch between PAL (AY-3-8500) and NTSC (AY-3-8500-1) modes.

Probably take a week or so to get here (UK), but will update you (and the web page) once done.

Have fun.

Grant