Commit 1681226b authored by deuce's avatar deuce
Browse files

Add support for Atari 8-bit emulation.

I'm not aware of any other old charsets that were popular AND still have
fans that run BBSs (ie: I don't know of any telnet TRS-80 BBSs that use
TRS-80 chars).
parent 01ec1f4b
......@@ -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);
}
......
......@@ -39,6 +39,7 @@ enum {
,SCREEN_MODE_C64
,SCREEN_MODE_C128_40
,SCREEN_MODE_C128_80
,SCREEN_MODE_ATARI
,SCREEN_MODE_TERMINATOR
};
......
......@@ -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;
......
......@@ -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':
......
......@@ -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;
......
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