Better support for static libraries

As there is more and more reusable code being shared as static libraries for Ndless programs, the latest update of the Ndless SDK (r604) can use a directory called .ndless/ found in ${USERPROFILE} (C:/Users/<Your Account> on Windows), automatically created by nspire-gcc and nspire-ld.

Just drop the header file (.h) and the archive file (.a) of  the libraries your programs depend on in .ndless/include and .ndless/lib to use them. This avoids any migration when updating the Ndless SDK or hard-coded paths in your Makefile.

Hackspire describes how to set this up in more details. Make the TI-Nspire native development experience even better, share your code as libraries!

Introducing OCD – the TI-Nspire on-calc debugger

Debugging without debugger can sometimes be a pain. For instance host USB isn’t implemented by the TI-Nspire computer emulator nspire_emu, and troubleshooting my USB drivers on-calc is becoming impossible.

I have decided to implement OCD, an on-calc debugger that mirrors most of nspire_emu debugger’s commands. I know calc84maniac started something similar a while ago, but unfortunately lost its source code.

The debugger must be linked to the program to debug as a static library. The debugger console will show up when a breakpoint is hit.

TI-Nspire developers, download it and help me improve it :) It hasn’t been extensively tested yet, please report any issue. It isn”t yet compatible with the CX because of nspireio on which it depends.

Many thanks to Goplat for some tricky code I have reused from nspire_emu such as the disassembler, and compu for the nice nspireio library I have slightly adapted for my needs.

USB Hacking

Here’s an early preview of USB-host support for native (Ndless) TI-Nspire programs. The TI-Nspire OS uses a customized version of the *BSD USB stack (and by the way does not respect the terms of the BSD license  which  requires that “redistributions in binary form [to] reproduce the [*BSD] copyright”). This means that writing community USB drivers with *BSD usbdi API should be possible, and porting existing *BSD drivers much easier.

The demo only requires a few lines of code. It runs in background and just displays the vendor and product info as returned by usbd_devinfo() at the top of the screen (you may need to zoom in to see it) when the USB device is plugged in. I unfortunately cannot take any video, my camera would make it too blurry.

I have successfully tested a flash drive, a mouse dongle and my old Sony eBook Reader. Strangely my Android phone wouldn’t advertise itself, maybe because 10 years separate the old TI-Nspire USB stack and the one used by the phone…

Startup programs

Ndless v3.1 beta now supports startup programs since r540!

Just drop any native program in the ndless/startup/ folder or any subfolder and it will be run at OS boot time. This will be useful for upcoming OS patches to avoid any manual installation after each reboot. Stay tuned for an updated version of critor’s overclocking program Nover.

The new startup feature is described in the User Guide. Developers, you can use the new function nl_isstartup()  to check whether you should start your programs in GUI mode or silent startup mode.

File association

The latest update of Ndless v3.1 has been enhanced with file association support! You now can open files with extensions directly from the OS document browser: This will run the corresponding program if it has been declared in the configuration file ndless.cfg.tns. More details are available in the user guide.

The NESpire emulator, nDoom and the nPlayer video player have already been updated by their authors to support .nes, .wad and .nvid files association. Update to Ndless v3.1 beta r538 or higher to try them. Updating Ndless is not really different than an initial installation, follow the update steps in the user guide.

Developers, Hackspire gives you more information on how to implement this in your own programs.

(credits to critor for the nDoom demo)

R3leased!

Thank you for your patience! Ndless v3.1 beta is proud to be part of the simultaneous release of tools and programs that open new era for TI-Nspire CX. The release includes PolyDumper, nspire_emu, Nover, nDOOM, nRGBlib, gbc4nspire, and NESpire compatible with the CX.

This third generation wouldn’t have been possible without the invaluable help of several contributors and testers, including adriweb, bsl, calc84maniac, critor, Goplat, jimbauwens, Levak and Lionel Debroux.

Download the beta (SDK + installer). Please don’t copy the file to your own site as it is frequently updated, prefer to share the URL.

Users, make sure to follow the User Guide for installation instructions, and the Troubleshooting Guide if you are having problems with the installation.
New developers, make your first steps with the SDK.
Authors of Ndless 2 programs, upgrade them with TI-Nspire CX compatibility, and check in Changes.txt the new functions of the API.

Follow the event on Omnimaga and TI-Planet!

New and noteworthy in v3.1:

  • TI-Nspire CX compatibility
  • Persistence: The installation is now reboot proof
  • Extended libndls API:  on_key_pressed(), show_msgbox_2b(), show_msgbox_3b(), is_cx, is_classic, has_colors, hwtype, IO, IO_LCD_CONTROL, lcd_incolor(), lcd_ingray(), lcd_isincolor()
  • New syscalls: ftell(), truncate()