Bare Metal
I was watching an interesting piece on YouTube the other day about bare metal coding without an Operating System, which took me back to the 1990s and a couple of old Mac applications from the era. Both had an influence on ideas of mine when we were engaged in developing software for the use of film producers in finding appropriate North Wales locations for their productions. A couple of the inspirations for my 'discovering', or rather, misappropriating the easiest solution to the problem, were two pieces of Mac-based software produced in the early 1990s, both of which saw good good service with me throughout the decade.
The game 'Maelstrom', by Ambrosia Software, written by Andrew Welch, was a firm favourite of mine throughout the decade, as I'd been a bit of an addict of the arcade game upon which it was based: Atari's 'Asteroids' from 1979. The original game was hard-coded in logic chips and was very much of its era: simple line and point rendered objects in monochrome, running at a modest, but real-time frame rate. Maelstrom was one of a small clutch of computer games written for the earlier Macintosh colour computers, which, because of the limitations of their physical architecture and the restrictions placed by Apple on software developers at the time, weren't best suited to video-gaming.
In order to get around these limitations, Welch and many others resorted to very low-level programming to circumvent the limitations of the hardware available to them: assembly language. As I've mentioned before, it's about as far down into the bare bones of the hardware itself as you can get; so, even though the bulk of the code in Maelstrom was written in the C programming language, at the heart of the game's stellar [for its time] performance was around half the quantity of that code, written in pure assembly language. The C code was simply 'maintenance' code: menus, background rendering, input/output stuff; whereas the real deal was in the assembler code. Coupled with some very clever [probably not approved] use of the unique Macintosh 'Resource Fork' file architecture to store graphic sprites which could be 'blitted' entire to the screen with virtually no time overhead, you had a real time gaming experience which would otherwise have been impossible on the Mac platform as it was then.
The kicker in this case is that the code was so quick, the developers had to introduce considerable delay loops to slow down the gameplay to humanly-useable speeds. However, they did put an Easter Egg command into the software which allowed the user the pleasure(?) of attempting to play the game at full native machine speed, a frankly impossible, if amusing, task. I'll return to the subject of the second particularly brilliant piece of expedient coding and the use to which we could currently put this mindset to in a future scribble...

Where are the Jo(e) Watts?
ReplyDeleteATB
Joe