On 23/05/2011 22:45, Lee Privett wrote:
Based on the fact that Turbo'd programmes will FTL QL SuperBasic in
newer emulators (a mistake of my far past programming examples) I find
myself needing to put slow down routines in to the code so that when
compiled or used on a PC 100 Gigahertz Super Duper all singing and
dancing with go faster stripes down the side computer it will still
run at the same speed (especially graphics or control operations).

In the past on the original QL I have rather naïvely used a plethora
of for/next loops (yes I know) to do this,  The only thing I can think
of now is to use something similar to TIMER (QuickBasic) which gives
you the number of cycles since the machine has switched on. Cycles?
what cycles? no idea, I think it's' fractions of milliseconds or
similar, well this is what I need. Also in Quickbasic you can use this
TIMER number as a really good randomiser seed number, however I
digress.

So if I want to move something across the screen at the same speed
regardless of host speed how do I do it?

Something like

                10 FOR F = 1 TO 25
                20 PRINT CHR$(31);
                25 A$ = INKEY$ : do something else with this (stops me
using the Pause command so…)
                30 DELAY (100)
                40 END FOR F

DELAY 100 gives a 100 millisecond delay

The QL doesn't seem to have anything suitable, DATE doesn't work,
PAUSE doesn’t work if you press a key and I need to do that, so there
must be a PEEK somewhere, or am I missing something simple, anyone?

Thanks, Lee

-----Back to the QL-----
http://backtotheql.blogspot.com/
https://sites.google.com/site/iwant2learn2/
https://sites.google.com/site/theqlimagerepository/


_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm


I am not sure if we are missing the point here...

Surely you can use

25 A$=INKEY$(20)

This will allow you to do something else if a key is pressed, otherwise, the machine waits for 20 frames.... (using the 50Hz interrupt)

Don't you want the program to take immediate action if a key is pressed?

--
Rich Mellor
RWAP Services

http://www.rwapsoftware.co.uk
http://www.rwapservices.co.uk

-- Try out our new site: http://sellmyretro.com


_______________________________________________
QL-Users Mailing List
http://www.q-v-d.demon.co.uk/smsqe.htm

Reply via email to