An Up-To-Date Development Environment For The Nokia N-Gage

One of the brave but unsuccessful plays from Nokia during their glory years was the N-Gage, an attempt to merge a Symbian smartphone and a handheld game console. It may not have managed to dethrone the Game Boy Advance but it still has a band of enthusiasts, and among them is [Michael Fitzmayer] who has produced a CMake-based toolchain for the original Symbian SDK. This is intended to ease development on the devices by making them more accessible to the tools of the 2020s, and may serve to bring a new generation of applications to those old Nokias still lying forgotten in dusty drawers.

In much of the public imagination, the invention of the smartphone came with the release of the first Apple iPhone in 2007. Hackaday readers will of course trace the smartphone back much further than that to an original IBM prototype, and will remind any doubters that the Nokias which the iPhone vanquished were very successful smartphones without any of Cupertino’s magic in sight. Nokia’s tragedy was that they appeared not to understand what they had in Symbian, and released a bewildering array of devices intended to satisfy every possible market without recognizing that the market they needed to serve was their customers being easily able to run the apps of their choice on the things.

Symbian itself has long ago become a piece of abandonware, but during its chequered history there was a period in which an open-source version was released. It would be nice to think that projects such as this one might revive interest in this capable yet forgotten operating system, as with the passage of a decade the cost of hardware which might run it has fallen to the point of affordability. Does anyone want to relive the 2000s?

Header image: Evan-Amos, Public domain.

Web-Centric Gabuino Has Compiler, Will Travel

Arguably the biggest advantage of the Arduino platform is its ease of use, especially when compared to what microcontroller development looked like before the introduction of the open source board and its associated software development environment. All you need to do is download the IDE for your platform, plug in your Arduino, and you can have code running on the hardware with just a few clicks.

But can it get even easier? [Gabriel Valky] certainly thinks so, which is why he’s developed the cloud-based Gabuino platform. As of right now it only supports the DS213 pocket oscilloscope and LA104 logic analyzer, but he says the code is lightweight enough that it should work with any STM32 board that has the appropriate bootloader. Using Gabuino requires no software to be installed on the computer, just plug in the board, and you’re already half way there.

Gabuino processing data from digital calipers.

The trick is that the code editor and compiler have been moved into the cloud, and are accessed through the host computer’s web browser. The web interface also integrates an impressive “Console”, which [Gabriel] likens to the Serial Monitor and Plotter functions of the Arduino IDE, but is actually far more capable. The Gabuino Console is not only bi-directional, but through the use of libraries such as Three.js and WebGL, it’s able to render video output from code running on the microcontroller.

[Gabriel] takes us through some of the capabilities of Gabuino in the video below, and we have to say, it looks pretty impressive. We especially liked the built-in debugging capabilities that let you set breakpoints and examine variables. This plug-and-play approach certainly holds promise for students or beginners, though we think the hardware compatibility will need some work before the project really takes off.

Incidentally, this isn’t the first time [Gabriel] has written some code for the LA104. Last year we covered his very impressive custom firmware for the ~$100 USD gadget, which should sweeten the deal considerably if you end up getting one to experiment with Gabuino on.

Continue reading “Web-Centric Gabuino Has Compiler, Will Travel”

Reverse Engineering The SEGA Mega Drive

With the widespread adoption of emulators, almost anyone can start playing video games from bygone eras. Some systems are even capable of supporting homebrew games, with several having active communities that are still creating new games even decades later. This ease of programming for non-PC platforms wasn’t always so easy, though. If you wanted to develop games on a now-antique console when it was still relatively new, you had to jump through a lot of hoops. [Tore] shows us how it would have been done with his Sega Mega Drive development kit that he built from scratch.

While [Tore] had an Atari ST, he wanted to do something a little more cutting edge and at the time there was nothing better than the Mega Drive (or the Genesis as it was known in North America). It had a number of features that lent the platform to development, namely the Motorola 68000 chip that was very common for the time and as a result had plenty of documentation available. He still needed to do quite a bit of reverse engineering of the system to get a proper dev board running, though, starting with figuring out how the cartridge system worked. He was able to build a memory bank that functioned as a re-writable game cartridge.

With the hard parts out of the way [Tore] set about building the glue logic, the startup firmware which interfaced with his Atari ST, and then of course wiring it all together. He was eventually able to get far enough along to send programs to the Mega Drive that would allow him to control sprites on a screen with the controller, but unfortunately he was interrupted before he could develop any complete games. The amount of research and work to get this far is incredible, though, and there may be some helpful nuggets for anyone in the homebrew Mega Drive community today. If you don’t want to get this deep into the Mega Drive hardware, though, you can build a cartridge that allows for development on native Sega hardware instead.

Rich showing off

Make Your Python CLI Tools Pop With Rich

It seems as though more and more of the simple command-line tools and small scripts that used to be bash or small c programs are slowly turning into python programs. Of course, we will just have to wait and see if this ultimately turns out to be a good idea. But in the meantime, next time you’re revamping or writing a new tool, why not spice it up with Rich?

Rich showing off it's traceback

