ZXSimulator

Anything QL Software or Programming Related.
User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: ZXSimulator

Post by pjw »

Hi bwinkel67,
I wanted to try your de-miner program on your latest ZXSimulator (above), but for some reason the program barfs on REM and refuses to run. Ive tried REM and REMARK but any program with that keyword in it refuses to run. Same if I just type REM/REMARK as an immediate command. I was using QPC2. Any other simple BASIC program, like 10 FOR i=1 to 9, 20 etc, seems to work fine. Any ideas?


Per
dont be happy. worry
- ?
User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: ZXSimulator

Post by bwinkel67 »

pjw wrote:Hi bwinkel67,
I wanted to try your de-miner program on your latest ZXSimulator (above), but for some reason the program barfs on REM and refuses to run. Ive tried REM and REMARK but any program with that keyword in it refuses to run. Same if I just type REM/REMARK as an immediate command. I was using QPC2. Any other simple BASIC program, like 10 FOR i=1 to 9, 20 etc, seems to work fine. Any ideas?
Hi,

Yes, so the minesSB_bas program is for running on SuperBASIC on the QL. If you load that into ZXSimulator it won't work and gives you the following error since it is not ZX81 BASIC.

Code: Select all

10 REMARK  MINESWEEPER
          <--NO COMMAND
What I did is convert the original ZX81 version of Minesweeper to SuperBASIC so anyone that didn't want to run ZXSimulator could just run it straight on the QL. If you want to run the ZXSimulator Minesweeper game you use minesZX_bas. ZX81 BASIC is a bit different form QL SuperBASIC as the latter uses REMark whereas the former uses REM, plus the former uses PRINT AT whereas the latter uses AT by itself. So a ton of little things like that plus a different character code.

Hope that clears it up :-/


User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: ZXSimulator

Post by pjw »

The problem was something else, relating to my unfamiliarity with ZXS syntax. I tried it again and it works as advertised. :)


Per
dont be happy. worry
- ?
User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: ZXSimulator

Post by bwinkel67 »

pjw wrote:The problem was something else, relating to my unfamiliarity with ZXS syntax. I tried it again and it works as advertised. :)
Cool. Minesweeper must run acceptably on ZXSimulator under QPC I suspect? How much faster is QPC compared to a BBQL? Some games, like Elite_bas, may need PAUSE added at various places to make it playable as that doesn't slow it down on a normal QL but does so on a fast one (I added a quick PAUSE when firing the laser).


stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: ZXSimulator

Post by stevepoole »

Hi Bwinkel67,
Please refer to the post below for the speed test program:
My 1.9Ghz 3core W8.1 QPC2 runs the test 90 times faster than my SuperGoldCard QL under QDOS..

Re: << Some speed tests on QL hardware >>
Postby stevepoole » Sat Mar 28, 2020 10:48 am
Hi All,
Just got a result from a friend with an AMD, w10, 1.46Ghz, Qemulator :
fast mode gets 16551 loops, 128k mode gets 141. ( speed factor of x117 ! )
What speed does a real 128k QL achieve ? (In order to define speed factor = 1...)
Regards,
Steve.

Unfortunately, nobody has yet run the code on a bare 128ko QL for an exact comparison.
Dare I unplug my SGC ?

Regards,
Steve.


User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: ZXSimulator

Post by bwinkel67 »

With all my optimizations lately I added a serious bug. At the K input prompt, if you preceded any BASIC command, line number, or input with a space it would sit there forever (an infinite loop). Forgot to move the increment before an if statement. I'll re-upload the zx_arc one on the previous post as well so I have my 8-week anniversary compile be bug-free (still compiling).
zx.zip
(29.1 KiB) Downloaded 135 times
BTW, this was asked form another site but loading a program requires quotes and full pathname: LOAD "mdv2_elite_bas" ...I'll have to add a README_txt eventually to the zip.


User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: ZXSimulator

Post by bwinkel67 »

stevepoole wrote: Unfortunately, nobody has yet run the code on a bare 128ko QL for an exact comparison.
Dare I unplug my SGC ?

