Running on the ZXSimulator, which is a tad slower than the base ZX81, I use the space to fire and the cursor keys to move as that aligns with the QL joystick port and it works quite nicely. It is slow so you have to be patient until the laser-site lines up with the pirate and then you can fire away (it's during the firing that it gets a bit strategic and game-like since the pirate darts so if you think you have it lined up you may not). You'll also see your shields and ammo drop and that's where luck and strategy comes in because you hope you don't waste too many bullets and the pirate has shields of their own and requires between 2 to 6 hits to be destroyed. Whenever you hit the pirate you may lose shields and those generate the fewest. It's usually what kills me when I play. And if you take too long, the pirate just hyperspaces away and you don't get its cargo after wasting all those resources.
Note that if you are constantly changing direction or say constantly hitting the left key to move left you go in and out of that mode and waste all your fuel, which is limited, very quickly. You only have so much fuel and you need to destroy the pirate to replenish it. So likely that's why the game ended so fast for you.
I continue to look for ways to speed it up since its aim is to demo the ZXSimulator which runs slower than the ZX81. I may just have the stars sit still when the player is trying to home in on the pirate as that takes up a lot of time, or I can get rid of their independent movement and just have them react to the player movement to give some sense of orientation. It's not going to be a fast machine-coded shoot-em up game and in the end, the pirate hunting will be much more brief, where you maybe have to destroy 3 or 4 before orbiting a planet so you can start bartering for goods and replenish resources -- the main part of Elite. If you've not seen Elite, a lot of time is spent flying through space towards a planet with stars zooming by but getting to the planet can take minutes with little change. Sometimes pirates attack but on other occasions literally nothing happens, because....wait for it...you are in space and it tries to be a bit realistic in that sense. I didn't create the game but I think that was one of the charms of Elite.
I will configure the QL emulator to run maybe 3 times that of an unexpanded QL and then see how ZXSimulator runs the Elite demo as that may be closer to your double-speed ROM configuration. In the video I posted it's about 10 or so times faster and plays more like an arcade. The one advantage the ZXSimulator has is the QL keyboard and potential joystick as the ZX81 keyboard is not always that responsive to key input.
Thanks again for giving it a go and giving me incentive to improve it. I had so much fun writing the ZXSimulator and now I'm on pause with finishing it because I've had so much fun writing this demo in ZX81 BASIC.
(Note that I include the executable to be run under a Sinclair QL, 3 demo basic programs including Elite.bas, and the C source code for the ZXSimulator compiled under Digital 'C' SE since it's an open source project)
Here's what's been added:
- DIM statement added
- CHR$ and CODE now use proper values (mostly, if unknown it will print ? and above 291 is reserved for QL)
- STR$ and VAL implemented
- NEW now wipes all variables and loops (and so does LOAD) and CLEAR was added to clear variables
- speaking of LOAD, it now ignores '/r' so no need to convert to unix anymore
- nesting of subroutines is now dynamic (variables still static in amount it can handle)
- sped up by about 15%, last baseline was 98 seconds, slowed down to 104 seconds w/features...now at 86 seconds (compared to 57 for PAL ZX81)
- string handling improved (concatenation now works and so does string equalities)
- Elite.bas is now on the zip along with Banner.bas & Ball.bas. The game is complete in part 1. Next part will be planet hopping. Improved in speed.
Minesweeper.bas I found here:
If you open it up you'll see it starts like this:
Code: Select all
0 REM [3978 bytes] 2 REM [3969 bytes] 3 REM %M%C%O%D%E%R\::%I%I COPYRIGHT 1983 D C THRELFALL COMPILER AT 17300 PROG AT 20500 10 REM MINESWEEPER
Give it a try. It's the first foreign program I've run on the ZXSImulator so it's pretty compatible already (even if it's still missing floating point).
https://qlforum.co.uk/viewtopic.php?f=3 ... =80#p33724
I got permission from the author to publish the modified Minesweeper game. The attached zip file contains these files:
- minesZX.bas - this is the ZX81 BASIC that can run on ZXSimulator or any ZX81 (emulator or real) if converted into .p or tape file
- minesZX.p - just the zxtext2p.exe converted file of the first (minesZX_bas) for one of the ZX81 emulators (I use EightyOne)
- minesSB.bas - this is converted QL SuperBASIC version that runs a bit faster though interface is plain as it only uses characters
- README.txt - repeats this above
It's a really fun game and very playable on the ZXSimulator on an unexpanded QL, or on a plain ZX81. If you really want to see it go, use an accelerated QL/ZX81. It does take a bit of time set up the board but I did add some output that tells you the progress (in addition to letting you choose key mapping - I use the arrow & space so I can use my joystick). Once the ZXSimulator version on an unexpanded QL starts play it becomes pretty playable (unless it clears out half the board because of a random clear path, then it'll take some time and sometimes it appears to be stuck but it is just getting out of a long nesting loop which takes time).
- Posts: 3032
- Joined: Mon Sep 26, 2011 10:56 am
- Location: Looking forward to summer in Somerset, UK...
Yes! A member here, Andy Rea at one time produced a ULA replacement that enabled a ZX81 to run at twice the normal speed. Some ‘clones’ or compatibles can also run faster.
https://qlforum.co.uk/viewtopic.php?f=3 ... 272#p34272
Most notable improvement is better file reading so it can load 16K programs into an unexpanded QL.
Also, I was able to salvage a game I wrote almost 40 years ago as a teenager that was in the process of being published (by Gladstone Electronics -- was that the right company) in early '83 but never made it as Timex pulled the plug in mid '83 I think. In any case, I remember waiting for their final response through the summer and then I got the word.
I'm adding it unchanged here. I got the audacity captured audio to load from PC into my spare TS1000. Unfortunately EightyOne did not want to load it. I then took 30 screen shots (it's almost 15K in size) and typed in in on Friday. Been playing with it and have gotten all the typos out. But I was so happy to have been able to reclaim it. Runs fine on the ZXSimulator as well, though I made one small mod and assign all instances of INKEY$ to a variable (K$) first, since the way that is implemented via a QL TRAP, it seems to miss some keystrokes and you can be sitting there pressing a key for longer than you want (esp on a faster machine that ZXSimulator is running on). For testing I use QLAY2, a QL emulator to run ZXSimulator, a ZX81 pseudo emulator, (it's like Inception all over again :-/).
The game has nice pacing I think. Let me know what you think...
- Computer play is slightly better, it no longer chooses spaces to the side or ends of already destroyed ships while searching or targeting.
- i.e. if a carrier is destroyed then the 12 spaces around it will no longer be searched
- still does useless moves as it doesn't account for what's left so it'll choose coordinate even if impossible to hold remaining ships
- Can now choose keys for every action (i.e. completely joystick playable).
- At the start screen you have to press "S" to start, any other key lets you set keys (so if you have a joystick, just press fire button).
- For joystick, not only choose left/right/up/down but use down for vertical and right for horizontal...then use fire button for set.
- Finally you are presented with choice "C" for coordinate, any other key (press fire button) uses joystick when playing game.
- In other words, you can choose to type in coordinates like the old fashion way or pick coordinates by moving cursor there.
- Defaults are set so once you start game you simply hit fire on joystick and it takes you to next screen.
- i.e. if it asks if you want to start (Y/N) if you hit fire it will start you as it looks for "N" or assumes yes.
- Adds a little animation so when you or computer picks a square you get a "blop" effect..
- This really works well on an actual TS1000/ZX81 as the speed is perfect for it (create wave file in EightyOne from .p file)
- In fact, this game really plays best on a normal TS1000/ZX81 as acceleration ruins pace and the "blop" animation.
- Cursor movement sped up and fixed the bugginess
- So I use and infinite for-loop for any loops that do cursor movement as it is faster
- i.e. FOR I=0 TO 1 STEP 0 ... NEXT I
- Added Battle mode
- In configuration screen...when you choose, each player gets extra turn after sinking an opponent ships
This also plays really well in ZXSimulator. It's one of the few BASIC-only games I've gotten my hands on so far, that plays fast enough and is complex enough. Of course I wish I could find more. Minesweeper is great but oh-so slow and the other stuff I've found so far is a bit simple. Really, mostly machine-code programs give you the best game-play on a ZX81/TS1000. Likely why they thought hard about publishing Battleship back in the early 80's before the plug by Timex got pulled. Of course Battleship is a perfect game to write with limited computing power.
It brings up a thought about what to do with ZXSimulator once its initial goal has been met: if an unexpanded QL can run a ZX81 in realtime. It's kind of a tiny audience because you need to like the QL and then want to run ZX81 programs on it :-/ Though you can easily run QLAY2 and get ZXSimulator running pretty quickly (I automated this for my better-half since she likes Minsweeper, but only when it runs faster). ZXSimulator is actually a WYSIWYG ZX81 editor and runtime BASIC environment and writing some BASIC code in it is quicker and much less frustrating (no remembering which key to press to expand keywords) and you can see right away the graphics as you try them. So once I'm done with it I may port it to Windows, which should be pretty easy since it's mostly in C with a few graphics functions (block, window, etc...) tied to QDOS.
Any thoughts? What I like about the ZX81/TS1000 is that it feels a lot like a first generation Scratch environment (scratch.mit.edu) which I sometimes use in teaching programming to students to give a different perspective (usually more advanced students). By that I mean, it's simple with the block graphics to create something quickly and the BASIC is forgiving (so you don't get bogged down in details at the start). Scratch is similar, though a visual programming environment where you can create stuff quickly (albeit much fancier since it's fully graphics capable).
https://qlforum.co.uk/viewtopic.php?f=3 ... 120#p35378
I also modified another of Bodo Wenzel's games, Mench Aergere Dich Nicht, to better display its board on a ZX81/TS1000/ZXSimulator. The BASIC listing can be found here and needs to be converted to .p file or wave file. You can find it here:
https://qlforum.co.uk/viewtopic.php?f=3 ... 120#p35400
Also created a video if you want to see the ZXSimulator running next to the ZX81/TS1000. It gives some background on the QL, in case you have never used one, and then does some side-by-side runs. It's about a 26 minute video with first half+ giving some background and the 2nd half starting at about the 16:30 mark running the ZXSimulator and doing the comparison:
You can run/play the provided ZX81 programs below or code up your own -- though it does not do keyword entries so you get to touch-type.
- ball_bas - bouncing ball demo for ZXSimulator
- bann_bas - banner demo for ZXSimulator (normally named banner_bas)
- elit_bas - Elite game, playable but not complete (normally named elite_bas)
- batt_bas - Battlship game (normally named battleship_bas)
- mine_bas - Minesweeper game by Bodo Wenzel (normally named minesweeper_bas)
- madn_bas - Mench Aergere Dich Nicht, famous German board game by Bodo Wenzel
- drac_bas - Dragon fractal by Bodo Wenzel (normally named drachen_bas)