MA2601: Atari VCS 2600 for the MiST fpga … almost

Source: http://upload.wikimedia.org/wikipedia/commons/b/b9/Atari-2600-Wood-4Sw-Set.jpg

During my search for easy portable hdl sources for the MiST I recently stumbled upon the TCA2601 which is based on the Papilio Arcade port of the A2601 done by Retromaster. Since the Turbo Chameleon 64 and the MiST are similar devices I thought of giving it a try.
The port was more or less assigning the right pins and using the input methods for the MiST. The first launch already was a success because I saw Pitfall on the screen 🙂

Pitfall with wrong colors and osd test

Unfortunately the game didn’t looked like the screen shots found in the web. It had less colors and looked more like a dark yellow/white composition. I couldn’t find the reason and contacted Till about it and after a short time he found out that the Atari VCS had some external switches one of them for B/W or Color mode … dooh! 🙂
He found some other smaller issues which I committed to the repository as well.
Pitfall and other 2k/4k games were playable but had to be compiled into the core.

A2601 running Pitfall

California Games intro

California Games

The next step will be to implement a OSD to choose the games from the sd card and upload it to the fpga. Till is cooking something together already and hopefully we have an usable Atari 2600 port soon with some limitations:

  1. Bank switching: The originial source had the bank switching schemes of the games on flash hardcoded into the source. That won’t work when we want to choose dynamicly games from sd card. So the first step will be to decide the bss depending on the size of the catridge. This will only support the Atari bank switching schemes for now.
  2. The current cpu doesn’t support the so called illegal opcodes.

The source code can be found here: https://github.com/wsoltys/tca2601
The binaries will be here: http://code.google.com/p/mist-board/source/browse/trunk/bin/cores/a2600

Building your own custom computer with the MiST FPGA board (part 2)

(Part 1 can be found here)

Recently Till Harbaum added a PS2 converter for the MiST. Since the IO is handled by the ARM processor the exchange with the FPGA goes via SPI. This makes it difficult to use existing HDL sources because often a PS2 interface is assumed.
Grant’s multi computer tutorial expects a PS2 keyboard as well. With the new converter I gave the project another go.
Putting the sources together and connecting the required pins was easy but it didn’t worked out. I still wasn’t able to type something on the screen. I had a little mail exchange with Till and asked him if he sees some obivious error done by me.
He replied pretty quickly and found the problem. I drove the PS2 converter with the CPU clock and that was too much. I read in the converter sources that it needs a clock between 10-16 … kHz but I blindly ignored the kHz and used the cpu clock which was around 12 MHz. 🙂
After I added a simple frequency divider which I found here and used 12 kHz for the PS2 converter clock the keyboard worked and I was able to type in some simple commands.
Below is a crappy image taken with my mobile:

Multicomp_basic

As usual the sources can be found in my github repository: https://github.com/wsoltys/multicomp

Building your own custom computer with the MiST FPGA board (part 1)

I’m still a noob when it comes to understanding the FPGA stuff. But I’m eager to learn an recently I’ve discovered the nice page of Grant Searle.
He takes the time to explain on how to build your own custom computer.
I thought it would be a nice challenge to get that running on my MiST. I’ve altered all sources of the module altsyncram to fit to the Cyclone III used in the MiST. Since the MiST is big enough I’ve used the following options without using sram:

  • CPU: Z80
  • ROM: Z80_BASIC_ROM
  • Program RAM: InternalRam4K
  • Interfaces: SBCTextDisplayRGB
  • Chip select: 4K internal RAM

I’ve connected the internal 27MHz clock of the MiST directly to the clock of this example. I knew that the example board is clocked with 50MHz but I wanted to see if it makes any difference. I’m still experimenting with this why not try it? 😉
I found in the minimig sources that the MiST uses there only two RGB output pins and that the pins 0-1 and 4-5 are unused. So I tried the same with the multicomp example:

Now the exciting part when starting the example the first time on the MiST. Unfortunately not much happened. The monitor didn’t show anything and went into sleep mode soon. So what is wrong?
I supposed that the monitor was driven by the wrong clock. Since the example board was driven by 50MHz it could be that the rest of the code is based on that.
I’ve used the Altera Megafunctions to create a module altpll with 27Mhz as input clock and 50MHz as output (c0). To enable that for the multicomp I’ve added the following code before the cpu entity:

Heureka! The boot prompt was visible and the cursor flashes so retro. 🙂
Still the screen was a little off and IIRC the monitor showed a refresh rate of 59MHz. In another attemped I changed the clk0_multiply_by of the alltpll from 50 to 60 and voila the screen looked really nice.

The next step will be to somehow connect the keyboard via SPI. The MiST uses SPI to talk to its IO ports like joysticks, keyboards, usb, etc. The example uses PS2 and I have to find a way to bring that together. For a regular vhdl developer this will be an easy task but for me it will be an adventure. 🙂

The current source code of this project can be found in my github repo.

(Click here for part 2)

PACE: compiling the frogger core for the MiST

Finally I found some time to do something with the MiST. Since I need something for starters I had a look at the PACE framework. It has build files for a lot of arcade cores and several targets like the MiST or the de1/2 boards. I just tried using an existing MiST Quartus II project file (pacman) and adapt it for frogger. The same goes for the project_pkg.vhd file. To generate the right clocks for the MiST I’ve used the existing pllclk_ez.* files.
After successful compilation of the core I was surprised that the core worked without problems on the MiST. Okay the gameplay was horizontal and it had no sound but from what I understand this is the current status for all frogger cores and nothing I did wrong 🙂
Later on I found the interesting web log of retroramblings.net and there an article about building a core from the pace archive. It gave me a little bit more insight about what I have done 😉
With the help of the article I’ve created new pllclk_ez.* files and adapted the project_pkg.vhd file accordingly. Voila …

frogger1

frogger2

Source files: https://github.com/wsoltys/pacedev/commit/d1d7df38f9aaa3bc46ba148c46e8962a6e3fa889
Core file: https://github.com/wsoltys/mist-board/tree/master/bin/cores/arcade/frogger

Update:
Does anyone have the pace framework documentation? I really would like to learn more about it but you can only download it from their forums as registered member. I’ve tried to contact them via the forum but no contact yet.