diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-03-30 03:25:35 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-03-30 03:25:35 -0400 |
| commit | ddfe09f3b8336630dd0f87e446306bc1e012f20b (patch) | |
| tree | ecffd52c482e987099b7a03383ec62763009e4fb /src/main.c | |
| parent | 28c0a056ce806a357371d7102fb25d72e358ff09 (diff) | |
| download | fujinet-chat-ddfe09f3b8336630dd0f87e446306bc1e012f20b.tar.gz | |
Trim down nio API (no parameter passing), now at 4852 free.
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -28,17 +28,19 @@ unsigned int txbuflen; // TX buffer length char hz; /* 50 for PAL, 60 for NSTC */ char reconnect_timeout = 1; -/* TODO: user modes (default +iw), fg/bg color... */ - extern void ih(); // defined in intr.s +void txbuf_append_chr(char c) { + tx_buf[txbuflen++] = c; +} + void txbuf_init(void) { txbuflen = tx_buf[0] = 0; } void txbuf_append_str(const char *str) { while(*str) { - tx_buf[txbuflen++] = *str++; + txbuf_append_chr(*str++); } } @@ -74,11 +76,13 @@ void txbuf_send(void) { /* always terminate with *ASCII* CRLF. DO NOT USE '\n' or even '\x0a', cc65 turns it into $9b! */ - tx_buf[txbuflen++] = 0x0d; - tx_buf[txbuflen++] = 0x0a; + // tx_buf[txbuflen++] = 0x0d; + // tx_buf[txbuflen++] = 0x0a; + txbuf_append_chr(0x0d); + txbuf_append_chr(0x0a); ind_net_tx(); - nwrite(tx_buf, txbuflen); + nwrite_txbuf(); ind_net_idle(); txbuf_init(); } |
