diff --git a/src/syncterm/bbslist.c b/src/syncterm/bbslist.c index 7134182a8a0608c15dd4a74cd22e7910c75fb778..541b636348fb0b4751a709ad6ea2b4a009c8e00e 100644 --- a/src/syncterm/bbslist.c +++ b/src/syncterm/bbslist.c @@ -19,7 +19,7 @@ #include "window.h" #include "term.h" -char *screen_modes[]={"Current", "80x25", "80x28", "80x43", "80x50", "80x60", "C64", "C128 (40col)", "C128 (80col)", NULL}; +char *screen_modes[]={"Current", "80x25", "80x28", "80x43", "80x50", "80x60", "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}; @@ -400,6 +400,8 @@ int edit_list(struct bbslist *item,char *listpath,int isdefault) if(item->screen_mode == SCREEN_MODE_C64) { strcpy(item->font,font_names[33]); iniSetString(&inifile,itemname,"Font",item->font,&ini_style); + item->nostatus = 1; + iniSetBool(&inifile,itemname,"NoStatus",item->nostatus,&ini_style); } if(item->screen_mode == SCREEN_MODE_C128_40 || item->screen_mode == SCREEN_MODE_C128_80) { @@ -408,6 +410,12 @@ int edit_list(struct bbslist *item,char *listpath,int isdefault) item->nostatus = 1; iniSetBool(&inifile,itemname,"NoStatus",item->nostatus,&ini_style); } + if(item->screen_mode == SCREEN_MODE_ATARI) { + strcpy(item->font,font_names[36]); + iniSetString(&inifile,itemname,"Font",item->font,&ini_style); + item->nostatus = 1; + iniSetBool(&inifile,itemname,"NoStatus",item->nostatus,&ini_style); + } changed=1; break; case 9: @@ -1013,6 +1021,9 @@ struct bbslist *show_bbslist(int mode) case SCREEN_MODE_C128_80: textmode(C128_80X25); break; + case SCREEN_MODE_ATARI: + textmode(ATARI_40X24); + break; } init_uifc(TRUE, TRUE); } diff --git a/src/syncterm/bbslist.h b/src/syncterm/bbslist.h index aa00d58674cd32f0d6f6b0d662f853d84596cce0..8dec48cc377e35fde73e4e82bb4f1439b86ca09e 100644 --- a/src/syncterm/bbslist.h +++ b/src/syncterm/bbslist.h @@ -39,6 +39,7 @@ enum { ,SCREEN_MODE_C64 ,SCREEN_MODE_C128_40 ,SCREEN_MODE_C128_80 + ,SCREEN_MODE_ATARI ,SCREEN_MODE_TERMINATOR }; diff --git a/src/syncterm/syncterm.c b/src/syncterm/syncterm.c index 0bd56ed0cbb18ed2bbcc42bf6cc54bafb0e45d96..1936234740440ef09b16e0de773ec2916f3e26f5 100644 --- a/src/syncterm/syncterm.c +++ b/src/syncterm/syncterm.c @@ -986,6 +986,9 @@ int main(int argc, char **argv) case SCREEN_MODE_C128_80: textmode(C128_80X25); break; + case SCREEN_MODE_ATARI: + textmode(ATARI_40X24); + break; } } @@ -1057,8 +1060,6 @@ int main(int argc, char **argv) } } uifcbail(); - load_font_files(); - setfont(find_font_id(bbs->font),TRUE); switch(bbs->screen_mode) { case SCREEN_MODE_80X25: textmode(C80); @@ -1084,7 +1085,12 @@ int main(int argc, char **argv) case SCREEN_MODE_C128_80: textmode(C128_80X25); break; + case SCREEN_MODE_ATARI: + textmode(ATARI_40X24); + break; } + load_font_files(); + setfont(find_font_id(bbs->font),TRUE); sprintf(str,"SyncTERM - %s",bbs->name); settitle(str); term.nostatus=bbs->nostatus; diff --git a/src/syncterm/term.c b/src/syncterm/term.c index 161051cf0344a16a5090eb88546cb956d4f6d221..9f388b6b64641b7dc9ef312cab3ccbf064090d9d 100644 --- a/src/syncterm/term.c +++ b/src/syncterm/term.c @@ -1059,6 +1059,7 @@ BOOL doterm(struct bbslist *bbs) int updated=FALSE; BOOL sleep; BOOL rd; + int emulation=CTERM_EMULATION_ANSI_BBS; speed = bbs->bpsrate; log_level = bbs->xfer_loglevel; @@ -1071,14 +1072,18 @@ BOOL doterm(struct bbslist *bbs) ciomouse_addevent(CIOLIB_BUTTON_2_CLICK); if(scrollback_buf != NULL) 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; + emulation = CTERM_EMULATION_PETASCII; + break; + case SCREEN_MODE_ATARI: + emulation = CTERM_EMULATION_ATASCII; + break; } + cterm_init(term.height,term.width,term.x-1,term.y-1,settings.backlines,scrollback_buf, emulation); + cterm.music_enable=bbs->music; ch[1]=0; zrqbuf[0]=0; #ifdef GUTS_BUILTIN @@ -1377,7 +1382,69 @@ BOOL doterm(struct bbslist *bbs) key = 0; break; } - if(key && cterm.emulation == CTERM_EMULATION_PETASCII) { + if(key && cterm.emulation == CTERM_EMULATION_ATASCII) { + /* Translate keys to ATASCII */ + switch(key) { + case '\r': + case '\n': + ch[0]=155; + conn_send(ch,1,0); + break; + case CIO_KEY_DOWN: + ch[0]=29; + conn_send(ch,1,0); + break; + case CIO_KEY_DC: /* "Delete" key */ + case '\b': /* Backspace */ + ch[0]=126; + conn_send(ch,1,0); + break; + case CIO_KEY_RIGHT: + ch[0]=31; + conn_send(ch,1,0); + break; + case CIO_KEY_UP: + ch[0]=28; + conn_send(ch,1,0); + break; + case CIO_KEY_LEFT: + ch[0]=30; + conn_send(ch,1,0); + break; + case '\t': + ch[0]=127; + conn_send(ch,1,0); + break; + default: + if(key<256) { + /* ASCII Translation */ + if(key<32) { + break; + } + else if(key<65) { + ch[0]=key; + conn_send(ch,1,0); + } + else if(key<91) { + ch[0]=tolower(key); + conn_send(ch,1,0); + } + else if(key<96) { + ch[0]=key; + conn_send(ch,1,0); + } + else if(key==96) { + break; + } + else if(key<123) { + ch[0]=toupper(key); + conn_send(ch,1,0); + } + } + break; + } + } + else if(key && cterm.emulation == CTERM_EMULATION_PETASCII) { /* Translate keys to PETSCII */ switch(key) { case '\r': diff --git a/src/syncterm/uifcinit.c b/src/syncterm/uifcinit.c index 02388c90a0dac8fa1fe7ec07afa6e4a6d4e732f0..199fa2068e9aa25d278e4458217cc7772e9446d9 100644 --- a/src/syncterm/uifcinit.c +++ b/src/syncterm/uifcinit.c @@ -27,7 +27,7 @@ int init_uifc(BOOL scrn, BOOL bottom) { if(!uifc_initialized) { /* Get old font... */ uifc_old_font=getfont(); - if(uifc_old_font >= 32 && uifc_old_font <= 34) + if(uifc_old_font >= 32 && uifc_old_font <= 36) setfont(0, FALSE); /* Set scrn_len to 0 to prevent textmode() call */ uifc.scrn_len=0;