User:Callum/Sonic Robo Blast 2

From WiiBrew
Jump to navigation Jump to search
SRB2Wii
SRB2 Titlescreen.png
General
Author(s)Sonic Team Jr.
Ported byCallum Dickinson
TypePlatform game
Versionlibogc-based: 2.0.6 r6572; Wii Linux-based: 2.0.0 RC4 r6112
LicenseGPL
Links
Website
Discussion
[[1]]
Peripherals
WiiMote2.svg Nunchuck alternative.svg ClassicController.svg GameCube Controller USB Keyboard USB mass storage device Loads files from SDHC cards in the Front SD slot Local WiFi Internet

SRB2Wii is an unofficial port of Sonic Robo Blast 2 to the Wii. Development is mainly headed by Callum. There are two distributions of SRB2Wii.

The earliest builds of SRB2Wii are based off a highly-customised Wii Linux distribution that run the PowerPC Linux version of SRB2.

SRB2Wii now natively uses the libogc libraries as opposed to running through Wii Linux, which brings massive speed improvements, although some new bugs were introduced.

SRB2Wii is currently under ongoing development. The libogc-based distribution features working controls, and faster performance than the Wii Linux-based distribution. The Wii Linux-based distribution currently features working controls and partial netgame support, though with some performance issues in more CPU-intensive maps.

Current release information

libogc-based

Wii Linux-based

Both distributions can coexist given that their Homebrew Channel folders are renamed.

Wii Linux-based Distribution

How it works

Sonic Robo Blast 2 is almost completely written in ANSI C. This allows it to be compiled and run on different architectures, given the appropriate modifications necessary to make it work on another operating system and architecture.

SRB2 is known to work (with varying degrees of compatibility) on at least the x86, x86-64, PowerPC, ARM, MIPS, SuperH and SPARC architectures. It works best on the x86, PowerPC and ARM architectures.

It can also compiled for the DOS, Windows, Windows CE, Linux, Mac OS X, FreeBSD (and possibly other Unix-like operating systems) and Solaris operating systems, in addition to many different video game systems.

SRB2 and Wii Linux

The Wii's Broadway CPU is a standard PowerPC architecture chip developed by IBM. As a result, standard PowerPC code can run on it once homebrew has been enabled.

The team at GC-Linux.org have taken this opportunity to expand their GC-Linux operating system to support the Wii as well. Almost all the hardware on the Wii is now well supported under Linux with the latest kernel patches. The only thing that does not work is the Wii's optical drive and the internal Wi-Fi in IOS mode.

The current status of Wii Linux has allowed programs that run under Linux but cannot easily be natively compiled for the Wii to run on the Wii through compiling for the powerpc-linux target and then running it on Wii Linux.

SRB2Wii follows this approach. It always uses the latest Wii Linux kernels for the most advanced features. SRB2Wii was forked from the Kobo Deluxe for Wii 0.5.1 sources. In its current stage, though, it looks nothing like the original source on which it was based.

SRB2Wii is a heavily simplified and modified version of GC-Linux.org's whiite-linux operating system (older version based on Debian etch), although they otherwise now have no similarities whatsoever. It only includes and loads the programs, libaries and services necessary to run SRB2 and related programs, and exploits Busybox to consolidate most of the required programs into one executable for simplicity.

The boot process

  • Kernel is loaded into memory and executed on the Broadway.
  • Kernel executes subroutines, probes the hardware, and then mounts the initramfs filesystem compiled into the kernel image.
  • Kernel executes the "init" shell script on the initramfs.
  • The script sets variables necessary to run, mounts sysfs and procfs, then mounts the first partition on the front SD card and looks for the main filesystem image.
    • If found, it will mount that filesystem and pass control to the /sbin/init program under the main filesystem, which continues the SRB2Wii boot.
    • If it finds a tarball of the filesystem image, it will convert the tarball into the main filesystem image and continue booting, but instead loading the /sbin/kickstart program, which will further prepare the filesystem for use.
    • If no image or tarball is found, it will report to the user that it cannot find the filesystem image and reboot.
  • The /sbin/init program follows the commands laid out in the /etc/inittab file, which sets up virtual terminals, and starts the runlevel S.
  • /etc/init/rcS runs all the scripts in /etc/rcS.d, which currently includes kserv (mount procfs and sysfs if they are not mounted already), procps (kernel services), udev, dbus, hcid (Bluetooth) and swap (mount swap files). rcS then passes control back to inittab.
  • inittab launches runlevel 1, which loads the rc1 script. /etc/init/rc1 runs all the scripts in /etc/rc1.d, which currently includes wiimote (start the Wii Remote and Sensor Bar), cleanup (create special device node symbolic links and create some files SRB2 needs) and launcher (the SRB2Wii launcher).
  • The SRB2Wii launcher starts and the user is now given control.