HNHacker News
TopNewBestAskShowJobs

ahefner

327 karma · joined June 23, 2012

submissionscomments
ahefner··on DOS game “F-15 Strike Eagle II” reverse engineering/reconstruction war stories
On the NES (or other 6502 machines), use assembly. That CPU just isn't a good target for C - pointers are awkward, you can't really do stack frames, and the addressing modes don't even support 'structs' very well. Fun to program assembly on, though. For your purpose the NES makes it double hard because it hardly has any ram (2 KB, and typically an additional 8 KB inside each cartridge except in the oldest games), and a character-mode graphics architecture rather than a framebuffer. If you do really want to do an 8-bit flight sim, the Atari 400/800 machines are an okay target. The Atari ST would be a better target.

Speaking of those machines, I'd love to see someone deeply reverse engineer the pseudo-voxel/fractal landscape engine that Lucasfilm Games invented for Rescue on Fractalus, Koronis Rift, etc. It still seems completely magical that they could pull that off on a machine with those specs.

Starting from zero, you might start at a high level and work your way down. Do a simple polygon flight engine using OpenGL and your favorite high level language of choice. Then write your own polygon rasterizer that you can overlay versus the OpenGL rendering as a reference. Then maybe rework it in pseudo 8-bit code (C constrained to only unsigned char variables, or similar), which should translate directly to assembly language on the target of choice. On a real 8-bit machine, unless you want low single digit frame rates, you probably have to pull a lot of dirty tricks. Maybe a 16-bit platform would be a better choice. This is speculative - I learned 3D (to a novice degree..) on a 486 PC under 16-bit DOS using C and assembly for inner loops (bitblts, texture mapping).

There's something about the aesthetic of late 80s PC flight sims (F-19 Stealth Fighter, LHX Attack Chopper, etc.) and their flat shaded polygon graphics that feels in vogue right now. Check out Thunder Helix on Steam.

Anyway there's definitely a magical feeling writing graphics code when you get your first feeling of realistic movement and rotation in 3D space working. Hopefully the ubiquity of ultra-realistic doesn't diminish that sensation too much.

ahefner··on Apple apologizes for iPad 'Crush' ad that 'missed the mark'
Never apologize.
ahefner··on A portable Common Lisp toolkit for building inspectors
It would be interesting to see if there are any useful integrations possible between this and 'Clouseau', the Inspector provided by McCLIM (McCLIM being a somewhat idiosyncratic UI toolkit implemented in pure Common Lisp). Years ago I'd extended Clouseau to do implement some custom visualizations of data structures in a work project, where I recall it was a relatively straightforward matter of specializing certain generic functions, but no longer recall the details.
ahefner··on The Unix-Haters Handbook (1994) [pdf]
"were as"
ahefner··on The Unix-Haters Handbook (1994) [pdf]
"were around". Not "where around".

Sorry to nitpick but I've seen this grammatical error in comments here three times just this morning and it begins to grate.

