ZXSimulator

Anything QL Software or Programming Related.
Post Reply
stevepoole
Super Gold Card
Posts: 712
Joined: Mon Nov 24, 2014 2:03 pm

Re: ZXSimulator

Post by stevepoole »

Hi again,

Unfortunately, the tabbing in the timing figures got removed by the site ..... Spaces between colons were removed !

Perhaps the site administrators could look into this ?

Best wishes,

Steve.


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

Re: ZXSimulator

Post by bwinkel67 »

stevepoole wrote:Hi again,

Unfortunately, the tabbing in the timing figures got removed by the site ..... Spaces between colons were removed !

Perhaps the site administrators could look into this ?

Best wishes,

Steve.
Steve,

I created a new thread for this here viewtopic.php?f=2&t=3213&p=32913#p32913 since I think benchmarks are quite interesting for others. Note that I also reformatted your table for easy reading.
Last edited by bwinkel67 on Fri Mar 27, 2020 12:49 am, edited 1 time in total.


User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: ZXSimulator

Post by dilwyn »

stevepoole wrote:Hi again,

Unfortunately, the tabbing in the timing figures got removed by the site ..... Spaces between colons were removed !

Perhaps the site administrators could look into this ?

Best wishes,

Steve.
Probably better to put space-critical stuff like that as CODE or QUOTE to try to preserve the spacing as a fixed pitch font (unless someone has a better idea).


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

Re: ZXSimulator

Post by bwinkel67 »

dilwyn wrote: Probably better to put space-critical stuff like that as CODE or QUOTE to try to preserve the spacing as a fixed pitch font (unless someone has a better idea).
Yup, I fixed it for him :-)


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

Re: ZXSimulator

Post by bwinkel67 »

BTW, looks like I'm not the first to come up with the idea of a simulator. The Commodore 64 "emulated" the Spectrum back in the mid 80's but in reality it was just implementing its BASIC. Here is a demo of it, the "The Whitby Spectrum Simulator" on a plain old C64:

https://www.youtube.com/watch?v=i98CTiq707U

So the hope is when I get the ZXSimulator done for the ZX81 I could upgrade it to the ZX Spectrum though I know a lot less about its BASIC but perhaps there isn't that much more to add. Hoping at that point to get some help with speeding up the fonts to make it realtime on a 128K QL (hey, if the C64 could do it, I'll make the 128K QL do it :-/)

Here is the latest, just fixed some inefficient code that barely sped it up, but its size is down to 38K again. Still needs lots of odds and ends plus adding floating point math...TBD
zx.zip
(18.94 KiB) Downloaded 126 times


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

Re: ZXSimulator

Post by stevepoole »

Hi admins,

< stevepoole wrote:
Hi again,

Unfortunately, the tabbing in the timing figures got removed by the site ..... Spaces between colons were removed !
Perhaps the site administrators could look into this ?
Best wishes,
Steve. >

< Dilwyn replied :
Probably better to put space-critical stuff like that as CODE or QUOTE to try to preserve the spacing as a fixed pitch font (unless someone has a better idea). >
________________

It looks as though the site software treats space charcaters as '"" rather than " " ?
Steve.


User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: ZXSimulator

Post by dilwyn »

stevepoole wrote:Hi admins,
...
It looks as though the site software treats space charcaters as '"" rather than " " ?
Steve.
Most such sites do - I know from bitter experience of screwed up listings and tables.


User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: ZXSimulator

Post by dilwyn »

Not directly aimed at ZXSimulator, just thought that I'd mention this on this thread.

I've added a ZX81 font for QL to the fonts page on my website.

It's based on the 64 character ZX81 character set, implemented as CHR$(128) onwards on QL so as to be able to use both QL and ZX81 characters. ZX81 characters are 8x8 pixels, with most characters (other than the block graphics and a few odd number width characters which are 7 pixels) using 6 out of 8 pixels across, to allow spacing between characters.

To use it on the QL you need to install it in the usual way for QL fonts. Then use CHAR_USE from Toolkit 2 to set it as font 2 for a given channel, then CHAR_INC to set character increments at 8 pixels across and 8 pixels down to vaguely resemble a ZX81.

Done as indicated in the instructions, ZX81 CHR$ 0 to 63 are 128 to 191 on QL, like the "inverse" fonts on a ZX81. On a QL, toggle normal and inverse just by swapping INK and PAPER.

As the fonts are 8 pixels wide, this can only be used in CSIZE width 1, i.e. CSIZE 1,0 or CSIZE 1,1
zx81.jpg
Download the font from http://www.dilwyn.me.uk/fonts/index.html


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

Re: ZXSimulator

Post by bwinkel67 »

Here is the latest version:
zx.zip
(20.64 KiB) Downloaded 129 times
I added full editing capabilities so now, if you want, you can write ZX81 BASIC code in the ZXSimulator. Note it still has many elements of BASIC missing so you can't fully run all ZX81 programs but you can use it to add in all the characters, even graphics. It's certainly easier to use than an emulator which forces you to remember the original ZX81 keyboard key mappings. It uses the zxtools standard (or whatever it is called) for graphics:
  • if you type a '%' the cursor goes to G and the next character you type will be inverted.
  • if you type a '\' the cursor goes to G and the next two charters you type will generate one of the block graphics.
  • cursor keys for left and right have been added in addition to delete
The one weirdness is that my cursor is always K which supposedly stands for "keyword" but I'm not going to add parsing to figure out when to turn it into L for letter (other than when it is getting input when running in BASIC).

This is the style formatting supported in the ZX81 community for zxtools and others (as far as I can tell):

http://freestuff.grok.co.uk/zxtext2p/index.html

I also added the RAND command and the RND function though presently it can only return integers between -32667 and +32768. It needs floating point numbers to be implemented for it to truly mimic a ZX81. I used Steve Poole's LGR with value 8421 with a cycle of 65537. Anyone know the actual algorithm Sinclair used for the ZX81? Be neat to implement it for exactness.

Also found this, the definitive ZX81 BASIC reference (I have fond memories of reading this, learning BASIC for the first time):

http://www.worldofspectrum.org/ZX81BasicProgramming/


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: ZXSimulator

Post by NormanDunbar »

Thanks Dilwyn, you've saved me lots of time. I was creating a zx-81 font from the actual font data in the zx-81 ROM which I found on-line.

Stay safe.

Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
Post Reply