annotate final_isi/fisitime.c @ 0:acb5694e93d9

Initial import.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 18 May 2010 04:25:44 +0300
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 #include "fisimusa.h"
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3 #ifdef MSDOS
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
4 #include <dos.h>
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 #endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 #define NUMCH 3
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 char cord=0,cpat=0,crow=0,drmt=0xff,drms=0;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 char auditype;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13 int plrbeep[2];
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
14 int musatempo=5;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
15
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
16 #ifdef MSDOS
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
17
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
18 /***************** h00KiNG nEW iNTERRuPT hANDLeRs **************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
20 #define setadlib adlib
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
22 unsigned int taimeri;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
23
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
24 void interrupt int_8();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
25 void interrupt (*old_int8)();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
26
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27 kellovauhti(char spiidi)
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
28 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 disable();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
30 outportb(0x43,0x36);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
31 outportb(0x40,0x00);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
32 outportb(0x40,spiidi);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
33 enable();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 timer_on()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 { taimeri=0;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
38
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
39 if(auditype){initsound();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
40 cpat=patord[0];}
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
41 disable();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
42 old_int8=getvect(0x08);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
43 setvect(0x08,int_8);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
44 enable();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
45 kellovauhti(64);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
46 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
47
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
48 timer_off()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
49 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
50 disable();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
51 setvect(0x08,old_int8);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
52 enable();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
53 kellovauhti(0);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
54
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
55 if(auditype)initsound();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
56 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
57
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
58 void interrupt int_8()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
59 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
60 taimeri++;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
61 if (!(taimeri&3)) (*old_int8)(); else outport(0x20,0x20);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
62 if(auditype)playtick();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
63 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
64
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
65 /**********************************************************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
66 /******************* pLAYVVERr RUTiNE ********************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
67
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
68 char instru[2][11]={
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
69 0xa1,0xa1,0xff,0xff,0x0f,0x0f,0x03,0x03,0x01,0x00,0x00, /* bass? */
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
70 0xa2,0xa2,0xff,0xff,0x0f,0x0f,0x03,0x03,0x01,0x00,0x00, /* ohrgan */
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
71 };
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
72
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
73 adl_ldinstr(int kanava,int i)
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
74 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
75 char*ins=instru[i];
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
76 char osotte[11] = {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
77 0x20,0x23,0x60,0x63,0x80,0x83,0xe0,0xe3,0xc0,0x40,0x43 };
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
78 char *tmp=ins; char l;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
79 for(l=0;l<11;l++) adlib(kanava+osotte[l],*tmp++);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
80 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
81
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82 initsound()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84 int l;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
86 if(auditype==1) nosound();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
87
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
88 if(auditype==2){
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
89 for(l=0;l<244;l++) adlib(l,0);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
90 adlib(0x01,0x20);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
91 adl_ldinstr(0,1);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
92 adl_ldinstr(1,1);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
93 adl_ldinstr(2,1);}
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
94
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
95 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
96 #endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
97
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
98 int freku[12] = {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
99 0x157,0x16b,0x181,0x198,0x1b0,0x1ca,
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
100 0x1e5,0x202,0x220,0x241,0x263,0x287
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
101 };
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
102 char plst=0;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
103
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
104 /**********************
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
105 **********************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
106
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
107 playtick()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
108 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
109 plst++;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
110
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
111 #ifdef MSDOS
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
112
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
113 if(auditype==1){
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114 if(plst==musatempo/3){
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115 if (plrbeep[0]) sound(plrbeep[0]>>3);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
116 else
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
117 if(plrbeep[0])sound(plrbeep[0]>>3);else nosound();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
118 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
119 if(plst==musatempo/2){
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
120 if (plrbeep[1]) sound(plrbeep[1]>>3);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
121 else
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122 if(plrbeep[2])sound(plrbeep[2]>>3);else nosound();
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
123 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
124
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
125 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
126
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127 if (auditype==2){int l;for(l=0;l<NUMCH;l++)
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128 if (plrbeep[l]<0xf0){
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129 adlib(0x40+l,2);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
130 adlib(0x43+l,1);}}
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
131
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
132 #endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
133
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
134 if (plst==musatempo) { uusinuotti(); plst=0; }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
135 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
136
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137 /*char ison[3]={1,1,1};*/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
138 char hvilk[3]={0xfe,0xfe,0xfe};
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
139
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
140 int lizayz=0;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
141
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
142 uusinuotti()
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
143 {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
144 int l;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
145 unsigned char mark,mkrl;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
146
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
147 for(l=0;l<NUMCH;l++) {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
148
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
149 mkrl=mark=trax[cpat][l][crow];
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
150
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
151 if(mark<0xf0)mkrl=mark+=lizayz;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
152
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
153 if (auditype==2) plrbeep[l]=mark;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
154
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
155 if(mark==0xfa){musatempo=8;lizayz=-16;}
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
156
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
157 if (mark==0xfb)if(auditype==2){
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
158 if(crow&1)mark=0xfe;else
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
159 mark=hvilk[l];
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
160 plrbeep[l]=mark;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
161 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
162
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
163 if (mark==0xfe)
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
164 #ifdef MSDOS
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
165 {if(auditype==2){adlib(0x40+l,63);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
166 adlib(0x43+l,63);}
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
167 else plrbeep[l]=0;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
168 /*ison[l]=0;*/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
169 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
170 #else
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
171 gbsound(l,0);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
172 #endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
173
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
174 if (mark==0xfd) musatempo=16;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
175 if (mark==0xfc) musatempo=4;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
176
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
177 if (mark<0xf0) {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
178
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
179 if(mark==mkrl)hvilk[l]=mark;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
180 if((mark&15)>=12)mark+=4;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
181
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
182 #ifdef MSDOS
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
183
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
184 /********* ADLiB ********/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
185
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
186 if(auditype==2){
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
187
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
188 int hum=(freku[mark&15]) /* note */
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
189 |(32*256)| /* key on */
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
190 (((mark&(255-15))-32) *64); /* octave */
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
191
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
192 adlib(0xb0+l,hum>>8);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
193 adlib(0xa0+l,hum&255);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
194 adlib(0x40+l,12);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
195 adlib(0x43+l,15);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
196 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
197
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
198 /******** iBM sPEAKER *****/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
199
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
200 if(auditype==1){
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
201
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
202 plrbeep[l]=freku[mark&15];
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
203 plrbeep[l]<<=((( (mark&(255-15)) >>4)&15)-2);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
204
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
205 /*
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
206 if (plrbeep[0]) sound(plrbeep[0]>>3);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
207 else if (plrbeep[1]) sound(plrbeep[1]>>3);
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
208 else nosound();*/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
209
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
210 }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
211
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
212 /*********************/
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
213
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
214 #else
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
215 gbsound(l,(mark&15)+((mark>>4)*12));
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
216 #endif
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
217
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
218 } }
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
219
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
220 crow++; if (crow==64) {
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
221 crow=0;cord++;
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
222 cpat=patord[cord];
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
223 if (cpat==99) { cord=0; cpat=patord[cord]; }}
acb5694e93d9 Initial import.
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
224 }