Quantum Computing On A Commodore 64 In 200 Lines Of BASIC

The term ‘quantum computer’ gets usually tossed around in the context of hyper-advanced, state-of-the-art computing devices. But much as how a 19th century mechanical computer, a discrete computer created from individual transistors, and a human being are all computers, the important quantifier is how fast and accurate the system is at the task. This is demonstrated succinctly by [Davide ‘dakk’ Gessa] with 200 lines of BASIC code on a Commodore 64 (GitHub), implementing a range of quantum gates.

Much like a transistor in classical computing, the qubit forms the core of quantum computing, and we have known for a long time that a qubit can be simulated, even on something as mundane as an 8-bit MPU. Ergo [Davide]’s simulations of various quantum gates on a C64, ranging from Pauli-X, Pauli-Y, Pauli-Z, Hadamard, CNOT and SWAP, all using a two-qubit system running on a system that first saw the light of day in the early 1980s.

Naturally, the practical use of simulating a two-qubit system on a general-purpose MPU running at a blistering ~1 MHz is quite limited, but as a teaching tool it’s incredibly accessible and a fun way to introduce people to the world of quantum computing.

Microsoft BASIC For The Dragon 64 Recovered

There are a great many pieces of software of yesteryear that are no longer readily accessible. It’s now possible to cross Microsoft BASIC for the Dragon 64 off that list, with the source code now posted for all to enjoy on GitHub.

The repository concerns the Microsoft 16K BASIC Interpreter as built for the Motorola 6809, as used in the Dragon 64 computer. This is also known as BASIC-69 or Extended Color Basic.

Hilariously, the source code was recovered from 340 pages of fan-fold tractor paper stored in four bundles. The output of a Motorola assembler was printed back in 1983 at Dragon Data’s R&D facility in Wales, and was recently recovered after being stored in an attic for much of the last four decades. The paper was carefully scanned at the 2022 Dragon Meetup, before passing the resulting images through OCR software. The output was then manually corrected and the source code was complete for both the 32K and 64K mode ROMs. There are some differences between the scanned source and what Microsoft shipped, which is outlined in the repository.

We’ve seen other heroic retrocomputer recovery efforts before, too, like the work to save the Polish CROOK OS. If you’ve been working on similar feats, be sure to let us know.

A BASIC Interpreter For The Raspberry Pi Pico

It’s pretty easy to program the Raspberry Pi Pico in Python, or you can use C or C++ if you so desire. However, if you fancy the easy language of yesteryear, you might like PiccoloBASIC from [Gary Sims].

Putting it simply, piccoloBASIC is a BASIC interpreter that runs on the Raspberry Pi Pico. It features all the good bits of BASIC such as GOTO and GOSUB commands, that fancier languages kind of look down upon. It’s also got enough built-in routines to handle regular programming life, like sleeps, delays, a basic pseudorandom number source, trigonometric functions, and the ability to deal with floating point numbers. As far as microcontroller tasks go, it’s got rudimentary support for talking to GPIOs right now via the pinon and pinoff commands. However, it’s probably not the way to go if you want to bit-bang an SD card to within an inch of its speed rating.

Down the road, [Gary] hopes to add support for features like the Pico’s I2C, SPI, and PIO hardware, along with networking protocols and Bluetooth. PEEK and POKE are also hopefully on the way for those that like to fiddle with memory directly.

Meanwhile, if you’re looking for a different yet similar take, explore the port of MMBasic to the Pico platform. Video after the break.

Continue reading “A BASIC Interpreter For The Raspberry Pi Pico”

TRS-80 Gains Multiple Monitor Support, And High-Resolution Graphics

To call [Glen Kleinschmidt] a vintage computing enthusiast would be an understatement. Who else would add the ability to control and address multiple VGA monitors to a rack-mounted TRS-80 Model 1? Multiple 64-color 640×480 monitors might not be considered particularly amazing by today’s standards, but for 70s-era computing, it’s a different story.

Drawing this sin(x)/x ripple surface can be done in only 17 lines of BASIC.

How does a TRS-80 even manage to output anything useful to these monitors? [Glen] wrote his own low-level driver in machine code to handle that. The driver even has useful routines that are callable from within BASIC, meaning that programs written on the TRS-80 are granted powerful drawing abilities. Oh, and did we mention that the VGA graphics cards themselves were designed and made by [Glen]?

Interested in making your own? [Glen] provides all the resources you’ll need to re-create his work, including machine code drivers and demonstration BASIC programs as downloadable audio files, just as they would have been on original cassette tapes.

Watch things in action in the videos embedded below. The first draws a Land Rover, and the second plots a simple Moiré pattern star. Not bad for 70s-era hardware and 74xx logic!

