| ||
| My programming of the atari 2600 |
| ||
Today I'm going to try and do some actual programming. First Im going to create a program that draws a border around the screen using the playfield registers. Then Im going to draw a cross in the middle of the screen.
I would like to draw the smallest border possible, so that I have room left for the actual game. The border should be of equal width.
The playfield registers are only 20 bits (40 bits reflected). SO
Verticaly we have 242 scan lines. So, then first 4 and the last 4 need to be solid lines...
3 Scanlines -> vertical synchronisation
Things dont look right?, I cut and pasted some code from the tutorial and it didn't work :(. I changed the code to the following????? 3 Scanlines -> vertical synchronisation
This made thing look right......maybe I will try it on a different emulator. | ||
| 0 Comments | Post Comment | Permanent Link |
| ||
More playfield stuff......
This address is uded to write into the playfield control register (a logic 1 causes action as described below)
D0 = REF (reflect playfield)
D1 = SCORE (left half of playfield gets color of player 0, right half gets color of player 1)
D2 = PFP (playfield gets priority over players so they can move behind the playfield)
D4 & D5 = BALL SIZE D5 D4 Width 0 0 1 clock 0 1 2 clocks 1 0 4 clocks 1 1 8 clocks
You can use ram if You want to modify an individual bit as follows ora #%00000001 ; SET bit 0 (D0 = 1) sta CTRLPF_shadow ; save new register value back to RAM sta CTRLPF You dont read from CTRLPF..... (write only).
I understand how to create playfields now. I will write a couple of demos to get better acquainted with the 6502 assembly language.
More notes: ORA ->OR the contents of A | ||
| 0 Comments | Post Comment | Permanent Link |
| ||
Below is a summary of what I have learnt so far.
There is 20 bits of playfield data stored in the TIA that correspond to 20 pixels on the screen
Each playfield pixel is 4 colour clocks wide.
Note:The Playfield is reflected through the middle of the screen (Y axis) ,so the 20 bits of playfield data
Now, focusing on the simplest playfield register pf1.
Looks simple, sta COLUPF
The Hex value is stored in a register a, and is then copied to COLUPF in the TIA. lda PATTERN ; use our saved pattern sta PF1 ; as the playfield shape
also, you have 228 colour clocks of which 160 are used to draw the pixels on the screen.
All I have to do is set the colour in COLUPF and load a pattern into PF1, then I just wait 242 scanline (PAL)
Looking ahead the TIA playfield registers (PF0, PF2) map to the onscreen pixels in reverse order.
Writting a game for this system looks like it is going to be headache.........The lowest level program I have written was a space invaders clone (In C and ASM) for the PC (DOS). I thought that was hard at the time even though I had 320x200 of video memory to play with as well as a huge amount of RAM. | ||
| 0 Comments | Post Comment | Permanent Link |
| ||
So I stumbled upon a site www.atariage.com and found some info on how to program the atari 2600. The atari 2600 was my first console and now looking back I can say it is my favourite. Although it has been 15 years since I owned one, I'm realy looking forward to developing games on this relic.
I set up an editor "Crimson Editor" so that i now have syntax highlighting. I also configured the IDE so that im now able to compile(DASM) and run binarys(Z26) at the press of a button. The Atari 2600 uses a 6507 Microprocessor which appears to be similiar to the 6502. I have programmed the 8086 under dos and windows so hopefuly this won't be to much of a stretch.
I originaly wanted to make a game that is a variant of the classic game Pong. However, after looking around I noticed that this has been done to death so I will probably look at doing something else.
Anyway I'm slowly working through a tutorial set written by Andrew Davie that can be found at the above link. | ||
| 0 Comments | Post Comment | Permanent Link |