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

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

Hi.
I've modified the code and schematic to check for the value on pin 6 (PD4) of the ATMEGA328 (ie. ARDUINO DIGITAL PIN 4) at startup.
If it is low then the chip now displays using NTSC timing. Leave disconnected for PAL.

Currently, it uses information that I took from the datasheets. I am waiting for an AY-3-8500-1 NTSC version of the original chip to arrive. When I get it, I will tweak values if necessary.

Latest code and schematics online.
http://searle.hostei.com/grant/AVRPong/index.html

Any probs or queries, please feel free to contact me.

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

Sorry it's taken me so long to get back to you Grant. Life got busy.

I tried your new code and it works great!

I was talking to a friend of mind that owns a small business making stuff for Arduinos. He thought he might like to make a shield that accommodates this game. Would you have an issue with this?

My next step in this is to build mine into a glass-top table and re-arrange the graphics slightly to make a '70s era bar video game. Should be a great way to quaff a few pints of Guinness. I know I spent a lot of time, money and my liver playing those bar games circa 1974 when I bought my Yamaha RD350.

Those were the days... bikes, bars and broa..err, ladies!.

Hi DirtBiker.

Glad it's working for you.
Yeah, your friend is free to make a shield or whatever - glad it's of use. Obviously, no charging for my code, and a link to my original page please :slight_smile:

I received the NTSC (AY-3-8500-1) version of the chip yesterday. I've been so busy at the moment that I haven't tried it yet, so hopefully in a few days power it up and I'll super-impose the original and my versions to see if any values need tweaking. I'll update when ready.

On free web hosting, so unfortunately sometimes the server is unavailable. If there is a problem loading any of my pages then please try again in a while/next day.

All the best.

Grant

Thanks Grant, I'll pass it on.

Hi.
The original NTSC version of the chip (AY-3-8500-1) arrived safely from the US. I connected it up and it works, so I was able to to an accurate side-by-side comparison between my implementation and the oritinal NTSC chip. I have now updated the code so that it accurately implements the NTSC version as well as the PAL versions.

Differences between the NTSC and PAL versions...

  1. The scores on the NTSC version occupy 20 scanlines (4 lines per block) but the PAL version occupies 30 scanlines (6 lines per block) - as on the datasheets. The NTSC numbers are noticeably shorter.
  2. The vertical net/centre line on the NTSC version is SOLID but the PAL version is DOTTED (as can be seen on the pictures below).
  3. The NTSC picture has fewer scanlines, so a lower vertical resolution. This results in the ball appearing to travel at slightly steeper angles on the NTSC version because each step therefore has a larger Y displacement. Additionally, this lower resolution makes the bats appear longer.

Here are actual screenshots of the PAL (left) and NTSC (right) versions as created with my code (these match the actual original chips)...

Updated code and descriptions on my web page here...
http://searle.hostei.com/grant/AVRPong/index.html

Any queries, as always, feel free to ask.

Regards.

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

Server issues...

There are problems with the server that holds my primary web pages.

Temporarily, I have also put the same pages on the following domain...

http://zx80.netai.net/grant/

http://zx80.netai.net/grant/AVRPong/index.html

Please use the original URLs (searle.hostei.com) where possible, but use the ones above if the primary URLs are temporarily down.

Regards.

Grant

Thanks for the updates Grant.