Why not use a tool if it’s available, right? I’ve been experimenting
with ChatGPT for a while and it writes generally abysmal Assembly
code for the C64. That’s probably because its training data on this
specific language is tiny. Now I would really like to have a generator
that does all of the boring stuff discussed in the previous post. Writing
reams of repetitive code to parse out individual words is not my idea of
fun, but it’s a necessary evil to get this game working. So I recruited
the machine to do the machine’s job!
Following up on yesterday’s conceptual musings, here’s some more meat to
the actual implementation. In this blog I’m exploring the actual Assembly
code that converts individual words to tokens for use by the input parser
later on in the process.
Leisure Suit Larry originally featured a free text input system that allows
the player to enter instructions for Larry to carry out. These instructions take
the form of sentences in plain everyday English. Parsing and interpreting this
so that a video game can make sense of it is quite a challenge. Can we teach a
computer English? It seems so, but not one from the 1980’s. The Commodore 64
does not have the RAM nor does it have the CPU to completely parse English
setence structures and grammar. But the good news is: neither did the PC on
which Larry first came out. There are tricks involved!
As mentioned earlier, I’m not porting AGI but writing Larry again from
scratch to cater to the specific strengths and weaknesses of the C64 as
a platform. I’m doing this in 6502 Assembler as that’s the only way for
me to gain the required speed and control over the hardware that is
needed to pull all the tricks I need. In this post I’ll provide more
detail on how the screen actually gets drawn.
To borrow the words of the greatest hero of all time who never
was, Samwise Gamgee: I’m back! And it’s been quite a ride
this past month. Let’s stick with the project and surrounding
computer stuff for now.
Nobody knows why exactly, but my cartridge code is now alive.
The problem is on the C64 side of things and mainly has to
do with the routine that would copy my bootloader into a safe
RAM location.
Started a new Git project for Larry on cartridge. Adapted the
framework I found online and things now work. I can actually
load a cartridge reliably and get the machine into a state that I
can work with. Decided to do an intro sequence for the game. It
helps that this forces me to deal with bitmapped graphics again,
which is something I hadn’t incorporated into the automated
build before.
Started a new Git project for Larry on cartridge. Adapted the
framework I found online and things now work. I can actually
load a cartridge reliably and get the machine into a state that I
can work with. Decided to do an intro sequence for the game. It
helps that this forces me to deal with bitmapped graphics again,
which is something I hadn’t incorporated into the automated
build before.
Had a few days off this project. Obviously that doesn’t mean
that no on-topic thinking takes place, and it’s been fruitful. The
Easyflash generator works correctly now as far as I can tell. Not
releasing it to the world just yet, but for now I can generate
a working EasyFlash cartridge.
Spending a little bit of time today on my EasyFlash generator.
Decided to feed the tool YAML files instead of command line
parameters. Defined the YAML spec in the README that goes
with the tool.