Monday, 23 May 2011

Getting there, so many hurdles, so much to do

Trying to get a graphical game off the blocks and I keep stumbling over inadequacies of the QL system or old QL software of which there is very little address.

Starting with a stab at DP's Super Hyped Sprite Generator, you would have seen my frustration with the x movement in a previous blog, not resolving that issue yet (not promising) and as of yet not found any other sprite software, I returned to the graphics control on the original QL, Point and Line, I was reminded of my first offering in Quanta - CAD in which the (for me) useless SCALE command would not allow control over the x-axis assuming fixed display ratio, how things change. Anyhoo, I got things working of sorts moving a drawn shape around the screen, a shape that changes shape depending where it is on the screen.

Looking on DJ's site for an alternative I come across plot and draw (well nearly, plot is a bit allusive at the moment - over to you DJ), well this seems more promising, well it may be promising, we'll see. So moving on to the next stumbling block assuming everything previous will get sorted, I now will have a timing problem, i.e. once the program is Turbo'd it will run fast, so how will it stop it from running too fast. With the CAD program I lazily (with hindsight) used for/next loops of incredible magnitude to slow things down on the original QL to a reasonable speed. 25 odd years later when running in an emulator at maximum speed this then becomes an obvious problematic issue. So what method can I use to limit speed on the FTL QL?

The only thing I can think of 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, fractions of milliseconds or similar, other than you can use this number as a really good randomiser seed, and also for timing regardless of the speed of the host machine. So if I want to move something across the screen at the same speed regardless of host speed how do I do it?

The QL doesn't have anything close so now what? DATE doesn't work, PAUSE is too slow so there must be a peek somewhere. Nope, how silly did I feel when I chance looked at the keyword Pause, realising that it can do milliseconds down to 20 as the smallest. Why didn't I use that before?, why did I think that the Pause command was seconds only?, who knows what evil lurks in the hearts of men? Only the Shadow knows!

Update, hmm forgot that the pause command is affected by key presses so control goes out the window, AH! that's why I didn't use it before, so feeling a little better with myself but still no nearer solving the problem, oh well back to the QL User List to see if someone can help. WTS

No comments:

Post a Comment