Commit bef6bef9 authored by deuce's avatar deuce
Browse files

Add support for 132 column modes.

parent 237ff721
......@@ -176,7 +176,7 @@ int sortorder[sizeof(sort_order)/sizeof(struct sort_order_info)];
char *sort_orders[]={"BBS Name","Address","Connection Type","Port","Date Added","Date Last Connected"};
char *screen_modes[]={"Current", "80x25", "80x28", "80x43", "80x50", "80x60", "C64", "C128 (40col)", "C128 (80col)", "Atari", NULL};
char *screen_modes[]={"Current", "80x25", "80x28", "80x43", "80x50", "80x60", "132x21", "132x25", "132x28", "132x30", "132x34", "132x43", "132x50", "132x60", "C64", "C128 (40col)", "C128 (80col)", "Atari", NULL};
char *log_levels[]={"Emergency", "Alert", "Critical", "Error", "Warning", "Notice", "Info", "Debug", NULL};
char *log_level_desc[]={"None", "Alerts", "Critical Errors", "Errors", "Warnings", "Notices", "Normal", "All (Debug)", NULL};
......@@ -1599,55 +1599,11 @@ struct bbslist *show_bbslist(int mode)
uifc.helpbuf= "`Screen Setup`\n\n"
"Select the new screen size.\n";
i=ti.currmode;
switch(i) {
case C80:
i=SCREEN_MODE_80X25;
break;
case C80X28:
i=SCREEN_MODE_80X28;
break;
case C80X43:
i=SCREEN_MODE_80X43;
break;
case C80X50:
i=SCREEN_MODE_80X50;
break;
case C80X60:
i=SCREEN_MODE_80X60;
break;
}
i=ciolib_to_screen(ti.currmode);
i=uifc.list(WIN_SAV,0,0,0,&i,NULL,"Screen Setup",screen_modes);
if(i>=0) {
uifcbail();
switch(i) {
case SCREEN_MODE_80X25:
textmode(C80);
break;
case SCREEN_MODE_80X28:
textmode(C80X28);
break;
case SCREEN_MODE_80X43:
textmode(C80X43);
break;
case SCREEN_MODE_80X50:
textmode(C80X50);
break;
case SCREEN_MODE_80X60:
textmode(C80X60);
break;
case SCREEN_MODE_C64:
textmode(C64_40X25);
break;
case SCREEN_MODE_C128_40:
textmode(C128_40X25);
break;
case SCREEN_MODE_C128_80:
textmode(C128_80X25);
break;
case SCREEN_MODE_ATARI:
textmode(ATARI_40X24);
break;
}
textmode(screen_to_ciolib(i));
init_uifc(TRUE, TRUE);
}
uifc.list((listcount<MAX_OPTS?WIN_XTR:0)
......
......@@ -38,6 +38,14 @@ enum {
,SCREEN_MODE_80X43
,SCREEN_MODE_80X50
,SCREEN_MODE_80X60
,SCREEN_MODE_132X21
,SCREEN_MODE_132X25
,SCREEN_MODE_132X28
,SCREEN_MODE_132X30
,SCREEN_MODE_132X34
,SCREEN_MODE_132X43
,SCREEN_MODE_132X50
,SCREEN_MODE_132X60
,SCREEN_MODE_C64
,SCREEN_MODE_C128_40
,SCREEN_MODE_C128_80
......
......@@ -390,35 +390,7 @@ int pty_connect(struct bbslist *bbs)
memcpy(ts.c_cc,ttydefchars,sizeof(ts.c_cc));
/* Horrible way to determine the screen size */
switch(bbs->screen_mode) {
case SCREEN_MODE_80X25:
textmode(C80);
break;
case SCREEN_MODE_80X28:
textmode(C80X28);
break;
case SCREEN_MODE_80X43:
textmode(C80X43);
break;
case SCREEN_MODE_80X50:
textmode(C80X50);
break;
case SCREEN_MODE_80X60:
textmode(C80X60);
break;
case SCREEN_MODE_C64:
textmode(C64_40X25);
break;
case SCREEN_MODE_C128_40:
textmode(C128_40X25);
break;
case SCREEN_MODE_C128_80:
textmode(C128_80X25);
break;
case SCREEN_MODE_ATARI:
textmode(ATARI_40X24);
break;
}
textmode(screen_to_ciolib(bbs->screen_mode));
gettextinfo(&ti);
if(ti.screenwidth < 80)
......
......@@ -1118,37 +1118,8 @@ int main(int argc, char **argv)
if(initciolib(ciolib_mode))
return(1);
seticon(syncterm_icon.pixel_data,syncterm_icon.width);
if(!dont_set_mode) {
switch(settings.startup_mode) {
case SCREEN_MODE_80X25:
textmode(C80);
break;
case SCREEN_MODE_80X28:
textmode(C80X28);
break;
case SCREEN_MODE_80X43:
textmode(C80X43);
break;
case SCREEN_MODE_80X50:
textmode(C80X50);
break;
case SCREEN_MODE_80X60:
textmode(C80X60);
break;
case SCREEN_MODE_C64:
textmode(C64_40X25);
break;
case SCREEN_MODE_C128_40:
textmode(C128_40X25);
break;
case SCREEN_MODE_C128_80:
textmode(C128_80X25);
break;
case SCREEN_MODE_ATARI:
textmode(ATARI_40X24);
break;
}
}
if(!dont_set_mode)
textmode(screen_to_ciolib(settings.startup_mode));
gettextinfo(&txtinfo);
if((txtinfo.screenwidth<40) || txtinfo.screenheight<24) {
......@@ -1230,35 +1201,7 @@ int main(int argc, char **argv)
}
}
uifcbail();
switch(bbs->screen_mode) {
case SCREEN_MODE_80X25:
textmode(C80);
break;
case SCREEN_MODE_80X28:
textmode(C80X28);
break;
case SCREEN_MODE_80X43:
textmode(C80X43);
break;
case SCREEN_MODE_80X50:
textmode(C80X50);
break;
case SCREEN_MODE_80X60:
textmode(C80X60);
break;
case SCREEN_MODE_C64:
textmode(C64_40X25);
break;
case SCREEN_MODE_C128_40:
textmode(C128_40X25);
break;
case SCREEN_MODE_C128_80:
textmode(C128_80X25);
break;
case SCREEN_MODE_ATARI:
textmode(ATARI_40X24);
break;
}
textmode(screen_to_ciolib(bbs->screen_mode));
load_font_files();
setfont(find_font_id(bbs->font),TRUE);
sprintf(str,"SyncTERM - %s",bbs->name);
......@@ -1366,3 +1309,93 @@ int main(int argc, char **argv)
getch();
return(0);
}
int screen_to_ciolib(int screen)
{
struct text_info ti;
switch(screen) {
case SCREEN_MODE_CURRENT:
gettextinfo(&ti);
return(ti.currmode);
case SCREEN_MODE_80X25:
return(C80);
case SCREEN_MODE_80X28:
return(C80X28);
case SCREEN_MODE_80X43:
return(C80X43);
case SCREEN_MODE_80X50:
return(C80X50);
case SCREEN_MODE_80X60:
return(C80X60);
case SCREEN_MODE_132X21:
return(VESA_132X21);
case SCREEN_MODE_132X25:
return(VESA_132X25);
case SCREEN_MODE_132X28:
return(VESA_132X28);
case SCREEN_MODE_132X30:
return(VESA_132X30);
case SCREEN_MODE_132X34:
return(VESA_132X34);
case SCREEN_MODE_132X43:
return(VESA_132X43);
case SCREEN_MODE_132X50:
return(VESA_132X50);
case SCREEN_MODE_132X60:
return(VESA_132X60);
case SCREEN_MODE_C64:
return(C64_40X25);
case SCREEN_MODE_C128_40:
return(C128_40X25);
case SCREEN_MODE_C128_80:
return(C128_80X25);
case SCREEN_MODE_ATARI:
return(ATARI_40X24);
}
gettextinfo(&ti);
return(ti.currmode);
}
int ciolib_to_screen(int ciolib)
{
struct text_info ti;
switch(ciolib) {
case C80 :
return(SCREEN_MODE_80X25);
case C80X28 :
return(SCREEN_MODE_80X28);
case C80X43 :
return(SCREEN_MODE_80X43);
case C80X50 :
return(SCREEN_MODE_80X50);
case C80X60 :
return(SCREEN_MODE_80X60);
case VESA_132X21 :
return(SCREEN_MODE_132X21);
case VESA_132X25 :
return(SCREEN_MODE_132X25);
case VESA_132X28 :
return(SCREEN_MODE_132X28);
case VESA_132X30 :
return(SCREEN_MODE_132X30);
case VESA_132X34 :
return(SCREEN_MODE_132X34);
case VESA_132X43 :
return(SCREEN_MODE_132X43);
case VESA_132X50 :
return(SCREEN_MODE_132X50);
case VESA_132X60 :
return(SCREEN_MODE_132X60);
case C64_40X25 :
return(SCREEN_MODE_C64);
case C128_40X25 :
return(SCREEN_MODE_C128_40);
case C128_80X25 :
return(SCREEN_MODE_C128_80);
case ATARI_40X24 :
return(SCREEN_MODE_ATARI);
}
return(SCREEN_MODE_CURRENT);
}
......@@ -45,5 +45,7 @@ extern char *output_types[];
extern int output_map[];
extern char *output_descrs[];
extern char *output_enum[];
int ciolib_to_screen(int screen);
int screen_to_ciolib(int ciolib);
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment