Rev 1590 | Rev 1631 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1590 | Rev 1610 | ||
---|---|---|---|
Line 78... | Line 78... | ||
78 | 78 | ||
79 | 79 | ||
80 | 80 | ||
81 | static void set_style(int fgcolor, int bgcolor) |
81 | static void set_style(int fgcolor, int bgcolor) |
82 | { |
82 | { |
83 | send_call_2(con_phone, CONSOLE_SET_STYLE, fgcolor, bgcolor); |
83 | async_msg_2(con_phone, CONSOLE_SET_STYLE, fgcolor, bgcolor); |
84 | } |
84 | } |
85 | 85 | ||
86 | static void start_standout(void) |
86 | static void start_standout(void) |
87 | { |
87 | { |
88 | set_style(0, 0xe0e0e0); |
88 | set_style(0, 0xe0e0e0); |
Line 94... | Line 94... | ||
94 | } |
94 | } |
95 | 95 | ||
96 | 96 | ||
97 | void clear_screen(void) |
97 | void clear_screen(void) |
98 | { |
98 | { |
99 | send_call(con_phone, CONSOLE_CLEAR, 0); |
99 | async_msg(con_phone, CONSOLE_CLEAR, 0); |
100 | moveto(0,0); |
100 | moveto(0,0); |
101 | } |
101 | } |
102 | 102 | ||
103 | /* |
103 | /* |
104 | * Clear the screen, forgetting the current contents in the process. |
104 | * Clear the screen, forgetting the current contents in the process. |
Line 106... | Line 106... | ||
106 | void |
106 | void |
107 | scr_clear(void) |
107 | scr_clear(void) |
108 | { |
108 | { |
109 | 109 | ||
110 | resume_normal(); |
110 | resume_normal(); |
111 | send_call(con_phone, CONSOLE_CLEAR, 0); |
111 | async_msg(con_phone, CONSOLE_CLEAR, 0); |
112 | curscore = -1; |
112 | curscore = -1; |
113 | memset((char *)curscreen, 0, sizeof(curscreen)); |
113 | memset((char *)curscreen, 0, sizeof(curscreen)); |
114 | } |
114 | } |
115 | 115 | ||
116 | /* |
116 | /* |
Line 118... | Line 118... | ||
118 | */ |
118 | */ |
119 | void |
119 | void |
120 | scr_init(void) |
120 | scr_init(void) |
121 | { |
121 | { |
122 | con_phone = get_fd_phone(1); |
122 | con_phone = get_fd_phone(1); |
123 | send_call(con_phone, CONSOLE_CURSOR_VISIBILITY, 0); |
123 | async_msg(con_phone, CONSOLE_CURSOR_VISIBILITY, 0); |
124 | resume_normal(); |
124 | resume_normal(); |
125 | scr_clear(); |
125 | scr_clear(); |
126 | } |
126 | } |
127 | 127 | ||
128 | void moveto(int r, int c) |
128 | void moveto(int r, int c) |
129 | { |
129 | { |
130 | send_call_2(con_phone, CONSOLE_GOTO, r, c); |
130 | async_msg_2(con_phone, CONSOLE_GOTO, r, c); |
131 | } |
131 | } |
132 | 132 | ||
133 | static void fflush(void) |
133 | static void fflush(void) |
134 | { |
134 | { |
135 | send_call(con_phone, CONSOLE_FLUSH, 0); |
135 | async_msg(con_phone, CONSOLE_FLUSH, 0); |
136 | } |
136 | } |
137 | 137 | ||
138 | winsize_t winsize; |
138 | winsize_t winsize; |
139 | 139 | ||
140 | static int get_display_size(winsize_t *ws) |
140 | static int get_display_size(winsize_t *ws) |
141 | { |
141 | { |
142 | return sync_send_2(con_phone, CONSOLE_GETSIZE, 0, 0, &ws->ws_row, &ws->ws_col); |
142 | return async_req_2(con_phone, CONSOLE_GETSIZE, 0, 0, &ws->ws_row, &ws->ws_col); |
143 | } |
143 | } |
144 | 144 | ||
145 | static void |
145 | static void |
146 | scr_stop(int sig) |
146 | scr_stop(int sig) |
147 | { |
147 | { |