Game Graphics: Rasterization

Last time, I talked about racing the beam, a type of graphics used when memory was scarce. Now it’s time to step into the future with more memory and talk about what modern 2D games still do to this day: rasterization.

Just in time Memory

Continuing the trend set by racing the beam, rasterized graphics are also on a grid, just a much tinier one. Though not unique to rasterized, the “frame buffer” is the logical conclusion of bitmap mode fidelity: enough memory is allocated so that every pixel can have its own color. What’s different about a frame buffer is that everything is drawn before it is shown and, crucially, this doesn’t have to happen in the same order as the pixels are displayed. Rasterization draws entire shapes — triangles, lines and rectangles — into the frame buffer and the screen is typically updated all at once. Continue reading “Game Graphics: Rasterization”

Hackaday Links Column Banner

Hackaday Links: December 24, 2023

Back near the beginning of the current Solar Cycle 25, we penned an article on what the whole deal is with solar cycles, and what could potentially lie in store for us as the eleven-year cycle of sunspot population developed. Although it doesn’t really come across in the article, we remember being somewhat pessimistic about things, thinking that Solar Cycle 25 would be somewhat of a bust in terms of increased solar activity, given that the new cycle was occurring along with other, longer-period cycles that tend to decrease solar output. Well, looks like we couldn’t have gotten that more wrong if we tried, since the Sun lashed out with a class X solar flare last week that really lit things up. The outburst came from a specific sunspot, number 3514, and clocked in at X2.8, the most powerful flare since just before the end of the previous solar cycle. To put that into perspective, X-class flares have a peak X-ray flux of 10-4 watts/m², which when you think about it is a lot of energy. The flare resulted in a strong radio blackout; pretty much everything below 30 MHz was unusable for a while.

Continue reading “Hackaday Links: December 24, 2023”

Beyond The Basics: Exploring Exotic Scope Trigger Modes

Will Rogers once said that veterinarians are the best doctors because their patients can’t tell them where it hurts. I’ve often thought that electronic people have a similar problem. In many cases, what’s wrong with our circuits isn’t visible. Sure, you can visually identify a backward diode, a bad solder joint, or a blown fuse. But you can’t look at a battery and see that it is dead or that a clock signal isn’t reaching some voltage. There are lots of ways to look at what’s really going on, but there is no substitute for a scope. It used to be hard for the average person to own a scope, but these days, it doesn’t require much. If you aren’t shopping for the best tech or you are willing to use it with a PC, oscilloscopes are quite affordable. If you spend even a little, you can now get scopes that are surprisingly capable with features undreamed of in years past. For example, many modern scopes have a dizzying array of triggering options. Do you need them? What do they do? Let’s find out.

I’ll be using a relatively new Rigol DHO924S, but none of the triggering modes are unique to that instrument. Sometimes, they have different names, and, of course, their setup might look different than my pictures, but you should be able to figure it out.

What is Triggering?

In simple terms, an oscilloscope plots time across the X-axis and voltage vertically on the Y-axis. So you can look at two peaks, for example, and measure the distance between them to understand how far apart they are in time. If the signal you are measuring happens repeatedly — like a square or sine wave, for example — it hardly matters which set of peaks you look at. After all, they are all the same for practical purposes.

Pretty square waves all in a row. Channel 2 is 180 degrees out of phase (inverted). But is that all there is?

The problem occurs when you want to see something relative to a particular event. Basic scopes often have level triggering. They “start” when the input voltage goes above or below a certain value. Suppose you are looking at a square wave that goes from 0 V to 5 V. You could trigger at about 2.5 V, and the scope will never start in the middle of a cycle.

Digital scopes tend to capture data before and after the trigger, so the center of the screen will be right on an edge, and you’ll be able to see the square waves on either side. The picture shows two square waves on the screen with the trigger point marked with a T in the top center of the display. You can see the level in the top bar and also marked with a T on the right side of the screen.

What happens if there are no pulses on the trigger source channel? That depends. If you are in auto mode, the scope will eventually get impatient and trigger at random. This lets you see what’s going on, but there’s no reference. If you are in normal mode, though, the scope will either show nothing or show the last thing it displayed. Either way, the green text near the top left corner will read WAIT until the trigger event occurs. Then it will say T’D.

Continue reading “Beyond The Basics: Exploring Exotic Scope Trigger Modes”

A hand holds a LEGO replica of a Polaroid camera. The back of the "camera" has been removed to show the sereies of Technic pieces inside that allow the camera shutter to work.

How A LEGO Set Is Born

LEGOs are the first window into making something in your head become real for many makers. The Verge dug into how a LEGO set itself goes from idea to the shelves.

While most sets come from the minds of LEGO designers, since 2008, fans can submit their own sets to LEGO Ideas for the chance to become a real product. In this case, we follow the journey of [Marc Corfmat]’s Polaroid OneStep Camera from his initial attempts at LEGO stardom with his brother [Nick] to the current set that took off.

