Top
Best
New

Posted by rabahs 15 hours ago

Porting my 1993 Amiga game to Godot, with an LLM reading the 68000 assembly(babyloniantwins.com)
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.

232 points | 68 commentspage 2
glimshe 8 hours 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.
rabahs 7 hours 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.
saulpw 6 hours ago||
Which game are you planning to do? We all should coordinate so we're not doing the same games repeatedly.
smilbandit 4 hours ago||
I've been wanting to do some ports of old games i liked on the atari 400 i had as a kid. some of them I want to see if they would translate to a mobile web game. couple i'm looking to translate are Archon, lode runner, balderdash and maybe some of the ultima games, I really liked ultima 4.
coder-pm 10 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...
Lerc 9 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.

rabahs 9 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.
Lerc 8 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.

rabahs 7 hours ago||
No, I have not. I will definitely check before releasing the Amiga port inside the Steam. I think that would be the right approach, especially if you are porting a game you have not played enough. I did use blitter for all graphics. Now you mentioned MFM, I remember I wrote some disk copy protection code back in the day that leverages MFM encoding. I will check if that code is still around.
Sharlin 9 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?
rabahs 6 hours ago|
Are you interested in comparing the 2010 remake (C++) to the original (Assembly)? They are quite different games, so hard to compare, but both run at peak frame rate for their respective platforms (60fps vs 50fps).

I have not compared the 2010 port to the current Godot port. However, I felt the Godot port was smoother. I think that was because Godot uses the latest graphics frameworks (e.g Metal) vs old Opengl ES 1. It would also be interesting to compare the godot port of the original game vs the original in assembly. Curious how I can achieve that. A good question to ask Claude.

byako 11 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
sgt 11 hours ago||
Very cool! Wish you had released it back then
rabahs 10 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!
sgt 8 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.
rabahs 7 hours 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.
caruasdo 7 hours ago||
It's interesting to know this.
TacticalCoder 8 hours 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...).

rabahs 7 hours ago|
Thanks for sharing. It is truly an amazing feeling when AI helps us excavate the past. I never thought I would be able to do so. I'm so glad I kept all my files over the past 33 years.
a2ff6eeb0 11 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.

rmunn 1 hour ago||
> ... confused about why I would talk to the human that prompted the AI, rather than the AI that did the work.

One reason is because you can't talk to the AI that did the work, not unless the human who prompted it is able to hand you a file with the complete session and/or context data. (And I'm not at all certain whether Anthropic would allow users to obtain that kind of thing, since it would probably be extremely useful to people trying to distill their models. It's possible they might allow user A to say "Hey, allow user B" (or anyone with the link) "to access my session with GUID ba5eba11-1234-5678-abcd-0decafc0ffee", but I doubt they'd ever allow context data to be downloaded and passed around).

Without the context, you're talking to a different instance of the AI that doesn't have the memory of the instance that ported the code, so the answers you get won't be nearly as useful.

rabahs 10 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

More comments...