Restore support for bell pitch/duration.

Because we only support a single argument to tf_param, use 16 bits for
the pitch and 16 bits for the duration. While there, make the argument
unsigned. There isn't a single param call that needs a signed integer.

Submitted by:	danfe (modified)
This commit is contained in:
Ed Schouten 2009-05-31 19:35:41 +00:00
parent 912ee8a8a3
commit ec034df134
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=193184
5 changed files with 20 additions and 3 deletions

View File

@ -491,7 +491,7 @@ scteken_copy(void *arg, const teken_rect_t *r, const teken_pos_t *p)
}
static void
scteken_param(void *arg, int cmd, int value)
scteken_param(void *arg, int cmd, unsigned int value)
{
scr_stat *scp = arg;
@ -508,6 +508,10 @@ scteken_param(void *arg, int cmd, int value)
case TP_SWITCHVT:
sc_switch_scr(scp->sc, value);
break;
case TP_SETBELLPD:
scp->bell_pitch = TP_SETBELLPD_PITCH(value);
scp->bell_duration = TP_SETBELLPD_DURATION(value);
break;
}
}

View File

@ -102,6 +102,7 @@ VPA Vertical Position Absolute ^[ [ d n
# Cons25 compatibility sequences
C25ADBG Cons25 set adapter background ^[ [ = G r
C25ADFG Cons25 set adapter foreground ^[ [ = F r
C25BLPD Cons25 set bell pitch duration ^[ [ = B r r
C25CURS Cons25 set cursor type ^[ [ = S r
C25VTSW Cons25 switch virtual terminal ^[ [ z r

View File

@ -167,7 +167,7 @@ teken_funcs_copy(teken_t *t, const teken_rect_t *r, const teken_pos_t *p)
}
static inline void
teken_funcs_param(teken_t *t, int cmd, int value)
teken_funcs_param(teken_t *t, int cmd, unsigned int value)
{
t->t_funcs->tf_param(t->t_softc, cmd, value);

View File

@ -98,13 +98,16 @@ typedef void tf_putchar_t(void *, const teken_pos_t *, teken_char_t,
typedef void tf_fill_t(void *, const teken_rect_t *, teken_char_t,
const teken_attr_t *);
typedef void tf_copy_t(void *, const teken_rect_t *, const teken_pos_t *);
typedef void tf_param_t(void *, int, int);
typedef void tf_param_t(void *, int, unsigned int);
#define TP_SHOWCURSOR 0
#define TP_CURSORKEYS 1
#define TP_KEYPADAPP 2
#define TP_AUTOREPEAT 3
#define TP_SWITCHVT 4
#define TP_132COLS 5
#define TP_SETBELLPD 6
#define TP_SETBELLPD_PITCH(pd) ((pd) >> 16)
#define TP_SETBELLPD_DURATION(pd) ((pd) & 0xffff)
typedef void tf_respond_t(void *, const void *, size_t);
typedef struct {

View File

@ -66,6 +66,15 @@ teken_subr_cons25_switch_virtual_terminal(teken_t *t, unsigned int vt)
teken_funcs_param(t, TP_SWITCHVT, vt);
}
static void
teken_subr_cons25_set_bell_pitch_duration(teken_t *t, unsigned int pitch,
unsigned int duration)
{
teken_funcs_param(t, TP_SETBELLPD, (pitch << 16) |
(duration & 0xffff));
}
#if 0
static void
teken_subr_vt52_decid(teken_t *t)