Pause on the zx80?

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Post Reply
lusciousthelock
Posts: 15
Joined: Sun Mar 02, 2014 4:50 pm

Pause on the zx80?

Post by lusciousthelock » Sat Mar 22, 2014 12:42 pm

Hiya,

How can I slow down the zx80 so I can see it count?

10 for a=1 to 1000
20 print a
30 cls
40 next a

I'm planning a little basic game based on dice rolls and would like a pause between moves so screen text can be read. is this possible? I also like the idea of zx81's pause statment that can be pushed forward by pushing any key to speed things up but I'm guessing the only way this could be done on the zx80 would be to input a string then press newline?

gozzo
Posts: 448
Joined: Fri Jul 08, 2011 8:52 pm

Re: Pause on the zx80?

Post by gozzo » Sat Mar 22, 2014 4:39 pm

I had also wondered if there was any way of simulating the zx81's PAUSE on a zx80, either timed or ended by keypress. unfortunately I don't know what will do it, yet!!

User avatar
PokeMon
Posts: 2225
Joined: Sat Sep 17, 2011 6:48 pm

Re: Pause on the zx80?

Post by PokeMon » Sat Mar 22, 2014 5:31 pm

The only thing you can do is something like this:

Code: Select all

FOR I=0 TO 10000
NEXT I
There is no PAUSE command because there is no interrupt or NMI used like on the ZX81 - so there is no timer at all.
But depending on the value you count, you can vary the TO value or put other commands between, can be a divsion for example or a multiplication which should take some time. Would be possible to put an additional FOR NEXT loop inside as well (have then 65535*65535 times to do - this should give an enormous amount of delay :mrgreen: ).

But the ZX80 does not generate a visible screen content while program is running. Could be forced with INPUT I think but anyway screen will flicker quite much as well. ;)

User avatar
PokeMon
Posts: 2225
Joined: Sat Sep 17, 2011 6:48 pm

Re: Pause on the zx80?

Post by PokeMon » Sat Mar 22, 2014 5:35 pm

gozzo wrote:I had also wondered if there was any way of simulating the zx81's PAUSE on a zx80, either timed or ended by keypress. unfortunately I don't know what will do it, yet!!
There is no INKEY$ function - this needs a timer as well. You could write an own assembler code doing keyboard enquiries.

Here is a good readable online manual:
http://fjkraan.home.xs4all.nl/comp/zx80/om/

lusciousthelock
Posts: 15
Joined: Sun Mar 02, 2014 4:50 pm

Re: Pause on the zx80?

Post by lusciousthelock » Sat Mar 22, 2014 9:12 pm

Actually that did answer my question. I do get reasonable results with input b$ then just entering newline to continue with my program. I like how this operates and should suffice for my little game :D

Post Reply