Porting my 1993 Amiga game to Godot, with an LLM reading the 68000 assembly
141 points by rabahs 8 hours ago | 49 comments
These are my notes from porting my Amiga game, which I originally built in Baghdad in 1993 in MC68000 assembly, to Godot, using Claude Fable 5 during last July holiday. It took an evening! Getting the feel right and shipping it took a few more weekends and evenings.

I spent the last few weeks analyzing what Claude did, feeding it my 33 years of memory of how I built the game, my notes and the git repos. It wrote the first draft of the article, and I edited line by line over a week. The screenshots of my 1993 map editor is the first I have run it since then. The one thing I never verified myself is the 108-byte explanation.

"Before starting everything, the model assembled the code using vasm on my Mac, and kept going till the binary is byte-identical to the binaries I had in my original game. Even after that, the there was mismatch of about 108 bytes. I originally used AsmOne which assembles into memory, and the game saved into the disk by saving that memory after running the game. So the original shipped files are a snapshot of the game that had already been running, not clean asm-one output."

Please post any questions. I am also releasing the original game for free.


mattjoyce 2 hours ago
A few weeks ago I downloaded a memory dump of a zx81 game, and ask Claude to build it in Go. It nailed it. Converted the binary back to basic and then to go. My idea was that the game would be unknown to llm training and perhaps a nice bench.

What a crazy thing it is to be first at the advent of personal computing, and then in the inflection point where AI treats that first experience as archeology.

reply
dannyobrien 46 minutes ago
I just wanted to add how much in awe I am at you creating this game in '93 in assembly. Around the same time I was trying to write a game on the Atari ST, and the dedication to the project -- especially when documentation was so thin on the ground, pre-Internet -- is extraordinary. Do you have any stories from debugging the game? I always found that the most dispiriting part, after the endless hope of handcrafting the code that I was sure would work first time...
reply
rabahs 28 minutes ago
Thank you for sharing your experience. It can be hard to remember all the details of debugging in assembly, but the main aspect I recall was managing game performance to ensure all rendering and processing stayed within 1/50 of a second. My technique was drawing a white line using the Amiga Copper, starting at the beginning of the top vertical blanking period. As I added more game objects, logic, and rendering, I had to make sure the line does not drop below the beginning of the active display area. If it went below that point, a frame would be dropped, resulting the game to flicker. I had to use many techniques to split the processing of the game objects in batches across multiple frames. Fun time.
reply
btbuildem 4 hours ago
> one copy of the Amiga Hardware Reference Manual

aka The Book... my, this brings back dusty memories

Babylonian Twins has such strong "Gods: Into the Wonderful" vibes, I wonder if that game was an inspiration for you

https://www.lemonamiga.com/game/gods-into-the-wonderful

https://www.youtube.com/watch?v=1kAXGjUwHyA

reply
rabahs 3 hours ago
The main inspiration for Babylonian Twins that nobody mentioned or even thought about was https://en.wikipedia.org/wiki/The_Maze_of_Galious it predates them all.
reply
anonzzzies 37 minutes ago
Ah! How many times I played that game. I missed it on the Amiga after and never unfortunately saw your game. Those old MSX games just had good ideas.
reply
glimshe 56 minutes ago
Great work! I'm planning to do that to another forgotten game (not mine) and it's great to see that this is now quite possible.
reply
rabahs 24 minutes ago
Thanks! Yes, this was not possible last year, and probably even a few months ago. Amazing times to revive forgotten games and software. Let me know if you have questions on my process.
reply
hedgehog 8 hours ago
This is fantastic. It would be interesting to have Claude Code export an engineering guide for doing similar ports, including descriptions of the tooling it built to do it. I've done some reversing from binary but never with results this good.
reply
rabahs 8 hours ago
This is a great idea. It could be a generic game porting skill to make the porting experience smoother. After my experience above. I have actually tried giving Claude binary files of games and it was able to reverse engineer to GoDot!
reply
hnlmorg 3 hours ago
Dumb question this, but how do you load it into Claude? I’ve only seen APIs for text and image uploads. Not random files. Or maybe that’s a limitation of the SDK I’m using?
reply
rabahs 2 hours ago
With Claude Code command line, you can point to any directory you have in your file system. In this case, Claude Code was working across three directories: the original game in assembly, the 2010 port in C++, and the new Godot port.
reply
sedawkgrep 4 hours ago
> I have actually tried giving Claude binary files of games and it was able to reverse engineer to GoDot!

Oh wow...I hadn't even thought of trying something like this. There are soooo many games from that era that I'd love to play again without the hackery of emulation.

