-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Wu Han
committed
Aug 24, 2019
1 parent
68a186f
commit 32d47b4
Showing
10 changed files
with
565 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,3 +50,4 @@ modules.order | |
Module.symvers | ||
Mkfile.old | ||
dkms.conf | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
## VT-100 | ||
|
||
RT-Thread 的终端 msh 一直是一个非常受大家欢迎的组件,但是终端只能打印基本的字符未免有些单调了,于是我封装了 ANSI Escape 标准,这样就可以在 msh 里实现更加丰富的图形界面了,例如动画和游戏开发。 | ||
|
||
### 奔跑的小火车 | ||
|
||
![](./doc/sl.gif) | ||
|
||
小火车还有不同类型 | ||
|
||
![](./doc/sl_c.png) | ||
|
||
### 实时控制台 | ||
|
||
![](./doc/monitor.png) | ||
|
||
|
||
|
||
### 绘制色条矩形 | ||
|
||
![](./doc/color.png) | ||
|
||
|
||
|
||
## 联系方式 | ||
|
||
- 维护:Wu Han | ||
- 主页:http://wuhanstudio.cc | ||
- 邮箱:wuhanstudio@hust.edu.cn |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* @Description: VT100 Color demo | ||
* @Author: Wu Han | ||
* @Date: 2019-08-24 21:02:52 | ||
* @LastEditTime: 2019-08-24 21:34:44 | ||
* @LastEditors: Please set LastEditors | ||
*/ | ||
|
||
#include <rtthread.h> | ||
#include <stdio.h> | ||
|
||
#include "vt100.h" | ||
|
||
void vt_color(int argc, char* argv[]) | ||
{ | ||
vt_hide_cursor(); | ||
vt_clear(); | ||
|
||
// 1. Corlor Bar | ||
for (int i = 0; i < 8; i++) | ||
{ | ||
if(i == 0) | ||
{ | ||
vt_set_font_color(VT_F_WHITE); | ||
} | ||
else | ||
{ | ||
vt_set_font_color(VT_F_BLACK + i - 1 ); | ||
} | ||
vt_set_bg_color(VT_B_BLACK + i); | ||
vt_draw_hline(i, 0, 80, ' '); | ||
vt_draw_str_at(i, 31, "Put your text here"); | ||
} | ||
|
||
// 2. Boxes | ||
vt_set_font_color(VT_F_WHITE); | ||
vt_set_bg_color(VT_B_BLACK); | ||
for (int i = 0; i < 7; i++) | ||
{ | ||
vt_draw_box(8 + i, 0, 16 - i * 2, 40 - i * 2, '-', '|', '+'); | ||
} | ||
|
||
// 3. Logo | ||
char rt_str[30]; | ||
vt_draw_str_at(14, 40, " \\ | /"); | ||
vt_draw_str_at(15, 40, "- RT - Thread Operating System\n"); | ||
sprintf(rt_str, " / | \\ %d.%d.%d build %s\n", RT_VERSION, RT_SUBVERSION, RT_REVISION, __DATE__); | ||
vt_draw_str_at(16, 40, rt_str); | ||
vt_draw_str_at(17, 40, " 2006 - 2019 Copyright by rt-thread team\n"); | ||
|
||
// 4. Fill box | ||
for (int i = 0; i < 6; i++) | ||
{ | ||
vt_set_bg_color(VT_B_RED + i); | ||
vt_fill_box(9, 43 + i * 6, 4, 4, ' '); | ||
} | ||
|
||
for (int i = 5; i >= 0; i--) | ||
{ | ||
vt_set_bg_color(VT_B_WHITE - i); | ||
vt_fill_box(19, 43 + i * 6, 4, 4, ' '); | ||
} | ||
|
||
vt_set_bg_color(VT_B_BLACK); | ||
vt_move_to(23, 0); | ||
printf("\n"); | ||
|
||
vt_clear_attr(); | ||
vt_show_cursor(); | ||
|
||
} | ||
MSH_CMD_EXPORT(vt_color, vt color demo) |
Oops, something went wrong.