chester's blog

technology, travel, comics, books, math, web, software and ramblings

Atari 2600

Atari 2600 on a breadboard, part VI: fixing the video, adding a joystick and wrapping up

26 Sep 2021

It has been a wild ride, and it finally comes to an end. Here are the final tweaks I’ve added to this project, which results in a mostly working Atari 2600. Most importantly, I learned a ton and had a lot of fun. If you came so far, I hope you did too!

Atari 2600 on a breadboard, part V: RIOT and Audio (and running actual games!)

12 Jul 2021

After Hello World

Now that I got Hello, World! running, I feel confident this project may actually succeed! 😅 The next step is to run an actual game, which requires wiring the last chip (and, due to the poor video I have so far, a sound circuit).

Atari 2600 on a breadboard, part IV: clock + composite video = Hello, World!

04 Jul 2021

TV Time

In the previous post, I had the CPU, cartridge and TIA wired and tested, but still needed the Arduino to make them tick and check the resuts. All those hex numbers were fun to debug, but let’s get to the real deal: plugging it to the TV.

Atari 2600 on a breadboard, part III: tidying up and adding the TIA (video chip)

25 Jun 2021

Tidying Up

In the previous posts I made the CPU work on the breadboard, then added a cartridge connector, all using jump wires - which can be easily reconnected, labeled, etc., but have a downside: they disconnect easily. Coupled with the equally flimsy cart connector, all my attempts at moving on with the project would result in failures.

After seeing Ben Eater’s beautiful breadboard computers I decided to rewire the boards I already had. For that, I’d have to rethink my cartridge connector: instead of having the jumper cables going out of it (left), I got some long pin female headers that extended the pins so the connector now fits the board like any other chip (right):

cart, before and after

Atari 2600 on a breadboard, part II: reading a cart

14 Feb 2021

Previously…

A long time ago I grabbed the three chips from a broken Atari 2600 (Jr.), to see if I could build an Atari with them on a solder-less “breadboard”. My first attempt (post here) was to drive the CPU with an Arduino, which showed the chip advancing through what it believes to be memory, but is actually just a single “no operation” (NOP) hard-wired instruction:

cleaner version of the 6507 memory walk on a breadboard

It took some time (between finding the right connector, 3D-printing a part, figuring out the wiring and fixing the Arduino software), but I finally moved on to the next step: plugging a real Atari cart and seeing some actual code running!

Renovating an Atari 2600 (AV mod + capacitor/power adaptor replacement)

18 Feb 2019

A while ago I got this beautiful Atari 2600 all-black, 4-switch model - often nicknamed “Darth Vader”, for obvious reasons:

The console generates a TV signal, which the TV has to tune in just like a normal over-the-air channel. It was quite convenient at the time (and quality was good enough for the TV sets we had), but modern TVs show degradation - not to mention some can’t even pick up the faint signal - I had to hook mine to a VCR that would decode the signal into A/V.

That quirky setup led me to make the popular A/V conversion (“mod”) - and, while at it, replace the power adaptor (with one that I can actually keep on the wall without fear of burning down the house) and capacitors (something that should be done to any vintage electronics that you want to keep humming).

Atari 2600 CPU running on a breadboard

06 Sep 2017

Introduction

A year ago, Ben Heck hand-soldered an Atari 2600 on a protoboard (and, as usual, turned that into a portable console). The idea of manually re-assembling the console for which I had already hacked together a game and an emulator sounded very exciting (and educational) for me.

The show crew always publishes schematics for his projects, so while I waited for that, I started de-soldering the chips and cartrige conector (and a few extra components, why not?) from an old Atari Jr. board I had lying around. De-soldering is hard, but eventually it was done:

An Atari VCS (Jr.) board, without several components

The schematics, however, never came. That episode’s GitHub repository only includes the original Atari’s block diagram, so I shelved the plan. But more recently I stumbled upon a series of blog posts in which David Barton describes how he built a 6502-based computer (a 65c02, to be precise) on a solder-less breadboard.

Those boards aren’t as sturdy or portable as traditional printed circuit boards, but the freedom to tinker (and make mistakes) sparked my flame once again, so I decided to give the project another shot. I started by reproducing his first two posts, but adapted to the Atari’s 6507 and adding a couple tweaks.

It was easy to plug this Atari in...

22 Oct 2014

I just had to:

  • Connect the Atari antenna output to a Coaxial (F-type) to Female RCA adapter;
  • Plug that in the antenna input of a the VCR;
  • Use 3 RCA cables to feed the VCR A/V output into an AV-to-HDMI adapter;
  • Connect the adapter HDMI output to the monitor;
  • Configure the Atari to the “Channel 3” position;
  • Select channel 3 on the VCR.

Easy, right? :-P Now I can play my homebrew (2048 2600) on the real thing.

By the way, if you want to buy a physical 2048 2600 cart, Good Deal Games sells them. I have no participation in that (other than coding the open-source game and pestering Jenn Harrison into drawing the cool cartridge front art), but I’m really happy to have my game on a real cart!

2048 2600: The 2048 game for the Atari 2600

25 Mar 2014

