Just keeping it real, a series of articles on oldskool/retro programming

Just keeping it real… old skool style
The article that started it all, covering CGA, EGA and VGA mode X programming, developing an efficient polygon rasterizer.

Just keeping it real, part 2
Briefly wraps up the CGA/EGA/VGA programming, then moves on to rendering polygons using the Amiga custom hardware.

Just keeping it real, part 3
Continues the exploration of the Amiga’s custom hardware where part 2 left off. Discusses the actual steps required to render a polygon on Amiga.

Just keeping it real, part 4
Wraps up the Amiga polygon business, and then discusses the merits of convex n-gon filling over just triangles. It closes off with a quick discussion of an old textured triangle renderer for 486 systems.

Just keeping it real, part 4.5
Talks about the limitations of the EGA palette in 320×200 resolution, and about the VGA palette being mapped on top of the EGA palette when using EGA videomodes on a VGA card.

Just keeping it real, part 4.6
Goes into the EGA modes on VGA cards somewhat more, and how this mode is faster than mode X for polygon filling. Also discusses some early games and demos using this trick.

Just keeping it real, part 5
Covers adding subpixel correction to the polygon fillers for both the software DOS routines, and the Amiga’s blitter-accelerated routine.

Just keeping it real, part 5.1
Picks up where part 5 left off with the Amiga, and introduces a hybrid blitter/CPU rasterizing method which works well enough for subpixel correction.
Also throws in some Tandy and Hercules renderers for DOS, for good measure.

Oldskool demo fixing
One of my favourite demos of all time is Triton’s Crystal Dream, a 16-bit DOS demo. Its Sound Blaster detection routines are very buggy however, and don’t work on faster machines, such as the 486 machine I have. I have patched the demo so the Sound Blaster works on my 486 now.

Triton’s Crystal Dream restored and preserved for posterity
After I had fixed Crystal Dream, I collected some capture equipment and uploaded a ‘perfect’ capture of the demo to YouTube (the versions on YouTube have buggy graphics because of Dosbox, and/or have bad sound because they had to use PC Speaker or LPT DAC instead of Sound Blaster).

A brief overview on the history of 3D graphics hardware
The title says it all.

Commodore 64: 30 years of keeping it real
An homage to the Commodore 64, the computer I grew up with, which is still alive and kicking in the demoscene, 30 years after it was first introduced.

Direct3D versioning and compatibility
An overview of Direct3D API and driver versions, for people interested in retro-programming on Windows.

Visual Studio versioning and compatibility
An overview of which Visual Studio versions you can use for which versions of Windows, if you want to do some retro-programming.

Just keeping it real, part 6
This time I briefly talk about the demo that won the Recursion 2012 party, for which I wrote the 3d renderer (based on the code discussed in this series).
Then the main part of the article covers the PowerVR PCX2, an early 3d accelerator add-on card, which had its own PowerSGL API, and some interesting, yet quirky features.

Chiptunes…
‘8-bit’ or ‘chip’ music seems like a popular fad… but most people seem to have no idea where the term ‘chiptune’ REALLY came from. It was the Amiga of course.

A little knowledge can be a dangerous thing
People seem to be so far removed from the old computer systems I cover in this series, that they have no idea just how expensive a 386 was at its introduction, and why it took so long until 32-bit computing finally became mainstream.

Just keeping it real, part 7
The Amiga content only covered the classic OCS/ECS machines so far (Amiga 500/1000/2000). This time I cover the later generation of Amiga’s using the AGA chipset (A1200/A4000).

Just keeping it real, part 8
An introduction to the Commodore 64, its hardware capabilities, and some useful online resources to get you started with programming on the C64.

Just keeping it real, part 9
Getting more in-depth with the C64, explaining how graphics and music were done in assembly, with carefully handcrafted code, and often cycle-exact routines. Demonstrates a stable raster routine with a raster bar effect.

Just keeping it real, part 10
This time I explain how to extend the C64’s mathematical capabilities beyond just 8-bit addition and subtraction, and how to implement a multiply and divide routine, since the 6510 CPU does not have these instructions in hardware.

Just keeping it real, part 10.1
Taking multiply and division to a more advanced level. Explains how to handle signed numbers, how to extend the precision of the operations, and how to speed up the multiply using a precalculated table (one that actually takes an acceptable amount of memory on a system with only 64k in total).

Revision 2013 is keeping it real
A quick write-up on one of the biggest annual demoscene parties, and the retro/oldskool things that were happening there.

Just keeping it real… like it’s 1991
Explains the PC intro I wrote for the 1991 party.

Just keeping it real… bugfixing like it’s 1991
An in-depth analysis of the bug that prevented me from having music in the 1991 donut intro at the time.

When old and new meet: lessons from the past
Discussing some things I have learnt over the years from bringing old code to new environments, and bringing new code to old environments.

CGADEMO by Codeblasters
Discusses my reverse-engineering and optimization of one of the very few demos that exist for the original IBM PC with 8088 and CGA.

Test Drive’s pixelized transition effect
A quick and fun look at this clever effect, and how to optimize it further, for no apparent reason other than being… fun.

