1

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.

Kenneth
  • 31
  • 5

3 Answers3

2

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

Kenneth
  • 31
  • 5
1

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.

Nick Westgate
  • 3,088
  • 2
  • 34
  • 41
0

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

vladwoguer
  • 951
  • 1
  • 14
  • 28
  • Yea I’m not using 80-col, this doesn’t seem to work using 40-column. – Kenneth Aug 11 '18 at 04:32
  • Yes and I found that the emulator doesn't support it either. https://github.com/AppleWin/AppleWin/issues/135 – vladwoguer Aug 11 '18 at 12:57
  • So it looks like the emulator doesn't support the POKE 2043 trick in 40 column. But I am curious how VisiCalc accomplished this, when I load their rom into AppleWin there is not a flashing cursor? – Kenneth Aug 11 '18 at 13:14
  • I found some details about Visicalc: https://rmf.vc/implementingvisicalc But none about the hidden cursor. – vladwoguer Aug 11 '18 at 14:35
  • It turns out I [investigated this years ago](https://github.com/AppleWin/AppleWin/issues/135) and that feature is specific to the Apple IIc 80-column firmware. It doesn't work on either the original or enhanced Apple IIe. – Nick Westgate Aug 15 '18 at 01:52