▲ 59 r/ClaudeGameDev+1 crossposts

Claude and old games

One of the interesting things about old games is just how small their code and binaries were.

Take Elite, my favorite game of all time. The whole thing fits into roughly 42 KB. And even some of that isn't really game code: there's copy protection, the screen buffer, and simple things like lookup tables used for fast calculations.

The result is that a complete Spectrum game can fit into Claude's context window.

I've been experimenting with the Claude coding agent, and it turns out that:

- Claude can directly read and understand compiled machine code for old computers.

- It is possible to make a very precise port of an old ZX Spectrum 48K game, even something as complex as Elite, to a modern platform.

- You can untangle the original highly optimized game logic and study long-forgotten secrets and outstanding bugs.

- With some guidance, you can even *improve* the original game and bring it closer to modern gaming standards.

Take Elite. I managed to port it to Java, move it to a modern 60 FPS engine, improve the controls and save system, and fix a number of original bugs.

If you want to dive into a modernized classic, you can play my version of Elite online:

https://scf37.me/tools/games/elite

reddit.com
u/Scf37 — 10 days ago

Speccy and coding agents

One of the awesome things about old games is just how small their code and binaries were.

Take Elite, my favorite game of all time. The whole thing fits roughly into 0x5B00 - 0xFFFF — that's 42 KB. And even some of that isn't really game code: there’s the Lenslok code (throw-away stuff), the screen buffer, and simple things like the squares table used for fast multiplication.

The result? A complete Spectrum game image can easily fit into a coding agent's context window.

I’ve been experimenting with the Claude coding agent, and it turns out that:

  • Claude is perfectly capable of reading Z80 machine code directly, without a disassembler.
  • It is possible to make a very precise port of an old ZX Spectrum 48K game, even something as complex as Elite, to a modern programming language and platform.
  • You can untangle the original highly optimized game logic and study long-forgotten secrets and outstanding bugs.
  • With some guidance, you can even improve the original game and bring it closer to modern gaming standards.

Take Elite. I managed to port it to Java, move it to a modern 60 FPS engine, improve the controls and save system, and fix a number of original bugs.

Ever wondered why the police sometimes attacked you even when you were clean?

IT'S A MEMORY OFFSET BUG IN THE ORIGINAL CODE!

The aggressiveness check reads the low byte of your combat rating instead of your legal status, making police attacks essentially random.

And why are firearms useless to trade even though they're banned goods?

Another bug. The price is simply wrong, so I "fixed" it by setting the price directly.

And there is plenty more fun stuff hiding in those 42 KB.

If you want to dive into a modernized classic, you can play my version of Elite online:

https://scf37.me/tools/games/elite

reddit.com
u/Scf37 — 11 days ago
▲ 3 r/freegames+1 crossposts

Boulder Dash clone. In browser. For mobile

Classic arcade game ported to the web. Supports both desktop and mobile browsers.

It is both a fully playable game and a technology demo, sources included. For desktop users, there are cheat codes for more (or less) fun.

Sorry for no music, I'm struggling to find a) free b) decent c) okay for everyone tracks.

scf37.me
u/Scf37 — 3 months ago

Boulder Dash clone. In browser. For mobile

Classic arcade game ported to the web. Supports both desktop and mobile browsers.

https://scf37.me/tools/games/boulder-dash

It is both a fully playable game and a technology demo, sources included. For desktop users, there are cheat codes for more (or less) fun.

Sorry for no music, I'm struggling to find a) free b) decent c) okay for everyone tracks.

https://preview.redd.it/6j8vmtwr5jfh1.png?width=740&format=png&auto=webp&s=fde9a2347f3fd1f6c7c5ea5d53a7d1346fafa503

reddit.com
u/Scf37 — 3 months ago
▲ 204 r/coolgithubprojects+1 crossposts

SpaceMonger in Java

Recently I found out SpaceMonger - one of the best disk space utilities out there (despite being created 25 years ago) has gone open source. So I took my time to port it to Java.

From user side. Yep, works on Linux. Yep, works on MacOS. Yep, still works on Windows however much more bloated than original 217K EXE. However, now it correctly handles all the filesystem stuff - links, sparse/compressed files, mount points (Windows and Linux only, I have no MacOS machine to test so MacOS is best-effort).

From technical side. Good old Swing, FFM API for native calls to precisely query filesystem metadata, Java is kind of limited there. Jlink for awesome 30Mb downloads. Unfortunately, native-image binary crashes miserably on Linux. jpackage launcher is unstable too - i've seen successful launches, JVM crashes and even double free errors.

Source code and downloads: https://github.com/scf37/spacemonger1/

u/Scf37 — 5 months ago