Skip to content

Commit c712474

Browse files
authored
Merge pull request #435 from boriel/bugfix/input_cursor_bad_position
Prevents cursor misplacement
2 parents 514e736 + 0b410cd commit c712474

2 files changed

Lines changed: 20 additions & 8 deletions

File tree

src/arch/zx48k/library/input.bas

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,25 @@ END FUNCTION
7272
' Function 'PRIVATE' to this module.
7373
' Shows a flashing cursor
7474
' ------------------------------------------------------------------
75-
SUB FASTCALL PRIVATEInputShowCursor
75+
SUB PRIVATEInputShowCursor
7676
REM Print a Flashing cursor at current print position
77-
PRINT AT csrlin(), pos(); OVER 0; FLASH 1; " " + CHR$(8);
77+
DIM x, y as UBYTE
78+
y = csrlin()
79+
x = pos()
80+
PRINT AT y, x; OVER 0; FLASH 1; " "; AT y, x;
7881
END SUB
7982

8083

8184
' ------------------------------------------------------------------
8285
' Function 'PRIVATE' to this module.
8386
' Hides the flashing cursor
8487
' ------------------------------------------------------------------
85-
SUB FASTCALL PRIVATEInputHideCursor
88+
SUB PRIVATEInputHideCursor
8689
REM Print a Flashing cursor at current print position
87-
PRINT AT csrlin(), pos(); OVER 0; FLASH 0; " " + CHR$(8);
90+
DIM x, y as UBYTE
91+
y = csrlin()
92+
x = pos()
93+
PRINT AT y, x; OVER 0; FLASH 0; " "; AT y, x;
8894
END SUB
8995

9096
#endif

src/arch/zxnext/library/input.bas

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,19 +72,25 @@ END FUNCTION
7272
' Function 'PRIVATE' to this module.
7373
' Shows a flashing cursor
7474
' ------------------------------------------------------------------
75-
SUB FASTCALL PRIVATEInputShowCursor
75+
SUB PRIVATEInputShowCursor
7676
REM Print a Flashing cursor at current print position
77-
PRINT AT csrlin(), pos(); OVER 0; FLASH 1; " " + CHR$(8);
77+
DIM x, y as UBYTE
78+
y = csrlin()
79+
x = pos()
80+
PRINT AT y, x; OVER 0; FLASH 1; " "; AT y, x;
7881
END SUB
7982

8083

8184
' ------------------------------------------------------------------
8285
' Function 'PRIVATE' to this module.
8386
' Hides the flashing cursor
8487
' ------------------------------------------------------------------
85-
SUB FASTCALL PRIVATEInputHideCursor
88+
SUB PRIVATEInputHideCursor
8689
REM Print a Flashing cursor at current print position
87-
PRINT AT csrlin(), pos(); OVER 0; FLASH 0; " " + CHR$(8);
90+
DIM x, y as UBYTE
91+
y = csrlin()
92+
x = pos()
93+
PRINT AT y, x; OVER 0; FLASH 0; " "; AT y, x;
8894
END SUB
8995

9096
#endif

0 commit comments

Comments
 (0)