TIC-80 Fantasy Console Documentation

repository·main·Indexed 24 days ago

https://github.com/nesbox/tic-80

TIC-80 is an open-source fantasy computer and constrained environment for creating and playing retro-style games. It features built-in editors for code, graphics, and sound, supporting multiple languages including Lua, Javascript, Python, and Ruby. The system is defined by technical constraints: a 240x136 display, 16-color palette, 256 8x8 sprites, and 4-channel audio. Documentation covers building from source across Windows, macOS, Linux (Ubuntu, Arch, Fedora, openSUSE), FreeBSD, and Raspberry Pi, as well as PRO version features.

Tokens
7.8K
Snippets
24
Records
45
Agent score
91%

What's inside TIC-80

  1. Overview of TIC-80 Fantasy Computer

    main

    TIC-80 is an open-source fantasy computer designed for creating, playing, and sharing small retro-style games. It provides a complete development environment with built-in editors for code, sprites, maps, sound effects, and music.

    Technical Constraints:

    • Display: 240x136 pixels
    • Palette: 16 colors
    • Sprites: 256 8x8 color sprites
    • Audio: 4-channel sound

    Supported Programming Languages:

    • Lua, Moonscript, Javascript, Ruby, Wren, Fennel, Squirrel, Janet, and Python.
  2. Build the TIC-80 libretro core

    main

    To build the TIC-80 libretro core independently from the main TIC-80 application, you must clone the repository, initialize submodules, and use cmake with specific flags to enable the libretro build while disabling the player, SDL, and tools components.

    git clone https://github.com/nesbox/TIC-80.git
    cd TIC-80
    git submodule update --init --recursive
    cd build
    cmake .. -DBUILD_PLAYER=OFF -DBUILD_SDL=OFF -DBUILD_TOOLS=OFF -DBUILD_LIBRETRO=ON
    make
  3. Build the TIC-80 PRO Version from source

    main

    The PRO version includes features like saving/loading cartridges in text format, 8 memory banks (instead of 1), and game exporting for app stores. You can build the PRO version from the source code using the -DBUILD_PRO=On CMake flag.

    cmake .. -DBUILD_PRO=On
  4. Build TIC-80 on Arch Linux

    main

    Install the required dependencies using pacman, clone the repository recursively, and build using cmake with BUILD_WITH_ALL=On.

    sudo pacman -S cmake ruby mesa libglvnd glu
    git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
    cmake -DBUILD_WITH_ALL=On .. && cmake --build . --parallel
  5. Build TIC-80 for Windows XP / Windows 7 (x86) using MSVC

    main

    To build for 32-bit legacy Windows systems, use an elevated Command Prompt:

    1. Install Git, CMake, Visual Studio 2019 Build Tools, and Ruby+Devkit 2.7.8 x86.
    2. In Visual Studio Installer, install "Desktop Development with C++" and specifically include "C++ Windows XP Support for VS 2017 (v141) tools" and "MSVC v141 - VS 2017 C++ x64/x86 build tools (v14.16)".
    3. Run ridk install with options 1,3.
    4. Add MSYS2's gcc at C:\Ruby27\msys32\mingw32\bin to your $PATH.
    5. Run the build commands.
    git clone --recursive https://github.com/nesbox/TIC-80 && cd .\TIC-80\build
    copy /y .\build\janet\janetconf.h .\vendor\janet\src\conf\janetconf.h
    cmake -G "Visual Studio 16 2019" -A Win32 -T v141_xp -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_WITH_ALL=On ..
    cmake --build . --parallel
  6. Build TIC-80 on openSUSE

    main

    Refresh repositories, install the devel_basis pattern and required libraries (cmake, glu-devel, libXext-devel, pipewire-devel, libcurl-devel), then build with BUILD_SDLGPU=On and BUILD_WITH_ALL=On.

    sudo zypper refresh
    sudo zypper install --no-confirm --type pattern devel_basis
    sudo zypper install --no-confirm cmake glu-devel libXext-devel pipewire-devel libcurl-devel
    git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
    cmake -DBUILD_SDLGPU=On -DBUILD_WITH_ALL=On .. && cmake --build . --parallel
  7. Build TIC-80 on FreeBSD

    main

    Install dependencies via pkg, clone the repository, and build. Note that you may need to symlink swrast_dri.so if Mesa cannot find it in the expected path.

    sudo pkg install gcc git cmake ruby libglvnd libglu freeglut mesa-devel mesa-dri alsa-lib
    git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
    cmake -DBUILD_WITH_ALL=On ..
    make -j4
    
    # Fix Mesa path if necessary
    sudo ln -s /usr/local/lib/dri/swrast_dri.so /usr/local/lib/dri-devel/
  8. Build TIC-80 on macOS

    main

    Ensure Command Line Tools for Xcode and brew are installed. Install git and cmake via Homebrew, clone the repository, and build using cmake with BUILD_WITH_ALL=On and a minimum CMAKE_POLICY_VERSION_MINIMUM=3.5.

    You can also create a development application icon by manually creating a .app bundle structure and a shell script wrapper pointing to the tic80 binary.

    brew install git cmake
    git clone --recursive https://github.com/nesbox/TIC-80 && cd TIC-80/build
    cmake -DBUILD_WITH_ALL=On -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
    make -j4
  9. Build TIC-80 for Windows 10/11 (x64) using MSYS2/MinGW

    main

    To build for 64-bit Windows using the MinGW toolchain, follow these steps in an elevated PowerShell prompt:

    1. Install dependencies using WinGet:
    winget install Git.Git Kitware.CMake RubyInstallerTeam.RubyWithDevKit.2.7
    1. Run ridk install with options 1,3 to set up MSYS2.
    2. Add MSYS2's gcc to your $PATH using the provided PowerShell command.
    3. Clone the repository and run the build commands.
    # Add MSYS2 gcc to PATH
    [Environment]::SetEnvironmentVariable('Path', $env:Path + ';C:\Ruby27-x64\msys64\mingw64\bin', [EnvironmentVariableTarget]::Machine)
    
    # Build commands
    git clone --recursive https://github.com/nesbox/TIC-80 && cd .\TIC-80\build
    cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SDLGPU=On -DBUILD_WITH_ALL=On ..
    $numCPUs = [Environment]::ProcessorCount
    mingw32-make "-j$numCPUs"
  10. Build TIC-80 for Windows 10/11 (x64) using MSVC

    main

    To build for 64-bit Windows using Microsoft Visual C++ (MSVC), follow these steps in an elevated PowerShell prompt:

    1. Install dependencies using WinGet:
    winget install Git.Git Kitware.CMake Microsoft.VisualStudio.2019.BuildTools RubyInstallerTeam.RubyWithDevKit.2.7
    1. In the Visual Studio Installer, ensure "Desktop Development with C++" is selected, along with the Windows 10 SDK (10.0.19041.0) and MSVC v142 build tools.
    2. Run ridk install with options 1,3 to set up MSYS2.
    3. Add MSYS2's gcc to your $PATH using the provided PowerShell command.
    4. Clone the repository and run the build commands.
    # Add MSYS2 gcc to PATH
    [Environment]::SetEnvironmentVariable('Path', $env:Path + ';C:\Ruby27-x64\msys64\mingw64\bin', [EnvironmentVariableTarget]::Machine)
    
    # Build commands
    git clone --recursive https://github.com/nesbox/TIC-80 && cd .\TIC-80\build
    cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SDLGPU=On -DBUILD_WITH_ALL=On ..
    cmake --build . --parallel