Skip to content

yujiyokoo/mega-mrubyc

 
 

Repository files navigation

Mega-mruby/c

This is a fork of mruby/c to port mruby/c to Sega Mega Drive.

This is still work in progress, and experimental.

This README focuses on information specific to this fork. For information that relates to the original mruby/c, please refer to the original mruby/c project.

Demo

Here is a video of the demo game running on a real Mega Drive unit:

#mruby/c running on Sega Mega Drive

Build

Using Docker

You can use the command:

docker run -i -t --rm --platform linux/amd64 -v $(pwd):/mnt -w /mnt yujiyokoo/gendev_mrubyc bash -c 'mrbc -B mrbsrc src/game.rb && make -f /opt/gendev/sgdk/mkfiles/Makefile.rom clean all'

You can also use the local Dockerfile to build instead of pulling with the above command:

docker build -t yujiyokoo/gendev_mrubyc --platform linux/amd64 .

Using your local machine

  1. Ensure gendev is installed I have used Gendev 0.71 on a Debian sid in 2022. The .deb package installs under /opt/gendev.

  2. Patch gendev files (use the patch file included in this repo) Change the command accordingly, but in my case, I patched gendev dir with:

> sudo cp gendev-mega-mrubyc.patch /opt
> cd /opt
> sudo patch -p1 < ./gendev-mega-mrubyc.patch
  1. Run build command
export GENDEV=/opt/gendev
mrbc -B mrbsrc src/game.rb && make -f $GENDEV/sgdk/mkfiles/Makefile.rom clean all

Execute

After the above building step, you should end up with out/rom.bin, which you can use with most emulators. If you have a way of runnig your own code on the real Mega Drive unit, it should work there too. I use Mega EverDrive X7 and it works for me.

License

This fork of mruby/c is released under the same licence as the orginal - Revised BSD License(aka 3-clause license).

About

mruby/c ported to Sega Megadrive

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 83.0%
  • Ruby 13.2%
  • Assembly 2.1%
  • Makefile 1.6%
  • Dockerfile 0.1%