QL Cursor

In the current issue of Quanta magazine, I was asked if it was possible to change the cursor on a QL. I gave the reply that it is possible on a system with SMSQ/E, but isn’t on a QDOS QL. This answer was only partly right – provided you count a Minerva ROM as a QDOS system, it is possible to exercise a degree of control over the cursor appearance.

I only found out about this when I cam across a short listing by Derek Stewart in the last few days, which explains how to use a Minerva extension to control shape, flash rate and colour of the text cursor on a Minerva system. It’s documented in the Assembler part of the Minerva manual, but REM statements in Derek’s program illustrate well how to use the facility. He has implemented it as a SuperBASIC procedure, making it easy to call the facility just by issuing the CURSER (not mis-spelling to avoid a clash with a CURSOR command!) command with three parameters for the flash rate, shape and colour options.

1000 DEFine PROCedure Curser (rate,shape,colour)
1010 REMark Derek Stewart 27.10.90
1020 REMark curser V2.1
1030 REMark Minvera v1.81
1040 REMark System variable offset 33 Hex
1050 REMark contains details cursor byte make up
1060 REMark ie 33 Hex : 7 6 5 4 3 2 1 0
1070 REMark R R R R S C C C
1080 REMark Where R = rate of cursor flash 0 (slow) to 15 (fast)
1090 REMark S = Shape of cursor, 0 (block) or 1 (line)
1100 REMark C = Colour of cursor 0 – 7 , general colours
1110 REMark 83 is normal
1120 REMark ie : 7 6 5 4 3 2 1 0
1130 REMark 1 0 1 0 0 0 1 1
1140 REMark Parameter : rate = 10
1150 REMark shape = 0
1160 REMark colour = 3
1170 REMark Consult Minverva Technical Manual page ASM. 15
1180 REMark This setup for the cursor works perfectly in MODE 8
1190 REMark
1200 REMark Trap any silly parameters.
1210 :
1220 IF rate < 0 OR rate > 15 THEN
1230   IF rate < 0 THEN rate = 0
1240   IF rate > 15 THEN rate = 15
1250 END IF
1260 IF colour < 0 OR colour > 7 THEN
1270   IF colour < 0 THEN colour = 0
1280   IF colour > 7 THEN colour = 7
1290 END IF
1300 IF shape < 0 OR shape > 1 THEN
1310   IF shape < 0 THEN shape = 0
1320   IF shape > 1 THEN shape = 1
1330 END IF
1340 :
1350 REMark Reverse order of rate to give 0 slow, 15 fast
1360 LET rate = ABS(rate-15)
1370 :
1380 REMark alter parameters to bit level binary numbers
1390 LET rate = rate*16
1400 LET shape = shape*8
1410 POKE !124!51,rate+shape+colour
1420 END DEFine Curser

The top four bits determine the flash rate.

The size bit, if set, produces an underline cursor: if clear it produces the standard QL block cursor.

The bottom three bits determine the cursor colour as per the standard 0-7 colour designation.

This routine only works on Minerva ROMs. Note the special version of the POKE command with exclamation marks either side of the value ‘124’.

 
This Minerva Cursor routine can be downloaded from the Utilities page on my website at http://www.dilwyn.me.uk/utils/index.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s