ReactOS  0.4.15-dev-1177-g6cb3b62
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 
16 static VOID
18 {
19  USHORT Scale;
20 
21  if (Frequency == 0)
22  {
23  WRITE_PORT_UCHAR((PUCHAR)0x61, READ_PORT_UCHAR((PUCHAR)0x61) & ~3);
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);
31  WRITE_PORT_UCHAR((PUCHAR)0x61, READ_PORT_UCHAR((PUCHAR)0x61) | 3);
32 }
33 
35 {
36  Sound(700);
38  Sound(0);
39 }
VOID StallExecutionProcessor(ULONG Microseconds)
Definition: pchw.c:60
#define READ_PORT_UCHAR(p)
Definition: pc98vid.h:21
unsigned char * PUCHAR
Definition: retypes.h:3
static VOID Sound(USHORT Frequency)
Definition: pcbeep.c:17
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:20
#define CLOCK_TICK_RATE
Definition: pcbeep.c:13
VOID PcBeep(VOID)
Definition: pcbeep.c:34
unsigned short USHORT
Definition: pedump.c:61
static LARGE_INTEGER Frequency
Definition: clock.c:41