Archive for August, 2008

File and Memory Offsets with DOS DEBUG

Friday, August 29th, 2008

I often use the DOS DEBUG command to investigate older 16-bit programs; while there are doubtless better tools, DEBUG is ubiquitous and effective. There are many guides to its operation, but here I focus on a specific and practical question: How does one translate between file offsets and memory addresses?

(more…)

JSON Data Formats (Bloxorz)

Friday, August 22nd, 2008

After writing last week’s post on a Bloxorz solution algorithm, I was inspired to revisit the solver to make it a little more useful. In addition to cleaning up a few minor bugs, I preloaded it with all 33 levels of the original puzzle, so that users would no longer have to input a level before finding its solution. I wasn’t entirely happy with the data format I ended up using for the levels; my mistakes may be instructive.

(more…)

Bloxorz/Bloxors

Friday, August 15th, 2008

A few months ago I came across a cute little puzzle game called Bloxorz. Inspired by Norvig’s Sudoku solver, I hacked together a JS-based pathfinder for Bloxorz problems. Although the proper spelling of the game’s name continues to frustrate me, the puzzle turns out to be easily solved with breadth-first search.

(more…)

1985 Data Structures (Hacker)

Friday, August 8th, 2008

Editorial note: I enjoy poking around the innards of old computer games. I think it’s interesting to learn how the things worked, especially since they often had to cope with formidable resource restrictions. This is one of an occasional series of articles on things I found while looking through assembly code.

Hacker

Hacker is a 1985-vintage computer game; Wikipedia offers a good overview of it. A large part of its gameplay is given over to navigating through a maze-like system of tunnels. Hacker uses a simple look-up table to represent this maze, which I thought was a particularly elegant solution.

The analysis which follows is based upon a particular (PC) version of the game. The MD5 of the executable is:

  • a75940020c4d18e353203a2211ffca74

(more…)

Working with binary data in JavaScript

Friday, August 1st, 2008

I recently needed to manipulate some binary data within JavaScript; my data stream was represented as a series of bytes, and I needed to extract floating point numbers from it. There were some existing solutions available on the Internet, but I thought that there was room for improvement. I wrote a generic solution (JS file here) to the problem, modeled on Python’s struct module.
(more…)