|
|
@ -31,6 +31,7 @@ static struct { |
|
|
|
int y; //!< Y coordinate
|
|
|
|
int y; //!< Y coordinate
|
|
|
|
bool visible; //!< Visible
|
|
|
|
bool visible; //!< Visible
|
|
|
|
bool inverse; //!< Inverse colors
|
|
|
|
bool inverse; //!< Inverse colors
|
|
|
|
|
|
|
|
bool autowrap; //!< Wrapping when EOL
|
|
|
|
Color fg; //!< Foreground color for writing
|
|
|
|
Color fg; //!< Foreground color for writing
|
|
|
|
Color bg; //!< Background color for writing
|
|
|
|
Color bg; //!< Background color for writing
|
|
|
|
} cursor; |
|
|
|
} cursor; |
|
|
@ -102,6 +103,7 @@ cursor_reset(void) |
|
|
|
cursor.bg = SCREEN_DEF_BG; |
|
|
|
cursor.bg = SCREEN_DEF_BG; |
|
|
|
cursor.visible = 1; |
|
|
|
cursor.visible = 1; |
|
|
|
cursor.inverse = 0; |
|
|
|
cursor.inverse = 0; |
|
|
|
|
|
|
|
cursor.autowrap = 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//endregion
|
|
|
|
//endregion
|
|
|
@ -397,6 +399,17 @@ screen_cursor_enable(bool enable) |
|
|
|
NOTIFY_DONE(); |
|
|
|
NOTIFY_DONE(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Enable autowrap |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
void ICACHE_FLASH_ATTR |
|
|
|
|
|
|
|
screen_wrap_enable(bool enable) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
NOTIFY_LOCK(); |
|
|
|
|
|
|
|
cursor.autowrap = enable; |
|
|
|
|
|
|
|
NOTIFY_DONE(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//endregion
|
|
|
|
//endregion
|
|
|
|
|
|
|
|
|
|
|
|
//region Colors
|
|
|
|
//region Colors
|
|
|
@ -492,7 +505,7 @@ screen_putchar(char ch) |
|
|
|
cursor.x--; |
|
|
|
cursor.x--; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// wrap around start of line
|
|
|
|
// wrap around start of line
|
|
|
|
if (cursor.y>0) { |
|
|
|
if (cursor.autowrap && cursor.y>0) { |
|
|
|
cursor.x=W-1; |
|
|
|
cursor.x=W-1; |
|
|
|
cursor.y--; |
|
|
|
cursor.y--; |
|
|
|
} |
|
|
|
} |
|
|
@ -532,6 +545,7 @@ screen_putchar(char ch) |
|
|
|
cursor.x++; |
|
|
|
cursor.x++; |
|
|
|
// X wrap
|
|
|
|
// X wrap
|
|
|
|
if (cursor.x >= W) { |
|
|
|
if (cursor.x >= W) { |
|
|
|
|
|
|
|
if (cursor.autowrap) { |
|
|
|
cursor.x = 0; |
|
|
|
cursor.x = 0; |
|
|
|
cursor.y++; |
|
|
|
cursor.y++; |
|
|
|
// Y wrap
|
|
|
|
// Y wrap
|
|
|
@ -540,6 +554,9 @@ screen_putchar(char ch) |
|
|
|
screen_scroll_up(1); |
|
|
|
screen_scroll_up(1); |
|
|
|
cursor.y = H - 1; |
|
|
|
cursor.y = H - 1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
cursor.x = W - 1; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
done: |
|
|
|
done: |
|
|
|