reply
rabahs 4 hours ago
Just grab any game, especially old rom files form the 80s (I tried TimePilot and Road Fighter from MSX era). The model extracted the graphics, the sounds and then built the whole game. It takes less than 1 hour to port a 16kb rom file, in one shot. You will get a playable game, but you need a few follow up prompts to get it back to its original form. Usually some sprites or sounds issues, but very easy to fix, if you have played the original game.
reply
ericd 4 hours ago
Yeah, someone reverse engineered Red Alert 2 recently. Took Fable cranking for almost a month, but it's pretty amazing to see.
reply
asimovDev 4 hours ago
session stored on the drive would also contain all of the tool calls , right? unless op changed the default settings it would've expired though by now, since the run was in July
reply
rabahs 3 hours ago
That's a good point. I looked at the git history for my analysis. What is the best way to analyze claude sessions history? I definitely check if I still have them stored. Thanks
reply
asimovDev 3 hours ago
sessions are stored in the home folder somewhere but are deleted after 30 days by default. it won't be stored in the bash history, at least it does not for me on macOS with zsh + omz
reply
robviren 5 hours ago
I'm actually glad to see it stumbled in a few areas. Always surprised to see how much it gets right though. I had always hoped the rather obscure parts of computer history and games would be this incredibly difficult area for Agents to mine.

The amount of non standard hackish and obtuse things that had to be done to implement things in the past feel impossibly complicated to touch today. Lots of people made it up as they went along and used the hardware in ways no one expected. Reminds me of Tim Follin doing the audio for Plock on SNES and Miamoto being shocked the audio was real. It would be so interesting to see what we could learn about development of the past from agentic insights into how code was constructed. I love stuff like this an appreciate the in depth post.

reply
caruasdo 20 minutes ago
It's interesting to know this.
reply
ericd 4 hours ago
Wow, that's gorgeous for something written in assembly, running in 512k, nice work!
reply
efficax 4 hours ago
amigas were way ahead of their time. We had an Amiga 500 and then got a 386 and it was such a downgrade, but the Amiga was clearly a dying system.
reply
coder-pm 3 hours ago
Hmm did you ever run the game port against the original one in UAE? With the same inputs? Or is it just "it plays right when I play it"? That 108 byte delta is puzzling...
reply
Lerc 2 hours ago
There are a few instructions that are functionally equivalent. It is possible that one of the assemblers has the ability to auto convert equivalent behaviour instructions into smaller instructions that do the exactly the same thing. That is fairly common in assemblers. If one of the assemblers had a normalisation phase where they treat multiple forms of the same instruction as the same thing prior to checking if a more compact encoding is possible then that normalisation phase could be generating a same size instruction with same behaviour but with a different encoding. A small number of bytes different with same behaviour is what I would expect from a reassembly like this.

The proof of the pudding would be to have a look at what the differing bytes were encoding.

reply
rabahs 2 hours ago
You mean run them side by side ? No, I did not do that. I played the ported game on my Mac only. The movement feels right based on my thousands of hours playing the original. There was only small tweak I had to make the trampoline jump, but everything else ported so smooth. I think the decision that Claude made not to use Godot physics and just port everything as as, made the gameplay feels right without much tweaks.
reply
Lerc 2 hours ago
Have you been following the videos on Youtube of the Amiga port of Sonic?

Their approach to replicating the behaviour is to run the original game logic. The display has to be totally rewritten but they had the advantage of 68k for both machines.

I don't know of any games that used the blitter for calculation like some programs did for MFM decoding, that might have presented quite the porting challenge.

reply
a2ff6eeb0 4 hours ago
> Please post any questions.

Since Claude did the port, wrote the article, and apparently understands it better than you do at this point, can we ask Claude? Is there a git repo we can point Claude at to interrogate it on the way things were done? Maybe you can share the transcripts you used to port it?

It's marvelous that software can be written with minimal human input, but I guess I'm confused about why I would talk to the human that prompted the AI, rather than the AI that did the work.

reply
rabahs 4 hours ago
This is actually what I did to understand what happened during the port. I did analysis weeks after the game was ready.

While doing the analysis, I came to know about this 108 byte delta. I didn't quite understand the explanation Claude gave me. I added more details about this in the post above. It could be the difference in the assembler used, the environment used (Amiga 500 vs M5 Macbook), or how the binary was saved from memory 33 years ago

reply
sgt 4 hours ago
Very cool! Wish you had released it back then
reply
rabahs 3 hours ago
Thanks. I know the Amiga version took a long time. It was very hard to even look at the assembly code I wrote after so many years. AI was the hero that explained everything and helped me to package it for releasee. Enjoy!
reply
sgt 2 hours ago
How was Baghdad like in 1993? All I remember from that time was the Gulf war, Saddam and much conflict. I can only imagine how it would be finding hardware, books and resources such a time. That was hard enough even in parts of Europe.
reply
rabahs 5 minutes ago
Yes, it was a tough time after the war, but the main difficulty was the economic sanctions, which hit us hard. There are a few interviews and news articles published after I launched the mobile version back in 2010 that discuss our experience in the 90s. You can read more about it here: https://babyloniantwins.com/story/ I am happy to go into more detail on any aspect. I will be watching this thread regularly.
reply
Sharlin 3 hours ago
What I'm interested in is performance and memory use. How many times less efficient is the 2010 port compared to the original? What about this new one?
reply
TacticalCoder 49 minutes ago
> I spent the last few weeks analyzing what Claude did, feeding it my 33 years of memory of how I built the game, my notes and the git repos. It wrote the first draft of the article, and I edited line by line over a week.

