A portable, bootable flappy bird game written in assembly.
Using BIOS interrupts for input and the linear VGA 320x200 256bit color mode for output, FlappyOS recreates the popular mobile game Flappy Bird with even more "Retro" graphics than the original!
As seen in the screenshots, FlappyOS has two modes: Color and Black/White. These modes can be selected on startup when the bootloader reads the game into memory. Additionally, custom VGA colors can be setup in the src/background.asm file.
On boot, the bootloader reads sectors 1, 2 an 3 into memory (that's right, the game is 3 + 1 sectors, ie 2KiB large!), then prompts the user for a mode, either color, black/white, or exit. Exit reboots the PC. Once the player selects a mode, the game starts. When the player collides, the screen fills with black. After a keypress, the game jumps back to the MBR and re-runs the code in the bootloader.
Pre-assembled binary images and iso's of the game are found in the build/ directory. These can either be used in a virtual environment such as VirtualBox or BOCHS or on real hardware that supports USB Floppy or USB Hard Drive emulation. Running make
in the main directory will assemble the source files and create a floppy.img in the build directory. It will also try to start the BOCHS emulator (for debugging) which should have been installed beforehand.
make
has other options too:
make usb
assembles all files and attempts to write the image to /dev/sdb This may brick your computer/bootloader depending on your HDD setup! Make sure you change /dev/sdb to your USB devicemake iso
assembles all files and creates a bootable iso images which can be used in VirtualBox or burned to a disk or USBmake image
only assembles a floppy disk image in the build directory
Read the Makefile for more information.
A word of warning: If playing in an emulator, delays and game timings may be too fast or too slow (as explained in this StackOverflow question). If you're using BOCHS, tweak the ips=xxx label in the bochsrc.txt file in the build/ directory or the actual timings of cx:dx in the source file flappy.asm.
Learning about CPU architecture, the boot process, and BIOS has been painful at times but an overall fantastic experience: I learned a lot. If you have any questions about my code or the game, feel free to raise an issue.
A big Thank You to user flxbe for his asm-space-invaders game and the StackOverflow community for their help & reassurance.
This has been quite the educational experience!
(Here's a secret: Pressing 'P' in game, pauses the game)