Tag Archives: cli

How to bring Amstrad NC100 screenshots to modern graphics apps

While browsing some scans of old, out-of-print books about the Amstrad NC100, I discovered that it has a built-in screenshot facility. I knew my various Psion devices could do this, but not the NC100.

NC100 screenshot BBC Basic

The trick — press ControlShiftS — was mentioned in Robin Nixon’s The Amstrad Advanced User Guide, published in 1993 by Sigma Press. The book contained BBC Basic and C utilities for converting the raw bitmap data generated by the keypress.
I immediately keyed in the C code to try it out. It did the job.

Typing in a listing! What an old-school feeling!

Continue reading

Primal Scheme: when Xcode settings vie with each other for supremacy

In interesting follow-up to last week’s post about the Xcode build system. This week, while updating another of my macOS CLI utilities, I found my new build script was breaking. Why? It was attempting to create a macOS universal binary out of what I thought were two separate ARM64 and x86_64 builds but were in fact both… er… universal binaries.

About xcode

This occurred with pdfmaker. The script was changed based on my experience building utitool and dlist. What might account for the difference? Comparing the architecture-related entries in the Xcode Build Settings for pdfmaker and dlist showed no differences at all. Both utilities’ project files are to Xcode 16.0 specification too.

Continue reading

Swift Fighting Man: How to duke it out with the Xcode build process and Win!

Today was going to be about so much else, but instead I found myself mêléeing with Apple’s build system.

I have a script I’ve been using very successfully for some years that automates the build process for my CLI apps. It builds a universal binary containing both ARM64 and x86-64 code, wraps it into a macOS installer package and submits the result to Apple’s notarisation service. One command in Terminal and it’s all done, or occasionally you get an error message.

Continue reading

Unearthing macOS’ Uniform Type Identifiers

The Uniform Type Identifier — UTI for short — is an interesting means to map files to the type of data they contain. macOS uses UTIs to work out what kinds of file an application can open to view or edit. My Preview… apps rely on UTIs to indicate their interest in certain file types. The system uses that information to pass files to my application extensions when a user previews a file using QuickLook. Generally, they’re hidden from users.

utitool 1.2.0 in action

There’s a flaw in the system, however. A UTI might indicate the content a file might be expected to contain, but how does the system connect a file to a UTI? By using its file extension. But while UTIs are unique, file extensions are not, and this is where the trouble begins.

Continue reading

How I went kicking and screaming from AppKit to SwiftUI… and why I plan to stay there

With time on my hands and having noted that rather a lot of iOS and macOS engineering jobs now emphasise SwiftUI skills, I thought it was high time that this old AppKit hand spent some time learning how to implement Swift’s ‘new’ declarative UI construction framework.

You might very well wonder why it has taken me so long. SwiftUI has been around for five and a half years – it debuted at Apple’s Worldwide Developers’ Conference in 2019. Why have I not tackled it before?

Continue reading

How to find the right Pi Pico board or retro tech connected to your Mac or Raspberry Pi

Recent work connecting old mobile devices — the Psion Series 3a and the Amstrad NC100 — to my Mac caused me to run into an issue with the script I use to determine the Unix device path of the USB-to-serial adaptor I use to talk to these gadgets. Long story short: I ended up converting a Z Shell function into a Swift CLI tool — and adding Linux support into the bargain.

Adafruit’s RP2040 board connects to the host via an integrated USB-to-serial adaptor (Image © 2021, Tony Smith)
Adafruit’s RP2040 board connects to the host via an integrated USB-to-serial adaptor
Continue reading

Meet Depot, an RP2040-based multi-bus adaptor for Macs and Linux PCs

I’d like to introduce you to Depot, the new name for an expanded version of the Raspberry Pi RP2040-based adaptor I launched last year as cli2c. Why the name change? In addition to I²C, the firmware and the client-side code that interacts with it, now supports 1-Wire, and more buses will be supported soon.

Depot client and adaptor firmware in action
Depot client and adaptor firmware in action
Continue reading

Pico SDK 1.5.0 revamps IO over USB — and makes it work

The Raspberry Pi company released version 1.5.0 of the Pico SDK a week ago — right after I issued the latest version of my desktop computer-oriented I²C adaptor, which is based on the Pico’s RP2040 chip. If I’d have known about the SDK update, I would have held back — SDK 1.5.0 solves an irritating problem I’d faced with unexplained adaptor firmware hangs.

The RP2040 based I2C adaptor here running on a Pimoroni Tiny 2040 and with a matrix LED connected
Continue reading

How to copy files to a Pico on a Ventura Mac error free

macOS 13.0.0 Ventura introduced an irritating problem for all us Mac-based Raspberry Pi Pico programmers: Finder no longer allows you to copy .uf2 files to a mounted Pico. It’s not a forbidden operation, but it does trigger an error that prevents the copy from taking place. This is undoubtedly the ‘new normal’, so here are some ways to circumvent the error. I’ll save the best one until last.

The macOS Ventura copy-to-Pico-in-Finder error
The macOS Ventura copy-to-Pico-in-Finder error
Continue reading

How to talk to I2C sensors, displays from… Linux

T’other week, I wrote about my work on building a Raspberry Pi RP2040-based I²C host device and some macOS client software to control it. I mentioned that I might get the latter running under Linux too. I now have, and it does.

The matrix display client and the CPU activity display example running on a Raspberry Pi 400
The matrix display client and the CPU activity display example running on a Raspberry Pi 400
Continue reading