Skip to content

Update TIC-80 - #28

Merged
RobLoach merged 32 commits into
masterfrom
revert-27-revert-26-update-tic80
Apr 22, 2026
Merged

RobLoach merged 32 commits into
masterfrom
revert-27-revert-26-update-tic80

Conversation

@RobLoach

@RobLoach RobLoach commented May 13, 2024 •

Copy link
Copy Markdown
Member

@RobLoach RobLoach added the Hold label May 13, 2024
@imsys

imsys commented Aug 24, 2025

Copy link
Copy Markdown

I don't know gitlab that well, but I could not find the mentioned targets. I hope we could get some update on this.

@imsys

imsys commented Aug 26, 2025

Copy link
Copy Markdown

I was able to build it for my Linux x86_64 and Android using your the configs you created in the gitlab yml.

It does fix nesbox#2504 (sprites) and nesbox#2319 (javascript games).

I made a small Makefile (with the help of ChatGPT) to build it. It can be found with instructions at: https://gist.github.com/imsys/2981c9de54a07abf7a24df139b3237a2

In case anyone wants to just use my binaries, I will host it at my Gdrive until we have an official build.
https://drive.google.com/drive/folders/14MkvLGF7qxGFfVlTElmYyMd-NQE_RrOF

I also tried compiling to Linux aarch64, so I could run it on my TRIMUI handheld. It would just build fine, but the core would just fail to load over there. I will probably check in their community what I may be missing to get it working correctly there.

Comment thread .gitmodules Resolved
@RobLoach

Copy link
Copy Markdown
Member Author

Thanks for testing. I think what was remaining here was making sure that all build targets passed in libretro buildbot. While most passed, not all did. I'm unclear on the status of that today.

Either way, this attempt could do with another update to the latest TIC80 😉

@imsys

imsys commented Aug 27, 2025

Copy link
Copy Markdown

I was able to compile for the TrimUI, notes are at: https://gist.github.com/imsys/0c67f1b27ff386abb075b67c6fa1766a

@imsys

imsys commented Sep 5, 2025

Copy link
Copy Markdown

Edge case: Bokdown https://tic80.com/play?cart=1411
In my Android and Trimu build, the game freezes in the first level. I first suspected it was due to using static link instead of dynamic, but I'm unsure,.. I can't get a dynamic build to work.
I will see if I can do more tests later.

@imsys

imsys commented Sep 5, 2025

Copy link
Copy Markdown

Sorry, my bad. The problem is in the TIC-80 main (latest 4c1b009).
The version proposed here (v1.1.2837) works fine.

Added support for building with JS and Janet in the CI configuration. Updated various build configurations to include 32-bit system arguments.
@RobLoach

RobLoach commented Mar 9, 2026

Copy link
Copy Markdown
Member Author

Like the idea of pushing some of the cmake stuff upstream. Good call 👍

@imsys

imsys commented Mar 9, 2026

Copy link
Copy Markdown
$ cmake $CORE_ARGS "$CMAKE_SOURCE_ROOT" -B$BUILD_DIR -DCMAKE_BUILD_TYPE=Release -DLIBRETRO_STATIC=ON -DLIBRETRO_SUFFIX=_ctr -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE_DIR}/ctr.cmake
CMake Error: Parse error in command line argument: TIC80_FFT_UNSUPPORTED\
 Should be: VAR:type=value
CMake Error: Run 'cmake --help' for all supported options.

This is really quite tricky, maybe this could work?

.core-some-32bits-system:
  variables:
    CORE_32BITS_ARGS: >
      -DCMAKE_C_FLAGS_RELEASE="-DLUA_32BITS -DTIC80_FFT_UNSUPPORTED -DPOOR_CLIB"
      -DCMAKE_CXX_FLAGS_RELEASE="-DLUA_32BITS"

RobLoach added 2 commits March 9, 2026 13:37
Disable JANET build option in CI configuration.
@imsys

imsys commented Mar 10, 2026

Copy link
Copy Markdown

The Switch version is basically fixed, we just need to set EXTRA_PATH: lib for it.

Actually, we have to add EXTRA_PATH: lib to everything that compiles with -DLIBRETRO_STATIC=ON, and that seems to be:

libretro-build-ctr
libretro-build-emscripten
libretro-build-libnx-aarch64
libretro-build-ngc
libretro-build-vita
libretro-build-wii
libretro-build-wiiu 

Speaking of which, they all compile fine, but the lib will be incomplete if we don't do the changes at nesbox#2905

So I thought that for now we could just do:

  before_script:
    - curl -L https://raw.githubusercontent.com/imsys/TIC-80/1a27f7a0dcfaf6149cd2c56e9d173c538526648a/cmake/libretro.cmake -o "$CI_PROJECT_DIR/$CMAKE_SOURCE_ROOT/cmake/libretro.cmake"

