source: trunk/AIR-BOOT/SOURCE/SPECIAL/SOUND.ASM@ 23

Last change on this file since 23 was 23, checked in by kiewitz, 23 years ago

AiR-BOOT v1.01.
Signature-date: 2003-03-02.
Updated a whole bunch of sources.
Note: This comment was created after rebuilding the repo. [2011-07]

File size: 3.3 KB
Line 
1
2; Disclaimer:
3;=============
4; The sourcecode is released via www.netlabs.org CVS *ONLY*.
5; You MUST NOT upload it to other servers nor republish it in any way.
6; The sourcecode is still COPYRIGHTED and NOT RELEASED UNDER GPL.
7; It's (c) Copyright 1998-2003 by Martin Kiewitz.
8; You may recompile the source and do *PRIVATE* modifications, but please keep
9; in mind that modifying this code needs at least *some* assembly skill. If
10; you mess up your system, because you needed to hack your way through, don't
11; blame me. Releasing a customized version of AiR-BOOT, selling it in any form
12; or reusing parts of this source is *PROHIBITED*. Ask me, if you have some
13; idea about new functionality *before* developing the code, otherwise I will
14; definitely reject it. Also please accept, that I have some basic design
15; rules on AiR-BOOT and I will maintain them at all costs, so this won't get
16; another GRUB.
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.