ahefner··on Don Bluth's Garage Band
"were". Not "where".
ahefner··on Autoconf makes me think we stopped evolving too soon
autoconf is a mess for developers, but when it's working it is great for users who want to build software from source. Fantastic feedback and help at the command line to enable/disable features and dependencies. Much friendlier than cmake, at least.
ahefner··on Apple to wind down electric car effort after decadelong odyssey
> ...or even just looks (i.e. fake chrome bits, spoilers and vents that don't do anything etc.)

Yes, and such decisions exemplify the horrible taste of many car designs, designers, and possibly buyers.

ahefner··on Game Font Forensics
And a partial answer to this, my memory being jogged by the linked article's mention of Autodesk Animator (which I spent a lot of time with as a kid), is that Autodesk Animator includes a font SIXBYSIX.FNT appears identical to the Atari's 6x6 ROM font, to the extent I can find examples to compare. Ignoring the riddle of this or that Amiga game, this is a perfect link between VGA-era DOS games, for which I'm sure Animator (Pro) was often used for art, and the Atari ST, because Autodesk Animator is a direct descendant of the program Cyber Paint on the Atari ST (another program I spent a lot of time with as a kid), both programmed by Jim Kent. It's perfectly possible that one of the ST ROM fonts hitchhiked along in the conversion from ST to PC and started cropping up in PC games.
ahefner··on Game Font Forensics
One thing I've wondered lately is about the 6x6 fonts (or perhaps one particular one) that I've seen in all kinds of old (late 80s to very early 90s) games, particularly on Amiga and MS-DOS platforms. The Atari ST had a 6x6 font in ROM (see https://fontstruct.com/fontstructions/show/876150/atari_st_6 for an example) and I think I've seen text that looks just like it in games that I know where developed first for the Amiga, as well as some early VGA DOS games. Maybe there's cases where artists were drawing graphics first on an ST, weird as that seems for an Amiga production - people have to use whatever tools they have at hand, so if that's an ST with Degas, Neochrome, or whatever, so be it. I considered maybe there was a similar font included with Deluxe Paint, but I can't find any indication of that. Perhaps instead a 6x6 character cell (leaving, really, 5x5) is just so constrained that there are very few ways to draw legible characters, and that's the reason for the uncanny similarity. Or perhaps the font got ripped and converted to some other format that was then passed around.

I suppose I should start collecting examples of this font as I spot them, for comparison.

ahefner··on Unicomp's "New" Model M Keyboard
I think they're generally reliable. I have a pair of Filco keyboards, one five years old, the other ten, and I haven't had any trouble except I did have to open the older one up and clean it recently as a couple switches had gotten gunked up.
ahefner··on Pkl, a Programming Language for Configuration
...and yet Python people routinely fail to grasp this and end up writing ad-hoc config language interpreters on top of yaml anyway.

Granted the conveniences of Python syntax for code are mostly lost when trying to express tree structured data, and yaml flips that on its head.

(Mumble, grumble, something about s-expressions...)

ahefner··on Sudo-rs' first security audit
So I inherited a machine in our lab last week (not a "production" or "test" server, just a random machine being used as a dev environment) and decided to change its hostname using systemd's hostnamectl. Subsequently every attempt to execute a command via 'sudo' caused it to hang for multiple tens of seconds before declaring it couldn't resolve the new (nonexistent, entirely local) hostname. This persisted until I eventually fixed the /etc/hosts file which the systemd thing had failed to do, and I still don't know why sudo wanted to look up this hostname over the network, or what bad things could've happened if one of the configured DNS servers had maliciously replied for it.
ahefner··on Tell HN: Automatic fraud detection is making my life hell
Thanks for the information!
ahefner··on Tell HN: Automatic fraud detection is making my life hell
Interesting. I was considering opening a second account specifically as a backup card and hedge against lockouts while travelling, and Schwab was high on my list, but it sounds like based on your experience that they are not fit for purpose.
ahefner··on Microsoft now demands to know why you won't use Edge when you download Chrome
What if, like so many capable engineers, he deep down loathes Windows and wishes to do it harm?
ahefner··on The Ur-Quan Masters: Open-source remake of Star Control II
Yeah, it's either crushing everyone with an invincible upgraded flagship, or mastering the delicate art of the Secret Spathi butt-torpedo strafing run and save-scumming whenever you accidentally lose your 1 Spathi ship.

I loved the melee mode in the original Star Control for the combat, and I love Star Control 2 for the exploration and the story.

ahefner··on Text showdown: Gap Buffers vs. Ropes
The contents of the line-tracking buffer (ignoring its gap for a moment, which you could move anywhere) only change when the text-buffer's gap moves. When that happens, each time a line break moves across the gap, you need to update its index in the line tracking buffer.

It doesn't directly matter where the gap is in the line-tracking buffer except ideally it's positioned consistent with the user's cursor so that if they insert a bunch of new lines, they're inserted into the line-tracking gap.

The position of the line-tracking gap doesn't effect the values stored on either side of it gap, so you can still use memmove there.

ahefner··on Text showdown: Gap Buffers vs. Ropes
Moving the gap from front to end - it takes O(n) time to do that both on the text (gap) buffer and the line-tracking (gap) buffer, so you're only a small constant factor worse.

Find the position of the Nth line is O(1) because N is either before the gap, in which case you just look up the Nth entry in the line-tracking buffer to get the position in the text buffer (which can be similarly mapped back to a position not including the gap in constant time if that's what you need), or N after the gap and you adjust the arithmetic to include the size of the gap.

ahefner··on Text showdown: Gap Buffers vs. Ropes
A neat trick with gap buffers is you can track the line boundaries as indices into the gap buffer itself rather than 'real' indices into the document. In this way the indices of line starts seldom change except when the gap buffer is resized. You can then keep a second gap buffer, this one recording the start of line indices, and keep its gap in sync with cursor movement in the text gap buffer, making insertion cheap and giving a trivial way to map from line numbers to a position in the gap buffer. No trees necessary.
ahefner··on UK Parliament passes Online Safety Bill
"Think of the children", except the population increasingly doesn't have any. It's nice then to imagine that approach would stop working at some point in the future, but probably not.
ahefner··on The Power of Prolog
I understand in practice that "nobody knows or likes Prolog" is a valid criticism, but was it a sound idea technically?
ahefner··on I Really Miss Laravel
There's a kernel of a brilliant idea to it, but when it's really just marketing speak for spinning up a VM or container on demand, it's kind of a joke.
ahefner··on AtariAge and Atari
Oddly, I grew up (in the 80s!) feeling the way you describe about the 2600, that it was just too crude to revisit.. but when i finally bought one some years back, paired with an authentic CRT, I was really enchanted by the elemental simplicity of the games, the instant snap response with no input or display lag, sharpened further by the pixel-perfect (and intuitively predictable) collision detection being done within the video chip. My console sweet spot previously had been the NES and some early 16-bit machines, but for the raw fundamentals of a lot of shooter-type games, the 2600 felt so much better - and to a lesser degree its successor in the 8-bit home computers, but with their expanded capabilities those machines gave developers more rope to hang themselves. Yar's Revenge, Demon Attack, Berzerk - there's real magic there, just you versus the circuitry.
ahefner··on The Colonel’s Bequest – Case Cracked (2020)
I had a good hacking opportunity on this game as well - a chap named Ravi Iyengar made a General MIDI sound driver you could drop into these SCI0 games (apparently they all did MT-32, but none did General Midi, and the driver from the later engine games wouldn't work), but for Colonel's Bequest the game would hang at the end of the intro sequence due to some sort of callback telling the script code the music had finished playing, which I identified and provided a patch for.

Funny thing to reminisce on an afternoon 20 years ago, hacking on a driver to upgrade the sound in a game that was already by then ~14 years old which I'd played as a kid.

Funnier still that only six months back or so I replayed this game again, but not before patching my ScummVM with a custom palette that I thought suited the game a little better than the default garish EGA colors..

ahefner··on Places on Google Maps. Can They Still Be Trusted?
Curious. For a few years I'd have looked to Google Maps / Google Local as one of the great services Google provides (along with gmail, Chat, Android, Chrome and ChromeOS development...) as an argument for how ad-supported Google is a substantial net benefit to society and against any antitrust or punitive government action. Call the legitimacy of the maps data into question and another pillar of the empire begins to crumble - not directly from any misdeed of Google, just a naive (or not..) reliance on algorithms and crowd-sourcing and inability to deal with the flood deliberate/malicious gaming of their systems by third parties.

A minor tragedy of the past 15 years of social networking is it feels like we're reaching the end of that era and, despite every opportunity for better or worse (e.g. Facebook's real name policy), we've emerged with no useful reputation system or web of trust to stem the tide of spam and SEO garbage.

ahefner··on Open-source canvas drawing web app, built using React
Any reflections / lessons learned from this project?
ahefner··on TSA is cracking down on CLEAR at airport security
Thanks. The original linked site was very suspicious. Seemingly invented persona with stock photo, site pushing credit card offers... "Thought leader in travel" indeed.
ahefner··on Symbolics CGI production notes: How Stanley and Stella came together (1988)
I first saw this animation on a VHS tape as a kid - ever since I learned about Lisp and Symbolics and all that history, I've thought it would be cool to redo this animation rendered in real-time. Hardly a challenge for modern computers - or probably even computers from 20 years ago.
ahefner··on Large-scale analysis of code re-use in Atari 2600 games (2022)
Was that really a thing? I ask because it feels like what I see people doing today around cloud and related technologies (kuber-this, kafka-that, etcd.), choosing solutions even before defining their problem.
← PreviousPage 2 of 7Next →