this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update 3ds docker toolchain (#2701)

* update 3ds docker

* try to fix 3ds lua error

* revert and try to fix wren error

* disable lua and scheme for 3ds

* try to fix lua

* try to fix lua

* try to fix lua

* test

* revert

* try to fix lua

* test

* test

* continue

* possible last lua fix

* disable javascript in 3ds

* disable js correctly

* disable python for 3ds

* try to fix script.c

* try to fix another error

* test

* try to fix miniaudio

* test

* test

* test

* test

* test

* test

* try to fix gif errors

* test

* test

* test

* continue

* try with official devkitarm docker image

* test

* clean

* proper miniaudio fix

* mianiaudio version used before

* use cmake to build 3dsx

* use explicit name

* fix 3ds build instructions

* use NINTENDO_3DS from devkitPro cmakery

* fixup build commands

* output to build/bin

* update tested version

---------

Co-authored-by: Dave Murphy <davem@devkitpro.org>

authored by

Miguel
Dave Murphy
and committed by
GitHub
ce24e763 e30b2731

+54 -54
+5 -6
.github/workflows/build.yml
··· 319 319 # === Nintendo 3DS build === 320 320 nintendo-3ds: 321 321 runs-on: ubuntu-latest 322 - container: nesbox/devkitpro-tic80:latest 322 + container: devkitpro/devkitarm:latest 323 323 324 324 steps: 325 - - uses: actions/checkout@v3 325 + - uses: actions/checkout@v4 326 326 with: 327 327 submodules: recursive 328 328 fetch-depth: 0 ··· 334 334 335 335 - name: Build 336 336 run: | 337 - cd build 338 - cmake -DCMAKE_TOOLCHAIN_FILE=$DEVKITPRO/3ds.cmake -DN3DS=TRUE -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_WITH_ALL=ON .. 339 - make -j$(nproc) 337 + 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 .. 338 + cmake --build build --parallel 340 339 341 340 - name: Deploy 342 - uses: actions/upload-artifact@v3 341 + uses: actions/upload-artifact@v4 343 342 with: 344 343 name: "tic80-nintendo-3ds" 345 344 path: build/bin/tic80.3dsx
+3 -3
CMakeLists.txt
··· 14 14 15 15 configure_file("${PROJECT_SOURCE_DIR}/version.h.in" "${CMAKE_CURRENT_BINARY_DIR}/version.h") 16 16 17 - if(ANDROID OR EMSCRIPTEN OR N3DS OR BAREMETALPI) 17 + if(ANDROID OR EMSCRIPTEN OR NINTENDO_3DS OR BAREMETALPI) 18 18 set(BUILD_STATIC_DEFAULT ON) 19 19 else() 20 20 set(BUILD_STATIC_DEFAULT OFF) ··· 64 64 message("BUILD_TOUCH_INPUT: ${BUILD_TOUCH_INPUT}") 65 65 message("BUILD_WITH_ALL: ${BUILD_WITH_ALL}") 66 66 67 - if (N3DS) 67 + if (NINTENDO_3DS) 68 68 set(BUILD_SDL OFF) 69 69 endif() 70 70 ··· 72 72 set(BUILD_SDL OFF) 73 73 endif() 74 74 75 - if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ANDROID AND NOT N3DS) 75 + if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ANDROID AND NOT NINTENDO_3DS) 76 76 set(LINUX TRUE) 77 77 78 78 if(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD")
+3 -6
build/n3ds/README.md
··· 2 2 3 3 ## Requirements 4 4 5 - * devkitARM (tested on release 54, please use latest) + the 3ds-dev meta package 5 + * devkitARM (tested on release 65, please use latest) + the 3ds-dev meta package 6 6 * the following additional packages: 7 - * devkitpro-pkgbuild-helpers 8 7 * 3ds-libpng 9 - * 3ds-pkg-config 10 8 * 3ds-zlib 11 9 12 10 ## Building instructions 13 11 14 12 ``` 15 - cd build 16 - cmake .. -DCMAKE_TOOLCHAIN_FILE=$DEVKITPRO/3ds.cmake -DN3DS=TRUE 17 - make 13 + cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=$DEVKITPRO/cmake/3DS.cmake 14 + cmake --build build 18 15 ``` 19 16 20 17 You should now be able to find `tic80.3dsx` in build/bin.
-5
build/n3ds/elf_to_3dsx.sh
··· 1 - #!/bin/sh 2 - echo "[3DSX] Building metadata" 3 - ${DEVKITPRO}/tools/bin/smdhtool --create "TIC-80 tiny computer" "Fantasy computer for making, playing and sharing tiny games" "Nesbox" "n3ds/icon.png" tic80.smdh 4 - echo "[3DSX] Building binary" 5 - ${DEVKITPRO}/tools/bin/3dsxtool bin/tic80_n3ds bin/tic80.3dsx --smdh=tic80.smdh --romfs=n3ds/romfs/
+1 -1
cmake/lua.cmake
··· 77 77 ${CMAKE_SOURCE_DIR}/src 78 78 ) 79 79 80 - if(N3DS) 80 + if(NINTENDO_3DS) 81 81 target_compile_definitions(luaapi PUBLIC LUA_32BITS) 82 82 endif() 83 83
+17 -9
cmake/n3ds.cmake
··· 2 2 # TIC-80 app (N3DS) 3 3 ################################ 4 4 5 - if(N3DS) 5 + if(NINTENDO_3DS) 6 6 set(TIC80_SRC ${TIC80_SRC} 7 7 ${CMAKE_SOURCE_DIR}/src/system/n3ds/utils.c 8 8 ${CMAKE_SOURCE_DIR}/src/system/n3ds/keyboard.c 9 9 ${CMAKE_SOURCE_DIR}/src/system/n3ds/main.c 10 10 ) 11 11 12 - add_executable(tic80_n3ds ${TIC80_SRC}) 12 + add_executable(tic80 ${TIC80_SRC}) 13 13 14 - target_include_directories(tic80_n3ds PRIVATE 14 + target_include_directories(tic80 PRIVATE 15 15 ${DEVKITPRO}/portlibs/3ds/include 16 16 ${CMAKE_SOURCE_DIR}/include 17 17 ${CMAKE_SOURCE_DIR}/src) 18 18 19 - target_link_directories(tic80_n3ds PRIVATE ${DEVKITPRO}/libctru/lib ${DEVKITPRO}/portlibs/3ds/lib) 20 - target_link_libraries(tic80_n3ds tic80studio png citro3d) 19 + target_link_directories(tic80 PRIVATE ${DEVKITPRO}/libctru/lib ${DEVKITPRO}/portlibs/3ds/lib) 20 + target_link_libraries(tic80 tic80studio png citro3d) 21 21 22 - add_custom_command(TARGET tic80_n3ds 23 - POST_BUILD 24 - COMMAND ${CMAKE_SOURCE_DIR}/build/n3ds/elf_to_3dsx.sh 25 - WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/build 22 + ctr_generate_smdh(tic80.smdh 23 + NAME "TIC-80 tiny computer" 24 + DESCRIPTION "Fantasy computer for making, playing and sharing tiny games" 25 + AUTHOR "Nesbox" 26 + ICON ${CMAKE_SOURCE_DIR}/build/n3ds/icon.png 27 + ) 28 + 29 + ctr_create_3dsx(tic80 30 + SMDH tic80.smdh 31 + ROMFS ${CMAKE_SOURCE_DIR}/build/n3ds/romfs 32 + OUTPUT ${CMAKE_SOURCE_DIR}/build/bin/tic80.3dsx 26 33 ) 34 + 27 35 endif()
+1 -1
cmake/naett.cmake
··· 2 2 # naett 3 3 ################################ 4 4 5 - if(NOT RPI AND NOT N3DS AND NOT EMSCRIPTEN AND NOT BAREMETALPI) 5 + if(NOT RPI AND NOT NINTENDO_3DS AND NOT EMSCRIPTEN AND NOT BAREMETALPI) 6 6 set(USE_NAETT TRUE) 7 7 endif() 8 8
+1 -1
cmake/quickjs.cmake
··· 25 25 target_compile_definitions(quickjs PRIVATE DUMP_LEAKS) 26 26 endif() 27 27 28 - if(BAREMETALPI OR N3DS) 28 + if(BAREMETALPI OR NINTENDO_3DS) 29 29 target_compile_definitions(quickjs PRIVATE POOR_CLIB) 30 30 endif() 31 31
+1 -1
cmake/scheme.cmake
··· 30 30 ${CMAKE_SOURCE_DIR}/src 31 31 ) 32 32 33 - if (N3DS) 33 + if (NINTENDO_3DS) 34 34 target_compile_definitions(scheme PRIVATE S7_N3DS) 35 35 endif() 36 36
+1 -1
cmake/zlib.cmake
··· 2 2 # ZLIB 3 3 ################################ 4 4 5 - if (NOT N3DS) 5 + if (NOT NINTENDO_3DS) 6 6 7 7 set(ZLIB_DIR ${THIRDPARTY_DIR}/zlib) 8 8 set(ZLIB_SRC
+5 -5
src/api/luaapi.c
··· 1595 1595 return 0; 1596 1596 } 1597 1597 1598 - static s32 lua_dofile(lua_State *lua) 1598 + static int lua_dofile(lua_State *lua) 1599 1599 { 1600 1600 luaL_error(lua, "unknown method: \"dofile\"\n"); 1601 1601 1602 1602 return 0; 1603 1603 } 1604 1604 1605 - static s32 lua_loadfile(lua_State *lua) 1605 + static int lua_loadfile(lua_State *lua) 1606 1606 { 1607 1607 luaL_error(lua, "unknown method: \"loadfile\"\n"); 1608 1608 ··· 1634 1634 { 1635 1635 static const struct{lua_CFunction func; const char* name;} ApiItems[] = 1636 1636 { 1637 - #define API_FUNC_DEF(name, ...) {lua_ ## name, #name}, 1637 + #define API_FUNC_DEF(name, ...) {(lua_CFunction)(lua_ ## name), #name}, 1638 1638 TIC_API_LIST(API_FUNC_DEF) 1639 1639 #undef API_FUNC_DEF 1640 1640 1641 1641 #if defined(BUILD_DEPRECATED) 1642 - {lua_textri, "textri"}, 1642 + {(lua_CFunction)lua_textri, "textri"}, 1643 1643 #endif 1644 1644 }; 1645 1645 ··· 1665 1665 ** Message handler which appends stract trace to exceptions. 1666 1666 ** This function was extractred from lua.c. 1667 1667 */ 1668 - static s32 msghandler (lua_State *lua) 1668 + static int msghandler (lua_State *lua) 1669 1669 { 1670 1670 const char *msg = lua_tostring(lua, 1); 1671 1671 if (msg == NULL) /* is error object not a string? */
+1 -1
src/api/wren.c
··· 1664 1664 } 1665 1665 } 1666 1666 1667 - static void reportError(WrenVM* vm, WrenErrorType type, const char* module, s32 line, const char* message) 1667 + static void reportError(WrenVM* vm, WrenErrorType type, const char* module, int line, const char* message) 1668 1668 { 1669 1669 tic_core* core = getWrenCore(vm); 1670 1670
+5 -4
src/ext/gif.c
··· 31 31 { 32 32 gif_image* image = NULL; 33 33 34 - s32 error = 0; 34 + int error = 0; 35 35 36 36 if(gif) 37 37 { ··· 101 101 102 102 case EXTENSION_RECORD_TYPE: 103 103 { 104 - s32 extCode = 0; 104 + int extCode = 0; 105 105 GifByteType* extension = NULL; 106 106 107 107 if (DGifGetExtension(gif, &extCode, &extension) == GIF_ERROR) ··· 167 167 s32 pos; 168 168 } GifBuffer; 169 169 170 - static s32 readBuffer(GifFileType* gif, GifByteType* data, s32 size) 170 + static int readBuffer(GifFileType* gif, GifByteType* data, int size) 171 171 { 172 172 GifBuffer* buffer = (GifBuffer*)gif->UserData; 173 173 ··· 177 177 return size; 178 178 } 179 179 180 - gif_image* gif_read_data(const void* data, s32 size) 180 + gif_image* gif_read_data(const void* data, int size) 181 181 { 182 182 GifBuffer buffer = {data, 0}; 183 183 GifFileType *gif = DGifOpen(&buffer, readBuffer, NULL); 184 184 185 185 return readGif(gif); 186 186 } 187 + 187 188 188 189 void gif_close(gif_image* image) 189 190 {
+1 -1
src/ext/gif.h
··· 43 43 s32 colors; 44 44 } gif_image; 45 45 46 - gif_image* gif_read_data(const void* buffer, s32 size); 46 + gif_image* gif_read_data(const void* buffer, int size); 47 47 void gif_close(gif_image* image);
+3 -3
src/ext/miniaudio.h
··· 16137 16137 int result; 16138 16138 pthread_attr_t* pAttr = NULL; 16139 16139 16140 - #if !defined(__EMSCRIPTEN__) 16140 + #if !defined(__EMSCRIPTEN__) && !defined(__3DS__) 16141 16141 /* Try setting the thread priority. It's not critical if anything fails here. */ 16142 16142 pthread_attr_t attr; 16143 16143 if (pthread_attr_init(&attr) == 0) { ··· 17864 17864 #ifdef MA_POSIX 17865 17865 /* No need for dlfcn.h if we're not using runtime linking. */ 17866 17866 #ifndef MA_NO_RUNTIME_LINKING 17867 - #include <dlfcn.h> 17867 + #include "../../vendor/dlfcn/src/dlfcn.h" 17868 17868 #endif 17869 17869 #endif 17870 17870 ··· 17995 17995 17996 17996 /* No need for dlfcn.h if we're not using runtime linking. */ 17997 17997 #ifndef MA_NO_RUNTIME_LINKING 17998 - #include <dlfcn.h> 17998 + #include "../../vendor/dlfcn/src/dlfcn.h" 17999 17999 #endif 18000 18000 #endif 18001 18001
+1 -1
src/script.c
··· 154 154 if(index < MAX_SUPPORTED_LANGS) 155 155 { 156 156 Scripts[index] = script; 157 - qsort(Scripts, index + 1, sizeof Scripts[0], compareScripts); 157 + qsort(Scripts, index + 1, sizeof Scripts[0], (int (*)(const void *, const void *))compareScripts); 158 158 } 159 159 } 160 160
+1 -1
src/studio/editors/code.c
··· 1695 1695 code->jump.line = -1; 1696 1696 } 1697 1697 1698 - static s32 funcCompare(const void* a, const void* b) 1698 + static int funcCompare(const void* a, const void* b) 1699 1699 { 1700 1700 const tic_outline_item* item1 = (const tic_outline_item*)a; 1701 1701 const tic_outline_item* item2 = (const tic_outline_item*)b;
+3 -3
src/studio/screens/console.c
··· 1498 1498 return (s32) ((u8) tolower(*str1) - (u8) tolower(*str2)); 1499 1499 } 1500 1500 1501 - static inline s32 itemcmp(const void* a, const void* b) 1501 + static inline int itemcmp(const void* a, const void* b) 1502 1502 { 1503 1503 const FileItem* item1 = a; 1504 1504 const FileItem* item2 = b; ··· 4489 4489 commandDone(console); 4490 4490 } 4491 4491 4492 - static s32 cmdcmp(const void* a, const void* b) 4492 + static int cmdcmp(const void* a, const void* b) 4493 4493 { 4494 4494 return strcmp(((const Command*)a)->name, ((const Command*)b)->name); 4495 4495 } 4496 4496 4497 - static s32 apicmp(const void* a, const void* b) 4497 + static int apicmp(const void* a, const void* b) 4498 4498 { 4499 4499 return strcmp(((const ApiItem*)a)->name, ((const ApiItem*)b)->name); 4500 4500 }
+1 -1
src/studio/screens/surf.c
··· 229 229 return true; 230 230 } 231 231 232 - static s32 itemcmp(const void* a, const void* b) 232 + static int itemcmp(const void* a, const void* b) 233 233 { 234 234 const SurfItem* item1 = a; 235 235 const SurfItem* item2 = b;