
THE VINTAGE GAMES OF YESTER-YEAR
Ever Since the early 50’s – 60’s video game entertainment units have always been the domain of nerds and the socially reclused. As technology has ‘speed-raced’ through from transistors – to TTL Logic chips – to micro controllers/processors – to FPGAs and Graphic cards – and beyond into the SoC technologies – proves one thing; The fundamental principles of Game logic forming:
Objective – and – Reward
have been more effective in lowering the teen birth rate than Communist China,
and more pacifying to the mass-populace than the gladiatorial combat of Pax Romana.
RE-INVENTING THE WHEEL
The earliest of games of Pong, Snake and Asteroids used only negligible memory, clock speed and hardware peripherals (in comparison to today’s standards). It was the time where Male gamers where real men, and Female Gamers where real women
and little green space aliens were only virtual little green space aliens.
It was a simpler time.
The task of trying to synthesize similar gaming experiences using modern hardware is not
a new one. There are already Arduino libraries such as TVOut that can be implemented
on the Arduino Uno/Mega.
But When investigating how low can we go in the technology food chain
There isn’t much lower (and price and time affordabability)
that the ATTiny10. A 6 pin (3 pin + Reset + Vcc and GND) micro controller with
1k of program memory and get this only 32 bytes of RAM!.
This 3rd world equiv. CPU is so resource lacking it presents a significant challenge
when programming just the video handling yet alone the game logic.
This is of coarse ignoring the 1x int. timer and max 16MHz Clock (8MHz max internal clock).
It was decided that out of the many games to try to reproduce; snake was one that
there was enough popularity to know but not much attempts to create on the ATTiny.
It should be stated clearly that this project is not novel but a following of
Ben Heck’s Hacks video where he used the same chip to produce a
mini space invaders games. I just decided to follow suit and try to re-create snake.
I WONT BORE YOU WITH THE DETAILS
First step in getting this done was to see the timing and voltage requirements
of using an old style PAL RCA connector.
An analogue PAL format can be accessed at http://martin.hinner.info/vga/pal.html a pulse minium of 2us was needed
Given the int. clock can give a 8MHz signal (by adjusting CLKMSR.CLKMS,OSCCAL)
and the the CPU prescaler can do 1:1 this meant I could use the internal clock to fufill timing requirements instead of using an external clock. The advantage of this was to reduce pin usage because of the precious pin count.

The Voltage requirements need a 1V p-p voltage BUT! a -0.3V sync voltage.
The negative voltage complicates matters The sync pulse along with the video signal
used different polarities and whilst a H bridge could resolve this so could a virtual ground.
I decided to use a virtual ground.
The other issue I ran into was the output voltage of the Video screen I used need about +3V in order to
register a white pixel. A transistor was chosen to amplifier the video signal as the collector side
also isolated the virtual ground from the base. Also by adding a transistor The load current in the 75ohm
input impedance wouldn’t cause over current issues.
However the common emitter-transistor was inverting the signal and so a 7404 inverter was added to correct it.
A voltage divider allowed the video signal to meet the require voltage constraints.


Now that Timing and voltage are sorted, Pixel Resolution was the next on the list.
What was the minimum pixel width the chip could provide? you ask.
Although the CPU clock could give out (1/8MHz)sec cycles; each instruction took from 1 – 3 clock cycles to complete
It was decided to use 2 pins for a SYNC PIN and a VID PIN (as used in the TVOut Library)
as the sync pulse was a crucial timing constraint and could be tied to the compare interrupt
and changing 2 pins at once was low instruction timing usage (4 instr).
After the inital test the pixel count got down to 74 across by 40 down but this was using
just PORT = ‘toggle’
So if a custom pixel layour was to be worked out pointers had to be used.
The resolution was acceptable for the task of ‘snake’ and after tweaking the timing and
potentiameters a smoother image of black, whites and greys could be made.


GAME LOGIC
Before considering the logic of snake I’d like to pay my respect to the game logic elders both past and present. and mention the beauty in sequential timing circuits and the age old process of drawing ‘the game’ ‘the state/staus’ and ‘the users/sprites’ and non so clearly shows this that the PAL Game of Atari’s PONG:

It is a sight to behold and a revelation for how a game goes together in hardware form.
Regarding the logic required for the snake project It’s currently underway and is being adapted from a javascript game, games2
that was developed previously. STAY TURNED TRUE BELIEVERS
3 replies on “µC Snake ‘PAL’ Game”
I think other site proprietors should take this web site as an model, very clean and great user genial style and design, let alone the content. You’re an expert in this topic!
Fascinating blog! Is your theme custom made or did you download it from somewhere? A design like yours with a few simple adjustements would really make my blog jump out. Please let me know where you got your theme. Thanks
Hi my family member! I wish to say that this post is amazing, nice written and include approximately all significant infos. I抎 like to look extra posts like this .