static boolean SetMode(int i) // set video mode { if(i == 1) textmode(C4350); else textmode(C80); hires = 0; return true; }
void MENU :: MAIN_MENU(void) { char ch ; LINES line ; do { textmode(C40) ; clrscr() ; line.BOX(2,1,39,25,219) ; line.BOX(6,5,35,21,218) ; line.BOX(12,7,26,9,218) ; gotoxy(13,8) ; cout <<"VIDEO LIBRARY" ; gotoxy(11,11) ; cout <<"1: ADD NEW CASSETTE" ; gotoxy(11,12) ; cout <<"2: ISSUE CASSETTE" ; gotoxy(11,13) ; cout <<"3: RETURN CASSETTE" ; gotoxy(11,14) ; cout <<"4: DISPLAY" ; gotoxy(11,15) ; cout <<"5: EDIT" ; gotoxy(11,16) ; cout <<"0: QUIT" ; gotoxy(11,19) ; cout <<"Enter your choice:" ; ch = getch() ; textmode(C80) ; clrscr() ; CASSETTE cas ; ISSUE_RETURN ir ; switch(ch) { case 27,'0' : break ; case '1' : cas.ADDITION() ; break ; case '2' : ir.ISSUE() ; break ; case '3' : ir.RETURN() ; break ; case '4' : DISPLAY_MENU() ; break ; case '5' : EDIT_MENU() ; break ; } } while (ch != 27 && ch != '0') ; }
void exitcode() { closegraph(); if ( StartupTextInfo.screenheight > 25 ) { textmode ( C4350 ); } else { textmode ( StartupTextInfo.currmode ); } printf ( "%s\n", ExitMessage ); }
void MENU :: DISPLAY_MENU(void) { char ch ; LINES line ; do { textmode(C40) ; clrscr() ; line.BOX(2,1,39,25,219) ; line.BOX(6,5,35,21,218) ; line.BOX(14,8,25,10,218) ; gotoxy(15,9) ; cout <<"DISPLAY..." ; gotoxy(10,12) ; cout <<"1: LIST OF CASSETTE" ; gotoxy(10,13) ; cout <<"2: LIST OF CUSTOMER" ; gotoxy(10,14) ; cout <<"3: CASSETTE RECORD" ; gotoxy(10,15) ; cout <<"4: CUSTOMER RECORD" ; gotoxy(10,16) ; cout <<"0: EXIT" ; gotoxy(10,18) ; cout <<"Enter your choice:" ; ch = getch() ; textmode(C80) ; clrscr() ; CASSETTE cas ; CUSTOMER cust ; switch(ch) { case 27,'0' : break ; case '1' : cas.LIST() ; break ; case '2' : cust.LIST() ; break ; case '3' : cas.DISPLAY() ; break ; case '4' : cust.DISPLAY() ; break ; } } while (ch != 27 && ch != '0') ; }
/* ---------------------- MAZE MAIN PROGRAM --------------------------------*/ void main() { int x1; int y1; int r,cl; int isX; int choice; progname(); _setcursortype(_NOCURSOR); textmode(64); textbackground(BLUE); for(;;){ choiceID = 1; display_atik_atik_Menu(); choice = getChoice(); switch(choice){ case 1: playMaze(); break; case 2: viewGameDevelopers(); break; case 3: exit(0); break; } } }
main(void) { textmode(C80); clrscr(); printf("\nModo de texto restaurado.\n"); }
int wherex (void) { if (!ConioInitialized) textmode (LASTMODE); return (CurrentAttributes.curx); }
void WS2(void) { int i; char text[500]="\ 000000 00 00 00000 0000 00 00 0000\n\r\ 00 0000 00 00 00 0000 00 00\n\r\ 00 00 00000 00 00 00 00 00 00\n\r\ 00 00 00 00 00 0000 00 00\n\r\ 00 00 00 0000 00 00 0000\n\r\ \n\r\ 000000 000000 0000 000000 000000 00000\n\r\ 00 00 00 00 00 00 00\n\r\ 00 0000 00 00 0000 00000\n\r\ 00 00 00 00 00 00 00\n\r\ 00 00000 0000 00 000000 00 00\ \n\n\n\n\n\n\rDevarghya Debroy"; textmode(C80); textbackground(0); _setcursortype(_NOCURSOR); window(15,5,80,25); for(i=0;i<16;i++) { textcolor(i); clrscr(); cprintf(text); delay(100); } }
/* * This function gets called once, to set up * the terminal channel. */ ttopen() { #ifdef TCCONIO gettextinfo(&tinfo); oldmode = tinfo.currmode; #if TCCONIOMODE textmode(TCCONIOMODE); #endif directvideo = 0; #else register char *tv_stype; char *getenv(), tcbuf[1024], err_str[72]; /* do this the REAL way */ if ((tv_stype = getenv("TERM")) == NULL) { puts("Environment variable TERM not defined!"); exit(1); } if((tgetent(tcbuf, tv_stype)) != 1) { (void) sprintf(err_str, "Unknown terminal type %s!", tv_stype); puts(err_str); exit(1); } #endif /* TCCONIO */ if (ttraw() == FALSE) panic("aborting due to terminal initialize failure"); #ifdef FEPCTRL /* 90.11.26 by K.Takano */ fepmode_init(); #endif }
void delline (void) { if (!ConioInitialized) textmode (LASTMODE); wdeleteln (CurrentWindow); wrefresh (CurrentWindow); }
void clreol (void) { if (!ConioInitialized) textmode (LASTMODE); wclrtoeol (CurrentWindow); wrefresh (CurrentWindow); }
void f(char *menu[]) { int i; textmode(2); clrscr(); textbackground(BLUE); textcolor(WHITE); for (i = 0; i < 6; i++) cprintf("%s\r\n", menu[i]); }
void killsystem(void) { freebloc(&mousebloc); freebloc(&mousefond); if (dacport) killspl(); if (sndblast) sendinit(0xd3); if (speaker) nosound(); killmse(); killkbd(); textmode(3); }
void textbackground (int newcolor) { if (!ConioInitialized) textmode (LASTMODE); if (newcolor < 0 || newcolor > 15) return; newcolor = newcolor << 4; newcolor |= CurrentAttributes.normattr & 0x0f; textattr (newcolor); }
void salir(void) { textmode(C80); textbackground(BLACK); textcolor(LIGHTGRAY); clrscr(); puts("DPA Software. 1997"); puts("Jairo Alejandro Duarte Avenda¤o."); _setcursortype(_NORMALCURSOR); /* mostrar de nuevo el cursor */ nosound(); exit(0); }
int main(void) { textmode(2); /* Call textmode function in conio.h for BW80 */ window(1,1,80,25); /* Call window function in conio.h for full screen */ initialize(); /* Call initialize function above to set values to 0 */ printf("Enter hex. integers for x,y and z with comma between values "); scanf("%X,%X,%X",&x,&y,&z); /* Read data from keyboard */ ptx = &x; /* Address of x is assigned to ptx */ pty = &y; /* ........ y ............. pty */ ptz = &z; /* ........ z ............. ptz */ pseudovar(); /* Call pseudo variable function */ ptradd(); /* Call pointer, address-of and indirection function */ printf("Press any key to continue"); getch(); /* Call function getch in conio.h to get char. from keyboard */ textmode(3); /* Call textmode function in conio.h to revert to colour */ clrscr(); /* Call function clrscr in conio.h to clear screen */ return 0; /* To indicate to DOS that the program terminated normally */ }
/* * This function gets called just * before we go back home to the shell. Put all of * the terminal parameters back. * Under MS-DOS this just calls ttcooked(), but the ttclose() hook is in * because vttidy() in display.c expects it for portability reasons. */ ttclose() { if (ttcooked() == FALSE) panic(""); /* ttcooked() already printf'd */ #ifdef FEPCTRL /* 90.11.26 by K.Takano */ fepmode_term(); #endif #ifdef TCCONIO #ifdef TCCONIOMODE textmode(oldmode); #endif #endif }
char *MENU :: CHOICE_MENU(void) { char ch ; LINES line ; do { textmode(C40) ; clrscr() ; line.BOX(2,1,39,25,219) ; line.BOX(6,5,35,21,218) ; gotoxy(11,9) ; cout <<"SELECT CASSETTE FOR..." ; gotoxy(12,12) ; cout <<"H: HINDI FILMS" ; gotoxy(12,13) ; cout <<"E: ENGLISH FILMS" ; gotoxy(12,14) ; cout <<"N: NON FILMS" ; gotoxy(12,17) ; cout <<"Enter your choice:" ; ch = getch() ; ch = toupper(ch) ; textmode(C80) ; clrscr() ; switch(ch) { case 27,'0' : break ; case 'H' : return "HINDI.DAT" ; case 'E' : return "ENGLISH.DAT" ; case 'N' : return "NONFILM.DAT" ; } } while (ch != 27 && ch != '0') ; return "FAILED" ; }
void MENU :: EDIT_MENU(void) { char ch ; LINES line ; do { textmode(C40) ; clrscr() ; line.BOX(2,1,39,25,219) ; line.BOX(6,5,35,21,218) ; line.BOX(14,8,24,10,218) ; gotoxy(15,9) ; cout <<"EDIT MENU" ; gotoxy(10,12) ; cout <<"1: MODIFY CASSETTE" ; gotoxy(10,14) ; cout <<"2: DELETE CASSETTE" ; gotoxy(10,16) ; cout <<"0: EXIT" ; gotoxy(10,18) ; cout <<"Enter your choice:" ; ch = getch() ; textmode(C80) ; clrscr() ; CASSETTE cas ; switch(ch) { case 27,'0' : break ; case '1' : cas.MODIFICATION() ; break ; case '2' : cas.DELETION() ; break ; } } while (ch != 27 && ch != '0') ; }
//Setup game: resources, variables and data structure void Initialize() { int i; //Initialize random numbers mt_init_genrand(13); //Text mode 80x50 textmode(C4350); //Hide cursor _setcursortype(_NOCURSOR); // Player initial position at screen = (80/2=40,42) // // - 1st line // o 2nd -> c[0] // o // ... // o 42th -> c[40] // ... // o 49th // - 50th line x = 40; x_prev = x; road[40] = 40; meters = 0; speed = 1; lifes = 3; //Setup road for(i=39;i>=0;i--) { road[i] = road[i+1] + Random(); if(road[i]<MIN) road[i] = MIN; else if(road[i]>MAX) road[i] = MAX; } //-- TODO:BOTTOM PART OF the road for(i=49;i>40;i--) { road[i] = road[i+1]+ Random(); if(road[i]<MIN) road[i] = MIN; else if(road[i]>MAX) road[i] = MAX; } //-- begin = true; }
struct spox *spox_init(const int width, const int height, const int interval, const int bright) { struct spox *s; #ifdef CURSES WINDOW *win; #endif #ifdef CONIO struct text_info *r; #endif s = (struct spox*) malloc(sizeof (struct spox)); if (!s) return NULL; #ifdef CURSES win = initscr(); if (!win) return NULL; nodelay(win, 1); getmaxyx(win, s->scr_height, s->scr_width); #endif #ifdef CONIO r = NULL; textmode(BW80); _setcursortype(_NOCURSOR); gotoxy(3, 3); cputs("press <alt> + <enter> for full screen"); sleep(3); gettextinfo(r); s->scr_width = (int) r->screenwidth; s->scr_height = (int) r->screenheight; #endif s->win_width = s->scr_width; s->win_height = s->scr_height; s->offset_x = 0; s->offset_y = 0; if (width < s->scr_width && width > 8) { s->win_width = width; s->offset_x = (s->win_width - width) / 2; } if (height < s->scr_height && height > 8) { s->win_height = height; s->offset_y = (s->win_height - height) / 2; } s->img_width = s->win_width * PPW; s->img_height = s->win_height * PPH; s->bright = bright; s->interval = interval; return s; }
/* TERMINATE SCREEN HANDLING */ void endwin( void ) { if ( nruns < 1 ) {failure( "endwin called before initscr" ); } if ( 0 == debug_pcurses ) { #ifdef __BORLANDC__ textmode( screen_defaults.currmode ); /* RESTORE INITIAL */ textattr( screen_defaults.normattr ); clrscr(); #endif } else {inform( "endwin" ); } }
/*界面初始化,数据初始化*/ void Init(void) { int i,j; char *Msg[]= { "Player1 key:", " UP----w", " DOWN--s", " LEFT--a", " RIGHT-d", " DO----space", "", "Player2 key:", " UP----up", " DOWN--down", " LEFT--left", " RIGHT-right", " DO----ENTER", "", "exitgame:ESC", NULL, }; /*先手方为1号玩家*/ gPlayOrder = CHESS_1; /*棋盘数据清零, 即棋盘上各点开始的时候都没有棋子*/ for(i=0;i<19;i++) for(j=0;j<19;j++) gChessBoard[i][j]=CHESS_NULL; /*光标初始位置*/ gCursor.x=gCursor.y=8; /*画棋盘*/ textmode(C40); /*将屏幕设成文本模式*/ DrawMap(); /*显示操作键说明*/ i=0; textcolor(YELLOW); while(Msg[i]!=NULL) { gotoxy(25,3+i); cputs(Msg[i]); i++; } /*显示先下棋方*/ ShowOrderMsg(gPlayOrder); /*光标移至棋盘的左上角点处*/ gotoxy(gCursor.x+MAPX_O,gCursor.y+MAPY_O); }
void textmode(int mode) { int fs = mode & FULLSCREEN; mode = mode & (~FULLSCREEN); if (mode == C80) { thData.width = 80; thData.height = 25; ResizeConsole(thData.output, 80, 25, 25); } else if (mode == C4350) { thData.width = 80; thData.height = 50; ResizeConsole(thData.output, 80, 50, 50); } else if (mode == LASTMODE) { textmode(thData.lastmode); }; };
/* START SCREEN HANDLING */ void initscr( void ) { nruns++; if ( 0 == debug_pcurses ) { #ifdef __BORLANDC__ normal_text_colour = NORMAL_TEXT_DEFAULT; normal_back_colour = NORMAL_BACK_DEFAULT; bold_text_colour = BOLD_TEXT_DEFAULT; reverse_text_colour = REVERSE_TEXT_DEFAULT; underline_text_colour = UNDERLINE_TEXT_DEFAULT; gettextinfo( &screen_defaults ); textmode( C80 ); textcolor( normal_text_colour ); textbackground( normal_back_colour ); clrscr(); #endif } else {inform( "initscr" ); } }
void scrInit(void) { textmode(C80); if (vmode() == 7) { color = BLACK; bgrd = LIGHTGRAY; ccolor = LIGHTGRAY; cbgrd = BLACK; mcolor = BLACK; mbgrd = LIGHTGRAY; } else { color = BLACK; bgrd = LIGHTGRAY; ccolor = BLUE; cbgrd = LIGHTGRAY; mcolor = LIGHTGRAY; mbgrd = MAGENTA; } textcolor(color); textbackground(bgrd); clrscr(); }
int screen(void) { char scrn[80*25*2]; static char *mess="V.9.t.9. .ù. ."; int count; char *ptr,*eptr; static char *footer="Arrows: Move <Space>: Tag/Untag <F1>: Default <Enter>: Save <Esc>: Abort"; for (count=1; count<strlen(mess); count+=2) mess[count]=BLUE*16+LIGHTBLUE; ptr=mess; eptr=mess+strlen(mess); for (count=0; count<80*25*2; count++) { scrn[count]=*ptr++; if (ptr>=eptr) ptr=mess; } textmode(C80); window(1,1,80,25); textbackground(LIGHTGRAY); textcolor(WHITE); puttext(1,1,80,25,scrn); textbackground(LIGHTGRAY); textcolor(BLACK); gotoxy(1,25); for (count=0; count<40-strlen(footer)/2; count++) cprintf(" "); cprintf(footer); clreol(); return 1; }
void InitText(void) { #ifdef UNIX if (initscr() == NULL) { fprintf(stderr, "initscr() failed\n"); exit(1); } cbreak(); noecho(); #ifdef HAVE_NCURSES start_color(); HasColors = has_colors(); #endif nonl(); ScrnWidth = COLS; ScrnHeight = LINES - 1; /* * if it were 25, it would scroll, damn it. */ clear(); #else /* reset to text mode */ textmode(3); ScrnWidth = 80; ScrnHeight = 24; /* * If it were 25, it would scroll, damn it. */ _setcursortype(_NOCURSOR); /* * Hide the cursor */ clrscr(); #endif gotoxy(1, 1); /* * Home the cursor */ }
static JSBool js_set(JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp) { jsval idval; jsint tiny; int32 i=0; JSBool b; jsrefcount rc; JS_IdToValue(cx, id, &idval); tiny = JSVAL_TO_INT(idval); switch(tiny) { case PROP_WSCROLL: JS_ValueToBoolean(cx, *vp, &_wscroll); break; case PROP_DIRECTVIDEO: JS_ValueToBoolean(cx, *vp, &directvideo); break; case PROP_HOLD_UPDATE: JS_ValueToBoolean(cx, *vp, &hold_update); break; case PROP_PUTTEXT_CAN_MOVE: JS_ValueToBoolean(cx, *vp, &puttext_can_move); break; case PROP_ESCDELAY: if(cio_api.ESCDELAY) { if(!JS_ValueToInt32(cx, *vp, (int32*)cio_api.ESCDELAY)) return JS_FALSE; } break; case PROP_TEXTATTR: if(!JS_ValueToInt32(cx, *vp, &i)) return JS_FALSE; rc=JS_SUSPENDREQUEST(cx); textattr(i); JS_RESUMEREQUEST(cx, rc); break; case PROP_WHEREX: if(!JS_ValueToInt32(cx, *vp, &i)) return JS_FALSE; rc=JS_SUSPENDREQUEST(cx); gotoxy(i, cio_textinfo.cury); JS_RESUMEREQUEST(cx, rc); break; case PROP_WHEREY: if(!JS_ValueToInt32(cx, *vp, &i)) return JS_FALSE; rc=JS_SUSPENDREQUEST(cx); gotoxy(cio_textinfo.curx, i); JS_RESUMEREQUEST(cx, rc); break; case PROP_TEXTMODE: if(!JS_ValueToInt32(cx, *vp, &i)) return JS_FALSE; rc=JS_SUSPENDREQUEST(cx); textmode(i); JS_RESUMEREQUEST(cx, rc); break; case PROP_TEXTBACKGROUND: if(!JS_ValueToInt32(cx, *vp, &i)) return JS_FALSE; rc=JS_SUSPENDREQUEST(cx); textbackground(i); JS_RESUMEREQUEST(cx, rc); break; case PROP_TEXTCOLOR: if(!JS_ValueToInt32(cx, *vp, &i)) return JS_FALSE; rc=JS_SUSPENDREQUEST(cx); textcolor(i); JS_RESUMEREQUEST(cx, rc); break; case PROP_CLIPBOARD: { size_t len; char *bytes; JSVALUE_TO_MSTRING(cx, *vp, bytes, &len); HANDLE_PENDING(cx); if(!bytes) return JS_FALSE; rc=JS_SUSPENDREQUEST(cx); copytext(bytes, len+1); free(bytes); JS_RESUMEREQUEST(cx, rc); } break; case PROP_HIGHVIDEO: JS_ValueToBoolean(cx, *vp, &b); rc=JS_SUSPENDREQUEST(cx); if(b) highvideo(); else lowvideo(); JS_RESUMEREQUEST(cx, rc); break; case PROP_LOWVIDEO: JS_ValueToBoolean(cx, *vp, &b); rc=JS_SUSPENDREQUEST(cx); if(b) lowvideo(); else highvideo(); JS_RESUMEREQUEST(cx, rc); break; } return(JS_TRUE); }
void show_scores() { int i; char key; int sc_file; char buffer[80]; SCORE_REC scores; textmode(3); if (exist("unicorn.sco")) { sc_file = open("unicorn.sco",O_RDONLY); read(sc_file,&scores,sizeof(SCORE_REC)); close(sc_file); } else { strcpy(scores.legend_name[1],"Elan of Marduk"); strcpy(scores.legend_title[1],"Lord"); scores.legend_exp[1] = 836e3; strcpy(scores.legend_name[2],"Gawaine of Radon"); strcpy(scores.legend_title[2],"Paladin"); scores.legend_exp[2] = 3532e3; strcpy(scores.legend_name[3],"Jason Thornblade"); strcpy(scores.legend_title[3],"Ranger Lord"); scores.legend_exp[3] = 3841e3; strcpy(scores.legend_name[4],"Amber of the Vale"); strcpy(scores.legend_title[4],"High Priestess"); scores.legend_exp[4] = 1573e3; strcpy(scores.legend_name[5],"Kesthler of the Wood"); strcpy(scores.legend_title[5],"The Great Druid"); scores.legend_exp[5] = 38963515; strcpy(scores.legend_name[6],"Nina the Wise"); strcpy(scores.legend_title[6],"Wizardess"); scores.legend_exp[6] = 48083e3; strcpy(scores.legend_name[7],"Galter the Feared"); strcpy(scores.legend_title[7],"Grandfather of Assassins"); scores.legend_exp[7] = 277837e4; strcpy(scores.legend_name[8],"Rasper of Solat"); strcpy(scores.legend_title[8],"Hierophant of the Cabal"); scores.legend_exp[8] = 100769e4; strcpy(scores.legend_name[9],"Ramoon of Talgon"); strcpy(scores.legend_title[9],"Cavalier"); scores.legend_exp[9] = 39748460; strcpy(scores.legend_name[10],"Arslon"); strcpy(scores.legend_title[10],"Grand Master of Flowers"); scores.legend_exp[10] = 1494197000; strcpy(scores.legend_name[11],"Marduk"); strcpy(scores.legend_title[11],"King of Halkanar"); scores.legend_exp[11] = 1550292000; for (i=1; i<=11; i++) { scores.high_exp[i] = 0; strcpy(scores.high_name[i]," "); strcpy(scores.high_title[i]," "); } sc_file = open("unicorn.sco",O_WRONLY | O_CREAT | O_TRUNC,0660); write(sc_file,&scores,sizeof(SCORE_REC)); close(sc_file); } textcolor(10); gotoxy(1,1); txt_write("Legends:"); textcolor(2); gotoxy(5,2); txt_write("Fighter :"); gotoxy(5,3); txt_write("Paladin :"); gotoxy(5,4); txt_write("Ranger :"); gotoxy(5,5); txt_write("Cleric :"); gotoxy(5,6); txt_write("Druid :"); gotoxy(5,7); txt_write("Wizard :"); gotoxy(5,8); txt_write("Assassin :"); gotoxy(5,9); txt_write("Hierophant :"); gotoxy(5,10); txt_write("Cavalier :"); gotoxy(5,11); txt_write("Monk :"); gotoxy(5,12); txt_write("Noble :"); textcolor(10); gotoxy(1,14); txt_write("High Scores:"); textcolor(2); gotoxy(5,15); txt_write("Fighter :"); gotoxy(5,16); txt_write("Paladin :"); gotoxy(5,17); txt_write("Ranger :"); gotoxy(5,18); txt_write("Cleric :"); gotoxy(5,19); txt_write("Druid :"); gotoxy(5,20); txt_write("Wizard :"); gotoxy(5,21); txt_write("Assassin :"); gotoxy(5,22); txt_write("Hierophant :"); gotoxy(5,23); txt_write("Cavalier :"); gotoxy(5,24); txt_write("Monk :"); gotoxy(5,25); txt_write("Noble :"); for (i=1; i<=11; i++) { if (score1 == i) textcolor(11); else textcolor(14); gotoxy(18,i+1); sprintf(buffer,"%10.0f",scores.legend_exp[i]); txt_write(buffer); gotoxy(30,i+1); txt_write(scores.legend_name[i]); gotoxy(55,i+1); txt_write(scores.legend_title[i]); } for (i=1; i<=11; i++) { if (score2 == i) textcolor(11); else textcolor(14); gotoxy(18,i+14); sprintf(buffer,"%10.0f",scores.high_exp[i]); txt_write(buffer); gotoxy(30,i+14); txt_write(scores.high_name[i]); gotoxy(55,i+14); txt_write(scores.high_title[i]); } key = 0; while (key != 13) key = inkey(); }