/** * Send a text string to the display * * @param line : Line number where the string must be written * @param s : String to write */ void disp_puts(u8 line, char *s) { disp_putc('0' + line); while(*s) { disp_putc(*s); s++; } disp_putc('\n'); }
/** * Initialisation of the display driver * */ void disp_init(void) { int i; uart2_init(); for (i = 0; i < 0x10000; i++) ; /* Reset display state machine */ disp_putc('\r'); /* Clear display */ disp_putc(0x1B); /* Wait a short time */ for (i = 0; i < 0x10000; i++) ; }
void ztc_put_char(int ch) { fg_box_t temp_box; msm_hidecursor(); if (in_graphics_mode && !in_splitscreen) lsplitscreen(NIL); if (ch != '\1' && ch != '\2') { if (in_graphics_mode) { if (ch == '\n') { ztc_graph_textx = 0; if (ztc_graph_texty - texth >= 0) ztc_graph_texty -= texth; else check_scroll(); } else if (ch == '\b') { if (ztc_graph_textx > 0) fg_adjustxy(FG_ROT180, 1, &ztc_graph_textx, &ztc_graph_texty, fg.charbox); } else if (ch == '\t') { fg_adjustxy(FG_ROT0, 8 - (x_coord&07), &ztc_graph_textx, &ztc_graph_texty, fg.charbox); if (ztc_graph_textx >= MaxX) print_char(stdout,'\n'); } else { if (ztc_text_bgcolor != 0) { temp_box[FG_X1] = temp_box[FG_X2] = ztc_graph_textx; temp_box[FG_Y1] = temp_box[FG_Y2] = ztc_graph_texty; fg_adjustxy(FG_ROT0, 2, &temp_box[FG_X2], &temp_box[FG_Y2], fg.charbox); temp_box[FG_Y2] += texth-1; fg_fillbox(ztc_text_bgcolor, FG_MODE_SET, ~0, temp_box); } fg_putc(ztc_textcolor, FG_MODE_SET, ~0, FG_ROT0, ztc_graph_textx, ztc_graph_texty, ch, fg.displaybox); fg_adjustxy(FG_ROT0, 1, &ztc_graph_textx, &ztc_graph_texty, fg.charbox); if (ztc_graph_textx >= MaxX) print_char(stdout,'\n'); } } else disp_putc(ch); } msm_showcursor(); }
void drawbox(uchar x,uchar y,uchar length,uchar width) { uint loop; disp_move(y,x); disp_putc(201); for(loop=0;loop<=(width-3);loop++) disp_putc(205); disp_putc(187); for(loop=y+1;loop<=(length+y-1);loop++) { disp_move(loop,x+width-1); disp_putc(186); } disp_move(loop,x+width-2) disp_putc(188); for(loop=(x+width);loop>=x+1;loop--) { disp_move(y+length,loop); disp_putc(205); } disp_putc(200); for(loop=(y+length);loop>=y+1;loop--) { disp_move(loop,x); disp_putc(186); } }