diff options
author | B. Watson <yalhcru@gmail.com> | 2019-03-23 18:52:25 -0400 |
---|---|---|
committer | B. Watson <yalhcru@gmail.com> | 2019-03-23 18:52:25 -0400 |
commit | 77eee1553e22578ff37c942e3e2df97b0bf9f72d (patch) | |
tree | f14e31b41ae150e58c16cd7c5a57739e95a0b715 | |
parent | 6b0a4ed26a9197b18f983317c5deed53d2206f43 (diff) | |
download | fujichat-77eee1553e22578ff37c942e3e2df97b0bf9f72d.tar.gz |
dont print so many blank lines, initial unicode test stuff
-rw-r--r-- | src/features.h | 2 | ||||
-rw-r--r-- | src/fujichat.atr | bin | 92176 -> 92176 bytes | |||
-rw-r--r-- | src/fujichat.c | 26 | ||||
-rw-r--r-- | src/fujitest.atr | bin | 92176 -> 92176 bytes |
4 files changed, 19 insertions, 9 deletions
diff --git a/src/features.h b/src/features.h index 822d8e7..b4263e8 100644 --- a/src/features.h +++ b/src/features.h @@ -99,7 +99,7 @@ #define FEAT_COLOR_COMMAND /* messing around, not functional yet */ -// #define FEAT_UNICODE_TEST +#define FEAT_UNICODE_TEST /* End of features */ diff --git a/src/fujichat.atr b/src/fujichat.atr Binary files differindex 8a2a997..3746138 100644 --- a/src/fujichat.atr +++ b/src/fujichat.atr diff --git a/src/fujichat.c b/src/fujichat.c index 5d47387..9bf4e07 100644 --- a/src/fujichat.c +++ b/src/fujichat.c @@ -203,6 +203,7 @@ void main(void) { exit(0); } else if(strcasecmp(cmdbuf, "r") == 0) { (void)atari_exec("D:FUJICHAT.COM"); + exit(0); } else if(strcasecmp(cmdbuf, "s") == 0) { i = atari_exec(SETUP_FILENAME); printf("Error %d!\n", i); @@ -547,6 +548,7 @@ static void handle_keystroke(void) { #ifdef FEAT_UNICODE_TEST +#if 0 if(c == 0x10) { /* ATASCII clubs symbol */ input_buf[input_buf_len++] = 0xe2; /* UTF-8 marker */ input_buf[input_buf_len++] = 0x99; @@ -555,6 +557,7 @@ static void handle_keystroke(void) { return; } #endif +#endif /* Store keystroke in input buffer */ input_buf[input_buf_len++] = c; @@ -620,7 +623,6 @@ void send_server_cmd_2arg(char *cmd, char *arg) { /* The telnet_* functions are uIP application callbacks. */ void telnet_connected(struct telnet_state *s) { - /* puts("Connected to host, press START to disconnect"); */ puts("> Connected to server"); tstate = s; s->text = NULL; @@ -629,29 +631,26 @@ void telnet_connected(struct telnet_state *s) { connected = 1; } -/* 20081125 bkw: why don't these pragmas do anything? */ -#pragma warn (off) -void telnet_closed(struct telnet_state *s) { +void telnet_closed(struct telnet_state *) { puts("> Connection closed"); uip_close(); done = 1; } -void telnet_sent(struct telnet_state *s) { +void telnet_sent(struct telnet_state *) { } -void telnet_aborted(struct telnet_state *s) { +void telnet_aborted(struct telnet_state *) { puts("> Connection aborted"); uip_abort(); done = 1; } -void telnet_timedout(struct telnet_state *s) { +void telnet_timedout(struct telnet_state *) { puts("> Connection timed out"); uip_abort(); done = 1; } -#pragma warn (on) void do_pong() { char *p = serv_msg_buf; @@ -830,7 +829,11 @@ void do_msg() { add_to_nick_list(nick); #endif } else { + /* get rid of ending EOL */ + output_buf[output_buf_len - 1] = '\0'; printf("%s %s", nick, msg); + /* only print an EOL if we're not in column 0 already */ + if(PEEK(0x55)) fuji_putchar(A_EOL); #ifdef FEAT_NICK_COMPLETE nick++; bang[0] = '\0'; @@ -988,6 +991,13 @@ void telnet_newdata(struct telnet_state *s, char *data, u16_t len) { } else if(c == 0x60) { // backtick c = 0xa7; // inverse quote #endif +#ifdef FEAT_UNICODE_TEST + } else if(c > 0x7f) { + if(c == 0xc2 && t[0] == 0xb0) { /* utf8 degrees */ + c = 20; /* ATASCII ball */ + t++; + } +#endif } output_buf[output_buf_len++] = c; diff --git a/src/fujitest.atr b/src/fujitest.atr Binary files differindex 4b178d3..ebe4651 100644 --- a/src/fujitest.atr +++ b/src/fujitest.atr |