At least just to check if it works. Or you could add the file to this project and do a cp or mv.

Now the biggest problem is still the C/CXX_FLAGS. The next suggestion Gemini gave is to we try this:

    - |
      echo 'set(CMAKE_C_FLAGS_RELEASE "-DLUA_32BITS -DTIC80_FFT_UNSUPPORTED -DPOOR_CLIB" CACHE STRING "" FORCE)' > build_flags.cmake
      echo 'set(CMAKE_CXX_FLAGS_RELEASE "-DLUA_32BITS" CACHE STRING "" FORCE)' >> build_flags.cmake
    - export CORE_ARGS="${CORE_ARGS} -C ${CI_PROJECT_DIR}/build_flags.cmake"

If this doesn't work, probably some variation of it will. So I updated my gist with all those changes.

@imsys

imsys commented Mar 10, 2026

Copy link
Copy Markdown

I thought it would take only a few iterations, but it's taking way more..

libretro-build-ctr (3DS) ✅ fixed
libretro-build-emscripten ✅ fixed

Switch build got an error that I was able to reproduce, and I fixed by more updates to libretro.cmake.

https://raw.githubusercontent.com/imsys/TIC-80/1fff1af2e33d71a586abdcac82cf3c3dbf881c49/cmake/libretro.cmake

It needs to be updated in the 3 occurrences in the before_script.

The WiiU and Vita seems to be missing some os-time related lib, and I'm looking into it.

@imsys

imsys commented Mar 10, 2026 •

Copy link
Copy Markdown

NGC and Wii are failing because they require devkit to be added to path, so I added:
- [ -n "${DEVKITPPC:-}" ] && export PATH="$PATH:$DEVKITPPC/bin"
it checks if the var exists, if so, it adds to the path.

WiiU is failing because of some python issue with UTC_TIME,.. so I just set python off only for it.
Vita is failing because of Javascript time issues, so I have set JS off only for that system.

I have also set JS of for dingux.

All updated in the gist.

Updated the URL for fetching libretro.cmake to a newer commit.
@imsys

imsys commented Mar 11, 2026

Copy link
Copy Markdown
`.gitlab-ci.yml`: (): did not find expected ',' or ']' while parsing a flow sequence at line 115 column 7

oh,.. that line required to be between quotes:

  before_script:
    - export NUMPROC=$(($(nproc)/5))
    - '[ -n "${DEVKITPPC:-}" ] && export PATH="$PATH:$DEVKITPPC/bin"'

@imsys

imsys commented Mar 13, 2026

Copy link
Copy Markdown

Updated gist

Drumrolls 😄

@@ -107,6 +107,13 @@
   - build-shared
   - build-static
 
+.js-patch:
+  before_script:
+    - export NUMPROC=$(($(nproc)/5))
+    - echo 'set(CMAKE_C_FLAGS_RELEASE "-DPOOR_CLIB" CACHE STRING "" FORCE)' > build_flags.cmake
+    - export CORE_ARGS="${CORE_ARGS} -C ${CI_PROJECT_DIR}/build_flags.cmake"
+    - sed -i 's|#include <fenv.h>|#if __has_include(<fenv.h>)\n#include <fenv.h>\n#endif|' "$CI_PROJECT_DIR/$CMAKE_SOURCE_ROOT/vendor/quickjs/quickjs.c"
+
 .core-some-32bits-system:
   variables:
     EXTRA_PATH: lib
@@ -117,6 +124,7 @@
       echo 'set(CMAKE_C_FLAGS_RELEASE "-DLUA_32BITS -DTIC80_FFT_UNSUPPORTED -DPOOR_CLIB" CACHE STRING "" FORCE)' > build_flags.cmake
       echo 'set(CMAKE_CXX_FLAGS_RELEASE "-DLUA_32BITS" CACHE STRING "" FORCE)' >> build_flags.cmake
     - export CORE_ARGS="${CORE_ARGS} -C ${CI_PROJECT_DIR}/build_flags.cmake"
+    - sed -i 's|#include <fenv.h>|#if __has_include(<fenv.h>)\n#include <fenv.h>\n#endif|' "$CI_PROJECT_DIR/$CMAKE_SOURCE_ROOT/vendor/quickjs/quickjs.c"
     - curl -L https://raw.githubusercontent.com/imsys/TIC-80/1fff1af2e33d71a586abdcac82cf3c3dbf881c49/cmake/libretro.cmake -o "$CI_PROJECT_DIR/$CMAKE_SOURCE_ROOT/cmake/libretro.cmake"
     - |
       curl -L https://github.com/Kitware/CMake/releases/download/v3.31.11/cmake-3.31.11-linux-x86_64.sh -o cmake-install.sh
@@ Dingux @@
 libretro-build-dingux-odbeta-mips32:
   extends:
     - .libretro-dingux-odbeta-cmake-mips32
     - .core-defs
