source: trunk/BOOTCODE/SPECIAL/SOUND.ASM@ 29

Last change on this file since 29 was 29, checked in by Ben Rietbroek, 15 years ago

AiR-BOOT v1.06 -- Complete sourceforge mirror. (r56) [2010-02-19]
Signature-date: 2006-03-13.
Also contains binairy releases from v1.01 to v1.06, cd-rom images, etc.
If you want the whole pre v1.07 shebang, checkout this revision's trunk.
The v1.06 reference version is in 'tags/v1.06r'.
Note that this reference version uses 'NL' for 'Dutch'.

File size: 3.1 KB
Line 
1; AiR-BOOT (c) Copyright 1998-2008 M. Kiewitz
2;
3; This file is part of AiR-BOOT
4;
5; AiR-BOOT is free software: you can redistribute it and/or modify it under
6; the terms of the GNU General Public License as published by the Free
7; Software Foundation, either version 3 of the License, or (at your option)
8; any later version.
9;
10; AiR-BOOT is distributed in the hope that it will be useful, but WITHOUT ANY
11; WARRANTY: without even the implied warranty of MERCHANTABILITY or FITNESS
12; FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13; details.
14;
15; You should have received a copy of the GNU General Public License along with
16; AiR-BOOT. If not, see <http://www.gnu.org/licenses/>.
17;
18;---------------------------------------------------------------------------
19; AiR-BOOT / SOUND SUPPORT
20;---------------------------------------------------------------------------
21
22; Here is some sound code. Requested by Hex1753.
23
24SOUND_PreBootMenu Proc Near Uses ax
25 test CFG_MakeSound, 1
26 jz SOUND_PreBootMenu_SkipSound
27 test StartSoundPlayed, 1
28 jnz SOUND_PreBootMenu_SkipSound
29 mov ax, 1500
30 call SOUND_MakeSound
31 mov ax, 100
32 call SOUND_WaitToSilence
33 mov ax, 2000
34 call SOUND_MakeSound
35 mov ax, 200
36 call SOUND_WaitToSilence
37 mov StartSoundPlayed, 1
38 SOUND_PreBootMenu_SkipSound:
39 ret
40SOUND_PreBootMenu EndP
41
42SOUND_ExecuteBoot Proc Near Uses ax
43 test CFG_MakeSound, 1
44 jz SOUND_ExecuteBoot_SkipSound
45 mov ax, 2000
46 call SOUND_MakeSound
47 mov ax, 10
48 call SOUND_WaitToSilence
49 mov ax, 1000
50 call SOUND_MakeSound
51 mov ax, 20
52 call SOUND_WaitToSilence
53 mov ax, 1500
54 call SOUND_MakeSound
55 mov ax, 10
56 call SOUND_WaitToSilence
57 mov ax, 1900
58 call SOUND_MakeSound
59 mov ax, 20
60 call SOUND_WaitToSilence
61 mov ax, 1000
62 call SOUND_MakeSound
63 mov ax, 10
64 call SOUND_WaitToSilence
65 mov ax, 1500
66 call SOUND_MakeSound
67 mov ax, 30
68 call SOUND_WaitToSilence
69 SOUND_ExecuteBoot_SkipSound:
70 ret
71SOUND_ExecuteBoot EndP
72
73SOUND_MakeSound Proc Near Uses bx dx
74 mov bx, ax
75 mov ax, 34DDh
76 mov dx, 0012h
77 cmp dx, bx ; Too small frequency
78 jnb SOUND_MakeSound_J1
79 div bx
80 mov bx, ax
81 in al, 61h
82 test al, 03h ; Already playing (?)
83 jnz SOUND_MakeSound_J2
84 or al, 03h
85 out 61h, al
86 mov al, -4Ah
87 out 43h, al
88 SOUND_MakeSound_J2:
89 mov al, bl
90 out 42h, al
91 mov al, bh
92 out 42h, al
93 SOUND_MakeSound_J1:
94 ret
95SOUND_MakeSound EndP
96
97SOUND_WaitToSilence Proc Near Uses bx cx dx
98 ; AX = MilliSeconds
99 mov bx, 03E8h
100 mul bx
101 mov cx, dx
102 mov dx, ax
103 mov ax, 8600h
104 int 15h
105 in al, 61h
106 and al, 0FCh
107 out 61h, al
108 ret
109SOUND_WaitToSilence EndP
Note: See TracBrowser for help on using the repository browser.