$ show ndless-nspire/Ndless
Ndless is a jailbreak and homebrew SDK for TI-Nspire calculators. It enables execution of unsigned ARM-native code and provides a complete development environment including cross-compilation toolchain, system libraries (libndls, libsyscalls), SDL 1.2 port, Lua scripting extensions, and support for multiple calculator models and OS versions (3.x through 6.x). The repository contains exploit-based installers for each OS version, a runtime loader with hooking infrastructure, and a custom executable format (Zehn). The SDK includes sample applications demonstrating graphics, input, particles, networking, and Lua integration. The codebase is heavily based on reverse-engineering of TI's firmware, with hardcoded memory addresses and syscall tables for dozens of OS releases. This is a hybrid project: primarily an application/SDK, but with a significant data/research component in the form of reverse-engineering artifacts (IDA IDC scripts) used to generate syscall mappings.
The LLM identified 4 files worth highlighting for reuse:
A simple, self-contained key-value configuration file parser. Provides cfg_open, cfg_get, cfg_register_fileext, and cfg_close functions. Can be extracted and reused in any C project that needs to read flat configuration files. Demonstrates clean error handling and does not depend on Ndless-specific internals.
Recursive directory traversal with a callback function. Implements file_each() that walks through a directory tree, calling a user-provided callback for each file. Fully self-contained, no external dependencies beyond standard POSIX file operations. Reusable in any file-system exploration tool.
An abstraction layer for LCD screen operations on TI-Nspire calculators. Wraps low-level framebuffer details (320x240, 240x320, color modes) into a unified API with lcd_init, lcd_blit, and screen mode detection. Although hardware-specific, the pattern of abstracting screen configuration via a scr_type_t enum and function pointers is a clean reusable design for embedded systems.
Header-only C++ templates for invoking OS system calls. Defines syscall<ID, Ret>(args...) and syscall_local<ID, Ret>(args...) using inline assembly to switch between direct syscall execution and SWI-based dispatch. Template-based abstraction allows type-safe, zero-cost syscall wrappers. The pattern could be adapted to other ARM platforms with a syscall table.