Applesoft Basic, how to hide the flashing cursor?

310 views Asked by At

I’ve finally decided to build a monthly budget program for an Apple //e, coming along nicely. Right now I’m using the AppleWin emulator.

Anyone know how to hide the cursor in Applesoft Basic? I was thinking of either hiding it using a Poke or change the cursor character to a blank space?

I know that VisiCalc does this, when you load the program, there is no flashing cursor until you begin editing. I want to do this same feature in my program.

Note: I don’t want to do it through the emulator as I will eventually move this to Apple hardware.

3

There are 3 answers

0
Kenneth On BEST ANSWER

I found a solution for this here. Terminal control/Hiding the cursor.

I was able to hide the cursor using the WAIT command, then grab the next character with GET.

WAIT 49152, 128
GET I$

More examples here: Applesoft Basic Examples

0
Nick Westgate On

VisiCalc is written in assembly language, and so is Applesoft BASIC - and so is the firmware routine that Applesoft calls to get a key while flashing the cursor. You can read the keyboard without flashing the cursor from Applesoft or assembly language, but you need to learn the underlying soft-switches used to do this.

Name     Hex    Decimal  Negative
KBD      $C000  49152    -16384
KBDSTRB  $C010  49168    -16368

In summary, you read KBD to get the value of the last key pressed. Bit 8 of that value (the 'strobe') will be set if it's a new key - in which case you need to subtract 128 to get the key value. You then access KBDSTRB to clear the strobe bit of KBD. For more details I refer you to page 5 of the Apple II Reference Manual or page 12 of the Apple IIe Technical Reference Manual.

Another good book which talks about this and many other things is The New Apple II User's Guide.

Here's a simple example of how to use these soft-switches:

10 KEY = PEEK (-16384) : REM READ KEY
20 IF KEY >= 128 THEN PRINT PEEK (-16368) : REM CLEAR STROBE
30 GOTO 10

Finally, consider visiting Retrocomputing for these kinds of questions.

5
vladwoguer On

Original answer:

There is a undocumented way to do this on Apple IIe

POKE 2043, ASC(" ") + 128

More info: https://www.atarimagazines.com/compute/issue90/Feedback_Custom_Cursor.php

Update

As @Nick Westgate said. This works for Apple IIc and not for Apple IIe.

More info: https://github.com/AppleWin/AppleWin/issues/135