Skip to content

Commit 99385d8

Browse files
committed
Merge branch 'main' into pr/2866
2 parents 9b11378 + 085423f commit 99385d8

File tree

14 files changed

+357
-293
lines changed

14 files changed

+357
-293
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ jobs:
330330
# === Nintendo 3DS build ===
331331
nintendo-3ds:
332332
runs-on: ubuntu-latest
333-
container: devkitpro/devkitarm:20250102
333+
container: devkitpro/devkitarm:20250728
334334

335335
steps:
336336
- uses: actions/checkout@v4
@@ -345,7 +345,9 @@ jobs:
345345
346346
- name: Build
347347
run: |
348-
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=$DEVKITPRO/cmake/3DS.cmake -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_WITH_ALL=ON -DBUILD_WITH_SCHEME=OFF -DBUILD_WITH_JS=OFF -DBUILD_WITH_PYTHON=OFF ..
348+
cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=$DEVKITPRO/cmake/3DS.cmake \
349+
-DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_WITH_ALL=ON \
350+
-DBUILD_WITH_SCHEME=OFF -DBUILD_WITH_JS=OFF -DBUILD_WITH_PYTHON=OFF
349351
cmake --build build --parallel
350352
351353
- name: Deploy
@@ -383,9 +385,9 @@ jobs:
383385
name: "tic80-nintendo-switch"
384386
path: build/bin/tic80.nro
385387

386-
# === MacOS 13 ===
387-
macos:
388-
runs-on: macos-13
388+
# === MacOS 14 / arm64 ===
389+
macos-arm64:
390+
runs-on: macos-14
389391

