A screen capture from Portal 2 running in Asahi Linux. The Asahi Linux logo is in the bottom right of the image as a watermark. The environment is a concrete and glass building with elements of nature taking over the room on the other side of the glass from the character. A red circle with a grey cube above it is in the foreground.

Asahi Linux Brings Better Gaming To Apple Silicon

For those of you longing for better gaming on an Apple Silicon device, Asahi Linux is here to help.

While Apple’s own line of CPUs are relatively new kids on the block, they’ve still been around for four years now, giving hackers ample time to dissect their innards. The team behind Asahi Linux has now brought us “the only conformant OpenGL®, OpenCL™, and Vulkan® drivers” for Apple’s M1 and M2.

The emulation overhead of the system means that most games will need at least 16 GB of RAM to run. Many games are playable, but newer titles can’t yet hit 60 frames per second. The developers are currently focused on “correctness” and hope to improve performance in future updates. Many indie titles are reported to already be working at full speed though.

You can hear more about some of the fiddly bits of how to “tessellate with arcane compute shaders” in the video below. Don’t worry, it’s only 40 minutes of the nine hour video and it should start right at the presentation by GPU dev [Alyssa Rosenzweig].

If you want to see some of how Linux on Apple Silicon started or some of the previous work on hacking the M1 GPU, we have you covered.

Continue reading “Asahi Linux Brings Better Gaming To Apple Silicon”

Modern In-Circuit Emulator For The 6809

The Motorola 6809, released in 1978, was the follow-up to their 6800 from four years earlier. It’s a powerful little chip with many 16-bit features, although it’s an 8-bit micro at heart. Despite its great improvements over the 6800, and even technical superiority over the Z80 and 6502 (hardware multiply, for example!), it never reached the same levels of success that those chips did. However, there are still some famous systems, such as the TRS-80 Colour Computer, which utilized the chip and are still being hacked on today. [Ted] is clearly a fan of the 6809, as he used a Teensy 4.1 to create a cycle-exact, drop-in 6809 emulator!

A small interposer board rearranges the Teensy pinout to match the 6809, as well as translating voltage levels from 3.3V to 5V. With careful design, the Teensy matches the cycle diagrams in the Motorola datasheet precisely, and so should be able to run any applications written for the chip! A great test was booting Extended Colour BASIC for the TRS-80 CoCo 2 and running some test BASIC programs. Any issues with opcode decoding or timing would certainly be exposed while running an interpreted language like BASIC. After this successful test, it was time to let the Teensy’s ARM Cortex-M7 rip and see what it could do.

Continue reading “Modern In-Circuit Emulator For The 6809”

Time’s Up For Mbed

In a forum post has come the announcement that mBed, ARM’s accessible microcontroller development platform, is to reach end-of-life in July 2026. This means that the online platform and OS will no longer be supported by ARM, though the latter will remain an open source project. The website will be shuttered, and no new projects can be created after that date using ARM infrastructure.

mBed was originally launched back in 2009, as a competitor to the Arduino IDE for ARM’s chips. Its easy development made it attractive and there were soon an array of boards from different manufacturers supporting it, but perhaps due to its support for only the one architecture, it failed to find success. It’s certainly not the first time a single-architecture microcontroller development platform has been discontinued, we need only look to the Intel Edison for that, but given the success of ARM platforms in general it’s still something of a surprise. Perhaps it’s time to take the press release explanation that other platforms such as Arduino have simply been much more popular.

Will a community form around an open source mBed? Given that it’s been a definite minority among Hackaday projects over the years, while we hope it does, we’re not so sure.

mBed board image: Viswesr, CC BY-SA 3.0.

Internals of the Blu-ray player, showing both the blu-ray drive and the custom PCBs

An Ingenious Blu-Ray Mini-Disk Player

[befi] brings us a project as impressive as it is reminiscent of older times, a Blu-Ray mini disk player. Easily fitting inside a pocket like a 8 cm CD player would, this is a labour of love and, thanks to [befi]’s skills both in electronics and in using a dremel tool.

A BluRay drive was taken apart, for a start, and a lot of case parts were cut off; somehow, [befi] made it fit within an exceptionally tiny footprint, getting new structural parts printed instead, to a new size. The space savings let him put a fully custom F1C100S-powered board with a number of unique features, from a USB-SATA chip to talk to the BluRay drive, to USB pathway control for making sure the player can do USB gadget mode when desired.

There’s an OLED screen on the side, buttons for controlling the playback, power and battery management – this player is built to a high standard, ready for day-to-day use as your companion, in the world where leaving your smartphone as uninvolved in your life as possible is a surprisingly wise decision. As a fun aside, did you know that while 8 cm CDs and DVDs existed, 8 cm BluRay drives never made it to market? If you’re wondering how is it that [befi] has disks to play in this device, yes, he’s used a dremel here too.

