I've had my Kickstarter-2 Spectrum Next sitting on my bench since it first arrived. I played with it for a few weeks when it landed, and then I loaded up the Next Core on the MisterFPGA downstairs instead. Why? I prefer the full 101 key keyboard I have with the Mister. I also prefer the giant telly to my smallish VGA monitor. So, all my experimenting has been on pure NextBASIC on the Mister, instead of the actual hardware itself.

Time for that to change, I think.

I've been meaning to spend more time on it since I started on the old 1980's Spectrum BASIC coding trip I've been on for the last four or five months. Sadly time hasn't been generously available, with two kids, a house that needs things, dinners cooked, people taken places all the time, a pretty demanding job (of my time) and the myriad other little distractions... Plus of course I want to actually have some fun game time now and again....

But with the KS3 Spectrum Next on its way, a low buzz of interest is starting to grow around the platform, so I thought I'd branch out from NextBASIC (which is BASICally Sinclair BASIC with a few extra bits and a tweak here and there), and look for something a bit more performant.

Performant why? Well, all those Sprite demos you see are just wanging Sprites about with careless abandon. The NextBASIC code to do that is pretty thin wrapper around the machine code instructions. But when you start to add collision detection, physics, particle systems, poor old BASIC starts to chug somewhat. You can easily have 50 sprites flying all over the screen... But as soon as you want to have them actually bounce off each other, things really slow down. It's 50*49 collision detections (in the naive case), or quite involved code to do it cleverly...

I've had a look at z88dk. It's a marvellous achievement! Two different z80 libraries with two different compilers that you can choose from. Unfortunately it's currently only half-finished with respect to the Next. One of the lead developers on the "NewLib" left the project, leaving it without some of the libraries that are in the "ClassicLib". Sure you can write them yourself, but I want to code in C to avoid needing to write Bresenham or Circle algorithms in Assembly. The build chain is a little complicated once you move away from a classic z80 target, and I'm told that z88dk doesn't produce the world's most performant code. I will return to z88dk later I think when there's a little more maturity in the Next support. But for classic Z80, z88dk is phenomenal! 3

So, that leaves Boriel's ZX BASIC. It's essentially the same as Sinclair BASIC, but it's actually compiled rather than interpreted. It's been under active development for many years and is really very solid by this point. There's even a VSCode plugin and some books written for it. It allows inline asm, so if I want to delve into the murky depths I can...

So, I think I'm going to stick with NextBASIC for simple examples and to just test out sprite features, and then maybe move any things I like over to Boriel BASIC. I'll be keeping an eye on z88dk, though.

Previous Post Next Post