+    - .js-patch
   variables:
     DINGUX_CFLAGS:   -DDINGUX -fomit-frame-pointer -march=mips32 -mtune=mips32r2 -mhard-float
     DINGUX_CXXFLAGS: -DDINGUX -fomit-frame-pointer -march=mips32 -mtune=mips32r2 -mhard-float
-    CORE_ARGS_EXTRA: >
-      -DBUILD_WITH_JS=OFF
 
 # RetroFW
 libretro-build-retrofw-mips32:
   extends:
     - .libretro-retrofw-odbeta-cmake-mips32
     - .core-defs
+    - .js-patch
   variables:
     DINGUX_CFLAGS:   -DDINGUX -fomit-frame-pointer -march=mips32 -mtune=mips32r2 -mhard-float
     DINGUX_CXXFLAGS: -DDINGUX -fomit-frame-pointer -march=mips32 -mtune=mips32r2 -mhard-float
-    CORE_ARGS_EXTRA: >
-      -DBUILD_WITH_JS=OFF
 
 # MIYOO
 libretro-build-miyoo-arm32:
   extends:
     - .libretro-miyoo-cmake-arm32
     - .core-defs
+    - .js-patch
   variables:
     DINGUX_CFLAGS:   -DDINGUX -fomit-frame-pointer -fno-fast-math -march=armv5te -mtune=arm926ej-s -ftree-vectorize -funswitch-loops
     DINGUX_CXXFLAGS: -DDINGUX -fomit-frame-pointer -fno-fast-math -march=armv5te -mtune=arm926ej-s -ftree-vectorize -funswitch-loops
-    CORE_ARGS_EXTRA: >
-      -DBUILD_WITH_JS=OFF
 
 # VITA
 libretro-build-vita:
@@ -262,11 +267,11 @@
     - .core-defs
   variables:
     EXTRA_PATH: lib
-    CORE_ARGS_EXTRA: >
-      -DBUILD_WITH_JS=OFF
   before_script:
     - export NUMPROC=$(($(nproc)/5))
-    - export CORE_ARGS="${CORE_ARGS} -DCMAKE_POSITION_INDEPENDENT_CODE=OFF"
+    - echo 'set(CMAKE_C_FLAGS_RELEASE "-DPOOR_CLIB" CACHE STRING "" FORCE)' > build_flags.cmake
+    - curl -L https://raw.githubusercontent.com/imsys/TIC-80/1fff1af2e33d71a586abdcac82cf3c3dbf881c49/cmake/libretro.cmake -o "$CI_PROJECT_DIR/$CMAKE_SOURCE_ROOT/cmake/libretro.cmake"
+    - export CORE_ARGS="${CORE_ARGS} -DCMAKE_POSITION_INDEPENDENT_CODE=OFF -C ${CI_PROJECT_DIR}/build_flags.cmake"
 
 # Libnx
 libretro-build-libnx-aarch64:
@@ -279,6 +284,7 @@
     - export NUMPROC=$(($(nproc)/5))
     - curl -L https://raw.githubusercontent.com/imsys/TIC-80/1fff1af2e33d71a586abdcac82cf3c3dbf881c49/cmake/libretro.cmake -o "$CI_PROJECT_DIR/$CMAKE_SOURCE_ROOT/cmake/libretro.cmake"
     - sed -i '13,31 s/^/#/' "$CI_PROJECT_DIR/$CMAKE_SOURCE_ROOT/cmake/nswitch.cmake"
+    - sed -i 's/set(PREFER_SYSTEM_LIBRARIES ON)/set(PREFER_SYSTEM_LIBRARIES OFF)/' "$CI_PROJECT_DIR/$CMAKE_SOURCE_ROOT/CMakeLists.txt"

Added .js-patch to various build configurations and adjusted CORE_ARGS.
Comment thread README.md Resolved
@imsys

imsys commented Mar 16, 2026

Copy link
Copy Markdown

Yay! It worked! :)

It builds fine, I just do not know if it actually runs. I do not have any of the Nintendo devices to test on them.

By the way, I think we could also add -DBUILD_WITH_JANET=ON that I think it would build just fine on most systems, and then just add -DBUILD_WITH_JANET=OFF using CORE_ARGS_EXTRA: just on the systems that fails. There is just 9 games using it, so it's not a priority, but there are some good ones, like Astro's Ladder. I actually would prefer if you just merge and then we try in a second PR, and maybe for that I could be the one starting the PR, and you would just assign the gitlab to mirror my PR, so we don't have to go back and forth exchanging patches.

Another note on the -DBUILD_WITH_RUBY=, it's quite easy to fix on debian/ubuntu based containers, we just have to add an apt-get install -y ruby rake, but as it uses a devkitpro container, it seems to use pacman for package manager, but from my initial tests, it seemed that the source repo was not set up. The challenge would be just installing those two packages. But there is only 5 games, and 4 out of them are from Itch. So it is also very low priority.

