ZXSimulator for the Sinclair QL
Posted: Mon Mar 30, 2020 2:40 am
Hi folks,
My first post on this board. The ZX81 was my first ever computer when I got it in 1982 back in the US and is the computer that introduced me to coding both BASIC and machine code. I have very fond memories of it. At the end of the 80's I upgraded to a Sinclair QL and then in the mid 90's left that platform. I've recently gotten back into using the system and have spent time on the QL Forum.
The latest crisis has us all staying home more so I decided for a fun project I would resurrect an old BASIC interpreter I wrote in the early 90's that I prototype on the QL (as it was all I the only computer I owned back then) and eventually moved to the Mac platform and turned into a real product (this post is not about that so I will skip details but feel free to enquirer as it was a full-featured system that ran on the old 68K Macs). The BASIC was a cross between the ZX81 BASIC that I initially learned on and the QL's SuperBASIC.
Born about two weeks ago was the ZXSimulator, a ZX81 simulator for an unexpanded QL. That's the primary goal, getting it to run to as close to realtime as possible without extra memory and without extra processing power. I post about a new copy or so a week in a zip file that can be expanded in one of the QL emulators and then run. I also include the C source code (presently a single file since I haven't figured out how to use multiple files in the old C compiler I used back in the 90's -- it is doable as the original BASIC was written in 4 files).
It presently isn't complete but is pretty far along and mostly I had to pull code out as it had too many SuperBASIC features that the ZX81 didn't have. I also spend a lot of time on finding ways to efficiently show the ZX81 character set and graphics, and it follows the zxtools/zxtext2p format so my saved BASIC files can be saved and run on ZX81 emulators like the EightyOne (and I have done that). ZXSimulator doesn't use keywords to enter code, instead you type code as you would today and then it parses an runs the program. It makes code entry into the ZX81 a bit faster (and what many of us are used to today). Currently it still only does integer BASIC which is the next big improvement needed to convert it to floating point plus its error handling is something to be desired so that will be fixed.
Instead of cross posting everything, here is the link to he QL forum for anyone that has run a QL emulator (I have been using QLAY2) and wants to give it a go. I will eventually create a package (a subfolder) that is configured as win1_ and should autorun via a "boot" file when starting up QLAY2. Could there be a Windows port in the future? Not really the point of it but if someone wants a ZX81 simulator that bypasses the quirky nature of the ZX81 ROM and how it deals with code entry...sure, why not, maybe someone will pick that up.
https://qlforum.co.uk/viewtopic.php?f=3&t=3193&start=50
The point of all this is just to do it for the fun of doing it. There are already several high quality ZX/Speccy emulators for the QL but all need extra speed and memory. Ironically, after I started this project I found the Speccy simulator for the Commodore 64 (by Whitby) so that gives me more reason to move forward and once I have it complete I may try and convert it to a Speccy Simulator to run on an unexpanded QL which would really be cool. So a mid 80's Sinclair computer running another mid 80's Sinclair computer with no modern intervention...pretty cool and if a Commodore 64 can do it, so should a QL, right?
My first post on this board. The ZX81 was my first ever computer when I got it in 1982 back in the US and is the computer that introduced me to coding both BASIC and machine code. I have very fond memories of it. At the end of the 80's I upgraded to a Sinclair QL and then in the mid 90's left that platform. I've recently gotten back into using the system and have spent time on the QL Forum.
The latest crisis has us all staying home more so I decided for a fun project I would resurrect an old BASIC interpreter I wrote in the early 90's that I prototype on the QL (as it was all I the only computer I owned back then) and eventually moved to the Mac platform and turned into a real product (this post is not about that so I will skip details but feel free to enquirer as it was a full-featured system that ran on the old 68K Macs). The BASIC was a cross between the ZX81 BASIC that I initially learned on and the QL's SuperBASIC.
Born about two weeks ago was the ZXSimulator, a ZX81 simulator for an unexpanded QL. That's the primary goal, getting it to run to as close to realtime as possible without extra memory and without extra processing power. I post about a new copy or so a week in a zip file that can be expanded in one of the QL emulators and then run. I also include the C source code (presently a single file since I haven't figured out how to use multiple files in the old C compiler I used back in the 90's -- it is doable as the original BASIC was written in 4 files).
It presently isn't complete but is pretty far along and mostly I had to pull code out as it had too many SuperBASIC features that the ZX81 didn't have. I also spend a lot of time on finding ways to efficiently show the ZX81 character set and graphics, and it follows the zxtools/zxtext2p format so my saved BASIC files can be saved and run on ZX81 emulators like the EightyOne (and I have done that). ZXSimulator doesn't use keywords to enter code, instead you type code as you would today and then it parses an runs the program. It makes code entry into the ZX81 a bit faster (and what many of us are used to today). Currently it still only does integer BASIC which is the next big improvement needed to convert it to floating point plus its error handling is something to be desired so that will be fixed.
Instead of cross posting everything, here is the link to he QL forum for anyone that has run a QL emulator (I have been using QLAY2) and wants to give it a go. I will eventually create a package (a subfolder) that is configured as win1_ and should autorun via a "boot" file when starting up QLAY2. Could there be a Windows port in the future? Not really the point of it but if someone wants a ZX81 simulator that bypasses the quirky nature of the ZX81 ROM and how it deals with code entry...sure, why not, maybe someone will pick that up.
https://qlforum.co.uk/viewtopic.php?f=3&t=3193&start=50
The point of all this is just to do it for the fun of doing it. There are already several high quality ZX/Speccy emulators for the QL but all need extra speed and memory. Ironically, after I started this project I found the Speccy simulator for the Commodore 64 (by Whitby) so that gives me more reason to move forward and once I have it complete I may try and convert it to a Speccy Simulator to run on an unexpanded QL which would really be cool. So a mid 80's Sinclair computer running another mid 80's Sinclair computer with no modern intervention...pretty cool and if a Commodore 64 can do it, so should a QL, right?