aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2026-03-09 02:03:42 -0400
committerB. Watson <urchlay@slackware.uk>2026-03-09 02:03:42 -0400
commit9dba8f52b61b1d56d9cf8e63bd1dde2b31b25a5d (patch)
tree91b01698979cfeae507eb820cd5e7f3027043b41
parent7cada3864c10b14dec18a0efc768f3455004166b (diff)
downloadfujinet-chat-9dba8f52b61b1d56d9cf8e63bd1dde2b31b25a5d.tar.gz
audible and visual bell on hilite.
-rw-r--r--TODO1
-rw-r--r--src/bell.s45
-rw-r--r--src/irc.c5
-rw-r--r--src/irc.h1
4 files changed, 51 insertions, 1 deletions
diff --git a/TODO b/TODO
index 8366164..755f5f0 100644
--- a/TODO
+++ b/TODO
@@ -1,7 +1,6 @@
FujiChat features:
- handle incoming PONG (with latency)
-- visual and audible bell
- nick tab completion (FujiChat's was very lame)
- option to not show ping/pong
- hide motd
diff --git a/src/bell.s b/src/bell.s
new file mode 100644
index 0000000..6a27503
--- /dev/null
+++ b/src/bell.s
@@ -0,0 +1,45 @@
+
+ .include "atari.inc"
+
+ .import _bell_type
+ .export _bell
+
+DISTVOL = $a8
+PITCH = $40
+JIFFIES = $03
+
+_bell:
+ lda #<bell_callback
+ sta CDTMA2
+ lda #>bell_callback
+ sta CDTMA2+1
+ lda _bell_type
+ beq done
+ lda #JIFFIES
+ sta CDTMV2
+ lda _bell_type
+ and #1
+ beq check_flash
+ lda #DISTVOL
+ sta AUDC1
+ lda #PITCH
+ sta AUDF1
+check_flash:
+ lda _bell_type
+ and #2
+ beq done
+ lda #$08
+ sta COLOR4
+ lda #JIFFIES
+ sta CDTMV2
+done:
+ rts
+
+bell_callback:
+ lda #0
+ sta AUDC1
+ sta AUDF1
+ sta COLOR4
+ lda #JIFFIES
+ sta CDTMV2
+ rts
diff --git a/src/irc.c b/src/irc.c
index e616f15..0572700 100644
--- a/src/irc.c
+++ b/src/irc.c
@@ -15,11 +15,14 @@
#define MAX_MSG 512
+extern void __fastcall__ bell(void); /* see src/bell.s */
+
char *msg_src, *msg_cmd, *msg_dest, *msg_text;
char *msg_args[MAX_MSG_ARGS];
int msg_argcount;
char irc_away = 0;
+char bell_type = 3;
static char msgbuf[MAX_MSG] = { 0 };
static char *msg; /* with source removed */
@@ -59,6 +62,7 @@ static void hilite_bold(void) {
}
static void do_chan_nick(void) {
+ if(hilite) bell();
hilite_bold();
scr_print_active("<");
hilite_bold();
@@ -78,6 +82,7 @@ static void do_priv_nick(void) {
scr_print_active("*");
scr_print_active(msg_src);
scr_print_active("* ");
+ bell();
}
/* FIXME: this isn't very fast */
diff --git a/src/irc.h b/src/irc.h
index edecb24..18a9d86 100644
--- a/src/irc.h
+++ b/src/irc.h
@@ -45,6 +45,7 @@ extern char *msg_src, *msg_cmd, *msg_dest, *msg_text;
extern char *msg_args[MAX_MSG_ARGS];
extern int msg_argcount;
extern char irc_away;
+extern char bell_type;
/* call this once, right after TCP connection is established. */
void irc_register(void);