File: sound.c

package info (click to toggle)
invaders 1.0.0-8
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 176 kB
  • ctags: 192
  • sloc: ansic: 678; sh: 70; makefile: 39; asm: 28
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);
};