Everything is open-sourced – 3D print files, the F1C100S board, and the Buildroot distribution complete with all the custom software used. If you want to build such a player, and we wouldn’t be surprised if you were, there’s more than enough resources for you to go off. And, if you’re thinking of building something else in a similar way, the Buildroot image will be hugely helpful.

Want some entertainment instead? Watch the video embedded below, the build journey is full of things you never knew you wanted to learn. This player is definitely a shining star on the dark path that is Blu-Ray, given that our most popular articles on Blu-Ray are about its problems.

Continue reading “An Ingenious Blu-Ray Mini-Disk Player”

The Nintendo Switch CPU Exposed

Ever wonder what’s inside a Nintendo Switch? Well, the chip is an Nvidia Tegra X1. However, if you peel back a layer, there are four ARM CPU cores inside — specifically Cortex A57 cores, which take up about two square millimeters of space on the die. The whole cluster, including some cache memory, takes up just over 13 square millimeters. [ClamChowder] takes us inside the Cortex A57 inside the Nintendo Switch in a recent post.

Interestingly, the X1 also has four A53 cores, which are more power efficient, but according to the post, Nintendo doesn’t use them. The 4 GB of DRAM is LPDDR4 memory with a theoretical bandwidth of 25.6 GB/s.

The post details the out-of-order execution and branch prediction used to improve performance. We can’t help but marvel that in our lifetime, we’ve seen computers go from giant, expensive machines to the point where a game console has 8 CPU cores and advanced things like out-of-order execution. Still, [ClamChowder] makes the point that the Switch’s processor is anemic by today’s standards, and can’t even compare with an outdated desktop CPU.

Want to program the ARM in assembly language? We can help you get started. You can even do it on a breadboard, though the LPC1114 is a pretty far cry from what even the Switch is packing under the hood.

A handheld computer made on a piece of prototyping board running a Tetris clone

Tetris Clone Uses 1000 Lines Of Code, And Nothing Else

If you’re programming on a modern computer, you typically make use of lots of work done by other people. There’s operating systems to abstract away the complexities of modern hardware, standard libraries to implement common tasks, and tons of third-party libraries that prevent you from having to reinvent the wheel all the time: you’re definitely not the first one trying to draw graphics onto a screen or store data in a file.

But if it’s the wheels you’re most interested in, then there’s nothing wrong with inventing new ones now and then. [Michal Zalewski], for instance, has made a beautiful Tetris clone in just 1000 lines of C, without using anyone else’s code.

The purpose of this exercise is to show that it’s possible to make a game with graphics comparable to modern, complex computing systems, without relying on operating systems or third-party libraries. The hardware consists of not much more than an ARM Cortex-M7 MCU, a 240×320 LCD screen and a few buttons soldered onto a piece of prototyping board, all powered by a set of AAA batteries.

The software is similarly spartan: just pure C code running directly on the CPU core. Graphic elements, some generated by AI and others hand-drawn, are stored in memory as plain bitmaps. They are manipulated by 150 lines of code that shuffles sprites around the display at a speed high enough to generate smooth motion. Game mechanics take up about 250 lines, while sound consists of simple square-wave chiptunes written in just 50 lines of code.

[Michal]’s code is very well documented, and his blog post gives even more details about all the problems he had to solve. One example is the length of keypresses: when do you interpret a keypress as a single “press”, and when does it become “press and hold”? Apparently, waiting 250 ms after the first press and 100 ms after subsequent ones does the trick. [Michal] is a bit of an expert on bare-bones game programming by now: he has previously pushed several 8-bit micros to their very limits. Third-party libraries can make your programming life a lot easier, but it’s good to reflect on the dangers of relying too much on other people’s code.

Continue reading Tetris Clone Uses 1000 Lines Of Code, And Nothing Else”

Emulating X86 On Apple’s AARCH64 X64 Emulator

You might know [Evan Martin] as the developer of retrowin32. It’s a Windows and x86 emulator designed to run on a Mac or on the web. He’s recently been exploring how to run 32-bit x86 binaries on the AArch64 (aka ARM64) architecture.

[Evan] realized that Apple’s ARM-based Macs feature a high-quality x86 emulator, used via the Rosetta binary translation system. It only supports 64-bit x86-64 binaries, also known as x64, and thus he had initially discounted it for running older 32-bit x86 software. However, as it turns out, x64 features a special compatibility mode for running 32-bit code. [Evan] was able to leverage this to run 32-bit Windows executables rather neatly via the high-performance Rosetta emulator.

To run a 32-bit executable on a 64-bit processor in this way, one creates a 64-bit program that is tasked with loading the 32-bit executable. It’s a little fussy, involving some tricks to handle memory management between the 32-bit code and the 64-bit wrapper, and how to interface with the OS, but [Evan] explains deftly how it’s all done.

[Evan] notes that this hack may not work forever, especially if Apple changes or deprecates Rosetta’s remaining x86-64 emulation in the future. Regardless, Apple’s “Game Porting Toolkit” relies on similar techniques used by Wine. If you find yourself dancing across platforms, you might learn some nifty tricks from [Evan]’s example!