From 9dba8f52b61b1d56d9cf8e63bd1dde2b31b25a5d Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 9 Mar 2026 02:03:42 -0400 Subject: audible and visual bell on hilite. --- src/bell.s | 45 +++++++++++++++++++++++++++++++++++++++++++++ src/irc.c | 5 +++++ src/irc.h | 1 + 3 files changed, 51 insertions(+) create mode 100644 src/bell.s (limited to 'src') 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+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); -- cgit v1.2.3