GithubHelp home page GithubHelp logo

sizious / mrbtris Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yujiyokoo/mrbtris-dreamcast

0.0 1.0 0.0 107 KB

A sample game for Sega Dreamcast written in Ruby

License: MIT License

Makefile 1.46% Ruby 73.71% C 24.26% Shell 0.56%

mrbtris's Introduction

mrbtris: Sample game for Sega Dreamcast written in Ruby

mrbtris is a simple game for the Sega Dreamcast which is written in Ruby as an proof-of-concept of using the mruby implementation on the Sega Dreamcast. This project was written by @yujiyokoo.

This project is built on the top of KallistiOS (KOS), which is the low-level library used to interact with the Sega Dreamcast hardware. Usually, programs written for the Sega Dreamcast are in C/C++, this project aims to demonstrate the use of Ruby source code targeting the Sega Dreamcast.

This project aims to provide a simple example of how to use KallistiOS (KOS) API and mruby together.

Demonstration

Below you may find a video of this game running on the real hardware. #mrbtris running on Sega Dreamcast

TODO

  • Make an mrbgem for the Dreamcast specific things
  • Create unit tests
  • Use more Sega Dreamcast features

Building

mrbtris uses KallistiOS (KOS) and mruby as dependencies. For building this program you have two options:

  • Using a working KallistiOS setup;
  • Use the provided Docker image below.

Using your working KallistiOS environment

If you have a working KallistiOS environment, you will have to install the rake and bison packages (e.g. using apt, brew or pacman). If you are using DreamSDK, you will have to install the RubyInstaller package separately, in that case, rake should be available in the PATH environment variable.

Install mruby:

cd /opt
git clone https://github.com/mruby/mruby.git
cd /opt/mruby
make MRUBY_CONFIG=dreamcast_shelf

These commands will produces all the necessary files for using mruby on Sega Dreamcast. After that, just navigate to the mrbtris directory then enter make. This will produces the mrbtris.elf binary file.

Note: You may consult this page for reference.

Using Docker image

The Docker image is named mruby-kos-dc which is built from docker-mruby-kos-dc. The instruction to input are:

git clone https://gitlab.com/yujiyokoo/mrbtris-dreamcast.git
cd mrbtris-dreamcast
docker pull yujiyokoo/mruby-kos-dc
docker run -i -t -v $(pwd):/mnt yujiyokoo/mruby-kos-dc bash -c 'cd /mnt && . /opt/toolchains/dc/kos/environ.sh && make'

This should produce an elf binary called mrbtris.elf.

Running

Dreamcast emulator: Lxdream

To check that it at least runs, you can use Dreamcast emulators. In my experience, lxdream can boot elf and seems to work well enough to check it runs, but text display doesn't seems to render properly. You could still check that it boots up even without text. To do that, run lxdream -e mrbtris.elf or lxdream mrbtris.elf, depending on your lxdream version, from your Terminal.

Unfortunately, running on the real hardware has been the only way for me to test text display and actual performance, but it may be different in your environment.

Making a bootable image

If you want to try this software in your real Dreamcast and/or in an another emulator (like Demul, Redream, Reicast...), you may create a Padus DiscJuggler (cdi) image. For example, if you are using DreamSDK, you may do the following:

make dist
elf2bin mrbtris.elf
scramble mrbtris.bin cd_root/1ST_READ.BIN
makedisc mrbtris.cdi cd_root

This will produces the mrbtris.cdi image file that you may burn onto a CD-R or use in a Dreamcast emulator. Alternatively, you may use BootDreams (on Windows) or similar tools. If you are on non-Windows systems, you may check the img4dc source code.

Using dcload/dc-tool (part of KallistiOS)

If you have a Coders Cable or a Broadband Adapter (BBA) / LAN Adapter, you could also the dcload program (part of KallistiOS) to load it directly on the Sega Dreamcast. It should load as a normal Sega Dreamcast program.

mrbtris's People

Contributors

yujiyokoo avatar sizious avatar

Watchers

James Cloos 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.