Let’s Code MS DOS 0x24: Low Level Keyboard Programming

Getting input from the keyboard can be as easy as calling the getch() function. But for games we need a better solution. For games on MS DOS machines you need quick, unbuffered input. To simply get the state of keypresses we need to talk to the keyboard controller directly. Let’s have a look at how that’s done!

Let’s Code MS DOS 0x23: 2nd Reality Lens Effect

In 1993 the Future Crew released the seminal demo “Second Reality”. Last episode we re-implemented the tunnel effect, this time we try to understand and replicate the lens effect. A bouncing, tinted glass ball that distorts the background image. Thirty years back it was pretty jaw dropping, and even today we can learn something!

Let’s Code MS DOS 0x22: 2nd Reality Tunnel Effect

In 1993 the Future Crew released the seminal demo “Second Reality”. One of the more simple effects they showed in this demo was the “Dot Tunnel”. It is a simple, yet mesmerizing oldskool demo effect. We can build on our knowledge of fixed point maths to implement this effect and maybe even improve on the original!

Let’s Code MS DOS 0x1B: Fixed Point Arithmetics Rotozoomer

In the last episode we learned how to code the rotozoom effect using floating point arithmetics. This however is pretty slow on ancient DOS machines, like 486 and even worse on slower machines. So in this episode we will rewrite the program to use integer based fixed point arithmetics.

Let’s Code MS DOS 0x1A: I Am Not An Atomic Playboy! (The Rotozoomer)

Back in 1993 the Future Crew published „Second Reality“ on the PC. This was a mega-demo of epic proportions. It showcases many new and some old effects with a brilliant soundtrack. One of the effects that was very well done and that stuck in my mind was the „rotozoomer“. A tiling image being rotated and scaled in a very fluent animation. As a kid I wondered how it’s done. Later I learned the maths behind this and today we want to explore this simple yet brilliant effect. In this part we will deal with the basics and implement a floating point version. However the original code used fixed point integer arithmetics, which we will visit in a second video…

Let’s Code MS DOS 0x17: Come On Let’s Twist

One ubiquitous demo effect that can be seen on a wide variety of demos and intros is the twister or the twister bar. There are numerous examples in productions for the Amiga, Atari ST and 2600 that I know of (and even at least one on the Sega Master System). And probably a lot more that I don’t know. However I have never seen this effect in any of the old PC demos, except maybe in Future Crew’s PANIC, where something very similar was used for the vertical scrolling greetings. But it was not quite the same still. So today we will code a variant of the twister using Turbo C for MS DOS!

Let’s Code ESP8266: The SI7021 Temperature and Humidity Sensor

The SiliconLabs SI7021 is a very popular sensor for measuring temperature and humidity. It uses the I2C bus and is easily accessed from the ESP9266 or ESP32. Some breakout boards use different variants of the chip, namely the measurement Specialties HTU21D or even the Sensirion SHT21. These chips are more or less compatible to one another, but some don’t implement all the commands. However temperature and humidity can be used on all those chips. Today I’ll walk you through a tutorial of accessing the SI7021 via the Arduino Wire library.

Let’s Code MS DOS 0x16: Fire Exclamation Mark!

It’s summer and it’s hot. And what better to code than another classic demo scene effect: the ubiquitous fire. But we will do it with a twist. The naive implementation is slow, very slow. Especially on older 286-486 computers. We will optimize the actual algorithm a bit and utilize a hidden VGA function that gives us scaling in the X-direction by a factor of 4 for free.

Let’s Code MS DOS 0x15: Sine Tables

I got a question in the YouTube comments about the sine tables that we used for a few animations, like the Copper Bars, the Smooth Scrolling etc. In this episode I try to explain why and how to create sine tables. The idea is to speed up computations, since computing the sine or cosine — even with an FPU — takes an awfully long time on early MS DOS machines.