1 /* Project 16 Source Code~
\r
2 * Copyright (C) 2012-2015 sparky4 & pngwen & andrius4669
\r
4 * This file is part of Project 16.
\r
6 * Project 16 is free software; you can redistribute it and/or modify
\r
7 * it under the terms of the GNU General Public License as published by
\r
8 * the Free Software Foundation; either version 3 of the License, or
\r
9 * (at your option) any later version.
\r
11 * Project 16 is distributed in the hope that it will be useful,
\r
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 * GNU General Public License for more details.
\r
16 * You should have received a copy of the GNU General Public License
\r
17 * along with this program. If not, see <http://www.gnu.org/licenses/>, or
\r
18 * write to the Free Software Foundation, Inc., 51 Franklin Street,
\r
19 * Fifth Floor, Boston, MA 02110-1301 USA.
\r
25 #include "src/lib/16_in.h"
26 //#include "src/lib/16_snd.h"
27 #include "src/lib/doslib/adlib.h"
28 #include "src/lib/doslib/8254.h" /* 8254 timer */
30 static unsigned int musical_scale[18] = {
52 void main(int argc, char near *argv[])
\r
55 // static FMInstrument testInst =
\r
57 //0x00, 0x01, /* modulator frequency multiple... 0x20 */
\r
58 //0x00, 0x00, /* modulator frequency level... 0x40 */
\r
59 //0xF0, 0xF0, /* modulator attack/decay... 0x60 */
\r
60 //0x73, 0x73, /* modulator sustain/release... 0x80 */
\r
61 //0x03, 0x00, /* output waveform distortion 0xE0 */
\r
62 //0x36, /* feedback algorithm and strength 0xC0 */
\r
67 //FMSetVoice(0, &testInst);
70 printf("Cannot init library\n");
74 if (adlib_fm_voices > 9)
76 // vga_bios_set_80x50_text();
78 memset(adlib_fm,0,sizeof(adlib_fm));
79 memset(&adlib_reg_bd,0,sizeof(adlib_reg_bd));
80 for (i=0;i < adlib_fm_voices;i++) {
81 struct adlib_fm_operator *f;
83 f->ch_a = f->ch_b = f->ch_c = f->ch_d = 1;
85 f->ch_a = f->ch_b = f->ch_c = f->ch_d = 1;
88 for (i=0;i < /*adlib_fm_voices*/1;i++) {
89 struct adlib_fm_operator *f;
93 f->total_level = 63 - 16;
98 f->f_number = musical_scale[i%18];
102 f = &adlib_fm[i].car;
104 f->total_level = 63 - 16;
107 f->sustain_level = 7;
116 printf("press Z! to noise\npress ESC to quit");
123 adlib_fm[0].mod.key_on = 1;
\r
124 //FMKeyOn(0, 0x106, 4);
128 adlib_fm[0].mod.key_on = 0;
131 adlib_update_groupA0(0,&adlib_fm[0]);
\r