diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-04-13 02:08:22 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-04-13 02:08:33 -0400 |
| commit | f844caecef4174f1fd52c1e810a836489935a01d (patch) | |
| tree | 537298c8d6b3beb2fc47f3347a66ed03d067c80e | |
| parent | 172db1bcaa88b51326e9b788022985c97276dbfb (diff) | |
| download | fujinet-chat-f844caecef4174f1fd52c1e810a836489935a01d.tar.gz | |
Save a tiny bit of space. 7701 bytes free.
| -rw-r--r-- | src/cmd.c | 6 | ||||
| -rw-r--r-- | src/irc.c | 4 | ||||
| -rw-r--r-- | src/irc.h | 3 | ||||
| -rw-r--r-- | src/main.c | 2 | ||||
| -rw-r--r-- | src/txbuf.s | 6 |
5 files changed, 14 insertions, 7 deletions
@@ -199,7 +199,7 @@ static void do_optional_chan(void) { } txbuf_set_str(cmd_def->cmd); - txbuf_append_chr(' '); + txbuf_append_spc(); txbuf_append_str(target); if(arg2) txbuf_append_str2(" :", arg2); @@ -218,7 +218,7 @@ static void send_ctcp(void) { txbuf_append_str(arg2); if(arg3) txbuf_append_str2(" ", arg3); - txbuf_append_chr('\x01'); + txbuf_append_01(); txbuf_send(); } @@ -409,7 +409,7 @@ static char cmd_local(void) { static void cmd_remote(void) { txbuf_set_str(command); if(arg1) { - txbuf_append_chr(' '); + txbuf_append_spc(); txbuf_append_str(arg1); } txbuf_send(); @@ -201,9 +201,9 @@ static void do_ctcp(char is_notice) { txbuf_set_str3("NOTICE ", msg_src, " :\x01"); txbuf_append_str(ctcp_type); - txbuf_append_chr(' '); + txbuf_append_spc(); txbuf_append_str(resp); - txbuf_append_chr('\x01'); + txbuf_append_01(); txbuf_send(); } } @@ -13,6 +13,9 @@ extern char reconnect_timeout; /* clears the transmit buffer. */ void txbuf_init(void); +/* these are in txbuf.s: */ +void txbuf_append_01(void); +void txbuf_append_spc(void); void txbuf_append_chr(char c); /* appends a string to the transmit buffer, updates txbuflen. */ @@ -42,8 +42,6 @@ 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; txbuf_append_chr(0x0d); txbuf_append_chr(0x0a); diff --git a/src/txbuf.s b/src/txbuf.s index bc1d1c2..dba52c3 100644 --- a/src/txbuf.s +++ b/src/txbuf.s @@ -8,8 +8,14 @@ .import _txbuflen .export _txbuf_append_chr, _txbuf_append_str + .export _txbuf_append_spc, _txbuf_append_01 .importzp sreg ; avoid ptr1 & friends, callers may use +_txbuf_append_01: + lda #$01 + .byte $2c ; BIT abs, skip next instruction +_txbuf_append_spc: + lda #' ' _txbuf_append_chr: tax lda #<tx_buf |
