|
Post by whathim on Feb 15, 2022 17:43:30 GMT 1
Jos We’ve discussed before ( link) some things in PowerBASIC that don’t work under vDos and I’ve been able to get around most of them. I’ve noticed an anomaly regarding the screen cursor. The normal way of hiding the cursor in PB code while leaving its screen location unchanged is: LOCATE , , 0 The syntax here is, LOCATE row, column, visible, where all arguments are optional. This works on my 32-bit laptop under NTVDM but on my 64-bit machine under vDos the cursor remains visible and even if the cursor is subsequently moved to another location, the original location remains visible. It seems the cursor must be simultaneously moved and hidden (e.g. LOCATE currentRow + 1, , 0). This is such a small anomaly, and easily worked around, that I hesitate to raise it. I can send you a minimalist demo program if you feel it’s worth looking at. The opposite action, that of unhiding the cursor (i.e., LOCATE , , 1), works with no such anomaly. Any thoughts are appreciated.
|
|
|
Post by Jos on Feb 15, 2022 17:59:19 GMT 1
Programs mostly hide the cursor by positioning it outside the screen. Else the start and end lines of the cursor have to be set to video mode specific values. Could also be PB sets some VGA card register to the same effect. Programming VGA card registers directly is however mostly ignored by vDos.
Can’t explain why LOCATE currentRow + 1, , 0 would work. You can send me a program to demonstrate both methods. Though could be it goes beyond vDos intended emulating of hardware.
Jos
|
|
|
Post by whathim on Feb 15, 2022 22:14:14 GMT 1
Jose
Please find attached test program. Sorry for delay but in process of preparing I thought I’d found another anomaly – false alarm. Anyway, the program demonstrates the following:
LOCATE , , 0 ‘ to hide the cursor – no immediate effect
LOCATE CSRLIN + 1, , 0 ‘ to hide the cursor – works ok
‘ (CSRLIN is current row)
LOCATE , , 1 ‘ to unhide cursor – works ok
Let’s clarify what I see happening. The statement LOCATE , , 0 has no immediate visual effect on the cursor – it remains visible on the screen. However, under the skin as it were, it has been hidden because when I move it to a different location, either by LOCATE or PRINT, it is not seen at the new location. The old location remains visible, though, until I unhide the cursor at a new location.
Many thanks.
|
|
|
Post by Jos on Feb 16, 2022 9:19:52 GMT 1
vDos updates its window at 25 fps. It maintains a textual copy of the current content and compares that with the (emulated) video memory.
Only the changed character cells are then rendered and the enclosing area displayed.
The text cursor is kind of special, in absence of a hardware cursor, it’s just the character cell with the cursor lines drawn over it.
At the start of the window update routine, vDos checks if the cursor was previously within the screen boundaries. If so and its location changed, the copy of the corresponding character cell is XORed. So the character cell will be redrawn, and the cursor disappears. It’s later on eventually redrawn at the new location.
The catch with LOCATE, ,0: the cursor position doesn’t change. Following position changes are not effective since the cursor is invisible.
For the next vDos version I added an extra upfront test for the cursor shape being changed.
Jos
|
|
|
Post by whathim on Feb 16, 2022 15:04:27 GMT 1
Jos
Thanks for looking into this and the explanation – much appreciated. I look forward to the next vDos version (with color palette setting?).
|
|