Commit 5cad8d35 authored by deuce's avatar deuce
Browse files

SyncTERM now handles *incoming* PETSCII correctly...

Next up, output translation.
parent d3e8091c
......@@ -19,7 +19,7 @@
#include "window.h"
#include "term.h"
char *screen_modes[]={"Current", "80x25", "80x28", "80x43", "80x50", "80x60", NULL};
char *screen_modes[]={"Current", "80x25", "80x28", "80x43", "80x50", "80x60", "C64", "C128 (40col)", "C128 (80col)", 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};
......@@ -397,6 +397,15 @@ int edit_list(struct bbslist *item,char *listpath,int isdefault)
"Select the screen size for this connection\n";
uifc.list(WIN_SAV,0,0,0,&(item->screen_mode),NULL,"Screen Mode",screen_modes);
iniSetEnum(&inifile,itemname,"ScreenMode",screen_modes,item->screen_mode,&ini_style);
if(item->screen_mode == SCREEN_MODE_C64) {
strcpy(item->font,font_names[33]);
iniSetString(&inifile,itemname,"Font",item->font,&ini_style);
}
if(item->screen_mode == SCREEN_MODE_C128_40
|| item->screen_mode == SCREEN_MODE_C128_80) {
strcpy(item->font,font_names[35]);
iniSetString(&inifile,itemname,"Font",item->font,&ini_style);
}
changed=1;
break;
case 9:
......@@ -993,6 +1002,15 @@ struct bbslist *show_bbslist(int mode)
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;
}
init_uifc(TRUE, TRUE);
}
......
......@@ -36,6 +36,9 @@ enum {
,SCREEN_MODE_80X43
,SCREEN_MODE_80X50
,SCREEN_MODE_80X60
,SCREEN_MODE_C64
,SCREEN_MODE_C128_40
,SCREEN_MODE_C128_80
,SCREEN_MODE_TERMINATOR
};
......
......@@ -977,6 +977,15 @@ int main(int argc, char **argv)
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;
}
}
......@@ -1066,6 +1075,15 @@ int main(int argc, char **argv)
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;
}
sprintf(str,"SyncTERM - %s",bbs->name);
settitle(str);
......
......@@ -1073,6 +1073,12 @@ BOOL doterm(struct bbslist *bbs)
memset(scrollback_buf,0,term.width*2*settings.backlines);
cterm_init(term.height,term.width,term.x-1,term.y-1,settings.backlines,scrollback_buf);
cterm.music_enable=bbs->music;
switch(bbs->screen_mode) {
case SCREEN_MODE_C64:
case SCREEN_MODE_C128_40:
case SCREEN_MODE_C128_80:
cterm.emulation = CTERM_EMULATION_PETASCII;
}
ch[1]=0;
zrqbuf[0]=0;
#ifdef GUTS_BUILTIN
......
......@@ -11,6 +11,7 @@
uifcapi_t uifc; /* User Interface (UIFC) Library API */
static int uifc_initialized=0;
static int uifc_old_font=0;
#define UIFC_INIT (1<<0)
#define WITH_SCRN (1<<1)
......@@ -24,6 +25,10 @@ int init_uifc(BOOL scrn, BOOL bottom) {
gettextinfo(&txtinfo);
if(!uifc_initialized) {
/* Get old font... */
uifc_old_font=getfont();
if(uifc_old_font >= 32 && uifc_old_font <= 34)
setfont(0, FALSE);
/* Set scrn_len to 0 to prevent textmode() call */
uifc.scrn_len=0;
if((i=uifcini32(&uifc))!=0) {
......@@ -66,6 +71,8 @@ void uifcbail(void)
{
if(uifc_initialized) {
uifc.bail();
if(uifc_old_font != getfont())
setfont(uifc_old_font, FALSE);
}
uifc_initialized=0;
}
......
......@@ -13,7 +13,10 @@ int drawwin(void)
strcpy(str,"SyncTERM ");
gettextinfo(&txtinfo);
term.width=80;
if(txtinfo.screenwidth < 80)
term.width=40;
else
term.width=80;
term.height=txtinfo.screenheight;
if(!term.nostatus)
term.height--;
......
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