Pages: 1 [2]   Go Down
Author Topic: Classic 70's TV game reproduced on the Arduino/AMTEGA328  (Read 7291 times)
0 Members and 1 Guest are viewing this topic.
Atlanta, USA
Offline Offline
Edison Member
*
Karma: 53
Posts: 1776
AKA: Ray Burne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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
Logged

Windy City
Offline Offline
Jr. Member
**
Karma: 0
Posts: 90
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Here they are:
Code:
const char FIELD_HEIGHT=100;          //Was 115
const char SOCCER_EDGE_HEIGHT=20;     //Was 25

Code:
beginVideo(80,100);          //Was (80,116)

Code:
#define _TIME_VERT_SYNC 60         //Was 58.85

Code:
#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
« Last Edit: August 19, 2013, 07:40:02 pm by DirtBiker » Logged

Dirt Biker

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-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 smiley 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
Logged

Windy City
Offline Offline
Jr. Member
**
Karma: 0
Posts: 90
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@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.


* Revised Decode.png (12.25 KB, 1495x810 - viewed 34 times.)
« Last Edit: August 21, 2013, 09:59:15 am by DirtBiker » Logged

Dirt Biker

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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/
Logged

Windy City
Offline Offline
Jr. Member
**
Karma: 0
Posts: 90
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!.

Logged

Dirt Biker

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

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
« Last Edit: August 31, 2013, 06:19:17 pm by zx80nut » Logged

Windy City
Offline Offline
Jr. Member
**
Karma: 0
Posts: 90
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks Grant, I'll pass it on.
Logged

Dirt Biker

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 23
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Windy City
Offline Offline
Jr. Member
**
Karma: 0
Posts: 90
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the updates Grant.
Logged

Dirt Biker

Pages: 1 [2]   Go Up
Jump to: