Skip to content

Libretro steamdeck/macOS - #138

Open
humbertodias wants to merge 183 commits into
megamarc:libretrofrom
humbertodias:libretro
Open

Libretro steamdeck/macOS#138
humbertodias wants to merge 183 commits into
megamarc:libretrofrom
humbertodias:libretro

Conversation

@humbertodias

@humbertodias humbertodias commented Aug 16, 2026

Copy link
Copy Markdown

Changes

  • Merged master branch into libretro
  • Adapted src/makefile to work on macOS arm64 and steamdeck x64
  • Link LuaJIT statically into the libretro core

Demo

  • macOS
tilengine-libretro-macos.mp4

How to compile (macOS)

brew install libpng
export CPATH="$(brew --prefix)/include"
export LIBRARY_PATH="$(brew --prefix)/lib"

make -C src clean
make -C src
otool -L src/tilengine_libretro.dylib

tilengine_libretro.dylib (compatibility version 0.0.0, current version 0.0.0)
	/opt/homebrew/opt/libpng/lib/libpng16.16.dylib (compatibility version 75.0.0, current version 75.0.0)
	/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.12)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1356.0.0)
  • steamdeck
tilengine-libretro-linux-deck.mp4
image

how to compile

make -C src clean
make -C src
ldd lua_game/libtilengine_libretro.so 
        linux-vdso.so.1 (0x00007ff0bfe5c000)
        libc.so.6 => /usr/lib/libc.so.6 (0x00007ff0bfb76000)
        libz.so.1 => /usr/lib/libz.so.1 (0x00007ff0bfb5d000)
        libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007ff0bfb22000)
        libm.so.6 => /usr/lib/libm.so.6 (0x00007ff0bfa2a000)
        libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007ff0bf9fb000)
        /usr/lib64/ld-linux-x86-64.so.2 (0x00007ff0bfe5e000)

megamarc and others added 30 commits December 22, 2019 14:28
Windows: Bundles newly compiled libpng16 with Visual Studio 2017, old one built with VS2005 Express was causing loading problems. Removes "legacy_stdio" hack in LoadBitmap.c
* Fixes broken crt effect in x64, due to mismatched bool for uint8_t causing missalignment of indexed data. Updates windows binaries
…n delay and the function did nothing. Kept for backwards compatibility
* Fixes testmouse, scales source window space to framebuffer space. closes megamarc#62
* Adds build.bat for quick tests under Windows 64-bit using tiny c compiler (https://bellard.org/tcc/)
* Implements TLN_CreateImageTileset() and expands TLN_LoadTileset() to load both formats (tile-based classic and new image-based)
* Adds image-based tileset "props.tsx" and related images to "assets/forest"
* Removes old object API: TLN_Object struct, TLN_AddObjectToList(), TLN_AddSpriteToList(), TLN_GetObjectsInReigion()
* Adds new TLN_AddTileObjectToList()
* Changes TLN_SetLayerObjects() parameter list
* Implements layer setup and rendering

TODO: share loading code between TLN_LoadTilemap() and TLN_LoadObjectList() (both load a .tmx file) so object list can determine and load correct tileset just as tilemap loader does. Should remove "firstgid" parameter in TLN_LoadObjectList()
* Adds LoadTMX.c that includes common functionality for TLN_LoadTilemap() and TLN_LoadObjectLayer()
* Fixes TLN_GetLayerTile() causing segfault when passing negative x value, now wraps correctly from left to right
* TLN_LoadTileset(): restores loading tile type from custom property in addition to the standard one for backwards compatibility
* TLN_LoadObjectList(): removes "firstgid" parameter, autodetects it internally
* Forest sample: updates source to use the updated API and related resources
* Object list: adds parsing and correct rendering of attributes flip_x, flip_y and custom property "priority" (like tiled layers or sprites)
* TLN_AddTileObjectToList(): adds parameter "id" when adding objects at runtime
* Adds TLN_ObjectList struct to get iterator info on objects in a list
* Adds TLN_GetListNumObjects() to get number of objects in list, and TLN_GetListObject() to iterate and get info
* Adds TLN_ERR_REF_LIST value to get error info on invalid TLN_ObjectList reference
* "Forest" sample: showcases new functionality in object attributes and iterating an object list
* Removes versioning of prebuilt binaries, only source code should be versioned
…inux_$(uname -m)

* Remove Travis CI config for automatic FTP upload - their support is officially broken
…oken

* Updates samples Makefile for correct linux_$(arch) library path
* Major rewrite of LoadSpriteset.c: now supports standard json format for spriteshets in addition to classic txt and csv (aseprite, texturepacker, piskel...)
* Can load file with or without extension
* Updates Forest sample and assets to showcase new loader
* Loads natively 24 and 32 bpp image data of pixel art. If number of colors is less that 255, converts on the fly to indexed color equivalents.
* Updates "forest" sample assets to their 24 and 32 bpp originals
setting setting → setting
* Adds sprite linked list order: TLN_SetFirstSprite() and TLN_SetNextSprite
* Adds sprite masking: TLN_EnableSpriteMasking() and TLN_SetSpritesMaskRegion()
* Removes parameter "count" in TLN_CreateSpriteSequence(), now gets detected from sprite names
* CRT effect: when disabled always uses nearest-neighbor interpolation
* Fixes compiler-induced optimization bugs in built-in window
* Samples: removes usage of old sqx files for sprite animation and replaces with TLN_CreateSpriteAnimation() (shooter, supermarioclone, forest)
* Fixes broken loading of txt-based spritesheets in 2.6.0
* Updates changelog to 2.7.0
* Fixes Kritika warnings
*
* Integrates with upgraded asset packager "respack" that allows for large passwords and avoids possible hash collisions
* Forest example upgraded
* Loads up to 64 layers per tmx, and protects against overflow if more are present. Fixes megamarc#67
* Slotted animation accounts only for palette (color cycle animations).
* Tileset and sprite animations are self-sustained and don't use shared slots anymore.
* Removed legacy unused "tilemap" animation type
* Breaking API changes: removed TLN_SetTilesetAnimation() and TLN_SetTilemapAnimation(). Removed parameter "index" from TLN_SetSpriteAnimation(), requires only sprite number. Replaces TLN_DisableAnimation() with TLN_DisablePaletteAnimation() and TLN_DisableSpriteAnimation()
* Cached Tileset loader in case a tilemap sues the same tileset on multiple layers
* Updated all samples to the modified animation API
@humbertodias humbertodias mentioned this pull request Aug 16, 2026
@humbertodias humbertodias changed the title Libretro macOS m4 Libretro steamdeck/macOS Aug 16, 2026
humbertodias and others added 27 commits August 16, 2026 11:27
* Windowing: native support for X-Input button names
* Fixes bug where starting in fullscreen didn't render CRT effect until window mode was toggled
* Samples start in fullscreen
* Adds build script to build and install
* TLN_ConfigCRTEffect() accepts new parameter to use scanlines or not
* Adds two CRT overlays: TLN_CRT_NONE (no overlay) and TLN_CRT_HORIZONTAL (like TLN_CRT_SLOT but horizontal arrangement)
* Adds TLN_SetMainTask(), required for running in web browser
* Window.c: fixes CRT effect not showing in windowed mode
* Removes old Visual Studio project form Samples
* Simplifies many samples, removes functionality and assets not used anymore
* Updates Makefile and CMakeLists.txt
Keep RetroArch/libretro APIs and bitmask input; drop SDL window, CRT, and C samples from master. Take engine updates and Doxygen comments in Tilengine.h.
* When compiling for web, disables CRT effect by default, and ignores processing of ESC and ALT+TAB
* Minor tweaks, use x-input names instead of previous vendor-specific button numbering
* Adds samples/build_emcc.bat for building for web under Windows
* Adds samples/html with required assets to build the samples into separate webs
Fixes undefined M_PI under linux
Keep Window.c and SDL samples out of the libretro tree, preserve
CheckRetroInput bitflags, and take Tilengine 2.16 header updates
that the core can compile without SDL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.