Subversion Repositories HelenOS-historic

Compare Revisions

Ignore whitespace Rev 1528 → Rev 1526

/uspace/trunk/console/console.c
284,7 → 284,6
return;
case CONSOLE_PUTCHAR:
write_char(consnum, IPC_GET_ARG1(call));
gcons_notify_char(consnum);
break;
case CONSOLE_CLEAR:
/* Send message to fb */
297,13 → 296,13
break;
case CONSOLE_GOTO:
screenbuffer_goto(&(connections[consnum].screenbuffer), IPC_GET_ARG2(call), IPC_GET_ARG1(call));
screenbuffer_goto(&(connections[consnum].screenbuffer), IPC_GET_ARG1(call), IPC_GET_ARG2(call));
break;
 
case CONSOLE_GETSIZE:
arg1 = fb_info.rows;
arg2 = fb_info.cols;
arg1 = fb_info.cols;
arg2 = fb_info.rows;
break;
case CONSOLE_FLUSH:
sync_send_2(fb_info.phone, FB_FLUSH, 0, 0, NULL, NULL);
/uspace/trunk/console/gcons.h
31,6 → 31,5
 
void gcons_init(int phone);
void gcons_change_console(int consnum);
void gcons_notify_char(int consnum);
 
#endif
/uspace/trunk/console/gcons.c
48,7 → 48,6
 
static int console_vp;
static int cstatus_vp[CONSOLE_COUNT];
static int console_has_input[CONSOLE_COUNT];
static int cstat_row, cstat_col; /* Size of cstatus buttons */
 
static int fbphone;
56,8 → 55,7
enum butstate {
CONS_ACTIVE = 0,
CONS_IDLE,
CONS_HAS_INPUT,
CONS_DISCONNECTED
CONS_HAS_INPUT
};
 
static struct {
66,8 → 64,7
} stat_colors[] = {
{0xd0d0d0, 0x808080},
{0xd0d0d0, 0x0},
{0xd0d0d0, 0xa04040},
{0xd0d0d0, 0x0}
{0xd0d0d0, 0xa04040}
};
 
static int active_console = 0;
111,11 → 108,9
vp_switch(cstatus_vp[consnum]);
set_style(stat_colors[state].fgcolor, stat_colors[state].bgcolor);
clear();
if (state != CONS_DISCONNECTED) {
snprintf(data, 5, "%d", consnum+1);
for (i=0;data[i];i++)
putch(data[i], 0, i);
}
snprintf(data, 5, "%d", consnum+1);
for (i=0;data[i];i++)
putch(data[i], 0, i);
}
 
void gcons_change_console(int consnum)
126,8 → 121,6
draw_stat(active_console, CONS_IDLE);
active_console = consnum;
draw_stat(consnum, CONS_ACTIVE);
console_has_input[consnum] = 0;
 
vp_switch(console_vp);
}
 
136,12 → 129,6
if (!use_gcons)
return;
 
if (consnum == active_console || console_has_input[consnum])
return;
 
console_has_input[consnum] = 1;
draw_stat(consnum, CONS_HAS_INPUT);
vp_switch(console_vp);
}
 
157,7 → 144,7
clear();
 
for (i=0;i < CONSOLE_COUNT; i++)
draw_stat(i, i == active_console ? CONS_ACTIVE : CONS_DISCONNECTED);
draw_stat(i, i == active_console ? CONS_ACTIVE : CONS_IDLE);
vp_switch(console_vp);
}
 
/uspace/trunk/tetris/screen.c
97,7 → 97,6
scr_clear(void)
{
 
resume_normal();
send_call(con_phone, CONSOLE_CLEAR, 0);
curscore = -1;
memset((char *)curscreen, 0, sizeof(curscreen));
187,6 → 186,12
}
 
 
#if vax && !__GNUC__
typedef int regcell; /* pcc is bad at `register char', etc */
#else
typedef cell regcell;
#endif
 
/*
* Update the screen.
*/
194,7 → 199,7
scr_update(void)
{
cell *bp, *sp;
cell so, cur_so = 0;
regcell so, cur_so = 0;
int i, ccol, j;
static const struct shape *lastshape;
 
294,12 → 299,17
scr_msg(char *s, int set)
{
int l = strlen(s);
moveto(Rows - 2, ((Cols - l) >> 1) - 1);
if (set)
putstr(s);
else
while (--l >= 0)
(void) putchar(' ');
if (set || CEstr == NULL) {
int l = strlen(s);
 
moveto(Rows - 2, ((Cols - l) >> 1) - 1);
if (set)
putstr(s);
else
while (--l >= 0)
(void) putchar(' ');
} else {
moveto(Rows - 2, 0);
putpad(CEstr);
}
}
/uspace/trunk/tetris/tetris.c
45,10 → 45,12
* Tetris (or however it is spelled).
*/
 
//#include <sys/param.h>
#include <sys/time.h>
#include <sys/types.h>
 
#include <err.h>
//#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/uspace/trunk/libc/include/io/stream.h
26,9 → 26,6
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
 
#ifndef __libc_STREAM_H_
#define __libc_STREAM_H_
 
#include <libarch/types.h>
 
#define EMFILE -17
41,5 → 38,3
 
fd_t open(const char *fname, int flags);
int get_fd_phone(int fd);
 
#endif
/uspace/trunk/libc/include/err.h
29,6 → 29,7
#ifndef _libc__ERR_H_
#define _libc__ERR_H_
 
#define errx(status,fmt,...) { printf((fmt),##__VA_ARGS__);_exit(status);}
extern void errx (int __status, __const char *__format, ...)
__attribute__ ((__noreturn__, __format__ (__printf__, 2, 3)));
 
#endif
/uspace/trunk/Makefile
38,8 → 38,7
init \
ns \
fb \
console \
tetris
console
 
ifeq ($(ARCH), amd64)
DIRS += pci \