Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dino game

Dino

Firmware for Atmega8A microcontroller: the Chrome-style Dino runner game on a Nokia 5110 (PCD8544) 84x48 LCD. The high score is stored in EEPROM.

Build

Requires gcc-avr and avr-libc:

sudo apt-get install -y gcc-avr avr-libc
  1. Set up your frequency in freq.h, now it's 10 MHz
  2. Build project: make (produces dist/out.hex and dist/eep.hex, prints a size report)
  3. Upload firmware: make upload (avrdude with a USBasp programmer)
  4. Configure external crystal oscillator with updating fuse bytes

Tests

Host-side unit tests for the game logic (no AVR toolchain required):

make test

Emulator

Play the game on your computer, no AVR toolchain and no hardware required:

make sim

It renders the 84x48 Nokia 5110 screen in the terminal. Press space to jump and q to quit.

The game logic in dino/dino.c talks to the display only through nlcd_set_cursor() and write_data(), so sim/sim.c implements those two functions on top of an in-memory framebuffer. The start and game over screens from main.c are not emulated, make sim goes straight into the game.

Notes

Controls

  • PD1 button — jump / start game (hold on the start screen to reset the high score)
  • PD7 button — toggle LCD backlight (LED on PB0)

img_maker

If you want to generate custom hero or barrier use ./img_maker

  1. Install dependencies:
  1. Run python3 ./img_maker/index.py YOUR_IMAGE.png
  2. Past generated code to dino/dino.c DINO_PIC or BARRIER_PIC

Board

Board

Schematic

Schema

About

Firmware of the Dino game for microcontroller ATmega8

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages