Posts

Showing posts from September, 2019

Porting Programs to Sinclair BASIC

Image
The ZX81 and ZX Spectrum were both ridiculously popular computers back in the 1980s. Especially in Europe. However, the variant of BASIC they used was... quirky, to say the least. It's extremely difficult and time consuming to port programs to Sinclair BASIC. In this post, I'll describe how to do it. Also, this video is mostly about this process, so it might be worth watching.

Battle System Test Version 1 Release

I've put the source code for the first release of the Battle Test up on GitHub . You'll find all the tape and disk images in a 7z file under the releases tab. It's a minimal implementation of the first battle from Final Fantasy VII, done as a scrolling set of text menus. It's not much of a game, but you can play it on almost any computer you can think of, and it's all written in glorious BASIC code.

Seeding the RNG

I've looked through the code of a lot of old BASIC programs, and they all seem to have one omission: the lack of an RNG seeding routine. When you first turn on an 8-bit computer, the RNG is always initialized to the same seed every time. If you don't reseed it, the random numbers will be the same every time you start a program after booting. I'm going to show you some common methods to seed the RNG.

Battle System Test - Complete...ish

So, I was able to write most of the Battle Test last night. The only parts I didn't finish were the randomization and screen clear routines. I didn't write those because they're different in pretty much every version of BASIC. And I'm planning on porting this program to a lot of different BASIC versions. Almost three dozen, to be somewhat precise. The source code will eventually make its way to GitHub. In my next Twitch stream, I will deal with writing the randomization routines and other stuff for the various Altair BASIC versions, and CP/M BASIC.

Designing the Battle System Test

Image
I've been working on the basic design of a test game. I decided to use the first battle of Final Fantasy VII as a starting point, seeing as others have reverse engineered the battle system from that game, and so all I need to do is implement the formulas from that game in BASIC. However, I want this test to run on as many different versions of BASIC as possible, and so there are some limitations that will make the implementation... annoying.