Skip to content

Commit 79cbc09

Browse files
authored
Merge branch 'main' into yuescript
2 parents ab64890 + 0876efa commit 79cbc09

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2950
-1342
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,9 @@ env:
77
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
88

99
jobs:
10-
# === Windows XP ===
11-
winxp:
12-
runs-on: windows-2019
13-
14-
steps:
15-
- uses: actions/checkout@v4
16-
with:
17-
submodules: recursive
18-
fetch-depth: 0
19-
20-
- uses: ruby/setup-ruby@v1
21-
with:
22-
ruby-version: 2.6
23-
24-
- name: Build
25-
shell: cmd
26-
run: |
27-
COPY /Y build\janet\janetconf.h vendor\janet\src\conf\janetconf.h
28-
cd build
29-
cmake -G "Visual Studio 16 2019" -A Win32 -T v141_xp -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_WITH_ALL=ON ..
30-
cmake --build . --config MinSizeRel --parallel
31-
32-
- name: Deploy
33-
uses: actions/upload-artifact@v4
34-
with:
35-
name: "tic80-winxp"
36-
path: |
37-
build/bin/tic80.exe
38-
build/bin/*.dll
39-
40-
- name: Build Pro
41-
shell: cmd
42-
run: |
43-
COPY /Y build\janet\janetconf.h vendor\janet\src\conf\janetconf.h
44-
cd build
45-
cmake -G "Visual Studio 16 2019" -A Win32 -T v141_xp -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_PRO=On -DBUILD_WITH_ALL=ON ..
46-
cmake --build . --config MinSizeRel --parallel
47-
4810
# === Windows ===
4911
windows:
50-
runs-on: windows-2019
12+
runs-on: windows-2022
5113

5214
steps:
5315
- uses: actions/checkout@v4
@@ -63,7 +25,7 @@ jobs:
6325
shell: cmd
6426
run: |
6527
cd build
66-
cmake -G "Visual Studio 16 2019" -DBUILD_SDLGPU=On -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_WITH_ALL=ON ..
28+
cmake -G "Visual Studio 17 2022" -DBUILD_SDLGPU=On -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_WITH_ALL=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
6729
cmake --build . --config MinSizeRel --parallel
6830
6931
- name: Deploy
@@ -78,7 +40,7 @@ jobs:
7840
shell: cmd
7941
run: |
8042
cd build
81-
cmake -G "Visual Studio 16 2019" -DBUILD_SDLGPU=On -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_PRO=On -DBUILD_WITH_ALL=ON ..
43+
cmake -G "Visual Studio 17 2022" -DBUILD_SDLGPU=On -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_PRO=On -DBUILD_WITH_ALL=ON ..
8244
cmake --build . --config MinSizeRel --parallel
8345
8446
# === Windows MinGW-64 ===
@@ -99,15 +61,15 @@ jobs:
9961
git
10062
gcc
10163
102-
- uses: ruby/setup-ruby@v1
103-
with:
104-
ruby-version: 2.6
105-
10664
- uses: actions/checkout@v4
10765
with:
10866
submodules: recursive
10967
fetch-depth: 0
11068

69+
- uses: ruby/setup-ruby@v1
70+
with:
71+
ruby-version: 2.6
72+
11173
- name: Build
11274
shell: bash
11375
run: |
@@ -156,9 +118,9 @@ jobs:
156118
cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SDLGPU=On -DBUILD_PRO=On -DBUILD_WITH_ALL=ON ..
157119
cmake --build . --config MinSizeRel --parallel
158120
159-
# === Ubuntu gcc14 ===
160-
linux-gcc14-glibc239:
161-
runs-on: ubuntu-24.04
121+
# === Ubuntu-arm64 ===
122+
linux-arm64-gcc12-glibc235:
123+
runs-on: ubuntu-22.04-arm
162124

163125
steps:
164126
- uses: actions/checkout@v4
@@ -172,11 +134,10 @@ jobs:
172134

173135
- name: Install
174136
run: |
175-
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
176-
sudo apt update
177-
sudo apt-get install gcc-14 g++-14 libxext-dev libglu1-mesa-dev libasound2-dev libpulse-dev libaudio-dev libsamplerate0-dev libcurl4-openssl-dev -y
178-
sudo ln -s -f /usr/bin/gcc-14 /usr/bin/gcc
179-
sudo ln -s -f /usr/bin/g++-14 /usr/bin/g++
137+
sudo apt-get update
138+
sudo apt-get install gcc-12 g++-12 libglu1-mesa-dev libasound2-dev libpulse-dev libaudio-dev libsamplerate0-dev libcurl4-openssl-dev -y
139+
sudo ln -s -f /usr/bin/gcc-12 /usr/bin/gcc
140+
sudo ln -s -f /usr/bin/g++-12 /usr/bin/g++
180141
181142
- name: Build
182143
run: |
@@ -187,7 +148,7 @@ jobs:
187148
- name: Deploy
188149
uses: actions/upload-artifact@v4
189150
with:
190-
name: "tic80-linux-gcc14"
151+
name: "tic80-linux-arm64-gcc12"
191152
path: |
192153
build/bin/tic80
193154
build/bin/*.so
@@ -198,40 +159,46 @@ jobs:
198159
cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SDLGPU=On -DBUILD_PRO=On -DBUILD_WITH_ALL=ON ..
199160
cmake --build . --config MinSizeRel --parallel
200161
201-
# === Raspberry PI ===
202-
rpi:
203-
runs-on: ubuntu-latest
204-
container: nesbox/rpi-tic80:latest
162+
# === Ubuntu gcc14 ===
163+
linux-gcc14-glibc239:
164+
runs-on: ubuntu-24.04
205165

206166
steps:
207-
- uses: actions/checkout@v3
167+
- uses: actions/checkout@v4
208168
with:
209169
submodules: recursive
210170
fetch-depth: 0
211171

212-
- name: Install Host toolchain
213-
run: |
214-
apt-get update
215-
apt-get install --assume-yes build-essential ruby-full gcc-8-arm-linux-gnueabihf g++-8-arm-linux-gnueabihf
172+
- uses: ruby/setup-ruby@v1
173+
with:
174+
ruby-version: 2.6
216175

176+
- name: Install
177+
run: |
178+
sudo add-apt-repository ppa:ubuntu-toolchain-r/ppa
179+
sudo apt update
180+
sudo apt-get install gcc-14 g++-14 libxext-dev libglu1-mesa-dev libasound2-dev libpulse-dev libaudio-dev libsamplerate0-dev libcurl4-openssl-dev -y
181+
sudo ln -s -f /usr/bin/gcc-14 /usr/bin/gcc
182+
sudo ln -s -f /usr/bin/g++-14 /usr/bin/g++
183+
217184
- name: Build
218185
run: |
219186
cd build
220-
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON -DCMAKE_TOOLCHAIN_FILE=rpi/toolchain.cmake -DBUILD_WITH_ALL=ON ..
187+
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SDLGPU=On -DBUILD_STATIC=ON -DBUILD_WITH_ALL=ON ..
221188
cmake --build . --parallel
222189
223190
- name: Deploy
224-
uses: actions/upload-artifact@v3
191+
uses: actions/upload-artifact@v4
225192
with:
226-
name: "tic80-rpi"
193+
name: "tic80-linux-gcc14"
227194
path: |
228195
build/bin/tic80
229196
build/bin/*.so
230197
231198
- name: Build Pro
232199
run: |
233200
cd build
234-
cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_PRO=On -DCMAKE_TOOLCHAIN_FILE=rpi/toolchain.cmake ..
201+
cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SDLGPU=On -DBUILD_PRO=On -DBUILD_WITH_ALL=ON ..
235202
cmake --build . --config MinSizeRel --parallel
236203
237204
# === Raspberry PI 1-4 Bare Metal ===
@@ -363,7 +330,7 @@ jobs:
363330
# === Nintendo 3DS build ===
364331
nintendo-3ds:
365332
runs-on: ubuntu-latest
366-
container: devkitpro/devkitarm:latest
333+
container: devkitpro/devkitarm:20250102
367334

368335
steps:
369336
- uses: actions/checkout@v4
@@ -403,7 +370,7 @@ jobs:
403370
- name: Build
404371
run: |
405372
cd build
406-
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON -DBUILD_SDLGPU=On -DBUILD_WITH_ALL=ON ..
373+
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON -DBUILD_SDLGPU=On -DBUILD_WITH_ALL=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
407374
cmake --build . --parallel
408375
409376
- name: Deploy
@@ -417,7 +384,7 @@ jobs:
417384
- name: Build Pro
418385
run: |
419386
cd build
420-
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SDLGPU=On -DBUILD_PRO=On -DBUILD_WITH_ALL=ON ..
387+
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SDLGPU=On -DBUILD_PRO=On -DBUILD_WITH_ALL=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
421388
cmake --build . --parallel
422389
423390
# === MacOS 14 / arm64 ===
@@ -436,7 +403,7 @@ jobs:
436403
- name: Build
437404
run: |
438405
cd build
439-
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON -DBUILD_SDLGPU=On -DBUILD_WITH_ALL=ON ..
406+
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC=ON -DBUILD_SDLGPU=On -DBUILD_WITH_ALL=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
440407
cmake --build . --parallel
441408
442409
- name: Deploy
@@ -466,14 +433,14 @@ jobs:
466433
- uses: nttld/setup-ndk@v1
467434
id: setup-ndk
468435
with:
469-
ndk-version: r21e
436+
ndk-version: r23
470437
add-to-path: false
471438
local-cache: true
472439

473-
- name: set up JDK 11
440+
- name: set up JDK 17
474441
uses: actions/setup-java@v4
475442
with:
476-
java-version: '11'
443+
java-version: '17'
477444
distribution: 'temurin'
478445
cache: gradle
479446

.gitmodules

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
path = vendor/giflib
1111
url = https://github.com/nesbox/giflib.git
1212
shallow = true
13-
[submodule "vendor/lpeg"]
14-
path = vendor/lpeg
15-
url = https://github.com/nesbox/lpeg.git
16-
shallow = true
1713
[submodule "vendor/lua"]
1814
path = vendor/lua
1915
url = https://github.com/lua/lua.git
@@ -70,10 +66,6 @@
7066
path = vendor/naett
7167
url = https://github.com/erkkah/naett.git
7268
shallow = true
73-
[submodule "vendor/msf_gif"]
74-
path = vendor/msf_gif
75-
url = https://github.com/notnullnotvoid/msf_gif.git
76-
shallow = true
7769
[submodule "vendor/dlfcn"]
7870
path = vendor/dlfcn
7971
url = https://github.com/dlfcn-win32/dlfcn-win32.git
@@ -88,9 +80,12 @@
8880
branch = master
8981
[submodule "vendor/pocketpy"]
9082
path = vendor/pocketpy
91-
url = https://github.com/PrimedErwin/pocketpy.git
83+
url = https://github.com/pocketpy/pocketpy.git
9284
shallow = true
9385
[submodule "vendor/yuescript"]
9486
path = vendor/yuescript
9587
url = https://github.com/IppClub/YueScript.git
96-
shallow = true
88+
shallow = true
89+
[submodule "vendor/lpeg"]
90+
path = vendor/lpeg
91+
url = https://github.com/roberto-ieru/LPeg.git

CMakeLists.txt

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
cmake_minimum_required(VERSION 3.3)
1+
cmake_minimum_required(VERSION 3.10)
22

33
include(cmake/version.cmake)
44

55
project(TIC-80 VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REVISION} LANGUAGES C CXX)
66

77
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
8-
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -flto -ffat-lto-objects")
9-
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -flto -ffat-lto-objects")
8+
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -flto -ffat-lto-objects")
9+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -flto -ffat-lto-objects")
1010
endif()
1111

1212
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
13-
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -flto")
14-
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -flto")
13+
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2 -flto")
14+
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -flto")
1515
endif()
1616

1717
if(APPLE)
@@ -49,6 +49,8 @@ option(BUILD_NO_OPTIMIZATION "Build without optimizations for debugging" OFF)
4949
option(BUILD_ASAN_DEBUG "Build with AddressSanitizer" OFF)
5050
option(BUILD_WITH_ZLIB "Build with zlib linked" ON)
5151
option(TIC80_TARGET "Target binary suffix")
52+
option(PREFER_SYSTEM_LIBRARIES "Prefer link with system libraries" OFF)
53+
5254

5355
if(NOT TIC80_TARGET)
5456
set(TIC80_TARGET tic80)
@@ -69,6 +71,7 @@ endif()
6971

7072
target_compile_definitions(runtime INTERFACE BUILD_DEPRECATED)
7173

74+
message("PREFER_SYSTEM_LIBRARIES: ${PREFER_SYSTEM_LIBRARIES}")
7275
message("BUILD_STATIC: ${BUILD_STATIC}")
7376
message("BUILD_SDLGPU: ${BUILD_SDLGPU}")
7477
message("BUILD_TOUCH_INPUT: ${BUILD_TOUCH_INPUT}")
@@ -149,6 +152,7 @@ include(cmake/gif.cmake)
149152
include(cmake/blipbuf.cmake)
150153
include(cmake/zlib.cmake)
151154
include(cmake/zip.cmake)
155+
include(cmake/png.cmake)
152156
include(cmake/tools.cmake)
153157

154158
include(cmake/lua.cmake)
@@ -168,7 +172,6 @@ include(cmake/core.cmake)
168172
include(cmake/wave.cmake)
169173
include(cmake/argparse.cmake)
170174
include(cmake/naett.cmake)
171-
include(cmake/png.cmake)
172175
include(cmake/studio.cmake)
173176

174177
include(cmake/sdl.cmake)

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- [Features](#features)
88
- [Binary Downloads](#binary-downloads)
99
- [Nightly builds](#nightly-builds)
10-
- [Unofficial Linux/arm64 nightly builds](#unofficial-linuxarm64-nightly-builds)
10+
- [Unofficial Linux/arm64 nightly builds](#unofficial-builds)
1111
- [Pro Version](#pro-version)
1212
- [Pro Features](#pro-features)
1313
- [Community](#community)
@@ -36,6 +36,7 @@
3636
- [FreeBSD](#freebsd)
3737
- [Install Instructions](#install-instructions)
3838
- [Linux](#linux-1)
39+
- [Android](#android)
3940
- [iOS / tvOS](#ios--tvos)
4041
- [Credits](#credits)
4142

@@ -224,7 +225,7 @@ Run the following commands from a terminal:
224225
```
225226
sudo apt update && sudo apt -y install build-essential cmake git libpipewire-0.3-dev libwayland-dev libsdl2-dev ruby-dev libcurl4-openssl-dev libglvnd-dev libglu1-mesa-dev freeglut3-dev
226227
git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
227-
cmake -DBUILD_SDLGPU=On -DBUILD_WITH_ALL=On .. && cmake --build . --parallel
228+
cmake -DBUILD_SDLGPU=On -DBUILD_WITH_ALL=On -DBUILD_STATIC=On .. && cmake --build . --parallel
228229
```
229230

230231
Install with [Install Instructions](#install-instructions)
@@ -336,20 +337,20 @@ run the following commands in the Terminal
336337
```
337338
brew install git cmake
338339
git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
339-
cmake -DBUILD_WITH_ALL=On ..
340+
cmake -DBUILD_WITH_ALL=On -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
340341
make -j4
341342
```
342343

343344
to create application icon for development version
344345
```
345-
mkdir -p ~/Applications/TIC80dev.app/Contents/{MacOS,Resources}
346-
cp -f macosx/tic80.plist ~/Applications/TIC80dev.app/Contents/Info.plist
347-
cp -f macosx/tic80.icns ~/Applications/TIC80dev.app/Contents/Resources
348-
cat > ~/Applications/TIC80dev.app/Contents/MacOS/tic80 <<EOF
346+
mkdir -p ~/Applications/tic80dev.app/Contents/{MacOS,Resources}
347+
cp -f macosx/tic80.plist ~/Applications/tic80dev.app/Contents/Info.plist
348+
cp -f macosx/tic80.icns ~/Applications/tic80dev.app/Contents/Resources
349+
cat > ~/Applications/tic80dev.app/Contents/MacOS/tic80 <<EOF
349350
#!/bin/sh
350-
exec /Users/nesbox/projects/TIC-80/build/bin/tic80 --skip --scale 2 >/dev/null
351+
exec /Users/nesbox/projects/TIC-80/build/bin/tic80 --skip >/dev/null
351352
EOF
352-
chmod +x ~/Applications/TIC80dev.app/Contents/MacOS/TIC80dev
353+
chmod +x ~/Applications/tic80dev.app/Contents/MacOS/tic80
353354
```
354355
Make sure to update the absolute path to the tic80 binary in the script, or
355356
update the launch arguments.
@@ -383,6 +384,10 @@ You can find iOS/tvOS version here
383384
- 0.60.3: https://github.com/brunophilipe/TIC-80
384385
- 0.45.0: https://github.com/CliffsDover/TIC-80
385386

387+
## Android
388+
You can find the compiled version ready download and install [on F-Droid](https://f-droid.org/packages/com.nesbox.tic/):
389+
[<img alt="Get it on F-Droid" src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png" width="256">](https://f-droid.org/packages/com.nesbox.tic/)
390+
386391
## Credits
387392
* Filippo Rivato — [Twitter @HomineLudens](https://twitter.com/HomineLudens)
388393
* Fred Bednarski — [Twitter @FredBednarski](https://twitter.com/FredBednarski)

0 commit comments

Comments
 (0)