Sooooo cool! I did something similar a few months ago: had the old source code (and executable files) of a game I wrote in 1991 (PC DOS) and a few notes in source code and, well, my old memories of how things worked. I didn't know how to compile it anymore but with the help of LLMs I managed to get it compiling again.

Since then I found about 8 pages of handwritten notes I took back in the days and I did immediately scan them and I added them to the repo.

Now my PC DOS from 1991/1992 does compile again and, well, I really should blog post about it one of these days (if only I had a blog...).

reply
byako 4 hours ago
porting a 93 game with an llm reading 68k assembly while i'm over here struggling to refactor last month's javascript. we are not the same. seriously cool project though
reply
saadyousfi 2 hours ago
[flagged]
reply
mattbruv 5 hours ago
I really tried to start reading this because I am interested in the idea, but the obvious AI writing prose is just so off-putting that I can't force myself to continue reading it without my eyes rolling into the back of my head. I'm not against using AI to code, but if you're actually passionate about the project and want to share it with others, you should use your own words.
reply
dang 4 hours ago
I mentioned the same thing to OP by email, but this story is too good to block on that.
reply
tomcam 3 hours ago
I couldn't detect it from my casual read. English is almost certainly OP's second language so it seems much more forgivable.
reply
dang 45 minutes ago
Yes, and that is unfortunately the worst of the fuzzy areas. We get a lot of emails from non-native English speakers asking why their posts are getting killed. This is what I usually say these days:

We understand that our non-native English speaking users are in a special position with all of this, and we sympathize - but we don't have an easy way to treat posts differently on that basis. What we're telling such users is to please write in your own voice and don't worry about any mistakes, because those are rapidly becoming signs of authenticity at this point (https://hn.algolia.com/?dateRange=all&page=0&prefix=false&qu...).

To judge by how the AI classifiers react, translation tools are leaving a ton of LLM imprints on text which are not strictly about translation. As many of us have been learning, it's hard to restrict what these systems do. They are overeager on every level.

reply
IshKebab 2 hours ago
Yeah I think it's not 100% AI but my vomit senses started tingling at

> The test was deliberate.

> Step one, the safe ask

> Step two, the unfair ask

My guess "AI write a blog post about this" and then he edited it, but didn't quite eliminate the stench. Pretty close though to be fair.

reply
aenis 4 hours ago
To me, someone with interest in amiga games and low level assembly ports, having that write up being done by hand wasn't load bearing.

Though I'd admit that using claude for a few hours every day this year desensitivized me to its prose :-)

reply
khazhoux 5 hours ago
There were a couple of AI tropes but not overly so. This is a great story, especially if you’ve programmed the Amiga before.

Think of it as: this is a story that quite possibly would not be told without AI to help with the writeup.

reply
rabahs 4 hours ago
Your last point is exactly right. I wouldn't have had the time to do this port and write-up without the help of AI. Having said that, the AI wrote this based on my own notes and I edited and reviewed every line over a week. AI also helped with extracting screenshots and code snippets which would have taking me more time. I don't like to read AI writing either, but I thought that the fact that this is based on my own notes and experience and using original code and screenshots from the 90s would be of interest to the community. Thanks
reply
sitkack 4 hours ago
Tics, tropes are worn out predictable plot devices
reply
lstodd 4 hours ago
What's the point though? If you got the stuff it's better run in UAE. If you have none I don't trust you and therefore think the Amiga name is misleading. To gain trust here show some code running in UAE.

There is no point in "porting to Godot" because either you port Amiga stuff to UAE-likes or FPGAs or you in fact advertise "AN AI REWROTE MY CRAP GWBASIC GAME FROM 93 LOL". Lol. Which is riduculous.

and people will just laugh.

also 68k asm is actually human-readable compared to x86.

reply
cstrahan 27 minutes ago
Suppose there are two options: remaster the game with AI assistance, or don’t remaster the game at all (because that would entail porting 72,758 lines of assembly by hand, and the time-to-reward ratio would be deemed to low for most people).

Why complain about the outcome? The old game remains available, and you can play it for free. This isn’t some zero sum situation where the existence of the remastered game sets the world back in some way. I could see being more interested (or only interested) in playing the original, but I don’t see what motivates the negativity.

reply
urbnspacecowboy 3 hours ago
This is inordinately harsh, though I agree with wanting to just play the original Amiga game. It's available at the following link from all the way at the bottom of the article: https://bithunch.itch.io/babylonian-twins
reply
lstodd 3 hours ago
[flagged]
reply
rabahs 3 hours ago
Thanks for the feedback. If you have read the article, I also mentioned that I have released the Amiga version for free to the Amiga community. AI actually helped addressing a few bugs and get it ready. You can download the ADF and play the full Amiga game for the first time since 33 years ago. This post was more about my experience using AI and interacting with assembly code from the 90s.
reply
tomcam 3 hours ago
You handled GP's post much better than I would have.
reply