Skip to content

Commit 4f68b59

Browse files
committed
I think this could be the final version of this for a little while.
1 parent f3dd121 commit 4f68b59

File tree

16 files changed

+326
-300
lines changed

16 files changed

+326
-300
lines changed

.github/workflows/linux.yml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
1-
2-
name: Linux (Debian) Build
1+
name: Linux Build
32
on:
43
push:
4+
55
jobs:
66
build:
7-
name: Linux (Debian) Build
8-
permissions: write-all
97
runs-on: ubuntu-latest
108
steps:
11-
- name: Pulling the new commit
9+
- name: Checkout repository
1210
uses: actions/[email protected]
13-
- name: Setting up Haxe
11+
12+
- name: Set up Haxe
1413
uses: krdlab/setup-haxe@master
1514
with:
1615
haxe-version: 4.3.5
17-
- name: Installing/Updating libraries
18-
run: |
19-
haxelib --always install hxcpp
20-
shell: cmd
21-
- name: Building HxCompileU
22-
run: |
23-
haxe build.hxml
24-
- name: Uploading artifact (entire build)
16+
17+
- name: Install Haxe libraries
18+
run: haxelib install hxcpp
19+
20+
- name: Compile project
21+
run: haxe build.hxml
22+
23+
- name: Debug output
24+
run: ls -la export/haxeCompileU
25+
26+
- name: Upload compiled artifact
2527
uses: actions/[email protected]
2628
with:
2729
name: Linux64_HxCompileU
28-
path: export/haxeCompileU
30+
path: export/haxeCompileU

.github/workflows/macos.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
1-
21
name: MacOS Build
32
on:
43
push:
4+
55
jobs:
66
build:
7-
name: MacOS Build
8-
permissions: write-all
97
runs-on: macos-latest
108
steps:
11-
- name: Pulling the new commit
9+
- name: Checkout repository
1210
uses: actions/[email protected]
13-
- name: Setting up Haxe
11+
12+
- name: Set up Haxe
1413
uses: krdlab/setup-haxe@master
1514
with:
1615
haxe-version: 4.3.5
17-
- name: Installing/Updating libraries
18-
run: |
19-
haxelib --always install hxcpp
20-
shell: cmd
21-
- name: Building HxCompileU
22-
run: |
23-
haxe build.hxml
24-
- name: Uploading artifact (entire build)
16+
17+
- name: Install Haxe libraries
18+
run: haxelib install hxcpp
19+
20+
- name: Compile project
21+
run: haxe build.hxml
22+
23+
- name: Debug output
24+
run: ls -la export/haxeCompileU
25+
26+
- name: Upload compiled artifact
2527
uses: actions/[email protected]
2628
with:
2729
name: Mac64_HxCompileU
28-
path: export/haxeCompileU
30+
path: export/haxeCompileU

README.md