Triton’s Crystal Dream – the final chapter
Discusses DOSBox-X, a fork of DOSBox which has some features and workarounds to run Crystal Dream correctly.

Just keeping it real at Revision 2015
Our winning oldskool demo on the original IBM PC 5150 with CGA at Revision 2015.

8088 MPH: How it came about
Some background information on the development process of 8088 MPH.

8088 MPH: Sprites? Where we’re going, we don’t need… sprites!
An explanation of the sprite and scroll routines used in 8088 MPH. They involve compiled sprites, setting up a special tweakmode to free up offscreen memory, and some timing to race the beam, since there is no double-buffering.

8088 MPH: The polygons
An explanation of the polygon routines used in 8088 MPH. Because of the limited bandwidth on CGA, the renderer will find the differences with the previous frame first, and draw only the changes, since drawing the whole screen would be too slow.

8088 MPH: The final version
The party-version of 8088 MPH was still a little rough around the edges, so we decided to make a final version with a bit more polish and compatibility with a wider range of systems.

Fixing Genesis Project’s GP-01
The demo group Genesis Project released a demo for 8088/CGA machines as well. Sadly, the original release did not work on real machines, only in DOSBox. In this article I describe the process of reverse engineering, debugging and fixing the demo to work on a real IBM PC/XT 5160.

Latch onto this, it’s all relative
Some tricks on how to use the timer for stable timing even during varying intervals, by making use of its latched mode. And a mention of the auto-EOI function of the 8259A, which avoids the need for manual EOI-code in your interrupt handler.

PC-compatibility, it’s all relative
This goes deeper into the 8259A and auto-EOI functionality, discussing variations in chips and configurations you may encounter, and how to write your code in a way that it can reliably work on a wide range of PC systems.

That’s not Possible on this Platform!
At Revision 2016, a year after 8088 MPH was released, we won a Meteorik award in the category “That’s not Possible on this Platform!”. This article looks back on 8088 MPH and what happened during that year.

Commander Keen 4: now in 16-colour composite CGA!
VileR, who did all the graphics for 8088 MPH, has re-done all the graphics for Commander Keen 4, and also modified the code where required, so that it now makes use of the 16-colour composite mode on CGA. The game has never looked this good!

Any real-keeping lately?
After a bit of silence, an update on things that are in the works, mainly relating to audio on early PC hardware.

Putting the things together
Another update, mainly discussing the Tandy soundcard from lo-tech, and how to program it to play VGMs, including sample playback.

DMA activation
Using the DMA controller to play back digital audio on early Sound Blaster cards, and why the Sound Blaster could not do seamless playback until the firmware for the DSP was updated to v2.00 (which could be done on any early Sound Blaster, as Creative supplied updated DSPs for this).

Trackers vs MIDI
Looking at two different worlds of early audio formats: trackers and MIDI.

Trackers vs MIDI, part deux
Focusing specifically on the FM synthesizers used on early AdLib and Sound Blaster cards on PC, and how MIDI was not doing them a lot of favours in many cases.

The Covox years
Looking at the odd Covox Speech Thing device, a low-end sound device from the mid-to-late 80s, which connected to a printer port. It also describes how it was reverse-engineered to make a very high-quality and faithful CVX4 clone.

More PC(jr) incompatibilities!
Looking at some more details in the convoluted IBM PC standard, which may differ from one implementation to the next.

What makes the PCjr cool, and what makes it uncool?
An in-depth look at how the PCjr differs from a regular PC in terms of hardware and software support.

Putting the things together, part 2: MIDI and other problems
As I adapted my timer-driven background routine for playing VGM files to support MIDI files, I ran into some new problems, related to how long it takes to process each command. And found some new solutions to deal with them.

6 Responses to Just keeping it real, a series of articles on oldskool/retro programming

  1. Pingback: Just keeping it Metro | Scali's OpenBlog™

  2. Sandy Joseph says:

    Dear Scali,

    My name is Sandy Joseph and I work for Packt a UK based publishing firm that specializes in publishing tutorials and guidebooks on a wide range of software.

    I’d like to bring to your notice that we have recently published a shading language book titled HLSL Development Cookbook. Written by Doron Feinstein, this one of a kind book provides recipes to implement powerful shaders with the High Level Shader Language used within games and simulations using the DirectX 11 API. You can check the book page for a complete overview(http://www.packtpub.com/high-level-shader-language-development-cookbook/book)

    I would be more than happy to provide you with a free e-copy of the book, if you’d be interested in reviewing this book.

    I have written to you considering your expertise/interest in the field of Direct X as mentioned on your blog and also evident in your posts and also I couldnot find your contact details hence had to mention my message in the comments section. Apologies for the inconvenience caused.
    I feel a review of this book would aid HLSL/Direct X enthusiasts to a great extent.

    I look forward to hearing from you.

    Regards,
    Sandy Joseph

  3. Pingback: When old and new meet: lessons from the past | Scali's OpenBlog™

  4. Pingback: Software: How to parallel? | Scali's OpenBlog™

  5. Pingback: Am I a software architect? | Scali's OpenBlog™

  6. Pingback: Retro programming, what is it? | Scali's OpenBlog™

Leave a comment