Continue reading “TRS-80 Gains Multiple Monitor Support, And High-Resolution Graphics”

A Commodore 64 running a smartwatch link program

The Commodore 64 Smartwatch Can Now Sync With Your Commodore 64 Desktop

If you’ve got a smartwatch on your wrist, chances are you’ve also got a device nearby that links up with it. Most modern watches will happily sync with Android devices or iPhones, and some will also talk to Windows PCs. But what if you’re running an alternative OS? Something like, say, Commodore BASIC? In that case, you might want to check out [Nick Bild]’s latest project, which lets you to sync your smartwatch to your Commodore 64.

Sadly, you can’t just use any old smartwatch: the project is an extension of [Nick]’s Commodore 64 Smartwatch that we featured earlier. This watch can run Commodore 64 programs thanks to a custom software stack, but like most typical smartwatches also includes an accelerometer that counts your steps. Syncing the step counter to your computer is straightforward: after you come home from your daily run, you simply tap “sync” on the watch, enter LOAD"SYNC.PRG",8,1 on your Commodore 64, and the computer will show your total step count.

The C64 watch communicates with the host computer through a built-in infrared port. The classic Commodore computers don’t have an IR receiver, so [Nick] built one himself using an Arduino Micro hooked up to the C64’s User port. A custom program reads out the data and shows the step count on the screen.

Although the feature set of this app is a bit limited, [Nick]’s project demonstrates how the good old Commodore 64 can still perform useful tasks in today’s world. Not that we needed much reminding: after all, we’ve even seen it run AI applications using TensorFlow Lite.

Continue reading “The Commodore 64 Smartwatch Can Now Sync With Your Commodore 64 Desktop”

PicoMite Gives Your Pico A Deluxe BASIC

What makes developing a microcontroller project quick and easy? Tops on our list are an interactive shell and comprehensive libraries that handle all the low-level peripheral stuff. You think we’re talking MicroPython? Not today! MMBasic has just been ported to the Raspberry Pi Pico dev board, and it has all the batteries included.

Just to give you a taste, it has built-in support for SD cards, all sorts of displays, touch screens, real-time clocks, IR remotes, numerous sensors, and of course WS2812 LED strips. And because all of this is baked into the BASIC, writing code to use any of these peripherals is straightforward.

Now, there’s BASIC and there’s BASIC. This is a modern BASIC: it has loops, functions, arrays, floating point, and a built-in full-screen editor. You connect to the Pico via UART, and you’re off to the races. If you’ve got a Pico sitting around, flash it and give it a try. Or check out the GitHub repository if you want to poke around in the internals.

This is a port of the BASIC that’s used on the Maximite virtual retrocomputer platform, which means that there are many working examples out there for you to crib from, and even a forum. Add in the incredibly nice user manual and tutorial (PDF), and you’ve got the perfect weekend afternoon.

Think MicroPython killed BASIC? Think again. BASIC is small enough that it can run where Python can’t, but that’s of course a more minimal experience. In contrast, MMBasic looks like it’s got all the toppings. The whole enchilada. It’s like BASIC Deluxe.

QB64 Hits Version 2.0, Gets Enhanced Debugging

Despite the name, BASIC isn’t exactly a language recommended for beginners these days. Technology has moved on, and now most people would steer you towards Python if you wanted to get your feet wet with software development. But for those who got their first taste of programming by copying lines of BASIC out of a computer magazine, the language still holds a certain nostalgic appeal.

If that sounds like you, then may we heartily recommend QB64. The open source project seeks to modernize the classic programming language while retaining compatibility for QBasic 4.5, the late-80s BASIC environment Microsoft included with MS-DOS. That modernization not only includes the addition of contemporary technology like OpenGL, but cross-platform support that lets you run the same code on Windows, Linux, and Mac OS.

The new debug mode in QB64 v2.

The QB64 team released version 2.0 just a few days ago, making this the perfect time to give the project a test drive if you haven’t tried it out yet. The changelog includes platform specific improvements for each supported operating system, as well as a long list of general fixes and updates. But arguably the biggest feature for this release is the inclusion of the $Debug metacommand.

When this command is included in your code, the IDE will insert a debugging stub into the compiled program. During execution, the QB64 IDE will switch over to debugging mode, and communicate with your program in real-time over a local TCP/IP connection. The debugging mode lets you step through the code line-by-line, check the values of variables, and set breakpoints. Once you’re done fussing with the code and want to release a final binary, you just need to remove that single $Debug command and recompile.

We’ve talked in the past about using QB64 to revitalize vintage code, and think the project is a fantastic melding of old and new technology. You never know when you might suddenly have the urge to dust off some code you wrote back in the 80s and run it on an OS that didn’t even exist at the time.