Skip to content

Commit cd9a008

Browse files
Nintendo Switch Support (?)
1 parent 3bd5fde commit cd9a008

File tree

15 files changed

+223
-343
lines changed

15 files changed

+223
-343
lines changed

.github/workflows/builds.yaml

Lines changed: 59 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,90 +15,129 @@ jobs:
1515
include:
1616
- platform: Windows
1717
os: windows-latest
18+
haxe_setup:
1819
build_cmd: haxelib run lime build windows
19-
setup_libs: ./install-haxelibs.bat
2020
extra_libs:
2121
pre_build_commands:
22-
post_build_commands:
2322
artifact_path: export/release/windows/bin
2423

2524
- platform: Windows x32
2625
os: windows-latest
26+
haxe_setup:
2727
build_cmd: haxelib run lime build windows -32 -D 32bits -D HXCPP_M32
28-
setup_libs: ./install-haxelibs.bat
2928
extra_libs:
3029
pre_build_commands:
31-
post_build_commands:
3230
artifact_path: export/32bit/windows/bin
3331

32+
- platform: Nintendo Switch
33+
os: ubuntu-latest
34+
haxe_setup: |
35+
apt-get update
36+
apt-get install -y wget git neko libgc-dev
37+
38+
wget https://github.com/HaxeFoundation/haxe/releases/download/4.3.4/haxe-4.3.4-linux64.tar.gz
39+
mkdir haxe_temp
40+
tar -xf haxe-4.3.4-linux64.tar.gz -C haxe_temp
41+
cp -r haxe_temp/haxe_*/* /usr/local/bin/
42+
43+
mkdir -p ~/haxelib
44+
haxelib --always --quiet setup ~/haxelib
45+
haxelib --global --always --quiet update haxelib
46+
build_cmd: haxelib run lime build Project.xml switch --app-version="4.0.0-${{ github.run_id}}" -D officialBuild
47+
extra_libs: |
48+
dkp-pacman -Sy --noconfirm
49+
50+
dkp-pacman -S --needed --noconfirm \
51+
52+
switch-bzip2 switch-cmake switch-curl switch-flac \
53+
switch-freetype switch-glad switch-glm switch-harfbuzz \
54+
switch-libdrm_nouveau switch-libjpeg-turbo switch-libmodplug \
55+
switch-libogg switch-libopus switch-libpng switch-libvorbis \
56+
switch-libvorbisidec switch-libwebp switch-mesa switch-mpg123 \
57+
switch-openal-soft switch-opusfile switch-pkg-config switch-sdl2 \
58+
switch-sdl2_gfx switch-sdl2_image switch-sdl2_mixer \
59+
switch-sdl2_net switch-sdl2_ttf switch-tools switch-zlib \
60+
switch-liblua51
61+
62+
haxelib --always --quiet install format
63+
haxelib --always --quiet install hxp
64+
haxelib --always --quiet git lime https://github.com/Slushi-Github/lime-nx.git
65+
haxelib --always --quiet git hxcpp https://github.com/Slushi-Github/hxcpp-nx.git
66+
haxelib --always --quiet git hx_libnx https://github.com/Slushi-Github/hx_libnx.git
67+
pre_build_commands: |
68+
cd ~/haxelib/hxcpp/git/tools/hxcpp
69+
haxe compile.hxml
70+
cd -
71+
72+
haxelib run lime rebuild switch
73+
artifact_path: export/release/switch/bin/*.nro
74+
3475
- platform: Linux
3576
os: ubuntu-22.04
77+
haxe_setup:
3678
build_cmd: haxelib run lime build linux
37-
setup_libs: sh ./install-haxelibs.sh
3879
extra_libs: |
3980
sudo apt-get update
4081
sudo apt-get install -y libvlc-dev libvlccore-dev dpkg-dev file desktop-file-utils gtk-update-icon-cache
4182
pre_build_commands:
42-
post_build_commands:
4383
artifact_path: export/release/linux/bin
4484

4585
- platform: Android
4686
os: ubuntu-latest
87+
haxe_setup:
4788
build_cmd: haxelib run lime build android
48-
setup_libs: sh ./install-haxelibs.sh
4989
extra_libs:
5090
pre_build_commands: |
5191
haxelib run lime config ANDROID_SDK $ANDROID_HOME
5292
haxelib run lime config ANDROID_NDK_ROOT $ANDROID_NDK_LATEST_HOME
5393
haxelib run lime config JAVA_HOME $JAVA_HOME_17_X64
5494
haxelib run lime config ANDROID_SETUP true
55-
post_build_commands:
5695
artifact_path: export/release/android/bin/app/build/outputs/apk/release/*.apk
5796

5897
- platform: MacOS
5998
os: macos-15
99+
haxe_setup:
60100
build_cmd: haxelib run lime build macos --app-version="4.0.0-${{ github.run_id}}"
61-
setup_libs: sh ./install-haxelibs.sh
62101
pre_build_commands:
63-
post_build_commands:
64102
artifact_path: export/release/macos/bin
65103

66104
- platform: MacOS x64
67105
os: macos-15-intel
106+
haxe_setup:
68107
build_cmd: haxelib run lime build macos --app-version="4.0.0-${{ github.run_id}}"
69-
setup_libs: sh ./install-haxelibs.sh
70108
pre_build_commands:
71-
post_build_commands:
72109
artifact_path: export/release/macos/bin
73110

74111
steps:
75112
- name: Pull the New Commit
76113
uses: actions/checkout@v4.1.7
77114

78115
- name: Setup Haxe
116+
if: ${{ !matrix.haxe_setup }}
79117
uses: krdlab/setup-haxe@master
80118
with:
81119
haxe-version: 4.3.7
82120

121+
- name: Custom Haxe Setup
122+
if: ${{ matrix.haxe_setup }}
123+
run: ${{ matrix.haxe_setup }}
124+
125+
- name: Install Main Libraries
126+
run: |
127+
haxelib --global git hmm https://github.com/ALE-Psych-Crew/hmm
128+
haxelib --global run hmm setup
129+
83130
- name: Install Extra Libraries
84131
if: ${{ matrix.extra_libs }}
85132
run: ${{ matrix.extra_libs }}
86133

87-
- name: Install Main Libraries
88-
run: ${{ matrix.setup_libs }}
89-
90134
- name: Pre-Build Commands
91135
if: ${{ matrix.pre_build_commands }}
92136
run: ${{ matrix.pre_build_commands }}
93137

94138
- name: Build for ${{ matrix.platform }}
95139
run: ${{ matrix.build_cmd }}
96140

97-
- name: Post-Build Commands
98-
if: ${{ matrix.post_build_commands }}
99-
shell: bash
100-
run: ${{ matrix.post_build_commands }}
101-
102141
- name: Upload Game
103142
uses: actions/upload-artifact@v4
104143
with:

Project.xml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626

2727
<define name="WINDOWS_API" if="windows cpp"/>
2828

29-
<define name="MOBILE_API" if="android || ios"/>
29+
<define name="MOBILE_API" if="mobile"/>
30+
31+
<define name="TOUCH_CONTROLS" if="mobile || switch"/>
3032

3133
<!-- ____________________________ Window Settings ___________________________ -->
3234

@@ -46,7 +48,7 @@
4648

4749
<assets path="assets"/>
4850

49-
<assets path="mods" embed="false" unless="mobile"/>
51+
<assets path="mods" embed="false"/>
5052

5153
<!-- _______________________________ Libraries ______________________________ -->
5254

@@ -63,8 +65,6 @@
6365
<haxelib name="flixel-animate"/>
6466

6567
<haxelib name="flxsoundfilters"/>
66-
<haxelib name="funkin.vis"/>
67-
<haxelib name="grig.audio"/>
6868

6969
<haxelib name="hxvlc" if="VIDEOS_ALLOWED"/>
7070

@@ -121,6 +121,8 @@
121121

122122
<haxedef name="DISABLED_MACRO_SUPERLATIVE" if="android"/>
123123

124+
<haxedef name="NO_PRECOMPILED_HEADERS" if="switch"/>
125+
124126
<haxedef name="hscriptPos"/>
125127

126128
<!-- ______________________________ Application Icon ______________________________ -->
@@ -137,6 +139,23 @@
137139
<assets path="alsoft.txt" rename="plugins/alsoft.conf" type="text" unless="windows"/>
138140
</section>
139141

142+
<!-- ______________________________ Switch Config ______________________________ -->
143+
144+
<section if="switch">
145+
<haxedef name="lime-opengl" if="switch" />
146+
<haxedef name="lime-cairo" value="false" if="switch" />
147+
148+
<set name="LIME_CAIRO" value="0" if="switch" />
149+
<set name="LIME_OPENGL" value="1" if="switch" />
150+
151+
<config:switch libs="lua5.1" if="switch LUA_ALLOWED"/>
152+
153+
<haxelib name="hx_libnx"/>
154+
155+
<!-- CHANGE THIS TO YOUR SWITCH IP -->
156+
<config:switch ip="192.168.1.140"/>
157+
</section>
158+
140159
<!-- ______________________________ Android Configs _____________________________ -->
141160

142161
<config type="android" gradle-version="8.10.2" gradle-plugin="8.8.0" ndkVersion="27.0" minimum-sdk-version="26" target-sdk-version="35"/>

assets/data/credits.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"name": "Slushi",
4848
"icon": "slushi",
4949
"link": "https://github.com/Slushi-Github",
50-
"description": "Helped compile on MacOS (ARM64)\nSlushi Windows API Creator",
50+
"description": "Helped compile on Nintendo Switch\nSlushi Windows API Creator",
5151
"color": "285C58"
5252
},
5353
{
5.36 KB
Loading

hmm.json

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
{
2+
"dependencies": [
3+
{
4+
"name": "jsonmod",
5+
"type": "haxelib",
6+
"version": "1.2.0"
7+
},
8+
{
9+
"name": "hxcpp",
10+
"type": "git",
11+
"url": "https://github.com/AlejoGDOfficial/MobilePorting-hxcpp"
12+
},
13+
{
14+
"name": "lime",
15+
"type": "haxelib",
16+
"version": "8.3.0"
17+
},
18+
{
19+
"name": "openfl",
20+
"type": "haxelib",
21+
"version": "9.5.0"
22+
},
23+
{
24+
"name": "flixel",
25+
"type": "haxelib",
26+
"version": "6.1.2"
27+
},
28+
{
29+
"name": "flixel-addons",
30+
"type": "haxelib",
31+
"version": "3.3.2"
32+
},
33+
{
34+
"name": "flixel-ui",
35+
"type": "haxelib",
36+
"version": "2.6.4"
37+
},
38+
{
39+
"name": "flixel-tools",
40+
"type": "haxelib",
41+
"version": "1.5.1"
42+
},
43+
{
44+
"name": "flixel-animate",
45+
"type": "git",
46+
"url": "https://github.com/MaybeMaru/flixel-animate",
47+
"ref": "ad424c76cb76cfda5622cce47837a4698e1a284c"
48+
},
49+
{
50+
"name": "flxsoundfilters",
51+
"type": "git",
52+
"url": "https://github.com/TheZoroForce240/FlxSoundFilters",
53+
"ref": "a89bb537684111a6ff85737981f4b2d8ef4b4f68"
54+
},
55+
{
56+
"name": "flixel-away3d",
57+
"type": "git",
58+
"url": "https://github.com/ALE-Psych-Crew/Flixel-Away-3D"
59+
},
60+
{
61+
"name": "away3d",
62+
"type": "git",
63+
"url": "https://github.com/ALE-Psych-Crew/away3d"
64+
},
65+
{
66+
"name": "ale-ui",
67+
"type": "haxelib",
68+
"version": "1.0.4"
69+
},
70+
{
71+
"name": "hxvlc",
72+
"type": "haxelib",
73+
"version": "2.2.5"
74+
},
75+
{
76+
"name": "hscript",
77+
"type": "git",
78+
"url": "https://github.com/HaxeFoundation/hscript",
79+
"ref": "0c7f99dbacd5382d9266cf8dfa6192ef80e58ea4"
80+
},
81+
{
82+
"name": "rulescript",
83+
"type": "git",
84+
"url": "https://github.com/Kriptel/RuleScript",
85+
"ref": "221050fbc10819fd22a3528e8cbc36ccc7c61b1d"
86+
},
87+
{
88+
"name": "hxluajit",
89+
"type": "haxelib",
90+
"version": "1.0.5"
91+
},
92+
{
93+
"name": "hxluajit-wrapper",
94+
"type": "haxelib",
95+
"version": "1.0.0"
96+
},
97+
{
98+
"name": "hxdiscord_rpc",
99+
"type": "haxelib",
100+
"version": "1.3.0"
101+
},
102+
{
103+
"name": "extension-androidtools",
104+
"type": "haxelib",
105+
"version": "2.2.2"
106+
},
107+
{
108+
"name": "extension-orientation",
109+
"type": "git",
110+
"url": "https://github.com/ALE-Psych-Crew/extension-orientation"
111+
},
112+
{
113+
"name": "sl-windows-api",
114+
"type": "haxelib",
115+
"version": "1.2.0"
116+
}
117+
]
118+
}

install-haxelibs.bat

Lines changed: 0 additions & 5 deletions
This file was deleted.

install-haxelibs.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)