The Many-Sprites Interpretation Of Amiga Mechanics

The invention of sprites triggered a major shift in video game design, enabling games with independent moving objects and richer graphics despite the limitations of early video gaming hardware. As a result, hardware design was specifically built to manipulate sprites, and generally as new generations of hardware were produced the number of sprites a system could produce went up. But [Coding Secrets], who published games for the Commodore Amiga, used an interesting method to get this system to produce far more sprites at a single time than the hardware claimed to support.

This hack is demonstrated with [Coding Secrets]’s first published game on the Amiga, Leander. Normally the Amiga can only display up to eight sprites at once, but there is a coprocessor in the computer that allows for re-drawing sprites in different areas of the screen. It can wait for certain vertical and horizontal line positions and then execute certain instructions. This doesn’t allow unlimited sprites to be displayed, but as long as only eight are displayed on any given line the effect is similar. [Coding Secrets] used this trick to display the information bar with sprites, as well as many backgrounds, all simultaneously with the characters and enemies we’d normally recognize as sprites.

Of course, using built-in hardware to do something the computer was designed to do isn’t necessarily a hack, but it does demonstrate how intimate knowledge of the system could result in a much more in-depth and immersive experience even on hardware that was otherwise limited. It also wasn’t free to use this coprocessor; it stole processing time away from other tasks the game might otherwise have to perform, so it did take finesse as well. We’ve seen similar programming feats in other gaming projects like this one which gets Tetris running with only 1000 lines of code.

Continue reading “The Many-Sprites Interpretation Of Amiga Mechanics”

Virus-Based Thermoresponsive Separation Of Rare-Earth Elements

Although rare-earth elements (REEs) are not very rare, their recovery and purification is very cumbersome, with no significant concentrations that would help with mining. This does contribute to limiting their availability, but there might be more efficient ways to recover these REEs. One such method involves the use of a bacteriophage that has been genetically modified to bind to specific REEs and release them based on thermal conditions.

The primary research article in Nano Letters is sadly paywalled, but the supporting information PDF gives some details. We can also look at the preceding article (full PDF) by [Inseok Chae] et al. in Nano Letters from 2024, in which they cover the binding part using a lanthanide-binding peptide (LBP) that was adapted from Methylobacterium extorquens.

With the new research an elastin-like peptide (ELP) was added that has thermoresponsive responsive properties, allowing the triggering of coacervation after the phages have had some time in the aqueous REE containing solution. The resulting slurry makes it fairly easy to separate the phages from the collected REE ions, with the phages ready for another cycle afterwards. Creating more of these modified phages is also straightforward, with the papers showing the infecting of E. coli to multiply the phages.

Whether the recovery rate and ability to scale makes it an economically feasible method of REE recovery remains to be seen, but it’s definitely another fascinating use of existing biology for new purposes.

Interconnected circuits for controlling the clock

Tick, Tock, Train Station Clock

We’ve seen a few H-bridge circuits around these parts before, and here’s another application. This time we have an Old Train Station Clock which has been refurbished after being picked up for cheap at the flea market. These are big analog clocks which used to be common at railway stations around the world.

This build uses an ESP32 C3-mini microcontroller (PDF) in combination with an A4988 Microstepping Motor Driver (PDF). The logic is handled with MicroPython code. The A4988 provides two H-bridge circuits, one for each of two stepper motors, only one of which is used in this build.

The controller for this clock needs to send an alternating positive then negative DC pulse every minute to register that a minute has passed so the clock can update its hour hand and minute hand as appropriate. The ESP32 and the A4988 H-bridge cooperate to make that happen. The wifi on the ESP32 C3-mini is put to good use by facilitating the fetching of the current time from the internet. On an hourly basis the clock gets the current time with a HTTP call to a time server API, for whatever is suitable for your time zone.

Thanks to [PiotrTopa] for writing in to let us know about his project. If you’re interested in learning more about H-bridge applications be sure to check out Introduction To The H-bridge Motor Controller and A H-Bridge Motor Controller Tutorial Makes It Simple To Understand.

The yagi, suction-cup mounted to a wall

Bringing A Yagi Antenna To 915MHz LoRa

If you’re a regular reader of Hackaday, you may have noticed a certain fondness for Meshtastic devices, and the LoRa protocol more generally. LoRa is a great, low-power radio communications standards, but sometimes the antennas you get with the modules can leave you wanting more. That’s why [Chris Prioli] at the Gloucester County Amateur Radio Club in the great state of New Jersey have got a Yagi antenna for North America’s 915 MHz LoRa band.

