ReactOS 0.4.15-dev-7928-g68a8619
pcbeep.c
Go to the documentation of this file.
1/*
2 * PROJECT: FreeLoader
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Hardware-specific beep routine
5 * COPYRIGHT: Copyright 1998-2003 Brian Palmer (brianp@reactos.org)
6 */
7
8#include <freeldr.h>
9
10#if defined(SARCH_XBOX)
11#define CLOCK_TICK_RATE 1125000
12#else
13#define CLOCK_TICK_RATE 1193182
14#endif
15
16static VOID
18{
19 USHORT Scale;
20
21 if (Frequency == 0)
22 {
24 return;
25 }
26
27 Scale = CLOCK_TICK_RATE / Frequency;
28 WRITE_PORT_UCHAR((PUCHAR)0x43, 0xB6);
29 WRITE_PORT_UCHAR((PUCHAR)0x42, Scale & 0xFF);
30 WRITE_PORT_UCHAR((PUCHAR)0x42, Scale >> 8);
32}
33
35{
36 Sound(700);
38 Sound(0);
39}
#define READ_PORT_UCHAR(p)
Definition: pc98vid.h:22
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21
#define CLOCK_TICK_RATE
Definition: pcbeep.c:13
static VOID Sound(USHORT Frequency)
Definition: pcbeep.c:17
VOID PcBeep(VOID)
Definition: pcbeep.c:34
VOID StallExecutionProcessor(ULONG Microseconds)
Definition: pchw.c:60
unsigned short USHORT
Definition: pedump.c:61
static LARGE_INTEGER Frequency
Definition: clock.c:41
unsigned char * PUCHAR
Definition: typedefs.h:53