Skip to content
shormatPublic

About

Dance Dance Revolution remake written in pure assembly for the PIC16F1789: PAL video signal and music generated in software, no video or sound chip.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

🎮 pic-dance — Dance Dance Revolution in pure PIC assembly

Release Language MCU Grade

A remake of Konami's Dance Dance Revolution, written entirely in assembly for an 8-bit PIC16F1789 microcontroller. The PIC generates the PAL video signal for a TV and synthesizes the music itself, with no dedicated video or sound chip.

Game menu

Demo

IMG_4071.mov

Contents

  1. Features
  2. How it works
  3. Screenshots
  4. Build & flash
  5. Project structure
  6. Possible improvements
  7. Authors

Features

  • 104×144 pixel display (up to 416×576 with enough RAM)
  • Main menu with a persistent high score
  • 1 map with its own song
  • Heart system: game over after 3 missed arrows
  • New songs are easy to add in music.s, for the menu or for new maps

📄 For the full details, see report.pdf and the electrical_schematic.pdf.

How it works

Video signal

The PIC bit-bangs a composite video signal that follows the PAL-G standard. Pixels go out at 1 pixel every 4 instruction cycles:

  1. A full byte (8 pixels) is loaded into the PORTC latch every 8 pixels.
  2. For each pixel, the latch is shifted left and written back.

Only the MSB of PORTC is wired to the video output.

Good intro to PAL generation on a PIC: Rickard Gunee's page.

Music

Music is generated from scratch with one of the PIC's PSMC modules. See music.s / music.inc for details.

Screenshots

Menu at startup Menu with new high score In-game view

Menu at startup · Menu after a new high score · In-game with score and hearts

Build & flash

Requirements: MPLAB X IDE with the pic-as assembler (user guide), a PICkit programmer and a PIC16F1789.

git clone git@github.com:shormat/pic-dance.git
cd pic-dance/code
make          # build
make flash    # flash through the PICkit

New to PIC assembly? Start with this exercise sheet.

Project structure

code/            Assembly sources (main, video, draw, music, inputs, game logic) + Makefile
documentation/   Datasheets (PIC, TV, MOSFET, LED, speaker, PAL standard…)
illustrations/   Screenshots
core_dumped/     Debugging captures (compilation, game logic crashes & fixes)
report.pdf       Full project report
electrical_schematic.pdf

Possible improvements

  • Faster pixel output: up to 1 pixel per instruction cycle, if there is enough RAM.
  • Use all of PORTC: only 1 of its 8 pins drives the video right now, so the other 7 are wasted.
  • Cheaper music updates: the music routine checks for an update every frame, even though the current song only needs one every 5 frames.

Authors

Project for the INFO2055 (Embedded Systems) course taught by Prof. Boigelot at ULiège. Final grade: 20/20.

⚠️ Copying any part of this code, even partially, for the INFO2055/APRI0007 course is not allowed.

About

Dance Dance Revolution remake written in pure assembly for the PIC16F1789: PAL video signal and music generated in software, no video or sound chip.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages