Skip to content

Slushi-Github/hxCompileU

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HxCompileU

mainImage

Using this small utility you can compile code from Haxe to PowerPC and finally the Nintendo Wii U using DevKitPro and reflaxe.CPP.

Currently supported libraries to be used in conjunction with HxCompileU:

  • hxWUT: the toolchain or SDK used to create homebrew on the Wii U.
  • hxLibNotifications: a library to create notifications on the Wii U (Useful for mostly plugins).
  • hxLibMappedMemory: a library to create mapped memory on the Wii U.
  • SlushiUtilsU: a library to facilitate the use of certain Wii U libraries.
  • hxSDL2: SDL2 (SDL2, SDL2_Image, SDL2_mixer...) @:native bindings for Haxe, for use SDL2 on the Wii U.
  • hxSDL_FontCache: SDL_FontCache @:native bindings for Haxe to do homebrew on Wii U.

How?

The magic really comes from reflaxe.CPP, being an alternative to HXCPP when you want to compile Haxe to C++. By default, if you would try to make Haxe with HXCPP compile to PPC... the results are not nice, there are many errors. With reflaxe.CPP we avoid this because it generates a cleaner code without dependencies!

This project is simple, yet incomplete.

This program what it does, is that by means of some data stored in a JSON file (hxCompileUConfig.json), it generates a MakeFile and a HXML file with those data of the JSON, of normal first it will try to execute the HXML with Haxe, reflaxe.CPP is in charge of generating the C++ code, if the compilation with Haxe is successful, it executes the MakeFile with Make and starts the normal compilation of a C++ code, if this is also successful, that's it, you have your homebrew for the Nintendo Wii U made with Haxe!

Why?

Well, since I got a Nintendo Wii U a while ago I've been interested in bringing Haxe to this console. Officially it's not possible mainly due to Nintendo NDA (Non-Disclosure Agreement) issues, and that actually it can't even be developed for this console anymore.

So... why not experiment to do it taking advantage of the homebrew that exists for the Wii U? hehe! well this is the project for it!

Usage

You need:

First, you need compilate this project, or you can use the precompiled version that is in the releases, or you can download it from the GitHub Actions.

# Just clone the repository
git clone https://github.com/Slushi-Github/hxCompileU.git

# Compile the project
cd hxCompileU
haxe build.hxml

After that, you will get your executable “haxeCompileU” in the export folder, for the moment, copy it to the root of the project you need it.

First, initialize your project, that is, create the configuration JSON file that HxCompileU will use, you can create it using this command:

{haxeCompileUProgram} --prepare

Once you have configured your JSON file to what your project needs, you can use the following command to compile it:

{haxeCompileUProgram} --compile

If you want to compile only Haxe but not to Wii U, you can use the following command:

{haxeCompileUProgram} --compile --onlyHaxe

You can also use the following command to compile only Wii U but not Haxe:

{haxeCompileUProgram} --compile --onlyCafe

You can also use the following command search a line of code in the .elf file from a line address of some log using DevKitPro's powerpc-eabi-addr2line program:

{haxeCompileUProgram} --searchProblem [lineAddress]

and that's it! if your compilation was successful on both Haxe and Wii U side, your .rpx and .elf will be in yourOuputFolder/wiiuFiles.