As everyone else on the planet, I got hooked on 2048 and amazed by the variants that sprouted. Its simple rules and graphics are one distinctive characteristic. “It’s so simple”, I thought, “that it really could have been done on an Atari”. And once you have such an idea…

That’s right: this is a version of 2048 for the Atari 2600! It took me about 16 hours of work to get to a playable prototype, and about 50 hours for the final version, spread over a couple weekends and nights during which I was refining the core game and squeezing features like sound, two-player mode, and a high score.

During this period it briefly made the front page of Hacker News, received lots of great feedback on Atari Age and RVG, and got a couple of contributions (bug fix, PAL support). The 2048 source was also helpful - even though I had to rethink the whole shifting/merging strategy, it provided a nice foundation with very readable code.

The project page has all the instructions and files you need to run it on an emulator, on a real console or even in your browser. The remainder of this post shows some technical notes (which can also be found at the main assembly source file).

Running ruby2600 in a browser with Opal

16 Feb 2014

ruby2600

Last year I challenged myself into writing an Atari 2600 emulator using Ruby in time to present it at RubyConfBr 2013 - thus ruby2600 was born. When I found Opal, a Ruby-to-JavaScript compiler, I felt it might be fun to run the emulator on a browser.

It runs even slower than in MRI and is far from polished, but works. To watch it, just click the button below and wait until the black lines get replaced by Pitfall Harry slooooowly running to the left (sorry, no key bindings for now).

Keep reading if you want the gory technical details!

sorteio2600

07 Nov 2011

O sorteio2600 é um programa que eu fiz para o Dev In Vale, por sugestão do Willian Fernandes, um dos organizadores do evento. Já que eu já ia demonstrar o Hello World em um Atari de verdade (graças ao Harmony), e a minha palestra era a última, a idéia era aproveitar o setup e fazer o sorteio dos brindes no próprio Atari.

Pensei que seria uma tarefa fácil, mesmo numa plataforma tão limitada, mas levei umas vinte horas ou mais quebrando a cabeça para que o programa saísse! Este post comenta o processo de desenvolvimento e no final mostra um vídeo do software rodando no Atari. É recomendável ver os slides ou assistir à palestra para entender melhor, mas talvez dê pra acompanhar sem isso.

Harmony: rodando jogos (e testando programas) num Atari de verdade

05 Nov 2011

Cartucho HarmonyA programação para Atari 2600 é uma curiosidade que já me levou a escrever artigo e minstrar palestras sobre o assunto. Vira e mexe estou lendo e experimentando, e até acredito que um dia alguma dessas brincadeiras pode se tornar um jogo de verdade.

Um bom emulador é necessário para programar para qualquer dispositivo, seja ele um celular ou um console. O Atari tem o excelente Stella (cujo debugger é bom até para quem só quer entender como algum jogo funciona). Mas é igualmente importante testar o programa no console “de verdade”, pois só lá os detalhes vão aparecer.

Palestra sobre Programação para Atari 2600 no Dev in Sampa 2011

28 Aug 2011

O Dev in Sampa é um evento bacana, por conta do blend muito equilibrado entre aprendizado e networking. A edição deste ano foi, a meu ver, ainda melhor que a do ano passado – os organizadores (@tinogomes, @nuxlli e @lfcipriani) e o pessoal de apoio da Abril estão de parabéns. Gostei da decisão de reverter ao formato de trilha única de palestras, que limita a quantidade de vagas mas mantém o nível alto e ajuda a galera a se manter na mesma estação.

Racing the Beam: Um raio-x do Atari 2600

04 Jan 2011

Racing The BeamUm aviso: não tenho como ser muito imparcial com este livro. Pra começo de conversa, jogos como Enduro, Pitfall, Adventure e Raiders of The Lost Ark são parte integrante das minhas memórias de infância. Eu associo o nome Atari ao universo dos videogames tanto quanto gerações mais recentes o fazem com Nintendo, Sega ou Sony. E um dos grandes “to-do”s da minha vida é concluir o desenvolvimento de algum jogo para essa plataforma. Já flertei com esta proeza no passado, o que resultou em uma pequena animação interativa (perdida no tempo) e em um artigo publicado há quase DEZ anos atrás no site Fliperama – cortesia do Internet Archive Wayback Machine.

Macho que é macho programa em Atari

22 Nov 2002

Certa vez escrevi um artigo sobre desenvolvimento de jogos para o videogame Atari 2600. Vira e mexe alguém quer mais informações sobre desenvolvimento pra Atari, e eu costumo recomendar o Stella – uma espécie de “manual oficial do desenvolvedor” – além de alguma coisa sobre Assembly 6502 (que você acha fácil no Google ou em sebos).

Da última vez que eu fui procurar, me deparei com um site que traz o código-fonte comentado (através de um paciente trabalho de engenharia reversa) de jogos como Combat, Freeway e Adventure. Passei uma hora divertidíssima (ok, diversão de nerd) lendo este último de cabo a rabo. Conclusão óbvia, mas indiscutível: esse Warren Robinett (autor do jogo) é um gênio. De marca maior.