AgonConsole8 / agon-vdp

Official Firmware for the Agon Console8: ESP32 VDP
MIT License
38 stars 17 forks source link

Changing text viewport breaks enabling the cursor #254

Open avysk opened 3 hours ago

avysk commented 3 hours ago

After the following sequence

  1. Disable the text cursor.
  2. Change text viewport.
  3. Enable text cursor.

the text cursor is not shown until something is printed on the screen. To demonstrate the behaviour try the following BASIC program:

   10 VDU 22, 0
   20 VDU 23, 1, 0
   30 VDU 28, 1, 11, 70, 10
   40 PRINT("PRESS ANY KEY TO ENABLE CURSOR")
   50 A$=GET$
   60 VDU 23, 1, 1
   70 VDU 26
   80 A$ = GET$
   90 PRINT("FOO")
  100 A$ = GET$

Running it produces the following result:

line 10: the screen is switched to mode 0 and cleared line 20: the text cursor is disabled line 30: the text viewport is changed line 40: the message is printed (no cursor, as expected) line 50: wait for keypress line 60: the text cursor is enabled line 70: the text viewport is reset (no cursor, why?) line 80: wait for keypress line 90: the message is printed (the cursor is back, as expected) line 100: wait for keypress

Notice that removing line 30 fixes the problem. The cursor is shown right after it is enabled.

avysk commented 3 hours ago

I probably should mention that I discovered this in an emulator, but I see the same behaviour on real AgonLight 2 from OLIMEX. Both are running Console8 VDP 2.10.1