Lines changed: 42 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,53 @@
11
# HxCompileU
22
![mainImage](https://github.com/Slushi-Github/hxCompileU/blob/main/docs/readme/MainImage.png)
33

4-
Using this small utility you can compile code from Haxe to PowerPC and finally the Nintendo Wii U using [DevKitPro](https://devkitpro.org/) and [reflaxe.CPP](https://github.com/SomeRanDev/reflaxe.CPP).
4+
Using this small utility you can compile code from Haxe to PowerPC and finally the Nintendo Wii U using [DevKitPro](https://devkitpro.org/) and [reflaxe.CPP](https://github.com/SomeRanDev/reflaxe.CPP), for creating homebrew for the Wii U.
55

66
Currently supported libraries to be used in conjunction with HxCompileU:
77

8-
- [hxWUT](https://github.com/Slushi-Github/hxWUT): the toolchain or SDK used to create homebrew on the Wii U.
9-
- [hxLibNotifications](https://github.com/Slushi-Github/hxLibNotifications): a library to create notifications on the Wii U (Useful for mostly plugins).
10-
- [hxLibMappedMemory](https://github.com/Slushi-Github/hxLibMappedMemory): a library to create mapped memory on the Wii U.
8+
- [HxU_WUT](https://github.com/Haxe-WiiU/HxU_WUT): the toolchain or SDK used to create homebrew on the Wii U.
9+
- [HxU_LibNotifications](https://github.com/Haxe-WiiU/HxU_LibNotifications): a library to create notifications on the Wii U (Useful for mostly plugins).
10+
- [HxU_LibMappedMemory](https://github.com/Haxe-WiiU/HxU_LibMappedMemory): a library to create mapped memory on the Wii U.
1111
- [SlushiUtilsU](https://github.com/Slushi-Github/slushiUtilsU): a library to facilitate the use of certain Wii U libraries.
12-
- [hxSDL2](https://github.com/Slushi-Github/hxSDL2): SDL2 (SDL2, SDL2_Image, SDL2_mixer...) @:native bindings for Haxe, for use SDL2 on the Wii U.
13-
- [hxSDL_FontCache](https://github.com/Slushi-Github/hxSDL_FontCache): SDL_FontCache @:native bindings for Haxe to do homebrew on Wii U.
14-
- [hxJansson](https://github.com/Slushi-Github/hxJansson): Jansson @:native bindings for Haxe to do homebrew on Wii U.
15-
- [hxVorbis](https://github.com/Slushi-Github/hxVorbis): Vorbis @:native bindings for Haxe to do homebrew on Wii U.
12+
- [HxU_SDL2](https://github.com/Haxe-WiiU/HxU_SDL2): SDL2 (SDL2, SDL2_Image, SDL2_mixer...) @:native bindings for Haxe, for use SDL2 on the Wii U.
13+
- [HxU_SDL_FontCache](https://github.com/Haxe-WiiU/HxU_SDL_FontCache): SDL_FontCache @:native bindings for Haxe to do homebrew on Wii U.
14+
- [HxU_Jansson](https://github.com/Haxe-WiiU/HxU_Jansson): Jansson @:native bindings for Haxe to do homebrew on Wii U.
15+
- [HxU_Vorbis](https://github.com/Haxe-WiiU/HxU_Vorbis): Vorbis @:native bindings for Haxe to do homebrew on Wii U.
1616

1717
- [Leafy Engine](https://github.com/Slushi-Github/leafyEngine): A 2D engine for the Wii U made with Haxe.
1818

1919
## How?
2020
The magic really comes from [reflaxe.CPP](https://github.com/SomeRanDev/reflaxe.CPP), being an alternative to [HXCPP](https://github.com/HaxeFoundation/hxcpp) when you want to compile Haxe to C++.
21-
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!
21+
By default, if you would try to make Haxe with [HXCPP](https://github.com/HaxeFoundation/hxcpp) compile to PowerPC... the results are not nice, there are many errors. With [Reflaxe/C++](https://github.com/SomeRanDev/reflaxe.CPP) we avoid this because it generates a cleaner code without dependencies!
2222

23-
This project is simple, **yet incomplete**.
23+
This project is simple... But it works!
2424

25-
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](https://haxe.org/manual/compiler-usage-hxml.html) file with those data of the JSON, of normal first it will try to execute the [HXML](https://haxe.org/manual/compiler-usage-hxml.html) with Haxe, [reflaxe.CPP](https://github.com/SomeRanDev/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!
25+
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](https://haxe.org/manual/compiler-usage-hxml.html) file with those data of the JSON, of normal first it will try to execute the [HXML](https://haxe.org/manual/compiler-usage-hxml.html) with Haxe, [Reflaxe/C++](https://github.com/SomeRanDev/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!
26+
27+
Currently there is only support focused on creating homebrew applications for the Wii U, but we are working on support for creating [WUPS](https://github.com/wiiu-env/WiiUPluginSystem) plugins using this utility.
2628

2729
## Why?
2830
Well, since I got a Nintendo Wii U a while ago I've been interested in bringing Haxe to this console.
2931
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.
3032

3133
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!
3234

33-
## Usage
35+
# Usage
36+
37+
The basic usage of HxCompileU is as follows:
3438

3539
You need:
3640
- [DevKitPro](https://devkitpro.org/wiki/Getting_Started)
3741

3842
- [WUT](https://github.com/devkitPro/wut?tab=readme-ov-file#install)
3943

44+
- [Haxe](https://haxe.org/)
45+
4046
- [reflaxe](https://github.com/SomeRanDev/reflaxe)
4147

4248
- [reflaxe.CPP (Fork)](https://github.com/Slushi-Github/reflaxe.CPP)
4349

44-
- [hxWUT](https://github.com/Slushi-Github/hxWUT)
50+
- [HxU_WUT](https://github.com/Haxe-WiiU/HxU_WUT)
4551

4652
First, you need compilate this project, or you can use the precompiled version that is in the [releases](https://github.com/Slushi-Github/hxCompileU/releases), or you can download it from the [GitHub Actions](https://github.com/Slushi-Github/hxCompileU/actions).
4753

@@ -54,32 +60,46 @@ cd hxCompileU
5460
haxe build.hxml
5561
```
5662

57-
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.
63+
After that, you will get your executable ``haxeCompileU`` in the "export" folder, for the moment, copy it to the root of the project folder you need it.
64+
5865

66+
## How to use
5967
#### First, initialize your project, that is, create the configuration JSON file that HxCompileU will use, you can create it using this command:
6068
``{haxeCompileUProgram} --prepare``
6169

70+
-----
71+
6272
#### Once you have configured your JSON file to what your project needs, you can use the following command to compile it:
6373
``{haxeCompileUProgram} --compile``
6474

65-
If you want to compile only Haxe but not to Wii U, you can use the following command:
75+
- If you want to compile only Haxe but not to Wii U,
76+
you can use the following command:
6677

67-
``{haxeCompileUProgram} --compile --onlyHaxe``
78+
``{haxeCompileUProgram} --compile --onlyHaxe``
6879

6980

70-
You can also use the following command to compile only Wii U but not Haxe:
81+
- You can also use the following command to compile only Wii U but not Haxe:
7182

72-
``{haxeCompileUProgram} --compile --onlyCafe``
83+
``{haxeCompileUProgram} --compile --onlyCafe``
7384

85+
-----
7486

75-
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:
87+
#### 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:
7688

7789
``{haxeCompileUProgram} --searchProblem [lineAddress]``
7890

91+
-----
92+
93+
#### You can also use the following command send the ``.rpx`` or ``.wps`` file to the Wii U using DevKitPro's ``wiiload`` program:
94+
95+
``{haxeCompileUProgram} --send``
96+
97+
-----
7998

80-
You can also use the following command send the ``.rpx`` file to the Wii U using DevKitPro's ``wiiload`` program:
99+
### You can also use the following command to start a UDP server to view the logs from the Wii U:
81100

82-
``{haxeCompileUProgram} --sendRPX``
101+
``{haxeCompileUProgram} --udpServer``
83102

103+
-----
84104

85-
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``.
105+
and that's it! if your compilation was successful on both Haxe and Wii U side, your ``.rpx`` or ``.wps`` and ``.elf`` will be in ``yourOutputFolder/wiiuFiles``.

src/JsonFile.hx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,14 @@ typedef HaxeConfig = {
1818
hxMain:String,
1919
outDir:String,
2020
debugMode:Bool,
21-
generateDoxDocs:Bool,
2221
othersOptions:Array<String>,
2322
errorReportingStyle:String,
2423
}
2524

2625
typedef WiiUConfig = {
2726
projectName:String,
2827
consoleIP:String,
29-
}
30-
31-
typedef ConsoleSettings = {
32-
sendProgramToConsole:Bool,
33-
consoleIP:String,
28+
isAPlugin:Bool,
3429
}
3530

3631
typedef JsonStruct = {
@@ -77,13 +72,13 @@ class JsonFile {
7772
hxMain: jsonContent.haxeConfig.hxMain,
7873
outDir: jsonContent.haxeConfig.outDir,
7974
debugMode: jsonContent.haxeConfig.debugMode,
80-
generateDoxDocs: jsonContent.haxeConfig.generateDoxDocs,
8175
othersOptions: jsonContent.haxeConfig.othersOptions,
8276
errorReportingStyle: jsonContent.haxeConfig.errorReportingStyle,
8377
},
8478
wiiuConfig: {
8579
projectName: jsonContent.wiiuConfig.projectName,
8680
consoleIP: jsonContent.wiiuConfig.consoleIP,
81+
isAPlugin: jsonContent.wiiuConfig.isAPlugin,
8782
},
8883
deleteTempFiles: jsonContent.deleteTempFiles,
8984
extraLibs: jsonContent.extraLibs,
@@ -115,13 +110,13 @@ class JsonFile {
115110
hxMain: "Main",
116111
outDir: "output",
117112
debugMode: false,
118-
generateDoxDocs: false,
119113
othersOptions: [],
120114
errorReportingStyle: "pretty",
121115
},
122116
wiiuConfig: {
123117
projectName: "project",
124118
consoleIP: "0.0.0.0",
119+
isAPlugin: false,
125120
},
126121
deleteTempFiles: true,
127122
extraLibs: [],

src/Main.hx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import src.utils.UDPListener;
77

88
class Main {
99
public static var hxcompileuString = "\x1b[38;5;214mHx\033[0mCompile\x1b[38;5;74mU\033[0m";
10-
public static var version:String = "1.3.6";
10+
public static var version:String = "1.4.0";
1111
static var stdin = Sys.stdin();
1212
static var stdout = Sys.stdout();
1313
static var args = Sys.args();
@@ -36,13 +36,13 @@ class Main {
3636
DevKitProUtils.searchProblem(args[1]);
3737
case "--udpServer":
3838
UDPListener.start();
39-
case "--sendRPX":
40-
DevKitProUtils.sendRPX();
39+
case "--send":
40+
DevKitProUtils.send();
4141
case "--version":
4242
// No need to print the version here, it's already printed at the start of the program
4343
return;
4444
case "--help":
45-
SlushiUtils.printMsg("Usage: hxCompileU [command]\nCommands:\n\t--prepare: Creates hxCompileUConfig.json\n\t--compile: Compiles the project (use \"--compile --onlyHaxe\" for compiling only the Haxe part)\n\t--searchProblem: search for a line of code in the [.elf] file from a line address of some log using DevKitPro's powerpc-eabi-addr2line program\n\t--udpServer: Starts the UDP server to view logs from the Wii U\n\t--sendRPX: Sends the .rpx file to the Wii U\n\t--version: Shows the version of the compiler\n\t--help: Shows this message",
45+
SlushiUtils.printMsg("Usage: hxCompileU [command]\nCommands:\n\t--prepare: Creates hxCompileUConfig.json\n\t--compile: Compiles the project (use \"--compile --onlyHaxe\" for compiling only the Haxe part, \"--compile --onlyCafe\" for compiling only the Wii U part)\n\t--searchProblem: search for a line of code in the [.elf] file from a line address of some log using DevKitPro's powerpc-eabi-addr2line program\n\t--udpServer: Starts the UDP server to view logs from the Wii U\n\t--send: Sends the .rpx or .wps file to the Wii U\n\t--version: Shows the version of the compiler\n\t--help: Shows this message",
4646
NONE);
4747
default:
4848
SlushiUtils.printMsg("Invalid argument: [" + args[0] + "], use --help for more information", NONE);

src/SlushiUtils.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ class SlushiUtils {
7979
}
8080

8181
public static function cleanBuild():Void {
82-
var outDir = getPathFromCurrentTerminal() + "/" + JsonFile.getJson().haxeConfig.outDir;
83-
var buildDir = getPathFromCurrentTerminal() + "/build";
82+
var outDir = getPathFromCurrentTerminal() + JsonFile.getJson().haxeConfig.outDir;
83+
var buildDir = getPathFromCurrentTerminal() + "build";
8484

8585
if (FileSystem.exists(outDir)) {
8686
try {

0 commit comments

Comments
 (0)