本文整理汇总了C++中putfonts8_asc_sht函数的典型用法代码示例。如果您正苦于以下问题:C++ putfonts8_asc_sht函数的具体用法?C++ putfonts8_asc_sht怎么用?C++ putfonts8_asc_sht使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了putfonts8_asc_sht函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cons_putchar
void cons_putchar(struct CONSOLE *cons, int chr, char move)
{
char s[2];
s[0] = chr;
s[1] = 0;
if (s[0] == 0x09) { /* タブ */
for (;;) {
putfonts8_asc_sht(cons->sht, cons->cur_x, cons->cur_y, COL8_FFFFFF, COL8_000000, " ", 1);
cons->cur_x += 8;
if (cons->cur_x == 8 + 240) {
cons_newline(cons);
}
if (((cons->cur_x - 8) & 0x1f) == 0) {
break; /* 32で割り切れたらbreak */
}
}
} else if (s[0] == 0x0a) { /* 改行 */
cons_newline(cons);
} else if (s[0] == 0x0d) { /* 復帰 */
/* とりあえずなにもしない */
} else { /* 普通の文字 */
putfonts8_asc_sht(cons->sht, cons->cur_x, cons->cur_y, COL8_FFFFFF, COL8_000000, s, 1);
if (move != 0) {
/* moveが0のときはカーソルを進めない */
cons->cur_x += 8;
if (cons->cur_x == 8 + 240) {
cons_newline(cons);
}
}
}
return;
}
示例2: cons_putchar
void cons_putchar (struct CONSOLE *cons, int chr, char move)
{
char s[2];
s[0] = chr;
s[1] = 0;
if (s[0] == 0x09) { // tab
for (;;) {
putfonts8_asc_sht (cons->sht, cons->cur_x, cons->cur_y, COL8_FFFFFF, COL8_000000, " ", 1);
cons->cur_x += 8;
if (cons->cur_x == 8 + 240) {
cons_newline(cons);
}
if (((cons->cur_x - 8) & 0x1f) == 0) {
break;
}
}
} else if (s[0] == 0x0a) { // enter
cons_newline(cons);
} else if (s[0] == 0x0d) { // enter
// Do nothing
} else {
putfonts8_asc_sht (cons->sht, cons->cur_x, cons->cur_y, COL8_FFFFFF, COL8_000000, s, 1);
if (move != 0) {
cons->cur_x += 8;
if (cons->cur_x == 8 + 240) {
cons_newline (cons);
}
}
}
return;
}
示例3: cons_putchar
void cons_putchar(struct CONSOLE *cons, char chr, int move)
{
/* 逐字输出 */
char s[2];
s[0] = chr;
s[1] = 0;
if (s[0] == 0x09) { /* 制表符 */
for (;;) {
putfonts8_asc_sht(cons->sht, cons->cur_x, cons->cur_y, COL8_FFFFFF, COL8_000000, " ", 1);
cons->cur_x += 8;
if (cons->cur_x == 8 + 240) {
cons_newline(cons);
}
if (((cons->cur_x - 8) & 0x1f) == 0) {
break; /* 被32整除则break */
}
}
} else if (s[0] == 0x0a) { /* 换行 */
cons_newline(cons);
} else if (s[0] == 0x0d) { /* 回车 */
/* 这里暂且不进行任何操作 */
} else { /* 一般字符 */
putfonts8_asc_sht(cons->sht, cons->cur_x, cons->cur_y, COL8_FFFFFF, COL8_000000, s, 1);
if (move != 0) {
/* move为0时光标不后移 */
cons->cur_x += 8; // 后移一位
if (cons->cur_x == 8 + 240) { // 到达最右端后换行
cons_newline(cons);
}
}
}
return;
}
示例4: console_task
void console_task(struct SHEET *sheet)
{
struct TIMER *timer;
struct TASK *task = task_now();
int i, fifobuf[128], cursor_x = 16, cursor_c = COL8_000000;
char s[2];
fifo32_init(&task->fifo, 128, fifobuf, task);
timer = timer_alloc();
timer_init(timer, &task->fifo, 1);
timer_settime(timer, 50);
/* 显示提示符 */
putfonts8_asc_sht(sheet, 8, 28, COL8_FFFFFF, COL8_000000, ">", 1);
for (;;) {
io_cli();
if (fifo32_status(&task->fifo) == 0) {
task_sleep(task);
io_sti();
} else {
i = fifo32_get(&task->fifo);
io_sti();
if (i <= 1) { /* 光标用定时器 */
if (i != 0) {
timer_init(timer, &task->fifo, 0); /* 下次置0 */
cursor_c = COL8_FFFFFF;
} else {
timer_init(timer, &task->fifo, 1); /* 下次置1 */
cursor_c = COL8_000000;
}
timer_settime(timer, 50);
}
if (256 <= i && i <= 511) { /* 键盘数据(通过任务A) */
if (i == 8 + 256) {
/* 退格键 */
if (cursor_x > 16) {
/* 用空白擦除光标后将光标前移一位 */
putfonts8_asc_sht(sheet, cursor_x, 28, COL8_FFFFFF, COL8_000000, " ", 1);
cursor_x -= 8;
}
} else {
/* 一般字符 */
if (cursor_x < 240) {
/* 显示一个字符之后将光标后移一位 */
s[0] = i - 256;
s[1] = 0;
putfonts8_asc_sht(sheet, cursor_x, 28, COL8_FFFFFF, COL8_000000, s, 1);
cursor_x += 8;
}
}
}
/* 重新显示光标 */
boxfill8(sheet->buf, sheet->bxsize, cursor_c, cursor_x, 28, cursor_x + 7, 43);
sheet_refresh(sheet, cursor_x, 28, cursor_x + 8, 44);
}
}
}
示例5: console_task
void console_task(struct SHEET *sheet)
{
struct TIMER *timer;
struct TASK *task = task_now();
int i, fifobuf[128], cursor_x = 16, cursor_c = COL8_000000;
char s[2];
fifo32_init(&task->fifo, 128, fifobuf, task);
timer = timer_alloc();
timer_init(timer, &task->fifo, 1);
timer_settime(timer, 50);
/* プロンプト表示 */
putfonts8_asc_sht(sheet, 8, 28, COL8_FFFFFF, COL8_000000, ">", 1);
for (;;) {
io_cli();
if (fifo32_status(&task->fifo) == 0) {
task_sleep(task);
io_sti();
} else {
i = fifo32_get(&task->fifo);
io_sti();
if (i <= 1) { /* カーソル用タイマ */
if (i != 0) {
timer_init(timer, &task->fifo, 0); /* 次は0を */
cursor_c = COL8_FFFFFF;
} else {
timer_init(timer, &task->fifo, 1); /* 次は1を */
cursor_c = COL8_000000;
}
timer_settime(timer, 50);
}
if (256 <= i && i <= 511) { /* キーボードデータ(タスクA経由) */
if (i == 8 + 256) {
/* バックスペース */
if (cursor_x > 16) {
/* カーソルをスペースで消してから、カーソルを1つ戻す */
putfonts8_asc_sht(sheet, cursor_x, 28, COL8_FFFFFF, COL8_000000, " ", 1);
cursor_x -= 8;
}
} else {
/* 一般文字 */
if (cursor_x < 240) {
/* 一文字表示してから、カーソルを1つ進める */
s[0] = i - 256;
s[1] = 0;
putfonts8_asc_sht(sheet, cursor_x, 28, COL8_FFFFFF, COL8_000000, s, 1);
cursor_x += 8;
}
}
}
/* カーソル再表示 */
boxfill8(sheet->buf, sheet->bxsize, cursor_c, cursor_x, 28, cursor_x + 7, 43);
sheet_refresh(sheet, cursor_x, 28, cursor_x + 8, 44);
}
}
}
示例6: cmd_mem
void cmd_mem(struct CONSOLE *cons, unsigned int memtotal)
{
struct MEMMAN *memman = (struct MEMMAN *) MEMMAN_ADDR;
char s[30];
sprintf(s, "total %dMB", memtotal / (1024 * 1024));
putfonts8_asc_sht(cons->sht, 8, cons->cur_y, COL8_FFFFFF, COL8_000000, s, 30);
cons_newline(cons);
sprintf(s, "free %dKB", memman_total(memman) / 1024);
putfonts8_asc_sht(cons->sht, 8, cons->cur_y, COL8_FFFFFF, COL8_000000, s, 30);
cons_newline(cons);
cons_newline(cons);
return;
}
示例7: cmd_dir
void cmd_dir(struct CONSOLE *cons)
{
struct FILEINFO *finfo = (struct FILEINFO *) (ADR_DISKIMG + 0x002600);
int i, j;
char s[30];
for (i = 0; i < 224; i++) {
if (finfo[i].name[0] == 0x00) {
break;
}
if (finfo[i].name[0] != 0xe5) {
if ((finfo[i].type & 0x18) == 0) {
sprintf(s, "filename.ext %7d", finfo[i].size);
for (j = 0; j < 8; j++) {
s[j] = finfo[i].name[j];
}
s[ 9] = finfo[i].ext[0];
s[10] = finfo[i].ext[1];
s[11] = finfo[i].ext[2];
putfonts8_asc_sht(cons->sht, 8, cons->cur_y, COL8_FFFFFF, COL8_000000, s, 30);
cons_newline(cons);
}
}
}
cons_newline(cons);
return;
}
示例8: task_b_main
void task_b_main(struct SHEET *sht_win_b)
{
struct FIFO32 fifo;
struct TIMER *timer_1s;
int i, fifobuf[128], count = 0, count0 = 0;
char s[12];
fifo32_init(&fifo, 128, fifobuf,0);
timer_1s = timer_alloc();
timer_init(timer_1s, &fifo, 100);
timer_settime(timer_1s, 100);
for (;;) {
count++;
io_cli();
if (fifo32_status(&fifo) == 0) {
io_sti();
} else {
i = fifo32_get(&fifo);
io_sti();
if (i == 100) {
sprintf(s, "%11d", count - count0);
putfonts8_asc_sht(sht_win_b, 24, 28, COL8_000000, COL8_C6C6C6, s, 11);
count0 = count;
timer_settime(timer_1s, 100);
}
}
}
}
示例9: task_b_main
void task_b_main (struct SHEET *sht_back)
{
struct FIFO32 fifo;
struct TIMER *timer_ts, *timer_put;
int i, fifobuf[128], count = 0;
fifo32_init(&fifo, 128, fifobuf);
timer_ts = timer_alloc();
timer_init(timer_ts, &fifo, 2);
timer_settime(timer_ts, 2);
timer_put = timer_alloc();
timer_init(timer_put, &fifo, 1);
timer_settime(timer_put, 1);
for (;;) {
count++;
io_cli();
if (fifo32_status(&fifo) == 0) {
io_stihlt();
} else {
i = fifo32_get(&fifo);
io_sti();
if (i == 1) {
char s[11];
sprintf (s, "%d", count);
putfonts8_asc_sht (sht_back, 0, 144, COL8_FFFFFF, COL8_008484, s, 11);
timer_settime (timer_put, 1);
} else if (i == 2) { // timeout 5 sec
farjmp(0, 3 * 8);
timer_settime(timer_ts, 2);
}
}
}
}
示例10: task_b_main
void task_b_main(struct SHEET *sht_back)
{
struct FIFO32 fifo;
struct TIMER *timer_put, *timer_1s;
int i, fifobuf[128], count = 0, count0 = 0;
char s[128];
fifo32_init(&fifo, 128, fifobuf);
timer_put = timer_alloc();
timer_init(timer_put, &fifo, 1);
timer_settime(timer_put, 1);
timer_1s = timer_alloc();
timer_init(timer_1s, &fifo, 100);
timer_settime(timer_1s, 100);
for (;;) {
count++;
io_cli();
if (fifo32_status(&fifo) == 0) {
io_sti();
} else {
i = fifo32_get(&fifo);
io_sti();
if (i == 1) {
sprintf(s, "+%11d, times=%d", count, task_switch_times);
putfonts8_asc_sht(sht_back, 0, 144, COL8_FFFFFF, COL8_008484, s, 31);
timer_settime(timer_put, 1);
} else if (i == 100) {
sprintf(s, "-%11d", count - count0);
putfonts8_asc_sht(sht_back, 0, 128, COL8_FFFFFF, COL8_008484, s, 31);
count0 = count;
timer_settime(timer_1s, 100);
}
}
}
}
示例11: task_b_main
void task_b_main(struct SHEET *sht_back)
{
struct FIFO32 fifo;
struct TIMER *timer_ls, *timer_put;
int i, fifobuf[128], count = 0, count0 = 0;
char s[11];
fifo32_init(&fifo, 128, fifobuf);
timer_ls = timer_alloc();
timer_init(timer_ls, &fifo, 100);
timer_settime(timer_ls, 100);
timer_put = timer_alloc();
timer_init(timer_put, &fifo, 1);
// timer_settime(timer_put, 1);
for (;;) {
count++;
io_cli();
if (0 == fifo32_status(&fifo)) {
io_sti();
} else {
i = fifo32_get(&fifo);
io_sti();
if (1 == i) {
sprintf(s, "%x", count);
putfonts8_asc_sht(sht_back, 0, 144, COL8_FFFFFF, COL8_008484, s, 10);
timer_settime(timer_put, 1);
} else if (100 == i) {
sprintf(s, "%x", count - count0);
putfonts8_asc_sht(sht_back, 0, 128, COL8_FFFFFF, COL8_008484, s, 11);
count0 = count;
timer_settime(timer_ls, 100);
}
}
}
}
示例12: cons_putchar
void cons_putchar(struct CONSOLE *cons, int chr, char move)
{
char s[2];
s[0] = chr;
s[1] = 0;
if (s[0] == 0x09) { /* �� */
for (;;) {
if (cons->sht != 0) {
putfonts8_asc_sht(cons->sht, cons->cur_x, cons->cur_y, COL8_FFFFFF, COL8_000000, " ", 1);
}
cons->cur_x += 8;
if (cons->cur_x == 8 + 240) {
cons_newline(cons);
}
if (((cons->cur_x - 8) & 0x1f) == 0) {
break; /* 32�� ������ �������� break */
}
}
} else if (s[0] == 0x0a) { /* ���� */
cons_newline(cons);
} else if (s[0] == 0x0d) { /* ���� */
/* �켱 �ƹ��͵� ���� �ʴ´� */
} else { /* ���� ���� */
if (cons->sht != 0) {
putfonts8_asc_sht(cons->sht, cons->cur_x, cons->cur_y, COL8_FFFFFF, COL8_000000, s, 1);
}
if (move != 0) {
/* move�� 0�� ���� Ŀ���� �����Ű�� �ʴ´� */
cons->cur_x += 8;
if (cons->cur_x == 8 + 240) {
cons_newline(cons);
}
}
}
return;
}
示例13: cons_runcmd
void cons_runcmd (char *cmdline, struct CONSOLE *cons, int *fat, unsigned int memtotal)
{
if (strcmp(cmdline, "mem") == 0) {
cmd_mem (cons, memtotal);
} else if (strcmp(cmdline, "cls") == 0) {
cmd_cls (cons);
} else if (strcmp (cmdline, "dir") == 0) {
cmd_dir (cons);
} else if (cmdline[0]=='t' && cmdline[1]=='y' && cmdline[2]=='p' && cmdline[3]=='e' && cmdline[4]==' ') {
cmd_type (cons, fat, cmdline);
} else if (strcmp (cmdline, "hlt") == 0) {
cmd_hlt (cons, fat);
} else if (cmdline[0] != 0) {
// Not Command Line and Empty
putfonts8_asc_sht (cons->sht, 8, cons->cur_y, COL8_FFFFFF, COL8_000000, "Bad command.", 12);
cons_newline (cons);
cons_newline (cons);
}
}
示例14: cons_runcmd
void cons_runcmd(char *cmdline, struct CONSOLE *cons, int *fat, unsigned int memtotal)
{
if (strcmp(cmdline, "mem") == 0) {
cmd_mem(cons, memtotal);
} else if (strcmp(cmdline, "cls") == 0) {
cmd_cls(cons);
} else if (strcmp(cmdline, "dir") == 0) {
cmd_dir(cons);
} else if (strncmp(cmdline, "type ", 5) == 0) {
cmd_type(cons, fat, cmdline);
} else if (strcmp(cmdline, "hlt") == 0) {
cmd_hlt(cons, fat);
} else if (cmdline[0] != 0) {
/* コマンドではなく、さらに空行でもない */
putfonts8_asc_sht(cons->sht, 8, cons->cur_y, COL8_FFFFFF, COL8_000000, "Bad command.", 12);
cons_newline(cons);
cons_newline(cons);
}
return;
}
示例15: cmd_hlt
void cmd_hlt(struct CONSOLE *cons, int *fat)
{
struct MEMMAN *memman = (struct MEMMAN *) MEMMAN_ADDR;
struct FILEINFO *finfo = file_search("HLT.HRB", (struct FILEINFO *) (ADR_DISKIMG + 0x002600), 224);
struct SEGMENT_DESCRIPTOR *gdt = (struct SEGMENT_DESCRIPTOR *) ADR_GDT;
char *p;
if (finfo != 0) {
/* ファイルが見つかった場合 */
p = (char *) memman_alloc_4k(memman, finfo->size);
file_loadfile(finfo->clustno, finfo->size, p, fat, (char *) (ADR_DISKIMG + 0x003e00));
set_segmdesc(gdt + 1003, finfo->size - 1, (int) p, AR_CODE32_ER);
farjmp(0, 1003 * 8);
memman_free_4k(memman, (int) p, finfo->size);
} else {
/* ファイルが見つからなかった場合 */
putfonts8_asc_sht(cons->sht, 8, cons->cur_y, COL8_FFFFFF, COL8_000000, "File not found.", 15);
cons_newline(cons);
}
cons_newline(cons);
return;
}