390392
steps:
391393
- uses: actions/checkout@v4
@@ -405,7 +407,7 @@ jobs:
405407
- name: Deploy
406408
uses: actions/upload-artifact@v4
407409
with:
408-
name: "tic80-macos"
410+
name: "tic80-macos-arm64"
409411
path: |
410412
build/bin/tic80
411413
build/bin/*.dylib
@@ -416,9 +418,9 @@ jobs:
416418
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SDLGPU=On -DBUILD_PRO=On -DBUILD_WITH_ALL=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
417419
cmake --build . --parallel
418420
419-
# === MacOS 14 / arm64 ===
420-
macos-arm64:
421-
runs-on: macos-14
421+
# === MacOS 15 / x86_64 ===
422+
macos:
423+
runs-on: macos-15-intel
422424

423425
steps:
424426
- uses: actions/checkout@v4
@@ -438,15 +440,15 @@ jobs:
438440
- name: Deploy
439441
uses: actions/upload-artifact@v4
440442
with:
441-
name: "tic80-macos-arm64"
443+
name: "tic80-macos"
442444
path: |
443445
build/bin/tic80
444446
build/bin/*.dylib
445447
446448
- name: Build Pro
447449
run: |
448450
cd build
449-
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SDLGPU=On -DBUILD_PRO=On -DBUILD_WITH_ALL=ON ..
451+
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SDLGPU=On -DBUILD_PRO=On -DBUILD_WITH_ALL=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
450452
cmake --build . --parallel
451453
452454
# === Android ===

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,3 +191,6 @@ build/*.map
191191
# byte battle / test files
192192
/*.lua
193193
/*.tic
194+
# 3ds files
195+
*.3dsx
196+
*.smdh

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,11 @@ if(NINTENDO_3DS OR BAREMETALPI)
8989
set(BUILD_SDL OFF)
9090
endif()
9191

92-
if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ANDROID AND NOT NINTENDO_3DS)
92+
if (NINTENDO_3DS)
93+
set(PREFER_SYSTEM_LIBRARIES ON)
94+
endif()
95+
96+
if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ANDROID)
9397
set(LINUX TRUE)
9498

9599
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")

build/n3ds/Dockerfile

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

build/n3ds/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Requirements
44

5-
* devkitARM (tested on release 65, please use latest) + the 3ds-dev meta package
5+
* devkitARM + the 3ds-dev meta package
66
* the following additional packages:
77
* 3ds-libpng
88
* 3ds-zlib

cmake/moon.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ if(BUILD_WITH_MOON)
2020
add_library(lpeg STATIC ${LPEG_SRC})
2121
target_include_directories(lpeg PRIVATE ${LUA_DIR})
2222

23+
if(NINTENDO_3DS)
24+
target_compile_definitions(lpeg PUBLIC LUA_32BITS)
25+
endif()
26+
2327
add_library(moon ${TIC_RUNTIME} ${CMAKE_SOURCE_DIR}/src/api/moonscript.c)
2428

2529
if(NOT BUILD_STATIC)

cmake/n3ds.cmake

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,28 @@
33
################################
44

55
if(NINTENDO_3DS)
6-
set(TIC80_SRC ${TIC80_SRC}
6+
if(BUILD_EDITORS)
7+
target_sources(tic80studio PRIVATE
8+
src/system/n3ds/net.c)
9+
target_include_directories(tic80studio
10+
PRIVATE ${TIC80LIB_DIR}/studio)
11+
endif()
12+
13+
add_executable(${TIC80_TARGET} ${TIC80_SRC}
714
${CMAKE_SOURCE_DIR}/src/system/n3ds/utils.c
815
${CMAKE_SOURCE_DIR}/src/system/n3ds/keyboard.c
9-
${CMAKE_SOURCE_DIR}/src/system/n3ds/main.c
10-
)
11-
12-
add_executable(tic80 ${TIC80_SRC})
16+
${CMAKE_SOURCE_DIR}/src/system/n3ds/main.c)
1317

14-
target_include_directories(tic80 PRIVATE
15-
${DEVKITPRO}/portlibs/3ds/include
16-
${CMAKE_SOURCE_DIR}/include
17-
${CMAKE_SOURCE_DIR}/src)
18-
19-
target_link_directories(tic80 PRIVATE ${DEVKITPRO}/libctru/lib ${DEVKITPRO}/portlibs/3ds/lib)
20-
target_link_libraries(tic80 tic80studio png citro3d)
18+
target_link_libraries(${TIC80_TARGET} tic80studio png citro3d)
2119

2220
ctr_generate_smdh(tic80.smdh
2321
NAME "TIC-80 tiny computer"
2422
DESCRIPTION "Fantasy computer for making, playing and sharing tiny games"
25-
AUTHOR "Nesbox"
26-
ICON ${CMAKE_SOURCE_DIR}/build/n3ds/icon.png
27-
)
23+
AUTHOR "Nesbox, asie"
24+
ICON ${CMAKE_SOURCE_DIR}/build/n3ds/icon.png)
2825

29-
ctr_create_3dsx(tic80
26+
ctr_create_3dsx(${TIC80_TARGET}
3027
SMDH tic80.smdh
3128
ROMFS ${CMAKE_SOURCE_DIR}/build/n3ds/romfs
32-
OUTPUT ${CMAKE_SOURCE_DIR}/build/bin/tic80.3dsx
33-
)
34-
35-
endif()
29+
OUTPUT ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tic80.3dsx)
30+
endif()

cmake/wasm.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ if(BUILD_WITH_WASM)
4848

4949
add_library(wasm ${TIC_RUNTIME} ${WASM_SRC})
5050

51+
if(NINTENDO_3DS)
52+
# TODO: seems to be broken with gcc 15.1
53+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DM3_HAS_TAIL_CALL=0")
54+
endif()
55+
5156
if(NOT BUILD_STATIC)
5257
set_target_properties(wasm PROPERTIES PREFIX "")
5358
else()

cmake/yue.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ if(BUILD_WITH_YUE)
5454
)
5555

5656
if(NINTENDO_3DS)
57+
# TODO: check if this really works
5758
target_compile_options(yuescript PRIVATE -ftls-model=initial-exec)
5859
endif()
5960

cmake/zlib.cmake

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ if(PREFER_SYSTEM_LIBRARIES)
1414
endif()
1515
endif()
1616

17-
if (NOT NINTENDO_3DS)
18-
1917
set(ZLIB_DIR ${THIRDPARTY_DIR}/zlib)
2018
set(ZLIB_SRC
2119
${ZLIB_DIR}/adler32.c
@@ -33,11 +31,3 @@ set(ZLIB_SRC
3331

3432
add_library(zlib STATIC ${ZLIB_SRC})
3533
target_include_directories(zlib INTERFACE ${THIRDPARTY_DIR}/zlib)
36-
37-
else ()
38-
39-
add_library(zlib STATIC IMPORTED)
40-
set_target_properties( zlib PROPERTIES IMPORTED_LOCATION ${DEVKITPRO}/portlibs/3ds/lib/libz.a )
41-
target_include_directories(zlib INTERFACE ${DEVKITPRO}/portlibs/3ds/include)
42-
43-
endif ()

0 commit comments

Comments
 (0)