Error message

Deprecated function: The each() function is deprecated. This message will be suppressed on further calls in menu_set_active_trail() (line 2405 of /home/qx/drupal-7.58/includes/menu.inc).

FPGA Platform Game

Contents: 
Subjects: 

This is an old Nintendo-style side-scrolling game written entirely in VHDL. There is no microprocessor. The hardware consists of:

  • A single FPGA
  • Power and clock circuitry
  • A controller, which is an imitation of the original NES controller
  • Three resistors and a VGA connector for video output

I originally wrote this for an Altera development board which was actually a TQFP breakout board with the chip soldered onto it. This was fragile and poorly soldered so it fell apart after a while. I have now changed all the ROMs to be generic VHDL instead of LPM macros so it works with the Xilinx tools (and, presumably, any other VHDL synthesizer).

The Game

Screen
The game running.

The player's character is a solid red block - this was a hardware project, not an art project. The tiles were all drawn by editing the ROM data in a text editor. The player can move left and right, jump, and fall (basic side-scroller physics). The map scrolled across the screen such that the player was kept in the middle unless that would make the edge of the map visible.

The Code

hwss.zip

According to the timestamps on the original files, I wrote this between May 18 and June 7, 2003. All the code is mine except for the Video_Sync module, which was one of the files used by labs in ECE2031.

This project really demonstrates that certain things which are hard in software are easy in hardware, and vice versa. I got the video output, including scrolling, working very quickly, but the game logic and physics took much longer. The opposite would have been true if I were writing this as procedural software - game logic is inherently procedural, while tile-based graphics are well suited to a hardware implementation.

The timing is not quite right - the player sprite is offset by one pixel and I think there are other timing bugs.