Code Monkey home page Code Monkey logo

pacman-tangnano's Introduction

Pac-Man on TangNano

This is the main README for original implementation on TangNano9k. For TangNano20k port, check also README_20k.

Pac-Man on TangNano9k

A Pac-Man Arcade implementation for the TangNano9K using HDMI for video and audio output. See it in action in the Youtube Video. The latest version supports the use of a USB Joystick as demonstrated in this video.

Pac-Man

Why another Pac-Man in HDL?

There are many Pac-Man implementations in HDL, especially the great version by MikeJ. I wanted to gain some experiences with the GoWin FPGAs and wanted to make use of the HDMI output of the TangNano9K. So I wrote another Pac-Man using HDMI.

Most existing versions recreate the original video and in a way that outputs an upright 60hz signal with NTSC timing expecting the screen to be mounted in portrait mode as it was in the original Arcade machine. Such a signal can be converted to HDMI in landscape format. But that needs a seperate frame buffer.

I wanted to implement the video to directly output a signal compatible with modern screens. So the video logic implemented here does not work like the original arcade machine. Instead it replaces the video logic by something that outputs a double scanned signal with 576 lines (576p@60hz).

By default the video is 1024x576p to nicely fit a 16:9 screen. The game area is displayed centered with a dark blue border left and right. The video can be configured to output a 4:3 video with a resolution of 768x576p instead by commenting ``define WIDE` in line 4 of src/top.sv.

ROMs

Since this project implements the hardware of the Pac-Man Arcade machine it needs the original ROM files to run. These can be obtained from the Pac-Man (Midway) romset.

The ROMs need to be converted into HDL source files compatible with the GoWin toolchain. This can either be done manually using the GoWin IDE or via the Python conversion tool and a shell script.

ROM file Contents Verilog file Module Depth Width
pacman.6e CPU ROM #1 pacman_6e.v pacman_6e 4096 8
pacman.6f CPU ROM #2 pacman_6f.v pacman_6f 4096 8
pacman.6h CPU ROM #3 pacman_6h.v pacman_6h 4096 8
pacman.6j CPU ROM #4 pacman_6j.v pacman_6j 4096 8
pacman.5e tile graphics pacman_5e.v pacman_5e 4096 8
pacman.5f sprite graphics pacman_5f.v pacman_5f 4096 8
82s123.7f color palette 82s123_7f.v prom_82s123_7f 32 8
82s126.4a colormap 82s126_4a.v prom_82s126_4a 256 4
82s126.1m audio wavetable 82s126_1m.v prom_82s126_1m 256 4
82s126.3m audio wavetable 82s126_3m.v prom_82s126_3m 256 4

The easiest way to convert these files is to place the ten ROM files in the src/roms directory and then run the shell script.

Usage

Convert the ROMs as described above.

Open the project file pacman.gprj from the corresponding board folder in the GoWin IDE run the synthesis, place & route and download the resulting bitstream onto the TangNano.

Buttons

Once the game runs it can be controlled with six buttons connected to the TangNano9K as depicted below:

Button mapping

The pins used are:

Function Pin Name Pin No
Up IOB8A 25
Down IOB8B 26
Left IOB11A 27
Right IOB11B 28
Coin IOB13A 29
Start IOB13B 30

USB joystick

You can also use a USB joystick.

pacman-tangnano's People

Contributors

harbaum avatar somhi avatar

Stargazers

 avatar  avatar Damiano Di Pietro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.