Subversion Repositories Shiroi

Rev

Rev 9 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9 Rev 10
Line 1... Line 1...
1
/* $Id: sound.c 9 2024-08-28 16:35:27Z nishi $ */
1
/* $Id: sound.c 10 2024-08-29 01:39:27Z nishi $ */
2
 
2
 
3
#include "sound.h"
3
#include "sound.h"
4
 
4
 
5
#include "io.h"
5
#include "io.h"
6
 
6
 
7
short psg_addr;
7
short psg_addr;
8
short psg_data;
8
short psg_data;
9
 
9
 
10
void beep(void){
10
void beep(void){
11
	_beep(3L * 1024);
11
	_beep(1L * 1024);
12
}
12
}
13
 
13
 
14
void _beep(unsigned long howlong){
14
void _beep(unsigned long howlong){
15
	if(psg_addr == -1) return;
15
	if(psg_addr == -1) return;
16
	unsigned long i;
16
	unsigned long i;
17
 
17
 
18
	outp(psg_addr, 8);
18
	outp(psg_addr, 8);
19
	outp(psg_data, 0x0f);
19
	outp(psg_data, 0x0f);
20
 
20
 
21
	outp(psg_addr, 0);
21
	outp(psg_addr, 0);
22
	outp(psg_data, 0xd6);
22
	outp(psg_data, 0xb0);
23
 
23
 
24
	outp(psg_addr, 1);
24
	outp(psg_addr, 1);
25
	outp(psg_data, 0x0);
25
	outp(psg_data, 0x0);
26
 
26
 
27
	outp(psg_addr, 7);
27
	outp(psg_addr, 7);