GithubHelp home page GithubHelp logo

seungmannlee / omega2-gnuboy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gamer-cndg/omega2-gnuboy

0.0 2.0 0.0 37.63 MB

A port of the Gameboy & Gameboy Color emulator "gnuboy" for the Omega2.

License: GNU General Public License v2.0

Makefile 0.70% C 97.70% C++ 1.60%

omega2-gnuboy's Introduction

gnuboy - for the Onion Omega2

Description

This is a port of the original gnuboy Gameboy and Gameboy Color emulator for the Onion Omega2(+).
It uses my ILI9225 library to drive the display and my Wii Classic library for the joystick input. Additionally, it uses ALSA to play audio over a USB audio card.

Issues

Due to the problems with the SPI interface on the Omega2(+), this program inherits these problems, too. The ILI9225 SPI display can only be driven at about 2 FPS for the time being, which is due to a 16 byte TX buffer in the SPI driver. Every 8th pixel's color might be corrupted (MSB of red value) because the SPI interface has a bug, causing it to transmit the first bit of my 16-byte transfers incorrectly. See here if you're interested.
I use multithreading to overcome the slowness of the display driver. The video thread just runs detached from everything else at its own pace. Audio and everything else still operates at full speed, stutter-free.

Hardware Wireup

You will need:

  • an Onion Omega2 or Omega2+, preferably with the extension dock
  • an ILI9225 display (e.g., on ebay)
  • a Wii classic controller
  • an adapter board for the controller's connector (e.g., Adafruit's nunchucky)
  • a USB audio card (can be obtained for $3 and less on ebay)
  • either headphones or an amplifier chip with loudspeakers (e.g. PAM8403) to hear the sound
  • breadboard and wires

The pins for SPI display are statically compiled into the binary. They are as follows: MOSI = 8, SCLK = 7, CS = 6, RST = 3, RS = 1. The Wii Classic gamepad has to be connected to the standard I2C bus, as labeled on the extension dock.

Program Usage

Since this is a port of the gnuboy program, it can be used exactly as the original program. Usually, you just want to play a ROM using the syntax

./gnuboy <path-to-romfile>

The Wii classic gamepad button mappings are as follows:

Wii Classic Gameboy
A A
B B
Start Start
Select Select
DPAD DPAD
left analog stick DPAD
ZL save state
ZR load state

Compilation

This project was designed for cross-compliation. Compile your toolchain according to https://docs.onion.io/omega2-docs/cross-compiling.html, change the paths in the Makefile (TOOLCHAIN_ROOT_DIR) and do a make all. Optionally, make upload will attempt to use sshpass with scp to transfer the compiled binary to your Omega Onion2 system. Simply change the IP address and the password if you whish to use this feature.

For a successful compilation, you need the omega_includes and omega_libs folder somewhere on your computer. You can download them here. Change the path in the Makefile accordingly.

Testing the compiled binaries

  1. Install the dependencies library by typing opkg update && opkg install libonionspi libonioni2c alsa-utils alsa-lib. If you already have these libraries, skip this step.
  2. Transfer the libili9225.so and libwiiclassic.so file from the omega2-libs repository to the /usr/lib/ folder on your Omega2, e.g. by using ssh or scp.
  3. Make sure the wiring is that which is described in the wireup section
  4. Transfer the gnuboy file (ELF) to some directory on your Omega2, e.g. /root/ and run it with the path to some ROM (.gb or .gbc file)!

Credits

  • Maximilian Gerhardt, program porter
  • Laguna (from gnuboy)
  • All the people and companies on which dependencies are based (e.g. for the Wii controller or the ILI9225 stuff)

Remember that gnuboy is GPL licensed! If you modify the source and distribute the binaries, you have to release the source code.

Media

hardware setup games

Video (links to youtube):

Watch the video

omega2-gnuboy's People

Contributors

maxgerhardt avatar gamer-cndg avatar

Watchers

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