Commit Graph

3072 Commits

Author SHA1 Message Date
Vadim Grigoruk a383406b1e stack overflow fix 2026-05-03 14:55:41 +02:00
borb 05a688aef0 increase TIC_BANKSIZE_BITS to 17 and decrease temp to 7 2026-05-03 14:35:46 +03:00
borb bd790655c9 remove MAX_CODE changes 2026-05-03 14:34:19 +03:00
borb 535d9bc7f0 remove unneeded builds 2026-05-03 14:08:13 +03:00
borb 6a39bfcae5 try changing MAX_CODE instead of CODE_SIZE 2026-05-03 14:07:03 +03:00
borb 193508b9ee increase TIC_CODE_SIZE 8x 2026-05-03 13:15:46 +03:00
imsys f133009adf Creates the BUILD_SURF build option (#2889)
* Creates the BUILD_SURF build option

* Managing starting with no game loaded

When built with BUILD_EDITORS=OFF, and we execute the app without any
game, it starts by showing the Main menu.

We also hide options from the menu when there is no cart loaded: the
Resume and Reset.

When we start with no cart and we try to do a Surf, it was saying there
were changes made to the cart, so I also do a check if the cart was
loaded before showing the warning.

So, basically when the App is started without any games, it will show
the options: Surf, Options, Quit

* Android: BUILD_EDITORS=OFF & BUILD_SURF=ON

* Fix inisializing cart by arg when BUILD_EDITORS=OFF

* rebuild
2026-03-12 19:16:10 +01:00
imsys 1699d081d7 Baremetal build fix (#2907)
* Attempt fixing Baremetal build

* Fixes Baremetal build

The first test worked, so applying to the second baremetal build too
2026-03-12 19:09:18 +01:00
Max 5997f32499 Create THIRD_PARTY_LICENSES doc and LICENSES folder (#2904) 2026-03-12 19:04:21 +01:00
Martin Rykfors 13a98f49d3 Restore fft and ffts functions for python (#2902)
* Restore `fft` and `ffts` functions for python

* Add int argument type check to fft and ffts
2026-03-12 19:01:59 +01:00
Gabriel Terrien 211b386dde [Fix] [SDL] Reset keyboard state on focus loss to avoid stuck keys (#2900) 2026-03-12 18:59:00 +01:00
Gabriel Terrien ac7b9ccee0 [Fix] [Music] Route note preview to the active editor channel (#2899) 2026-03-12 18:56:58 +01:00
Gabriel Terrien c2e5695a6d [Fix] [Console] generate help version runtime strings from CMake sources (#2898) 2026-03-12 18:54:25 +01:00
Gabriel Terrien 80926eba36 [Fix] [Android] restore external keyboard arrow keys by tightening joystick classification (#2897) 2026-03-12 18:53:10 +01:00
Gabriel Terrien 14058be7cb Fix #2439: [Android] prevent extra character insertion on Ctrl shortcuts (#2896) 2026-03-12 18:52:01 +01:00
Gabriel Terrien c04f958e32 Fix music editor hex input with Caps Lock on (#2480) (#2895) 2026-03-12 18:51:12 +01:00
Gabriel Terrien feced4cfec docs: clarify map remap callback behavior across language bindings (issue #2478) (#2894) 2026-03-12 18:49:50 +01:00
imsys f632217978 Fixes libretro NSwitch build (#2891) 2026-03-12 18:48:12 +01:00
Sven ae1195a9d0 Bump miniaudio version (#2888)
Co-authored-by: Sven Knebel <sven.knebel@kdab.com>
2026-02-21 11:50:35 +01:00
Max 097d2ec585 fix(code): make escape() idempotent to avoid NULL cursor on repeated ESC (#2881) (#2887)
Guard against repeated ESC during popup hide animation so we don’t restore NULL cursor pointers.
Fixes #2881.
2026-02-21 11:48:26 +01:00
imsys 2f3e3d8dbb [CMake] Allow overwrite compilation optimization options (#2885)
From the GCC manual: "If you use multiple -O options, with or without level numbers, the last such option is the one that is effective."
2026-02-21 11:47:34 +01:00
Dania Rifki 8f7f36d2db Update vendor/zip from v0.1.19 to v0.3.6 (#2883)
* Updates verdor/zip from v0.1.19 to v0.3.5

no need for the -DCMAKE_POLICY_VERSION_MINIMUM=3.5 flag anymore.

* uses zip v0.2.6 instead of v.3.5

due to:
zip/src/miniz.h:8503:30: error: comparison is always false due to
limited range of data type [-Werror=type-limits]
8503 |     if (((mz_uint64)buf_size > 0xFFFFFFFF) || (uncomp_size >
0xFFFFFFFF)) {

* tries zip v0.3.5 again

but with the -Wno-type-limits flag

* Update vendor/zip to 0.3.6

* Add -Wno-stringop-truncation to zip compile options

* Refactor compiler option checks for zip to only apply -Wno-stringop-truncation for GCC

* Fix for  Baremetal GCC treating string truncation warnings as errors

* Fix support for bare-metal environment by defining lstat as stat

* Format comment

---------

Co-authored-by: imsys <911254+imsys@users.noreply.github.com>
2026-02-07 12:10:19 +01:00
BLUELOVETH 7020500a6e Fix old python issues #2841 and #2856 (#2878)
* Update pocketpy

* fix #2841 and #2856

* Update python.c

* flip get/set and fix doc
2026-01-16 17:36:10 +01:00
Tobias Mansfield-Williams 881828910e Fix WASM btnp and fget return type (#2875)
* Fix WASM btnp and fget return type

Fixes https://github.com/nesbox/TIC-80/issues/2183

`btnp` and `fget` are linked as returning i32, but  m3ApiReturnType(bool) only writes 1 byte and leaves the remaining 3 bytes uninitialized.

This can cause those functions to randomly return true in release builds.

* Fix btnp return type
2025-12-30 18:58:29 +01:00
Rhys-T df226e6a0f [cmake/mruby.cmake] Replace exec_program (deprecated) (#2869) 2025-12-02 12:41:41 +01:00
Carsten Teibes 48673531dd Add Nintendo Switch port (#2866)
* Initial Nintendo Switch Port

* Switch: Enable CRT shader

* Switch: Some QOL changes
- hack: make the menu accessible with "+"
- Invert Controller buttons A/B X/Y
- Enable network log only for debug builds
- Enable touchscreen mouse emulation
Also add myself to the credits in README

---------

Co-authored-by: Vadim Grigoruk <grigoruk@gmail.com>
2025-11-23 11:57:51 +01:00
Carsten Teibes 085423ff42 Migrate to macos-15-intel github action image (#2865)
The macos-13 image will be removed soon and macos-14-(x)large / x86_64 is not availble for free:
https://github.blog/changelog/2025-09-19-github-actions-macos-13-runner-image-is-closing-down/
2025-11-20 09:55:32 +01:00
Carsten Teibes e9d10fe29b Revamp the 3DS port (#2864)
- fix use of deprecated macro
- move network stuff to platform directory
- ensure all lua is built for 32 bit integers
- clean up build configurations
- use newer docker image
2025-11-20 09:31:26 +01:00
Mikan 7e70ea3eae Fix Pro=On + Editors=Off (#2863) 2025-11-15 07:38:33 +01:00
Vadim Grigoruk 1a86695670 default cursor fix 2025-11-10 20:19:04 +01:00
Dania Rifki a2c875f727 Add Credits for YueScript Support contributors (#2854) 2025-10-21 11:27:10 +02:00
Dania Rifki b3feccf770 Add YueScript as an additional scripting language (#2743)
* Publish Code

* Fixed YueScript build.

* Disabled macro feature which crashes runtime.

* Update YueScript submodule

* Try to fix the "function TIC()..." isn't found bug, no luck so far...

* Fix Demo and Mark

* Format yue.cpp

* Make it work in C99, let's hope this compiles in Win XP et cetera

* Fix Compilation Issues

* Try fixing rpi-baremetal(4) and nintendo-3ds builds

* Try fixing linking

* Reenable Exceptions

* Override YueParser

* Try forcing newer glibc?

* Debugging Build Step

* Update YueScript version

* Simplify build

* Add yue.cpp

* Whoops

* Update YueScript

* Update circle.patch to try to fix the build error

* Try removing -lstdc++fs

* Modify Patch

* Revert Update circle.patch

* ???

* Forgot to git Apply

* Accidentally put it in macOS instead of N3DS

* Remove platform specific configurations for now

* Remove thread_local for N3DS Build

* Use a more reliable way to disable thread_local on N3DS

* Forgot to pass in initial-exec

* Remove build/yuescript-makefile-remove-stdc++fs.patch

* Include libyuescript in the baremetal Makefile

---------

Co-authored-by: Li Jin <dragon-fly@qq.com>
2025-10-20 19:08:09 +02:00
Andrew Neeley 0876efa360 Fix faulty implementation of pmemset (#2852) 2025-10-19 12:43:30 +02:00
Chaitanya Koparkar e9fb53073f [demo] Fix minor mismatch between Fennel and other demo carts (#2851) 2025-10-19 12:42:52 +02:00
Miguel 463d8b14ef sokol branch 258 tile esc key mouse flicker fix (#2849) 2025-09-29 09:43:30 +02:00
imsys 35bc7f7c2a [.github/workflows] macos-arm64 -DCMAKE_POLICY_VERSION_MINIMUM=3.5 (#2846) 2025-09-20 10:11:53 +02:00
Carl Lange da3ea61dab [web export] Fix Safari Arrow keys in HTML export/webapp (#2838)
* web: Fix Safari Arrow keys in HTML export and webapp\n\n- Remap Arrow key events with KeyboardEvent.location === 3 (numpad) to location: 0 on WebKit in capture phase\n- Prevent page scrolling on Arrow keys while canvas is focused\n- Ensure canvas is focusable (tabindex=0) and focused on start\n\nThis addresses Safari/WebKit misclassification of physical Arrow keys so games receive directional input correctly.

* Add missing semicolon

* Update index.html

* Update index.html
2025-09-20 10:10:42 +02:00
imsys 8071f388b3 [Android] Update gradle and gradlew to v9.0.0 (#2836)
* [Android] Update gradle and gradlew to v9.0.0

As we update gradle-wrapper.jar, it is desirable to confirm the
authenticity.

It can be checked by verifying:
sha256sum gradle/wrapper/gradle-wrapper.jar

to be identical to the one available at:
http://services.gradle.org/distributions/gradle-9.0.0-wrapper.jar.sha256

that should be:

76805e32c009c0cf0dd5d206bddc9fb22ea42e84db904b764f3047de095493f3

* [Android] updates JDK to v17

* [Android] Updates NDK to version r23

* [Android] informs NDK version in gradle file

The newer versions of Gradle requires us to explicitly inform the NDK
version we use.

* readme and comments
2025-09-20 10:08:27 +02:00
imsys 2cc226b6d0 Informs retroarch that PNG extension is also supported (#2832)
* Informs retroarch that PNG extension is also supported

* Loading PNG cart from cart.c (fix PNG load in libretro)

Moved loadPngCart from studio.c to cart.c
The standalone binary loads carts from this stack:
studio.c: studio_create()
console.c: initConsole()
console.c: cmdLoadCart()

cmdLoadCart() had a working PNG cart load,
but libretro uses `tic.c: tic80_load()` directlty, but that had a
incompete PNG load.

So I tried to combine and bring the aproach from cmdLoadCart() to
tic80_load() by letting them both use the same PNG loading function.

* libpng CMakelist - order may matter

* target_link_libraries(tic80core PRIVATE png)
2025-09-15 18:31:35 +02:00
imsys 6a23ce9306 [Android standalone] fix association of .tic and .png to TIC-80 app (#2837)
* [Android standalone] fix association of .tic and .png to TIC-80 app 

Solves #2811

* [Android standalone] Fix loading directly from files

The android app was not configured to open directly form apps.
This now should work.
Code written by Gemini.

* [Android standalone] .tic file association case insensitive
2025-09-14 10:36:31 +02:00
imsys bae9661882 [Linux] Associates .tic and .png to TIC-80 (#2835) 2025-09-13 08:04:19 +02:00
imsys 03cad44003 [Android] Associate .tic files to TIC-80 app (#2834)
* [Android] Associate .tic files to TIC-80 app

Proposed by @Popolon at #2811

* [Android] Associate .tic and .png to TIC-80 app
2025-09-13 08:02:03 +02:00
imsys 70b0ba34c4 [Android standalone] update SDL files to v2.32.10 (#2831)
* [Android standalone] update SDL files to v2.32.10

* fixed multiline comment

I tried to selective update the file, butt there were a multiline
comment I mislook. So I just updated he full file SDLActivity.java file.

* [Android standalone] Restore custom virtual keyboard after SDL update

[Gemini 2.5 Pro] The custom virtual keyboard on Android is no longer
displayed after updating the underlying SDL library from v2.26.2 to
v2.32.10.

This was caused by a change in how the new version of `SDLActivity.java`
handles text input. The newer SDL version more aggressively activates
its own text input system (`SDL_StartTextInput()`) on Android.

The TIC-80 C code in `src/system/sdl/main.c` has a function,
`isKbdVisible()`, which determines whether to render the custom
keyboard. This function contained a specific check for Android:
`!SDL_IsTextInputActive()`. This line was intended to hide the custom
keyboard when a native (e.g., system) keyboard was active.

Because the newer SDL version keeps its text input system active by
default, this check was causing the custom TIC-80 keyboard to be
permanently hidden.

This change resolves the issue by commenting out the
`!SDL_IsTextInputActive()` check. This restores the intended behavior,
ensuring that TIC-80's own integrated virtual keyboard is always used
for input on touch devices, independent of the underlying SDL text input
state.

* Restore virtual keyboard and system keyboard toggle

Tries to make the system keyboard show when it was previously working.

* [Android standalone]

The virtual keyboard was not appearing after updating SDL to v2.32.10.

The new `SDLActivity.java` now enables text input on launch by default,
which caused TIC-80's logic to hide its custom keyboard.

This is fixed by adding an explicit `SDL_StopTextInput()` call during
initialization to restore the correct default state. A redundant text
input call was also removed from the `SDL_KEYDOWN` handler to ensure the
system keyboard is only activated by its specific toggle key.
2025-09-13 08:00:37 +02:00
imsys b98d07c734 Replace msf_gif submodule with single header (–711 MiB) + macOS build fix (#2833)
* Includes the msf_gif.h in the project instead of using the full repo (saves 711 MiB of disk space)

* fix macos build

CMake Error at vendor/zip/CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.
-- Configuring incomplete, errors occurred!

Update the VERSION argument <min> value.  Or, use the <min>...<max>
syntax
to tell CMake that the project requires at least <min> but has been
updated
  to work with policies introduced by <max> or earlier.

  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.
2025-09-12 18:44:16 +02:00
imsys fe58c53957 [libretro] fix frametime (#2829)
There is a critical bug in how the core handles game time, directly
related to TIC80_FREQUENCY. The core incorrectly provides the TIC-80
engine with the time delta (time since last frame) instead of a
continuously running counter. This causes the engine's internal clock to
advance far too slowly, leading to the reported issues.

Because state->frameTime is being reset instead of accumulated, the
TIC-80 engine sees a counter value that hovers around the same number
every frame (e.g., ~16667 for 60 FPS). When the engine calculates the
difference (new_counter_value - old_counter_value), the result is close
to zero. The engine therefore concludes that almost no time has passed,
causing game logic to run at a fraction of the intended speed.
2025-09-11 17:37:09 +02:00
Will Green 1f7f7ae718 Update macOS build instructions (#2788)
1. DCMAKE_POLICY_VERSION_MINIMUM=3.5 required with brew version of cmake
2. Correct binary name for chmod +x (binary is called tic80)
3. Renamed app from TIC80DEV to tic80dev for consistency with release name
2025-09-08 18:55:33 +02:00
Softkandi a4c75d3092 Fix saving options to JSON (#2790)
Remove the JSON macro, which doesn't work as intended because it literally pastes preprocessor code into the options file, corrupting it.
2025-09-08 18:54:19 +02:00
imsys d531774efb Libretro cursorfix (#2822)
* [libretro] draw cursor directly to screen

This fixes some bugs where the cursor were not drawn in some games, and
also causing a cursor trail in other games.

* [libretro] Makes the cursor to start hidden

As many games don't use mouse, we keep it hidden while it was not moved.
Those wanting to take screenshots of the titlescreen don't risk taking a
screenshot of the cursor.
2025-09-08 18:51:44 +02:00
imsys cd2be4f659 Informative screenshot filenames (#2826)
* Informative screenshot filenames

screenshots and recordings now contain the rom name + datetime

* Informative screenshot filenames - multiplataform fix

In my last commit, the code to get the milliseconds would not work on
Windows. This new code should be able to compile on Windows too.

* Informative screenshot filenames - multiplataform fix2
2025-09-08 18:50:04 +02:00
imsys 86a4cc3a92 Update SDL to release-2.32.10 (pipewire fix) (#2827)
* Update SDL2 submodule to release-2.32.10

* SDL2 update MSVC fix

Tries to ensure SDL2 builds with the same runtime as the rest of the
project

* Another try to compile the updated SDL2 on MSVC.

* Yet another try to compile the updated SDL2 on MSVC.

* Directly link libs for SDL2 win compiling

* SDL2 update linking MSVC try using CMP0079

* another sdl2 win build try
2025-09-08 18:43:55 +02:00