While the initial idea and build are the seed for a new set, once the project is in the hands of LEGO, designers meticulously make revision after revision to ensure the set is enjoyable to build and any moving parts continue to function for thousands of cycles. This is all weighed against the total cost of the BOM as well as any licensing required for intellectual property. One particularly interesting part of the article is how designers at LEGO are afforded a certain number of “frames” for custom bricks which leads to some interesting hacks and collaboration as all good constraints do.

For more LEGO hacks, checkout LEGO’s long lost cousin, testing LEGO-compatible axle materials, or these giant LEGO-like pieces.

Raspberry Pi Zero Powers Custom Camera Platform

These days, most of us are carrying a fairly impressive digital camera with us at all times. But as capable as the hardware and software of a modern smartphone may be, there’s still plenty of reasons you may want a “real” camera to go along with it. The larger sensor, advanced controls, and selection of lenses that you’ll get with even a relatively cheap camera opens up a world of artistic possibilities.

If you’re really into chasing that perfect shot, you can even build your own digital camera these days. This design from [Jacob Cunningham] may not be able to go shot-for-shot against a Canon or Nikon in its current state, but we think you’ll agree there’s a lot of potential here — especially for something pieced together with modular components and perfboard.

Inside the 3D printed enclosure is a Raspberry Pi Zero, a Pi HQ Camera module, an 1.5″ OLED display, a lithium-ion battery pouch cell, and the charging and voltage regulation boards necessary to keep everything powered up. There’s also a handful of tactile buttons to work through the settings and menus, and a 10-axis IMU to help you keep your horizon level.

[Jacob] figures the whole thing comes in at around at $185.00, though naturally that number could go up or down considerably depending on what you’ve already got in the parts bin and what kind of lenses you add to the mix.

The hardware side of things looks more or less complete, at least for a first version, and [Jacob] has provided everything you’ll need to build one of your own. But the software is still a work in progress, with the latest push to the Python code in the project’s GitHub repository just eight hours old at the time of this writing. If you’ve been looking for a DIY camera project to really sink your teeth into, this could provide a great starting point.

If you’re more interested in moving pictures, we recently covered the CinePi project, which aims to develop an open source cinema-quality camera that you won’t need studio backing to afford.

Continue reading “Raspberry Pi Zero Powers Custom Camera Platform”

The IBM 5100, image from December 1975 issue of BYTE.

Bringing APL To The Masses: The History Of The IBM 5100

The 1970s was a somewhat awkward phase for the computer industry — as hulking, room-sized mainframes became ever smaller and the concept of home and portable computers more capable than a basic calculator began to gain traction. Amidst all of this, two interpreted programming languages saw themselves being used the most: BASIC and APL, with the latter being IBM’s programming language of choice for its mainframes. The advantages of being able to run APL on a single-user, portable system, eventually led to the IBM 5100. Its story is succinctly summarized by [Bradford Morgan White] in a recent article.

The IBM PALM processor.
The IBM PALM processor.

Although probably not well-known to the average computer use, APL (A Programming Language) is a multi-dimensional array-based language that uses a range of special graphic symbols that are often imprinted on the keyboard for ease of entry.

It excels at concisely describing complex functions, such as the example provided on the APL Wikipedia entry for picking 6 pseudo-random, non-repeating integers between 1 and 40 and sorting them in ascending order:

x[x6?40]

Part of what made it possible to bring the power of APL processing to a portable system like the IBM 5100 was the IBM PALM processor, which implemented an emulator in microcode to allow e.g. running System/360 APL code on a 5100, as well as BASIC.

Despite [Bradford]’s claim that the 5100 was not a commercial success, it’s important to remember the target market. With a price tag of tens of thousands of (inflation-adjusted 2023) dollars, it bridged the gap between a multi-user mainframe with APL and far less capable single-user systems that generally only managed BASIC. This is reflected in that the Commodore SuperPET supported APL, and the 5100 was followed by the 5110 and 5120 systems, and that today you can download GNU APL which implements the ISO/IEC 13751:2001 (APL2) standard.

We’ve previously looked at the Canadian-made MCM/70, another portable APL machine that embodied the cyberdeck aesthetic before William Gibson even gave it a name.

Top image: The IBM 5100, image from December 1975 issue of BYTE.

Thanks to [Stephen Walters] for the tip.

Hackaday Links Column Banner

Hackaday Links: December 17, 2023

Disappointing news from the US Senate this week as the “AM Radio for Every Vehicle Act” failed to advance in the sausage-making legislative process. We’ve previously covered this bill, which aims to force vehicle manufacturers to provide the means to receive terrestrial AM broadcasts in their cars and trucks without the need for extra subscriptions or charges. The bill’s sponsors tried to get it through on a “unanimous consent” maneuver, but Senator Rand Paul decided he didn’t like the idea of the government mandating what equipment cars should have. The coverage we’ve seen on this bill leads us to believe its sponsors are missing the point. Instead of pitching this as an issue of freedom of choice in entertainment, what they should be concentrating on is the safety aspect of AM radio. We’ve seen how much the government has invested in keeping AM stations on the air in just about any foreseeable emergency, so it’s only natural to look at a car’s AM radio as essential safety equipment like airbags, antilock brakes, and backup cameras. Seems like that’s something that everyone can agree on.  Continue reading “Hackaday Links: December 17, 2023”