{"id":20477324,"url":"https://github.com/harbaum/pacman-tangnano9k","last_synced_at":"2026-03-08T11:39:01.427Z","repository":{"id":185678736,"uuid":"673911204","full_name":"harbaum/Pacman-TangNano9k","owner":"harbaum","description":"A Pac-Man Arcade implementation for the TangNano9K using HDMI","archived":false,"fork":false,"pushed_at":"2025-01-25T20:25:53.000Z","size":1332,"stargazers_count":32,"open_issues_count":1,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-01-25T21:21:09.658Z","etag":null,"topics":["arcade","fpga","gowin","hdmi","pacman","tangnano9k","verilog"],"latest_commit_sha":null,"homepage":"","language":"VHDL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harbaum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-02T17:49:14.000Z","updated_at":"2025-01-25T20:25:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"30256000-47ff-450c-b265-d65d51e3df43","html_url":"https://github.com/harbaum/Pacman-TangNano9k","commit_stats":null,"previous_names":["harbaum/pacman-tangnano9k"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harbaum%2FPacman-TangNano9k","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harbaum%2FPacman-TangNano9k/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harbaum%2FPacman-TangNano9k/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harbaum%2FPacman-TangNano9k/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harbaum","download_url":"https://codeload.github.com/harbaum/Pacman-TangNano9k/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242048384,"owners_count":20063400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arcade","fpga","gowin","hdmi","pacman","tangnano9k","verilog"],"created_at":"2024-11-15T15:27:31.181Z","updated_at":"2026-03-08T11:38:56.401Z","avatar_url":"https://github.com/harbaum.png","language":"VHDL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pac-Man on TangNano\n\nThis is the main README for original implementation on TangNano9k. For TangNano20k port, check also [README_20k](README_20k.md).\n\n# Pac-Man on TangNano9k\n\nA Pac-Man Arcade implementation for the [TangNano9K](https://wiki.sipeed.com/hardware/en/tang/Tang-Nano-9K/Nano-9K.html) using HDMI for video and audio output. See it in action in the\n[Youtube Video](https://www.youtube.com/shorts/erQIn8R661M). The latest version supports the [use of a USB Joystick](m0sdock_usb_joystick/) as demonstrated in [this video](https://www.youtube.com/shorts/Z1DRsI0xd8o).\n\n![Pac-Man](images/pacman_hdmi_wide.jpeg)\n\n## Why another Pac-Man in HDL?\n\nThere are many Pac-Man implementations in HDL, especially the [great\nversion by MikeJ](https://www.fpgaarcade.com/kb/pacman/).  I wanted to\ngain some experiences with the GoWin FPGAs and wanted to make use of\nthe HDMI output of the TangNano9K. So I wrote another Pac-Man using\n[HDMI](https://github.com/hdl-util/hdmi).\n\nMost existing versions recreate the original video and in a way that\noutputs an upright 60hz signal with NTSC timing expecting the screen\nto be mounted in portrait mode as it was in the original Arcade\nmachine. Such a signal can be converted to HDMI in landscape\nformat. But that needs a seperate frame buffer.\n\nI wanted to implement the video to directly output a signal compatible\nwith modern screens. So the video logic implemented here does not work\nlike the original arcade machine. Instead it replaces the video logic\nby something that outputs a double scanned signal with 576 lines\n(576p@60hz).\n\nBy default the video is 1024x576p to nicely fit a 16:9 screen. The\ngame area is displayed centered with a dark blue border left and right.\nThe video can be configured to output a 4:3 video with a resolution\nof 768x576p instead by commenting ``define WIDE` in line 4 of src/top.sv.\n\n## ROMs\n\nSince this project implements the hardware of the Pac-Man Arcade\nmachine it needs the original ROM files to run. These can\nbe obtained from the [Pac-Man (Midway)](https://www.bing.com/search?q=pacman+midway+arcade+rom) romset.\n\nThe ROMs need to be converted into HDL source files compatible with\nthe GoWin toolchain. This can either be done manually using the GoWin\nIDE or via the [Python conversion tool](src/roms/bin2v.py) and [a shell script](src/roms/conv.sh).\n\n|     ROM file    |     Contents    |   Verilog file    |     Module     | Depth | Width |\n|-----------------|-----------------|-------------------|----------------|------:|------:|\n| ```pacman.6e``` |   CPU ROM #1    | ```pacman_6e.v``` | pacman_6e      | 4096  |     8 |\n| ```pacman.6f``` |   CPU ROM #2    | ```pacman_6f.v``` | pacman_6f      | 4096  |     8 |\n| ```pacman.6h``` |   CPU ROM #3    | ```pacman_6h.v``` | pacman_6h      | 4096  |     8 |\n| ```pacman.6j``` |   CPU ROM #4    | ```pacman_6j.v``` | pacman_6j      | 4096  |     8 |\n| ```pacman.5e``` |   tile graphics | ```pacman_5e.v``` | pacman_5e      | 4096  |     8 |\n| ```pacman.5f``` | sprite graphics | ```pacman_5f.v``` | pacman_5f      | 4096  |     8 |\n| ```82s123.7f``` |   color palette | ```82s123_7f.v``` | prom_82s123_7f |    32 |     8 |\n| ```82s126.4a``` |        colormap | ```82s126_4a.v``` | prom_82s126_4a |   256 |     4 |\n| ```82s126.1m``` | audio wavetable | ```82s126_1m.v``` | prom_82s126_1m |   256 |     4 |\n| ```82s126.3m``` | audio wavetable | ```82s126_3m.v``` | prom_82s126_3m |   256 |     4 |\n\nThe easiest way to convert these files is to place the ten ROM files\nin the [src/roms](src/roms) directory and then run the\n[shell script](src/roms/conv.sh).\n\n## Usage\n\nConvert the ROMs as described above.\n\nOpen the project file pacman.gprj from the corresponding board folder in the GoWin IDE run the synthesis, place \u0026 route and download the resulting bitstream onto the TangNano.\n\n## Buttons\n\nOnce the game runs it can be controlled with six buttons connected to the TangNano9K\nas depicted below:\n\n![Button mapping](images/buttons.jpg)\n\nThe [pins used](tangnano9k/src/pacman.cst) are:\n\n| Function | Pin Name | Pin No |\n|----------|---------:|-------:|\n| Up       |   IOB8A  |    25  |\n| Down     |   IOB8B  |    26  |\n| Left     |  IOB11A  |    27  |\n| Right    |  IOB11B  |    28  |\n| Coin     |  IOB13A  |    29  |\n| Start    |  IOB13B  |    30  |\n\n## USB joystick\n\nYou can also use a [USB joystick](m0sdock_usb_joystick/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharbaum%2Fpacman-tangnano9k","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharbaum%2Fpacman-tangnano9k","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharbaum%2Fpacman-tangnano9k/lists"}