Right out the gate, their article links to one of ours, where [tastes_the_code] builds a Yagi antenna for the European 868 MHz LoRa. Like [tastes_the_code], the radio club found [Chris]’s antenna gives much better reception than what came with the LoRa module. Looking out their window, instead of two Metastatic nodes with a stock antenna, one club member is now connecting to two hundred.

A simulation of the radiation pattern. Looks like a Yagi, alright.

Now, the Yagi is directional, so you only get that boost pointed down the axis of the antenna, but at least in simulation they estimate a 7.7 dB front-to-back gain vs under 3 dB for an omnidirectional antenna. Not bad, for a simple 3D print and some stiff wire!

If you don’t want to re-invent the wheel again, check out the GCARC’s GitHub for files if you’re in North America. If you’re in Europe, check out [taste_the_code]’s build from last year. Of course whatever band you’re operating in, Yagi isn’t your only roll-your-own option for a LoRa antenna.

Thanks to [Jon Pearce WB2MNF] for the tip!

Escaping The Linux Networking Stack At Cloudflare

Courtesy of the complex routing and network configurations that Cloudflare uses, their engineers like to push the Linux network stack to its limits and ideally beyond. In a blog article [Chris Branch] details how they ran into limitations while expanding their use of soft-unicast functionality that fits with their extensive use of anycast to push as much redundancy onto the external network as possible.

The particular issue that they ran into had to do with the Netfilter connection tracking (conntrack) module and the Linux socket subsystem when you use packet rewriting. For soft-unicast it is important that multiple processes are aware of the same connection, yet due to how Linux works this made it impossible to use packet rewriting. Instead they had to use a local proxy initially, but this creates overhead.

To work around this the solution appeared to be to abuse the TCP_REPAIR socket option in Linux, which normally exists to e.g. migrate VM network connections. This enables one to describe the entire socket connection state, thus ‘repairing’ it. Combined with TCP Fast Open to skip the whole handshake bit with a TFO ‘cookie’. This still left a few more issues to fix, with an early demux providing a potential solution.

Ironically, ultimately it was decided to not break the Linux networking stack that much and stick with the much less complicated local proxy to terminate TCP connections and redirect traffic to a local socket. Unfortunately escaping the Linux networking stack isn’t that straightforward.

Rectal Oxygenation Could Save Your Life One Day

Humans have lots of basic requirements that need to be met in order to stay alive. Food is a necessary one, though it’s possible to go without for great stretches of time. Water is more important, with survival becoming difficult beyond a few days in its absence. Most of all, though, we crave oxygen. Without an air supply, death arrives in mere minutes.

The importance of oxygen is why airway management is such a key part of emergency medicine. It can be particularly challenging in cases where there is significant trauma to the head, neck, or surrounding areas. In these cases, new research suggests there may be an alternative route to oxygenating the body—through the rear.

Continue reading “Rectal Oxygenation Could Save Your Life One Day”

Measuring Caffeine Content At Home

By far, the most widely used psychoactive substance in the world is caffeine. It’s farmed around the world in virtually every place that it has cropped up, most commonly on coffee plants, tea plants, and cocoa plants. But is also found in other less common plants like the yaupon holly in the southeastern United States and yerba maté holly in South America. For how common it is and how long humans have been consuming it, it’s always been a bit difficult to quantify exactly how much is in any given beverage, but [Johnowhitaker] has a solution to that.

This build uses a practice called thin layer chromatography, which separates the components of a mixture by allowing them to travel at different rates across a thin adsorbent layer using a solvent. Different components will move to different places allowing them to be individually measured. In this case, the solvent is ethyl acetate and when the samples of various beverages are exposed to it on a thin strip, the caffeine will move to a predictable location and will show up as a dark smudge under UV light. The smudge’s dimensions can then be accurately measured to indicate the caffeine quantity, and compared against known reference samples.

Although this build does require a few specialized compounds and equipment, it’s by far a simpler and less expensive way of figuring out how much caffeine is in a product than other methods like high-performance liquid chromatography or gas chromatography, both of which can require extremely expensive setups. Plus [Johnowhitaker]’s results all match the pure samples as well as the amounts reported in various beverages so he’s pretty confident in his experimental results on beverages which haven’t provided that information directly.

If you need a sample for your own lab, we covered a method on how to make pure caffeine at home a while back.

Continue reading “Measuring Caffeine Content At Home”