Changeset d6cc453 in mainline
- Timestamp:
- 2006-06-02T19:22:08Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 53daee3
- Parents:
- e87e18f
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
re87e18f rd6cc453 39 39 ns \ 40 40 fb \ 41 console 41 console \ 42 tetris 42 43 43 44 ifeq ($(ARCH), amd64) -
console/console.c
re87e18f rd6cc453 285 285 case CONSOLE_PUTCHAR: 286 286 write_char(consnum, IPC_GET_ARG1(call)); 287 gcons_notify_char(consnum); 287 288 break; 288 289 case CONSOLE_CLEAR: … … 297 298 case CONSOLE_GOTO: 298 299 299 screenbuffer_goto(&(connections[consnum].screenbuffer), IPC_GET_ARG 1(call), IPC_GET_ARG2(call));300 screenbuffer_goto(&(connections[consnum].screenbuffer), IPC_GET_ARG2(call), IPC_GET_ARG1(call)); 300 301 301 302 break; 302 303 303 304 case CONSOLE_GETSIZE: 304 arg1 = fb_info. cols;305 arg2 = fb_info. rows;305 arg1 = fb_info.rows; 306 arg2 = fb_info.cols; 306 307 break; 307 308 case CONSOLE_FLUSH: -
console/gcons.c
re87e18f rd6cc453 49 49 static int console_vp; 50 50 static int cstatus_vp[CONSOLE_COUNT]; 51 static int console_has_input[CONSOLE_COUNT]; 51 52 static int cstat_row, cstat_col; /* Size of cstatus buttons */ 52 53 … … 56 57 CONS_ACTIVE = 0, 57 58 CONS_IDLE, 58 CONS_HAS_INPUT 59 CONS_HAS_INPUT, 60 CONS_DISCONNECTED 59 61 }; 60 62 … … 65 67 {0xd0d0d0, 0x808080}, 66 68 {0xd0d0d0, 0x0}, 67 {0xd0d0d0, 0xa04040} 69 {0xd0d0d0, 0xa04040}, 70 {0xd0d0d0, 0x0} 68 71 }; 69 72 … … 109 112 set_style(stat_colors[state].fgcolor, stat_colors[state].bgcolor); 110 113 clear(); 111 snprintf(data, 5, "%d", consnum+1); 112 for (i=0;data[i];i++) 113 putch(data[i], 0, i); 114 if (state != CONS_DISCONNECTED) { 115 snprintf(data, 5, "%d", consnum+1); 116 for (i=0;data[i];i++) 117 putch(data[i], 0, i); 118 } 114 119 } 115 120 … … 122 127 active_console = consnum; 123 128 draw_stat(consnum, CONS_ACTIVE); 129 console_has_input[consnum] = 0; 130 124 131 vp_switch(console_vp); 125 132 } … … 130 137 return; 131 138 139 if (consnum == active_console || console_has_input[consnum]) 140 return; 141 142 console_has_input[consnum] = 1; 143 draw_stat(consnum, CONS_HAS_INPUT); 144 132 145 vp_switch(console_vp); 133 146 } … … 145 158 146 159 for (i=0;i < CONSOLE_COUNT; i++) 147 draw_stat(i, i == active_console ? CONS_ACTIVE : CONS_ IDLE);160 draw_stat(i, i == active_console ? CONS_ACTIVE : CONS_DISCONNECTED); 148 161 vp_switch(console_vp); 149 162 } -
console/gcons.h
re87e18f rd6cc453 32 32 void gcons_init(int phone); 33 33 void gcons_change_console(int consnum); 34 void gcons_notify_char(int consnum); 34 35 35 36 #endif -
libc/include/err.h
re87e18f rd6cc453 30 30 #define _libc__ERR_H_ 31 31 32 extern void errx (int __status, __const char *__format, ...) 33 __attribute__ ((__noreturn__, __format__ (__printf__, 2, 3))); 32 #define errx(status,fmt,...) { printf((fmt),##__VA_ARGS__);_exit(status);} 34 33 35 34 #endif -
libc/include/io/stream.h
re87e18f rd6cc453 27 27 */ 28 28 29 #ifndef __libc_STREAM_H_ 30 #define __libc_STREAM_H_ 31 29 32 #include <libarch/types.h> 30 33 … … 39 42 fd_t open(const char *fname, int flags); 40 43 int get_fd_phone(int fd); 44 45 #endif -
tetris/screen.c
re87e18f rd6cc453 98 98 { 99 99 100 resume_normal(); 100 101 send_call(con_phone, CONSOLE_CLEAR, 0); 101 102 curscore = -1; … … 187 188 188 189 189 #if vax && !__GNUC__190 typedef int regcell; /* pcc is bad at `register char', etc */191 #else192 typedef cell regcell;193 #endif194 195 190 /* 196 191 * Update the screen. … … 200 195 { 201 196 cell *bp, *sp; 202 regcell so, cur_so = 0;197 cell so, cur_so = 0; 203 198 int i, ccol, j; 204 199 static const struct shape *lastshape; … … 300 295 { 301 296 302 if (set || CEstr == NULL) { 303 int l = strlen(s); 304 305 moveto(Rows - 2, ((Cols - l) >> 1) - 1); 306 if (set) 307 putstr(s); 308 else 309 while (--l >= 0) 310 (void) putchar(' '); 311 } else { 312 moveto(Rows - 2, 0); 313 putpad(CEstr); 314 } 315 } 297 int l = strlen(s); 298 299 moveto(Rows - 2, ((Cols - l) >> 1) - 1); 300 if (set) 301 putstr(s); 302 else 303 while (--l >= 0) 304 (void) putchar(' '); 305 } -
tetris/tetris.c
re87e18f rd6cc453 46 46 */ 47 47 48 //#include <sys/param.h>49 48 #include <sys/time.h> 50 49 #include <sys/types.h> 51 50 52 51 #include <err.h> 53 //#include <signal.h>54 52 #include <stdio.h> 55 53 #include <stdlib.h>
Note:
See TracChangeset
for help on using the changeset viewer.