Coder Social home page Coder Social logo

0xfeedc0de64 / tetris-os-cxx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lucianoforks/tetris-os

4.0 1.0 2.0 344 KB

This fork tries to fix the silly-language problem, by converting piece by piece to modern C++20

License: MIT License

Makefile 1.65% C 91.40% C++ 0.62% Assembly 6.33%

tetris-os-cxx's Introduction

TETRIS-OS: An operating system that only plays Tetris.

screenshot

Video with an explanation of the development process.

Features:

  • It's Tetris.
  • 32-bit (x86)
  • Fully custom bootloader
  • Soundblaster 16 driver
  • Custom music track runner
  • Fully hardcoded tetris theme
  • Double-buffered 60 FPS graphics at 320x200 pixels with custom 8-bit RGB palette

Resources Used

Building & Running

NOTE: This has only been tested in an emulator. Real hardware might not like it.

EDIT: this is not true anymore! @parkerlreed has run this on a Thinkpad T510.

Mac OS

For the cross-compiler: $ brew tap nativeos/i386-elf-toolchain && brew install i386-elf-binutils i386-elf-gcc

$ make iso
$ qemu-system-i386 -drive format=raw,file=boot.iso -d cpu_reset -monitor stdio -device sb16 -audiodev coreaudio,id=coreaudio,out.frequency=48000,out.channels=2,out.format=s32

Unix-like

You should not need a cross-compiler in most cases as the gcc shipped in most linux distros will support i386 targets.

If this isn't the case for you, read here about getting a cross-compiler.

To run:

$ make iso
$ qemu-system-i386 -drive format=raw,file=boot.iso -d cpu_reset -monitor stdio -device sb16 -audiodev pulseaudio,id=pulseaudio,out.frequency=48000,out.channels=2,out.format=s32

If you have sound device issues:

  • To disable music entirely, try building without the #define ENABLE_MUSIC in main.c and running with
    $ qemu-system-i386 -drive format=raw,file=boot.iso.
  • Try using the SDL backend for QEMU:
    $ qemu-system-i386 -display sdl -drive format=raw,file=boot.iso -d cpu_reset -monitor stdio -audiodev sdl,id=sdl,out.frequency=48000,out.channels=2,out.format=s32 -device sb16,audiodev=sdl

If you're having issues with no image showing up/QEMU freezing, this is a known bug with QEMU SB16 emulation under GTK. Please read what @takaswie has written in #2 for a workaround.

Windows

Absolutely no idea. Maybe try WSL.

Real hardware

You probably know what you're doing if you're going to try this. Just burn boot.iso onto some bootable media and give it a go. If things break, try disabling all of the music (remove #define ENABLE_MUSIC in main.c) since you probably don't have something with a SB16 in it.

tetris-os-cxx's People

Contributors

0xfeedc0de64 avatar jdah avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

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.