Z80 BBC BASIC - Emulated on Windows

Published May 22, 2008
I've started working with the actual BBC BASIC interpreter. As it won't run in its current state on the TI calculator (it relies on a jump table at &FF80..&FFFF to interact with the host, which is protected) I'm using the Z80 emulator I wrote for Cogwheel to try and puzzle out what the host interface should be doing from the relative sanity of C# code (the jump table is populated with OUT (n), A instructions which are subsequently trapped and handled by the emulator).


One thing I hadn't realised is that the graphics operations that BBC BASIC offers are actually implemented via the OSWRCH handler (OS WRite CHaracter), which means that BBC BASIC's PLOT, MOVE and DRAW commands will also be available, as well as any commands that use them indirectly (such as CIRCLE).
0 likes 2 comments

Comments

Comments are shown oldest first so the discussion reads top to bottom.
MaximZhao
So could it be ported to Sega 8-bit hardware? Sega BASIC is rather rubbish compared to the godly BBC Basic. I spent many an hour messing around in there on my Z88.
May 22, 2008 11:15 AM
benryves
Yes, it could be ported relatively simply. It only requires about 13KB of ROM for the interpreter and about 1KB for workspace RAM; assuming a 32KB ROM that leaves you with a lot of space to implement the device-specific host interface code (very little of which actually needs to be implemented to get BBC BASIC up and running).

Assuming the SC-3000 was the target machine you'd presumably also need a special cartridge with added RAM, as I don't think the 1KB of remaining system RAM would really be of much use. (Alternatively, the SF-7000's RAM could be used, as well as its disk drive for saving/loading files). I really have no idea how the SC-3000's memory system works, I'm afraid (I emulated it as a flat 64KB RAM, which seems to work) so I'm not sure whether the &FF80..&FFFF range is available for writing on that machine. If not, J.G.Harston, author of the Spectrum port, is very kindly amending his relocator program to also relocate the jump table.

As the SMS is the more popular machine, it might be more fun to port BBC BASIC to that machine; it wouldn't require a very complex circuit to attach an AT (or PS/2) keyboard to its controller port, and you could use battery-backed RAM on a Flash cartridge to store programs.

I must confess, I'd never heard of the Z88, but it looks like a great machine. My nostalgia for BBC BASIC originates from prep school, where I was first introduced to serious programming on the BBC Master 128 machines. [smile]
May 22, 2008 12:01 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!