ZX81 BASIC
Posted: Sun Mar 08, 2020 7:08 pm
Starting this topic here to get some help. I know there are forums out there for the ZX81 and its emulators and I have started reading them but not ready to join another forum as then I'm spending too much time on two :-/
My plan is to turn my BASIC interpreter (check out viewtopic.php?f=3&t=3169 though it kind of got off topic regarding random number generation) into a ZX81 BASIC interpreter that could then run any BASIC game on an unexpanded QL.
So the natural question is why oh why? I know there already is a ZX81 emulator that will do that on a Gold Card QL or anything higher. Well, it's a hobby and it might be neat to recreate the ZX81 BASIC and I already have a working interpreter written in C (Digital C to be specific) that presently does integer BASIC (need to add floating point which I did back in the 90's when I ported it to the Mac) and does more of its BASIC things ZX81-like than QL-like (feel free to look at it as I distributed the source). For instance, I use GOTO not GO TO. Don't even know how I missed that the QL splits it up. I figure all I need to add in is the graphics and then might have a pretty peppy running (what I call) simulator on an unexpanded QL. It wouldn't run machine code programs but should run BASIC ones.
First task, reclaim some of my BASIC programs I still have on tape. Back as a teenager I wrote a few including a terminal program, an assembler, a text editor, and a game called Battleship. The latter I was in negotiation with one of the US distributors to sell right around the time Timex pulled the plug in the US. Ugh, a year too late. But it was fully written in ZX81 BASIC with 16K RAM pack and it had some cool graphics and played pretty nicely. I kind of want to see it running in my ZX81 simulator on the QL -- that's the goal.
First off, in the ZX81 community they have tools to take audio files and load them in to EightyOne (I'm using v0.43c), which seems to be the best emulator out there -- I'm wondering if it is related to the Spectrum Next project since it can emulate all of those machines. So figuring out how to read in a wave file and then convert it to a .p file so another tool (zxlist64) can convert it to text has not been trivial. Does anyone on this forum have any experience with the emulator? Just to understand the difference between .p and .z81 and .t81 and .tzx files has been a bit of a headache. It's unclear how to go from one to the other though I do understand some are collections of BASIC programs: like an entire cassette vs a program on a cassette -- is that what the "p" and "t" stand for, (p)rogram vs cassette (t)ape?
I could re-type my game in but who wants that. One nice thing, they have ASCII representations of the ZX81 graphic character set so I don't have to recreate the wheel.
My plan is to turn my BASIC interpreter (check out viewtopic.php?f=3&t=3169 though it kind of got off topic regarding random number generation) into a ZX81 BASIC interpreter that could then run any BASIC game on an unexpanded QL.
So the natural question is why oh why? I know there already is a ZX81 emulator that will do that on a Gold Card QL or anything higher. Well, it's a hobby and it might be neat to recreate the ZX81 BASIC and I already have a working interpreter written in C (Digital C to be specific) that presently does integer BASIC (need to add floating point which I did back in the 90's when I ported it to the Mac) and does more of its BASIC things ZX81-like than QL-like (feel free to look at it as I distributed the source). For instance, I use GOTO not GO TO. Don't even know how I missed that the QL splits it up. I figure all I need to add in is the graphics and then might have a pretty peppy running (what I call) simulator on an unexpanded QL. It wouldn't run machine code programs but should run BASIC ones.
First task, reclaim some of my BASIC programs I still have on tape. Back as a teenager I wrote a few including a terminal program, an assembler, a text editor, and a game called Battleship. The latter I was in negotiation with one of the US distributors to sell right around the time Timex pulled the plug in the US. Ugh, a year too late. But it was fully written in ZX81 BASIC with 16K RAM pack and it had some cool graphics and played pretty nicely. I kind of want to see it running in my ZX81 simulator on the QL -- that's the goal.
First off, in the ZX81 community they have tools to take audio files and load them in to EightyOne (I'm using v0.43c), which seems to be the best emulator out there -- I'm wondering if it is related to the Spectrum Next project since it can emulate all of those machines. So figuring out how to read in a wave file and then convert it to a .p file so another tool (zxlist64) can convert it to text has not been trivial. Does anyone on this forum have any experience with the emulator? Just to understand the difference between .p and .z81 and .t81 and .tzx files has been a bit of a headache. It's unclear how to go from one to the other though I do understand some are collections of BASIC programs: like an entire cassette vs a program on a cassette -- is that what the "p" and "t" stand for, (p)rogram vs cassette (t)ape?
I could re-type my game in but who wants that. One nice thing, they have ASCII representations of the ZX81 graphic character set so I don't have to recreate the wheel.