Difference between revisions of "User:QuarkTheAwesome/Dev guide draft"

From WiiUBrew
Jump to navigation Jump to search
(Get started with a rewrite; "Configuring Environment")
 
Line 3: Line 3:
 
== Configuring environment ==
 
== Configuring environment ==
 
At this time, a linux-esque environment (<i>not</i> msys2) is required - though work into Windows support is ongoing. For now, Windows users can use [https://docs.microsoft.com/en-us/windows/wsl/install-win10 WSL] or a [https://itsfoss.com/install-linux-in-virtualbox/ virtual machine]. Your first step is to install [https://devkitpro.org/wiki/devkitPro_pacman devkitPro pacman], downloading the Linux or OSX versions as appropriate for your setup. Once installed, you can use one of <syntaxhighlight inline>dkp-pacman -S <package></syntaxhighlight> or <syntaxhighlight inline>pacman -S <package></syntaxhighlight> to install packages! Start off by installing <syntaxhighlight inline>devkitPPC</syntaxhighlight>, followed by <syntaxhighlight inline>devkit-env</syntaxhighlight> on Linux or Windows. If that worked without error, your next step is to [https://gitlab.com/QuarkTheAwesome/wiiu-fling/blob/master/README.md install wiiu-fling] using the instructions in that link. That will add some extra Wii U-related packages to pacman, including most things you'll need to develop homebrew!
 
At this time, a linux-esque environment (<i>not</i> msys2) is required - though work into Windows support is ongoing. For now, Windows users can use [https://docs.microsoft.com/en-us/windows/wsl/install-win10 WSL] or a [https://itsfoss.com/install-linux-in-virtualbox/ virtual machine]. Your first step is to install [https://devkitpro.org/wiki/devkitPro_pacman devkitPro pacman], downloading the Linux or OSX versions as appropriate for your setup. Once installed, you can use one of <syntaxhighlight inline>dkp-pacman -S <package></syntaxhighlight> or <syntaxhighlight inline>pacman -S <package></syntaxhighlight> to install packages! Start off by installing <syntaxhighlight inline>devkitPPC</syntaxhighlight>, followed by <syntaxhighlight inline>devkit-env</syntaxhighlight> on Linux or Windows. If that worked without error, your next step is to [https://gitlab.com/QuarkTheAwesome/wiiu-fling/blob/master/README.md install wiiu-fling] using the instructions in that link. That will add some extra Wii U-related packages to pacman, including most things you'll need to develop homebrew!
+
 
== Making HBL Apps ==
+
== Making Native Apps (wut) ==
 +
The best solution for making Wii U homebrew at this time is [https://github.com/decaf-emu/wut wut]; an activley-developed toolchain that can build native RPX apps. RPX apps have a high filesize limit, can be launched through HBL or installed to the System Menu as a channel, and can take advantage of many Nintendo features previously unavailable to homebrew. It's recommended to use wut for all new projects.
 +
 
 +
If you followed the wiiu-fling install instructions above, you should be able to install the <syntaxhighlight inline>wut-linux</syntaxhighlight>, <syntaxhighlight inline>wut-osx</syntaxhighlight> or <syntaxhighlight inline>wut-msys2</syntaxhighlight> packages, depending on your system.
 +
 
 +
There's plenty of examples of using wut, such as [https://github.com/decaf-emu/wut/tree/master/samples its own examples]; along with real-world apps. See [[#Guides]] for more info on getting started with wut.
 +
 
 +
=== SDL ===
 +
There's also a port of SDL2 built on top of wut available to developers; with features like hardware acceleration and sound support. It's designed to be as close to the Switch port of SDL2 as possible, so often Switch and PC SDL2 apps can be used without any changes. It can be installed with <syntaxhighlight inline>wiiu-sdl2</syntaxhighlight> - real-world examples of use include [https://github.com/vgmoose/hb-appstore hb-appstore], [https://github.com/rw-r-r-0644/Fireplace-WiiU Fireplace-WiiU], [https://github.com/rw-r-r-0644/WiiU-Shell WiiU-Shell], and many others!
 +
 
 +
== Legacy methods ==
 +
The methods below are useful to know about in case you need to work with or learn from older code, though are generally unsupported and unmaintained.
 +
 
 +
=== Making HBL ELF apps ===
 
The [[Homebrew Launcher]] is an easy platform to target for development. The two below methods are useful for making console and GUI apps respectively. In particular, lib_easy is a good place to start. Apps compiled with this method are in the ELF format.
 
The [[Homebrew Launcher]] is an easy platform to target for development. The two below methods are useful for making console and GUI apps respectively. In particular, lib_easy is a good place to start. Apps compiled with this method are in the ELF format.
  
=== Using lib_easy ===
+
==== Using lib_easy ====
 
[https://github.com/rw-r-r-0644/WiiU-HelloWorld-Easy lib_easy] by rw-r-r_0644 was designed to be a quick way to get familiar with programming on the Wii U. That link contains an example hello world project. After setting up your environment, you can compile the hello world project by cd-ing into the folder and running "make".
 
[https://github.com/rw-r-r-0644/WiiU-HelloWorld-Easy lib_easy] by rw-r-r_0644 was designed to be a quick way to get familiar with programming on the Wii U. That link contains an example hello world project. After setting up your environment, you can compile the hello world project by cd-ing into the folder and running "make".
  
An example of a homebrew app that was made using lib_easy is [[UClick]].
+
An example of a homebrew app that was made using lib_easy is [[UClick]]. lib_easy is now deprecated in favor of wut.
  
=== Using Dimok's libraries ===
+
==== Using Dimok's libraries ====
 
[[Dimok's libraries]] provide assistance with interacting with various parts of the Wii U. For some projects that use OSScreen to interact with the see [[Pong]], [[C@ve]], [[Snake]], or [[Space Game]]. (Specifically, you will want to look at [https://github.com/dimok789/pong_port this HBL pong port]).
 
[[Dimok's libraries]] provide assistance with interacting with various parts of the Wii U. For some projects that use OSScreen to interact with the see [[Pong]], [[C@ve]], [[Snake]], or [[Space Game]]. (Specifically, you will want to look at [https://github.com/dimok789/pong_port this HBL pong port]).
  
 
Dimok's libs also provide many GX2 wrappers that provide a template for creating Homebrew Launcher-style GUIs. Examples of projects that utilize this include [[Homebrew Launcher]], [[CHIP-8_Emulator]], and [[Homebrew App Store]].
 
Dimok's libs also provide many GX2 wrappers that provide a template for creating Homebrew Launcher-style GUIs. Examples of projects that utilize this include [[Homebrew Launcher]], [[CHIP-8_Emulator]], and [[Homebrew App Store]].
  
== Making Native Apps ==
+
=== Making Userland Apps ===
There's a work in progress [https://github.com/decaf-emu/wut Wii U Toolchain] (also called "wut") that can be used to make native RPX apps. These would be able to be installed to the System if not for the heavy signature checking that the Wii U performs on the System menu. In the long run, these may be preferable to the HBL-style ELF launching system.
 
 
 
Wut is under active development. It provides instructions on how to get started in its readme along with a Hello World. There are a few apps out that make use of wut, including [[gx2texture2d]] and ports of [https://github.com/decaf-emu/wut/tree/master/samples/pong Pong] and [https://github.com/vgmoose/space/tree/wut Space Game]. Although it is under development, it is still fairly featured. RPX files that are compiled with wut can also be played in [[decaf-emu]].
 
 
 
== Making Userland Apps ==
 
 
The userland environment does not require a kernel exploit to execute programs, but as a result is heavily limited. These apps hijack the browser, but don't go any further. [https://github.com/wiiudev/libwiiu libwiiu] is a good build system to use to produce .bin files which can be converted into mp4 payloads. It has detailed compilation instructions and many examples in the readme and repository.
 
The userland environment does not require a kernel exploit to execute programs, but as a result is heavily limited. These apps hijack the browser, but don't go any further. [https://github.com/wiiudev/libwiiu libwiiu] is a good build system to use to produce .bin files which can be converted into mp4 payloads. It has detailed compilation instructions and many examples in the readme and repository.
  
Line 30: Line 38:
  
 
== Guides ==
 
== Guides ==
[[User:QuarkTheAwesome|QuarkTheAwesome]] is working on a more in-depth guide to Wii U development, which is available [https://github.com/QuarkTheAwesome/ProgrammingOnTheU here].
+
[[User:QuarkTheAwesome|QuarkTheAwesome]] is working on a more in-depth guide to Wii U development using wut, which is available [https://github.com/QuarkTheAwesome/ProgrammingOnTheU here].
  
 
He has also produced an older, outdated development guide for the userspace environment [https://gbatemp.net/threads/wip-wii-u-development-tutorial.420975/ here].
 
He has also produced an older, outdated development guide for the userspace environment [https://gbatemp.net/threads/wip-wii-u-development-tutorial.420975/ here].
  
 
== Support ==
 
== Support ==
If you need help developing, here are a few IRC channels that may be able to provide direct assistance.
+
If you need help developing, here are a few channels that may be able to provide direct assistance.
  
* [https://kiwiirc.com/client/irc.efnet.org/wiiudev #wiiudev on irc.efnet.org]
+
* [https://discord.gg/Y6JwXpn fortheusers Discord] (formerly wiiubru) has a lot of key homebrew and toolchain devs
* [https://kiwiirc.com/client/irc.freenode.net/wiiubru #wiiubru on irc.freenode.net] (also on [https://discord.gg/Y6JwXpn Discord])
+
* [https://kiwiirc.com/client/irc.efnet.org/wiiudev #wiiudev on irc.efnet.org] is a good place to talk about the hacking side of things
  
 
Don't be afraid to ask! :)
 
Don't be afraid to ask! :)

Latest revision as of 00:24, 7 January 2019

This article will go over the primary ways of developing various types of homebrew on the Wii U.

Configuring environment

At this time, a linux-esque environment (not msys2) is required - though work into Windows support is ongoing. For now, Windows users can use WSL or a virtual machine. Your first step is to install devkitPro pacman, downloading the Linux or OSX versions as appropriate for your setup. Once installed, you can use one of dkp-pacman -S <package> or pacman -S <package> to install packages! Start off by installing devkitPPC, followed by devkit-env on Linux or Windows. If that worked without error, your next step is to install wiiu-fling using the instructions in that link. That will add some extra Wii U-related packages to pacman, including most things you'll need to develop homebrew!

Making Native Apps (wut)

The best solution for making Wii U homebrew at this time is wut; an activley-developed toolchain that can build native RPX apps. RPX apps have a high filesize limit, can be launched through HBL or installed to the System Menu as a channel, and can take advantage of many Nintendo features previously unavailable to homebrew. It's recommended to use wut for all new projects.

If you followed the wiiu-fling install instructions above, you should be able to install the wut-linux, wut-osx or wut-msys2 packages, depending on your system.

There's plenty of examples of using wut, such as its own examples; along with real-world apps. See #Guides for more info on getting started with wut.

SDL

There's also a port of SDL2 built on top of wut available to developers; with features like hardware acceleration and sound support. It's designed to be as close to the Switch port of SDL2 as possible, so often Switch and PC SDL2 apps can be used without any changes. It can be installed with wiiu-sdl2 - real-world examples of use include hb-appstore, Fireplace-WiiU, WiiU-Shell, and many others!

Legacy methods

The methods below are useful to know about in case you need to work with or learn from older code, though are generally unsupported and unmaintained.

Making HBL ELF apps

The Homebrew Launcher is an easy platform to target for development. The two below methods are useful for making console and GUI apps respectively. In particular, lib_easy is a good place to start. Apps compiled with this method are in the ELF format.

Using lib_easy

lib_easy by rw-r-r_0644 was designed to be a quick way to get familiar with programming on the Wii U. That link contains an example hello world project. After setting up your environment, you can compile the hello world project by cd-ing into the folder and running "make".

An example of a homebrew app that was made using lib_easy is UClick. lib_easy is now deprecated in favor of wut.

Using Dimok's libraries

Dimok's libraries provide assistance with interacting with various parts of the Wii U. For some projects that use OSScreen to interact with the see Pong, C@ve, Snake, or Space Game. (Specifically, you will want to look at this HBL pong port).

Dimok's libs also provide many GX2 wrappers that provide a template for creating Homebrew Launcher-style GUIs. Examples of projects that utilize this include Homebrew Launcher, CHIP-8_Emulator, and Homebrew App Store.

Making Userland Apps

The userland environment does not require a kernel exploit to execute programs, but as a result is heavily limited. These apps hijack the browser, but don't go any further. libwiiu is a good build system to use to produce .bin files which can be converted into mp4 payloads. It has detailed compilation instructions and many examples in the readme and repository.

A lot of the earlier homebrew was initially made for this userland environment, although most of it has since been ported to HBL. Pong, C@ve, and Space Game are among those early apps.

It isn't really recommended to use userland while a kernel exploit environment is available. It is heavily restricted to ~20KB payload files, no access to global variables, and no access to GX2 (OSScreen only).

Guides

QuarkTheAwesome is working on a more in-depth guide to Wii U development using wut, which is available here.

He has also produced an older, outdated development guide for the userspace environment here.

Support

If you need help developing, here are a few channels that may be able to provide direct assistance.

Don't be afraid to ask! :)