Regards,
Steve.
It would be nice to know what a unit is here...i.e. how much faster is a SuperGoldCard form a BBQL. I think this has been measured on a previous thread but still, never hurts to back it up with more data. Was it something like 23 times faster?


stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: ZXSimulator

Post by stevepoole »

Hi All,

The reason I don't unplug my SuperGoldCard is because I have SuperHermes and RomDisk installed, which might mean the QL would behave diffferently to a 'bare' JS ?

If anyone could run the code on a bare QL, it would give us the unit figure Bwinkel is looking for too ...

(See the thread << Some speed tests on QL hardware >> for the test code).

Once we have the bare QL 'unit' figure, we can compare it to ANY system running QL programs.

Regards,

Steve.


User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: ZXSimulator

Post by bwinkel67 »

Ok, I finally ran it (first line in the table) and I readjusted all the realtime factors since the BBQL should be at 1:

Code: Select all

CONFIGURATION                   CYCLES/SEC     +/- %    SPEED      REMARKS
---------------------------     -----------    ------   ------     ------------------------------------------------------
Ql 128ko JSU                    168            .296     x1         BBQL JSU with Hermes
SGC QL under QDOS               1864           .25      x11        No extra multitasking from me.
SGC QL with SMSQ/E              8440           .11      x50        " " ROMdisc and Hermes.
Compaq, 1core, QPC2, 2.8Ghz     173894         37.2     x1035      Very variable timings due to monocore multitasking.
Asus, 3core, QPC2, 1.9Ghz       138683         4.0      x825       Triple core means better variability when multitasking.
"     "      "     "            ?              ?        ?          C++ code runs 400 tmes faster than superbasic version !
On QLAY on my iMac 2011 with a couple of speed settings. It runs best at 1000/120 when accounting for media access but when I need to do things fast (like compiles or regression tests) I up the speed/delay to 100000/0.

Code: Select all

CONFIGURATION                   CYCLES/SEC     +/- %    SPEED      REMARKS
---------------------------     -----------    ------   ------     ------------------------------------------------------
QLAY2, iMac 2011/Win7           1431           .935     x8.5       Speed 1000 Delay 120
QLAY2, iMac 2011/Win7           30341          1.43     x180       Speed 100000 Delay 0
So yes, Minesweeper on the ZXSimulator runs just perfectly fine under QPC2. ZXSimulator has been designed to run reasonably on the base BBQL so 800 to 1000 times faster is just fine. I've run Minesweeper on it at 180 times faster and it's almost instantaneous when it clears unused spaces around mines. An interesting side-effect is that the cursor blink will slow down or speed up depending on what square you are on though it doesn't align with anything that's hidden so no secrets are revealed. It basically just hits a specific refresh rate that makes it seem slower.

Unfortunately, some games, like the Elite_bas demo that I'm half-done with (it still needs the planet hopping part) won't run at all when that fast (I'm guessing it will literally start and end with 0 shields as it instantaneously depletes them). I run Elite_bas at the 1000/120 speed setting which gives me about 8.5x realtime and it plays pretty well -- arcade-like (see the video I posted a few weeks back). Though I do find Elite_bas entertaining at 1x realtime as it takes on a more challenging feel when trying to destroy pirates as aligning them into sites takes both patience, luck, and a bit of skill estimating the pirates future movement -- in the 8.5x realtime mode you just keep moving the joystick and firing, though you end up expending limited ammo much quicker that way.

So for QPC or some of the faster platforms (not counting emulators) is there a way to slow a program down? Does SMSQ/E have a feature to reduce process priorities and would that actually slow a program down significantly enough?


stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: ZXSimulator

Post by stevepoole »

Hi Bwinkel67,

Many thanks for these timings, especially for having measured the QL 128ko 'unit'.

The GoldCard User Manual contains the keyword SLUG, which slows key reading speed in 1/1000ths second.
I verified this under QPC2, and it works fine ! 'SLUG 10' slowed a 100000 inkey$ loop by around 15 times...

But as the manual says, only a hardware modification could slow general program speed !

I first tried SLUG 100, which meant that thereafter cursor flashing was horribly slow, until I entered 'SLUG 0' again...

Best Wishes,

Steve.


Post Reply