Comment thread .gitlab-ci.yml
echo 'set(CMAKE_CXX_FLAGS_RELEASE "-DLUA_32BITS" CACHE STRING "" FORCE)' >> build_flags.cmake
- export CORE_ARGS="${CORE_ARGS} -C ${CI_PROJECT_DIR}/build_flags.cmake"
- sed -i 's|#include <fenv.h>|#if __has_include(<fenv.h>)\n#include <fenv.h>\n#endif|' "$CI_PROJECT_DIR/$CMAKE_SOURCE_ROOT/vendor/quickjs/quickjs.c"
- curl -L https://raw.githubusercontent.com/imsys/TIC-80/1fff1af2e33d71a586abdcac82cf3c3dbf881c49/cmake/libretro.cmake -o "$CI_PROJECT_DIR/$CMAKE_SOURCE_ROOT/cmake/libretro.cmake"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this gets in, I'd prefer if the upstream PR gets in first: nesbox#2905

Selectively building off of forks can become a mess in some cases 😅

Comment thread .gitlab-ci.yml
before_script:
- export NUMPROC=$(($(nproc)/5))
- echo 'set(CMAKE_C_FLAGS_RELEASE "-DPOOR_CLIB" CACHE STRING "" FORCE)' > build_flags.cmake
- curl -L https://raw.githubusercontent.com/imsys/TIC-80/1fff1af2e33d71a586abdcac82cf3c3dbf881c49/cmake/libretro.cmake -o "$CI_PROJECT_DIR/$CMAKE_SOURCE_ROOT/cmake/libretro.cmake"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread .gitlab-ci.yml
EXTRA_PATH: lib
before_script:
- export NUMPROC=$(($(nproc)/5))
- curl -L https://raw.githubusercontent.com/imsys/TIC-80/1fff1af2e33d71a586abdcac82cf3c3dbf881c49/cmake/libretro.cmake -o "$CI_PROJECT_DIR/$CMAKE_SOURCE_ROOT/cmake/libretro.cmake"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread .gitlab-ci.yml
variables:
EXTRA_PATH: lib
before_script:
- curl -L https://raw.githubusercontent.com/imsys/TIC-80/1fff1af2e33d71a586abdcac82cf3c3dbf881c49/cmake/libretro.cmake -o "$CI_PROJECT_DIR/$CMAKE_SOURCE_ROOT/cmake/libretro.cmake"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RobLoach

Copy link
Copy Markdown
Member Author

@imsys Brought in the latest changes, and I'm unsure if it will break everything. Mind having a look?

Comment thread .gitlab-ci.yml
before_script:
- export NUMPROC=$(($(nproc)/5))
- curl -L https://raw.githubusercontent.com/imsys/TIC-80/1fff1af2e33d71a586abdcac82cf3c3dbf881c49/cmake/libretro.cmake -o "$CI_PROJECT_DIR/$CMAKE_SOURCE_ROOT/cmake/libretro.cmake"
- sed -i '13,31 s/^/#/' "$CI_PROJECT_DIR/$CMAKE_SOURCE_ROOT/cmake/nswitch.cmake"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove this line, this patch was already applied in nesbox#2891

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be more clear, remove the - sed -i '13,31 s/^/#/' "$CI_PROJECT_DIR/$CMAKE_SOURCE_ROOT/cmake/nswitch.cmake"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, nevermind, you are getting the commit "Bump miniaudio version" that is just one before this was applied.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we should just merge this big change in, even though Nesbox hasn't merged your update?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

He has been away for about 40 days. I think we should just merge and later update it when he is back.

Comment thread .gitlab-ci.yml
- .libretro-webos-armv7a-cmake
- .core-defs
variables:
CORE_ARGS: "${CORE_ARGS} -DCMAKE_POLICY_VERSION_MINIMUM=3.5"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the WebOS section, don't use CORE_ARGS, it has some unexpected behaviors when trying to overwrite. If you want to use it, use CORE_ARGS_EXTRA, but as the CMAKE_POLICY_VERSION_MINIMUM is already set, just remove it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CORE_ARGS: "${CORE_ARGS} -DCMAKE_POLICY_VERSION_MINIMUM=3.5"
CORE_ARGS_EXTRA: "${CORE_ARGS} -DCMAKE_POLICY_VERSION_MINIMUM=3.5"

Comment thread .gitlab-ci.yml
Comment on lines 349 to 350
variables:
CORE_ARGS: "${CORE_ARGS} -DCMAKE_POLICY_VERSION_MINIMUM=3.5"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@RobLoach
RobLoach merged commit 10e6aa2 into master Apr 22, 2026
@imsys imsys mentioned this pull request Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants