Exemplo n.º 1
0
vt100init()
{
	register int i;
	register SCREEN	*sp = &screen;

	sp->s_term_mode = 0;
	sp->s_term_mode |= (SRM|DECSCLM|DECAWM|DECARM|DECCSR_ACTV);
	sp->s_current_stat = 0;
	sp->s_csr.csr_x = 1;
	sp->s_csr.csr_y = 1;
	sp->s_csr.csr_p.x = x_ofst;
	sp->s_csr.csr_p.y = y_ofst;
	sp->s_csr.csr_attributes = NORMALM;
	sp->s_region.top_margin = TOP_M;
	sp->s_region.btm_margin = btm_m;
	sp->s_plane = consfb->planemask;
	sp->s_bgcol = 0;
	fcolor = sp->s_plane;
	bcolor = sp->s_bgcol;
	for (i = 0; i < RIT_M_MAX; i++)
		sp->s_tab_pos[i] = 0;
	for (i = 9; i < RIT_M_MAX; i +=8)
		sp->s_tab_pos[i] = 1;

	esc_store_csr(sp);
	inner_buf_tstat = sp->s_term_mode & (DECOM|DECAWM);
	local_csr_buf.csr_number = 1;

	cursor_on(&sp->s_csr.csr_p);
}
Exemplo n.º 2
0
static void read_cb(uv_stream_t *stream, ssize_t cnt, const uv_buf_t *buf)
{
  // TODO(tarruda): avoid using a growable array for this, refactor the
  // algorithm to call `ml_append` directly(skip unecessary copies/resizes)
  int i;
  ProcessData *pdata = (ProcessData *)stream->data;

  if (cnt <= 0) {
    if (cnt != UV_ENOBUFS) {
      uv_read_stop(stream);
      uv_close((uv_handle_t *)stream, NULL);
      pdata->exited++;
    }
    return;
  }

  for (i = 0; i < cnt; ++i) {
    if (pdata->rbuffer[i] == NL) {
      // Insert the line
      append_ga_line(&pdata->ga);
    } else if (pdata->rbuffer[i] == NUL) {
      // Translate NUL to NL
      ga_append(&pdata->ga, NL);
    } else {
      // buffer data into the grow array
      ga_append(&pdata->ga, pdata->rbuffer[i]);
    }
  }

  windgoto(msg_row, msg_col);
  cursor_on();
  out_flush();

  pdata->reading = false;
}
Exemplo n.º 3
0
void sighandler(int sig)
{
    cursor_on();
    fflush(stdout);
    signal(sig, SIG_DFL);
    raise(sig);
}
Exemplo n.º 4
0
/*******************************************************************************
 * Initialize the cursor so that it blinks
 */
gboolean
cursor_init (gpointer data)
{
	cursor.id = 0;
	cursor.blink = TRUE;
	cursor_on (NULL);
	return FALSE;
}
Exemplo n.º 5
0
void message(char *s) {
    cursor_off();
    clear_screen();
    cursor(10, 10);
    printf("%s", s);
    getch();
    cursor_on();
}
void lcd_reset() {
	clear_screen();
	write_string("How Many Cans? 1");
	cursor_left(1);
	cursor_on();
	cursor_blink_on();

	lcd_state = LCD_STATE_DEFAULT;
}
Exemplo n.º 7
0
void main_screen(void) {
    int c, quit = 0;
    char file[70];
    size_t filelen = 0;

    file[0] = 0;

    while(!quit) {
        clear_screen();
        cursor_on();
        cursor(30, 1);
        printf("TMAZE by DWK");
        
        cursor(5, 20);
        printf("%s", file);
            
        switch((c=getch())) {
        case 0:  /* extended key */
            switch((c=getch())) {
            /*case 72:  /* up */
            }
            /*cursor(0, 1);
            printf("%3i", c);*/
            break;
        case 27: quit = 1; break;  /* esc */
        case '\b':
            if(filelen > 0) {
                file[--filelen] = 0;
            }
            break;
        case '\r':
            start_game(file);
            break;
        case 10: /* ctrl-enter */
            start_edit(file);
            break;
        default:
            if(isprint(c) && filelen < 70) {
                file[filelen++] = c;
                file[filelen] = 0;
            }
        }
    }
}
Exemplo n.º 8
0
//print the matrix
void print_matrix(void){
	char p,l;
	
	fill();
	cursor_off();
	print_hits();

	l = 20-(players<<1);
	print_num(level,2,36,l);
	for (p=0;p<players+1;++p){
		l += 2;
		print_num(score[p],6,28,l);
	}
	stop = 1;	
	display_time();
	appear();
	cursor_on();
	delay(230);
}
Exemplo n.º 9
0
Arquivo: devtty.c Projeto: 8l/FUZIX
void tty_putc(uint8_t minor, unsigned char c)
{
    irqflags_t irq;
    if (minor == 3)
        tr1865_rxtx = c;
    else {
        irq = di();
        if (curtty != minor -1) {
            /* Kill the cursor as we are changing the memory buffers. If
               we don't do this the next cursor_off will hit the wrong
               buffer */
            cursor_off();
            vt_save(&ttysave[curtty]);
            curtty = minor - 1;
            vt_load(&ttysave[curtty]);
            /* Fix up the cursor */
            cursor_on(ttysave[curtty].cursory, ttysave[curtty].cursorx);
       }
       vtoutput(&c, 1);
       irqrestore(irq);
   }
}
Exemplo n.º 10
0
Arquivo: devtty.c Projeto: 8l/FUZIX
void vtexchange(void)
{
        /* Swap the pointers over: TRS80 video we switch by copying not
           flipping hardware pointers */
        uint8_t *v = vtbase[0];
        vtbase[0] = vtbase[1];
        vtbase[1] = v;
        /* The cursor x/y for current tty are stale in the save area
           so save them */
        vt_save(&ttysave[curtty]);

        /* Before we flip the memory */
        cursor_off();

        /* Swap the buffers over */
        __asm
                ld hl, #0xf800
                ld de, #_vtbackbuf
                ld bc, #VT_WIDTH*VT_HEIGHT
        exchit:
                push bc
                ld a, (de)	; Could be optimised but its only 2K
                ld c, (hl)	; Probably worth doing eventuallly
                ex de, hl
                ld (hl), c
                ld (de), a
                inc hl
                inc de
                pop bc
                dec bc
                ld a, b
                or c
                jr nz, exchit
                ret
        __endasm;
        /* Cursor back */
        cursor_on(ttysave[inputtty].cursory, ttysave[inputtty].cursorx);
}
Exemplo n.º 11
0
int main(int argc, char **argv)
{
    float bitcoins = 25.0;
    if (argc > 1)
        bitcoins = atof(argv[1]);

    signal(SIGINT, sighandler);
    cursor_off();
    clear();

    float usd_btc_last = 0;
    float usd_btc = 0;
    do {
        float eur_in_usd = get_eur_in_usd();
        float usd_in_nok = get_usd_in_nok();

        if (argc > 2)
            usd_btc = atof(argv[2]);

        if (mtgox) {
            time_t btc_time = mtgox_time();
            struct tm *tm = localtime(&btc_time);

            char timebuf[16];
            sprintf(timebuf, "%02u:%02u:%02u", tm->tm_hour, tm->tm_min, tm->tm_sec);

            usd_btc = mtgox_usd();
            printf("\r%s%s%.04f%s$ #BTC: %.02f TOTAL: { %sUSD: %.02f, EUR: %.02f, NOK: %.02f%s } USD in NOK: %.04f, EXCHANGE SAMPLED: %s",
                COLOR_BOLD,
                usd_btc_last <= usd_btc ? COLOR_GREEN : COLOR_RED,
                usd_btc,
                COLOR_NORMAL,
                bitcoins,
                COLOR_BOLD,
                bitcoins * usd_btc,
                (bitcoins * usd_btc) / eur_in_usd,
                (bitcoins * usd_btc) * usd_in_nok,
                COLOR_NORMAL,
                usd_in_nok,
                timebuf
            );
        } else {
            usd_btc = bitcoin24_usd();
            printf("\r%s%s%.04f%s$ #BTC: %.02f TOTAL: { %sUSD: %.02f, EUR: %.02f, NOK: %.02f%s } USD in NOK: %.04f",
                COLOR_BOLD,
                usd_btc_last <= usd_btc ? COLOR_GREEN : COLOR_RED,
                usd_btc,
                COLOR_NORMAL,
                bitcoins,
                COLOR_BOLD,
                bitcoins * usd_btc,
                (bitcoins * usd_btc) / eur_in_usd,
                (bitcoins * usd_btc) * usd_in_nok,
                COLOR_NORMAL,
                usd_in_nok
            );
        }

        fflush(stdout);
        sleep(10);
        usd_btc_last = usd_btc;
    } while(1);
    cursor_on();

    return 0;
}
Exemplo n.º 12
0
Arquivo: vt.c Projeto: Rappalot/FUZIX
void vtinit(void)
{
	vtmode = 0;
	clear_lines(0, VT_HEIGHT);
	cursor_on(0, 0);
}
Exemplo n.º 13
0
Arquivo: vt.c Projeto: Rappalot/FUZIX
/* VT52 alike functionality */
void vtoutput(unsigned char *p, unsigned int len)
{
	irqflags_t irq;
	uint8_t cq;

	/* We can get re-entry into the vt code from tty echo. This is one of
	   the few places in Fuzix interrupts bite us this way.

	   If we have a clash then we queue the echoed symbol and print it
	   in the thread of execution it interrupted. We only queue one so
	   in theory might lose the odd echo - but the same occurs with real
	   uarts. If anyone actually has printing code slow enough this is a
	   problem then vtpend can turn into a small queue */
	irq = di();
	if (vtbusy) {
		vtpend = *p;
		irqrestore(irq);
		return;
	}
	vtbusy = 1;
	irqrestore(irq);
	cursor_off();
	do {
		while (len--) {
			unsigned char c = *p++;
			if (vtmode == 0) {
				charout(c);
				continue;
			}
			if (vtmode == 1) {
				vtmode = escout(c);
				continue;
			}
			if (vtmode == 2) {
				ncursory = c - ' ';
				vtmode++;
				continue;
			} else if (vtmode == 3) {
				int ncursorx = c - ' ';
				if (ncursory >= 0 && ncursorx <= VT_BOTTOM)
					cursory = ncursory;
				if (ncursorx >= 0 && ncursorx <= VT_RIGHT)
					cursorx = ncursorx;
					vtmode = 0;
			} else {
				vtattr = c;
				vtmode = 0;
				continue;
			}
		}
		/* Copy the pending symbol and clear the buffer */
		cq = vtpend;
		vtpend = 0;
		/* Any loops print the single byte in cq */
		p = &cq;
		len = 1;
		/* Until we don't get interrupted */
	} while(cq);

	cursor_on(cursory, cursorx);
	vtbusy = 0;
}
Exemplo n.º 14
0
void edit_game(FILE *fp) {
    int quit = 0, m = 0;
    int x, y, z, a, c, xp, yp;

    while(!quit && m >= 0) {
        xp = maze[m].xp, yp = maze[m].yp;

        clear_screen();
        cursor(0, 0);

        for(y = 0; y < 22; y ++) {
            cursor(0, y);
                
            for(x = 0; x < 80; x ++) {
                if(x == xp && y == yp) printf("\017");
                else if(x == maze[m].xp && y == maze[m].yp) printf("\001");
                else {
                    switch(maze[m].sq[x][y].type) {
                    case MAZE_BLANK: printf(" "); break;
                    case MAZE_KEY: printf("\013"); break;
                    /*case MAZE_NOKEY: printf("\372"); break;*/
                    case MAZE_DOOR: printf("\376"); break;
                    case MAZE_FINISH: printf("\257"); break;
                    default: printf("\333"); break;
                    }
                }
            }
        }

        cursor_off();

        while(!quit) {
            cursor(0, 0);
    
            if(xp > 0) maze[m].sq[xp-1][yp].ex = 1;
            if(yp > 0) maze[m].sq[xp][yp-1].ex = 1;
            if(xp < 79) maze[m].sq[xp+1][yp].ex = 1;
            if(yp < 21) maze[m].sq[xp][yp+1].ex = 1;
            if(xp > 0 && yp > 0) maze[m].sq[xp-1][yp-1].ex = 1;
            if(xp > 0 && yp < 21) maze[m].sq[xp-1][yp+1].ex = 1;
            if(xp < 79 && yp > 0) maze[m].sq[xp+1][yp-1].ex = 1;
            if(xp < 79 && yp < 21) maze[m].sq[xp+1][yp+1].ex = 1;
    
            z = xp-1;
            if(z < 0) z = 0;
    
            for(y = yp-1 < 0 ? 0 : yp-1; y < yp+2 && y < 22; y ++) {
                cursor(z, y);
                
                for(x = z; x < xp+2 && x < 80; x ++) {
                    if(x == xp && y == yp) printf("\017");
                    else if(x == maze[m].xp && y == maze[m].yp) printf("\001");
                    else {
                        switch(maze[m].sq[x][y].type) {
                        case MAZE_BLANK: printf(" "); break;
                        case MAZE_KEY: printf("\013"); break;
                        /*case MAZE_NOKEY: printf("\372"); break;*/
                        case MAZE_DOOR: printf("\376"); break;
                        case MAZE_FINISH: printf("\257"); break;
                        default: printf("\333"); break;
                        }
                    }
                }
            }

            cursor(0, 22);
            printf("MAZE %c    ", m+'A');

            switch(maze[m].sq[xp][yp].type) {
            case MAZE_KEY:
                printf("Key %c ", maze[m].sq[xp][yp].data < 26 ?
                    maze[m].sq[xp][yp].data + 'A'
                    : maze[m].sq[xp][yp].data + 'a' - 26);
                break;
            case MAZE_DOOR:
                printf("Door %c", maze[m].sq[xp][yp].data < 26 ?
                    maze[m].sq[xp][yp].data + 'A'
                    : maze[m].sq[xp][yp].data + 'a' - 26);
                break;
            case MAZE_FINISH:
                printf("Fin %c ", maze[m].sq[xp][yp].data < 0 ?
                    '>' : maze[m].sq[xp][yp].data + 'A');
                break;
            default: printf("      "); break;
            }
    
            switch((c=getch())) {
            case 0:  /* extended */
                switch((c=getch())) {
                case 72:  /* up */
                    if(yp > 0) yp --;
                    break;
                case 80:  /* down */
                    if(yp < 21) yp ++;
                    break;
                case 75:  /* left */
                    if(xp > 0) xp --;
                    break;
                case 77:  /* right */
                    if(xp < 79) xp ++;
                    break;
                case 15:  /* shift-tab */
                    if(m > 0) {
                        m --;
                        quit = 1;
                    }
                    break;
                }
                break;
            case 27: quit = 2; break;  /* esc */
            case ' ': maze[m].sq[xp][yp].type = MAZE_BLANK; break;
            case '.': maze[m].sq[xp][yp].type = MAZE_WALL; break;
            case '+':
                maze[m].sq[xp][yp].type = MAZE_KEY;
                while(!isalpha(c = getch())) ;
                maze[m].sq[xp][yp].data = (isupper(c) ? c-'A' : c-'a'+26);
                break;
            case '-':
                maze[m].sq[xp][yp].type = MAZE_DOOR;
                while(!isalpha(c = getch())) ;
                maze[m].sq[xp][yp].data = (isupper(c) ? c-'A' : c-'a'+26);
                break;
            case '>':
                maze[m].sq[xp][yp].type = MAZE_FINISH;
                c = getch();
                maze[m].sq[xp][yp].data = (c>='A' && c<='M' ? c-'A' : -1);
                break;
            case 's':
                cursor(maze[m].xp, maze[m].yp);
                printf(" ");
                maze[m].xp = xp, maze[m].yp = yp;
                maze[m].sq[xp][yp].type = MAZE_BLANK;
                break;
            case 'l':
                for(x = 0; x < 80; x ++) {
                    for(y = 0; y < 22; y ++) {
                        if(maze[m].sq[x][y].type == MAZE_DOOR ||
                            maze[m].sq[x][y].type == MAZE_KEY) {

                            cursor(x, y);
                            printf("%c", maze[m].sq[x][y].data < 26 ?
                                maze[m].sq[x][y].data + 'A' :
                                maze[m].sq[x][y].data + 'a'-26);
                        }
                    }
                }

                getch();

                for(x = 0; x < 80; x ++) {
                    for(y = 0; y < 22; y ++) {
                        if(maze[m].sq[x][y].type == MAZE_DOOR) {
                            cursor(x, y);
                            printf("\376");
                        }
                        else if(maze[m].sq[x][y].type == MAZE_KEY) {
                            cursor(x, y);
                            printf("\013");
                        }
                    }
                }
                
                break;
            case '\t':
                if(m < 13) {
                    m ++;
                    quit = 1;
                }
                break;
            }

            /*cursor(0, 24);
            printf("%3i", c);*/
        }
        
        quit --;
    }

    fputs("TMAZE\n", fp);
    for(z = 0; z < 13; z ++) {
        for(x = 0; x < 80; x ++) {
            for(y = 0; y < 22; y ++) {
                if(maze[z].sq[x][y].type != MAZE_BLANK) x = 81;
            }
        }

        if(x > 80) {
            putc(z+'A', fp);
            putc('\n', fp);
            
            for(y = 0; y < 22; y ++) {
                for(a = 79; a >= 0; a --) {
                    if(maze[z].sq[a][y].type != MAZE_BLANK ||
                        (maze[z].xp == a && maze[z].yp == y)) break;
                }

                for(x = 0; x <= a; x ++) {
                    if(x == maze[z].xp && y == maze[z].yp) putc(':', fp);
                    else switch(maze[z].sq[x][y].type) {
                    case MAZE_BLANK: putc(' ', fp); break;
                    case MAZE_WALL: putc('.', fp); break;
                    case MAZE_KEY: case MAZE_NOKEY:
                        putc('+', fp);
                        putc(maze[z].sq[x][y].data < 26 ?
                            maze[z].sq[x][y].data + 'A' :
                            maze[z].sq[x][y].data + 'a'-26, fp);
                        break;
                    case MAZE_DOOR:
                        putc('-', fp);
                        putc(maze[z].sq[x][y].data < 26 ? maze[z].sq[x][y].data + 'A' :
                            maze[z].sq[x][y].data + 'a'-26, fp);
                        break;
                    case MAZE_FINISH:
                        putc('>', fp);
                        if(maze[z].sq[x][y].data == -1) putc('>', fp);
                        else putc(maze[z].sq[x][y].data + 'A', fp);
                        break;
                    }
                }

                putc('\n', fp);
            }
        }
    }

    cursor_on();
}
Exemplo n.º 15
0
void play_game(void) {
    int quit = 0, key[52], m = 0;
    int x, y, z, c, xp, yp;

    while(!quit && m >= 0) {
        xp = maze[m].xp, yp = maze[m].yp;

        for(x = 0; x < 52; x ++) key[x] = 0;
        
        for(x = 0; x < 80; x ++) {
            for(y = 0; y < 22; y ++) {
                maze[m].sq[x][y].ex = 0;
            }
        }

        clear_screen();
        cursor(0, 0);

        for(x = 0; x < 80; x ++) {
            printf("\260\260\260\260\260\260\260\260\260\260"
                "\260\260\260\260\260\260\260\260\260\260\260\260");
        }

        cursor_off();

        while(!quit) {
            cursor(0, 0);
    
            if(xp > 0) maze[m].sq[xp-1][yp].ex = 1;
            if(yp > 0) maze[m].sq[xp][yp-1].ex = 1;
            if(xp < 79) maze[m].sq[xp+1][yp].ex = 1;
            if(yp < 21) maze[m].sq[xp][yp+1].ex = 1;
            
            if(xp > 0 && yp > 0) maze[m].sq[xp-1][yp-1].ex = 1;
            if(xp > 0 && yp < 21) maze[m].sq[xp-1][yp+1].ex = 1;
            if(xp < 79 && yp > 0) maze[m].sq[xp+1][yp-1].ex = 1;
            if(xp < 79 && yp < 21) maze[m].sq[xp+1][yp+1].ex = 1;
    
            z = xp-1;
            if(z < 0) z = 0;
    
            for(y = yp-1 < 0 ? 0 : yp-1; y < yp+2 && y < 22; y ++) {
                cursor(z, y);
                
                for(x = z; x < xp+2 && x < 80; x ++) {
                    if(x == xp && y == yp) printf("\017");
                    else if(maze[m].sq[x][y].ex) {
                        switch(maze[m].sq[x][y].type) {
                        case MAZE_BLANK: printf(" "); break;
                        case MAZE_KEY: printf("\013"); break;
                        case MAZE_NOKEY: printf("\372"); break;
                        case MAZE_DOOR: printf("\376"); break;
                        case MAZE_FINISH: printf("\257"); break;
                        default: printf("\333"); break;
                        }
                    }
                }
            }
    
            switch((c=getch())) {
            case 0:  /* extended */
                switch((c=getch())) {
                case 72:  /* up */
                    if(yp > 0) {
                        switch(maze[m].sq[xp][yp-1].type) {
                        case MAZE_FINISH:
                            m = maze[m].sq[xp][yp-1].data;
                            quit = 1;
                            break;
                        case MAZE_NOKEY:
                        case MAZE_BLANK: yp --; break;
                        case MAZE_WALL: break;
                        case MAZE_KEY:
                            yp --;
                            key[maze[m].sq[xp][yp].data] = 1;
                            maze[m].sq[xp][yp].type = MAZE_NOKEY;
                            break;
                        case MAZE_DOOR:
                            if(key[maze[m].sq[xp][yp-1].data]) yp --;
                            break;
                        }
                    }
                    break;
                case 80:  /* down */
                    if(yp < 21) {
                        switch(maze[m].sq[xp][yp+1].type) {
                        case MAZE_FINISH:
                            m = maze[m].sq[xp][yp+1].data;
                            quit = 1;
                            break;
                        case MAZE_NOKEY:
                        case MAZE_BLANK: yp ++; break;
                        case MAZE_WALL: break;
                        case MAZE_KEY:
                            yp ++;
                            key[maze[m].sq[xp][yp].data] = 1;
                            maze[m].sq[xp][yp].type = MAZE_NOKEY;
                            break;
                        case MAZE_DOOR:
                            if(key[maze[m].sq[xp][yp+1].data]) yp ++;
                            break;
                        }
                    }
                    break;
                case 75:  /* left */
                    if(xp > 0) {
                        switch(maze[m].sq[xp-1][yp].type) {
                        case MAZE_FINISH:
                            m = maze[m].sq[xp-1][yp].data;
                            quit = 1;
                            break;
                        case MAZE_NOKEY:
                        case MAZE_BLANK: xp --; break;
                        case MAZE_WALL: break;
                        case MAZE_KEY:
                            xp --;
                            key[maze[m].sq[xp][yp].data] = 1;
                            maze[m].sq[xp][yp].type = MAZE_NOKEY;
                            break;
                        case MAZE_DOOR:
                            if(key[maze[m].sq[xp-1][yp].data]) xp --;
                            break;
                        }
                    }
                    break;
                case 77:  /* right */
                    if(xp < 79) {
                        switch(maze[m].sq[xp+1][yp].type) {
                        case MAZE_FINISH:
                            m = maze[m].sq[xp+1][yp].data;
                            quit = 1;
                            break;
                        case MAZE_NOKEY:
                        case MAZE_BLANK: xp ++; break;
                        case MAZE_WALL: break;
                        case MAZE_KEY:
                            xp ++;
                            key[maze[m].sq[xp][yp].data] = 1;
                            maze[m].sq[xp][yp].type = MAZE_NOKEY;
                            break;
                        case MAZE_DOOR:
                            if(key[maze[m].sq[xp+1][yp].data]) xp ++;
                            break;
                        }
                    }
                    break;
                }
                break;
            case 27: quit = 2; break;  /* esc */
            }
    
            /*cursor(0, 24);
            printf("%3i", c);*/
        }
        
        quit --;
    }

    cursor_on();
}
Exemplo n.º 16
0
int read_in_mazes(FILE *fp) {
    char c;
    int x, y, z, m;

    for(z = 0; z < 13; z ++) {
        maze[z].exists = 0;
        maze[z].xp = maze[z].yp = 0;
        for(x = 0; x < 80; x ++) {
            for(y = 0; y < 22; y ++) {
                maze[z].sq[x][y].type = MAZE_BLANK;
            }
        }
    }

    clear_screen();
    cursor_on();
    cursor(0, 0);
    printf("\nLoading file . . .");
    
    while(!feof(fp)) {
        c = getc(fp);
        if(feof(fp)) break;

        if((x=getc(fp)) != '\n') {
            printf("Expected '\\n', found '%c'", x);
            getch();
            return 1;
        }

        m = (isupper(c)?c-'A':c-'a'+26);

        maze[m].exists = 1;

        for(x = y = 0; y < 22; ) {
            c = getc(fp);
            if(feof(fp)) break;

            if(x >= 80 && c != '\n') continue;

            if(c == '.') maze[m].sq[x][y].type = MAZE_WALL;
            else if(c == ' ') ;
            else if(c == '+') {
                maze[m].sq[x][y].type = MAZE_KEY;
                c = getc(fp);
                maze[m].sq[x][y].data = (isupper(c)?c-'A':c-'a'+26);
            }
            else if(c == '-') {
                maze[m].sq[x][y].type = MAZE_DOOR;
                c = getc(fp);
                maze[m].sq[x][y].data = (isupper(c)?c-'A':c-'a'+26);
            }
            else if(c == '>') {
                maze[m].sq[x][y].type = MAZE_FINISH;
                c = getc(fp);
                maze[m].sq[x][y].data = (c=='>'?-1:(isupper(c)?c-'A':c-'a'+26));
            }
            else if(isspace(c)) ;
            else if(c == ':') {
                maze[m].xp = x, maze[m].yp = y;
            }
            
            if(c == '\n') y ++, x = 0;
            else x ++;
        }
    }

    return 0;
}