File: sound.c

package info (click to toggle)
invaders 1.0.0-19
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 324 kB
  • sloc: ansic: 2,231; sh: 56; asm: 28; makefile: 17
file content (18 lines) | stat: -rw-r--r-- 273 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "sound.h"

#include "io.h"

void sound_freq (uint32 freq)
{
  uint16 z = (uint16) ( ((uint32)(1193180)) / freq );

  outb(182,0x43);
  outb(z&255, 0x42);
  outb(z>>8, 0x42);
  outb(inb(0x61) | 3, 0x61);
};

void sound_nosound ()
{
  outb(inb(0x61) & ~3, 0x61);
};