Rich is a python library written by [Will McGugan] that offers text formatting, colors, graphs, progress bars, markdown, syntax highlighting, charts, and more through the power of ANSI codes. The best part is that it works with macOS, Windows, and Linux. In addition, it offers logging solutions that work out of the box. One of the best features of Rich is the inspect functionality. You can pass in an object, and it will use reflection to print a beautiful chart detailing what exactly the object is, helpful in debugging. The other feature is the traceback, which shows a formatted and annotated snapshot of relevant code on the stack during exceptions.

The source itself is well-written python with comments and typing information. There’s a good chance you’ll pick up a trick or two reading through it. Rich is used to build Textual (also by [Will]), which aims to be a GUI API that runs in the terminal. It served as an excellent example of what Rich is capable of. It is incredible how long these protocols have been around. [Will] even ran Rich on a Teletype Model 33. If you’re working with a bit more of a constrained environment, why not bring some color to your Arduino serial terminal?

Parsing PNGs Differently

There are millions of tiny bugs all around us, in everything from our desktop applications to the appliances in the kitchen. Hidden, arbitrary conditions that cause unintended outputs and behaviors. There are many ways to find these bugs, but one way we don’t hear about very often is finding a bug in your own code, only to realize someone else made the same mistake. For example, [David Buchanan] found a bug in his multi-threaded PNG decoder and realized that the Apple PNG decoder had the same bug.

PNG (Portable Network Graphics) is an image format just like JPEG, WEBP, or TIFF designed to replace GIFs. After a header, the rest of the file is entirely chunks. Each chunk is prepended by a four-letter identifier, with a few chunks being critical chunks. The essential sections are IHDR (the header), IDAT (actual image data), PLTE (the palette information), and IEND (the last chunk in the file). Compression is via the DEFLATE method used in zlib, which is inherently serial. If you’re interested, there’s a convenient poster about the format from a great resource we covered a while back.

Continue reading “Parsing PNGs Differently”

Hack The Web Without A Browser

It is a classic problem. You want data for use in your program but it is on a webpage. Some websites have an API, of course, but usually, you are on your own. You can load the whole page via HTTP and parse it. Or you can use some tools to “scrape” the site. One interesting way to do this is woob — web outside of browsers.

The system uses a series of backends tailored at particular sites. There’s a collection of official backends, and you can also create your own. Once you have a backend, you can configure it and use it from Python. Here’s an example of finding a bank account balance:

>>> from woob.core import Woob
>>> from woob.capabilities.bank import CapBank
>>> w = Woob()
>>> w.load_backends(CapBank)
{'societegenerale': <Backend 'societegenerale'>, 'creditmutuel': <Backend 'creditmutuel'>}
>>> pprint(list(w.iter_accounts()))
[<Account id='7418529638527412' label=u'Compte de ch\xe8ques'>,
<Account id='9876543216549871' label=u'Livret A'>,
<Account id='123456789123456789123EUR' label=u'C/C Eurocompte Confort M Roger Philibert'>]
>>> acc = next(iter(w.iter_accounts()))
>>> acc.balance
Decimal('87.32')

The list of available backends is impressive, but eventually, you’ll want to create your own modules. Thankfully, there’s plenty of documentation about how to do that. The framework allows you to post data to the website and easily read the results. Each backend also has a test which can detect if a change in the website breaks the code, which is a common problem with such schemes.

We didn’t see a Hackaday backend. Too bad. There are, however, many application examples, both console-based and using QT. For example, you can search for movies, manage recipes, or dating sites.

Of course, there are many approaches possible to this problem. Maybe you need to find out when the next train is leaving.

Arduino IDE Creates Bootable X86 Floppy Disks

Arguably the biggest advantage of the Arduino ecosystem is how easy it is to get your code running. Type a few lines into the IDE, hit the button, and in a few seconds you’re seeing an LED blink or some text get echoed back over the serial port. But what if that same ease of use didn’t have to be limited to microcontrollers? What if you could use the Arduino IDE to create computer software?

That’s exactly what boot2duino, a project developed by [Jean THOMAS] hopes to accomplish. As you might have guessed from the name, the code you write in the Arduino is turned into a bootable floppy disk image that you can stick into an old PC. After a few seconds of beeping and grinding your “Hello World” should pop up on the monitor, and you’ve got yourself the world’s biggest Arduino.

A minimal x86 Arduino sketch.

Now to be clear, this isn’t some kind of minimal Linux environment that boots up and runs a compiled C program. [Jean] has created an Arduino core that provides basic functionality on x86 hardware. Your code has full control over the computer, and there’s no operating system overhead to contend with. As demonstrated in a series of videos, programs written with boot2duino can display text, read from the keyboard, and play tones over the PC’s speaker.

The documentation for boot2duino says the project serves no practical purpose, but we’re not so sure. While the feature set is minimal, the low overhead means you could theoretically press truly ancient PCs into service. There’s certainly an appeal to being able to write your code on a modern OS and effortlessly deploy it on a retrocomputer, from somewhat modernized versions of early computer games to more practical applications. If any readers end up exploring this concept a bit further, be sure to let us know how it goes.

Continue reading “Arduino IDE Creates Bootable X86 Floppy Disks”