Giter Site home page Giter Site logo

tennsoku / taiko-on-fpga Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 27.84 MB

ECE241 Project - Rhythm games on Nios2 FPGA

Home Page: http://www.eecg.toronto.edu/~pc/courses/ece241projects/2015/musicgame.mp4

Verilog 91.49% VHDL 0.77% HTML 6.52% SystemVerilog 0.38% Standard ML 0.01% Coq 0.83%

taiko-on-fpga's Introduction

Taiko-on-FPGA

  • ECE241 Project - Rhythm games on Nios2 FPGA

  • All img and audio are converted to .mif, and due to the limit of VGA output and ram of FPGA board, these resources are relatively simplifed.

  • Most parts of the proj are verilog.

  • Inspired by a Japanese rhyme game - Taiko no tatsujin presented by Namco.

    • To finish the game, player needs to accurately hit the patterns on screen, which stand for the beats of a song.
    • Score will be received based on the timing of hitting, and a scoreboard will show the updated score on the screen and on the result page after finishing the song.
    • The goal of this game is keeping trying to obtain higher score.

Note Sequence

  • The sequence of patterns appeared on the screen is fixed, since it is based on the beat of BGM.
  • The sequence is stored in the memory, initializing by mif, and is connected to a counter to give outputs at a constant rate corresponding to the beats per minute (BPM) of BGM.
  • Since there are 15 blocks for patterns moving on the screen, there is a FSM called sequenceManager to find block available for receiving the note(patterns that are still moving cannot receive new note before complete current note).

Scoreboard

  • Scoreboard records player’s game points, which are obtained when the player hit the sequence at the correct moment, also with the correct keys. The final score will be displayed at the screen each time the game ends, reflecting player’s performance to make the game more competitive.
  • Ten mif files are stored in FPGA memory corresponding to images of 0-9 numbers. Scoreboard has three digits in total, therefore it can record up to decimal base 999, and it will be reset to zero automatically for the next round of the game.
  • The status of each digit is stored in three different registers that have 4-bit width, with “0000” representing “0” and “1000” representing “9”. When the value inside the register exceeds the maximum, which is nine(1000), it will be set back to 0. The scores are added to the register of the first digit , the second digit is incremented by 1 when the first digit reach the maximum before it will be set to “0” . Increment of digit three is controlled by digit two in the same way.
  • If 0000 is the current status of one of the digit, a 9to1 mux will choose image of “0” stored beforehand to be display by VGA.

Animated Background

  • Animating effect of the background is achieved by constantly changing backgrounds in sequence of six images extracted from a gif file. A 2Hz counter controls time for each images to stay at the screen to be exactly 0.5 second.
  • An “in_game” register determines when the counter comes into effect, otherwise the background stays the same at the “game beginning” and “game end” stages.

taiko-on-fpga's People

Contributors

tennsoku avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Forkers

yinghuan-chen

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.