Mercurial > hg > forks > pwpunix
annotate final_isi/time.c @ 89:ea44e1d9eb7c default tip
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 25 May 2014 05:03:14 +0300 |
parents | 96dd9b4e3fe7 |
children |
rev | line source |
---|---|
69
c13a2f8c5b10
Rename files and some minor cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
1 #include "musa.h" |
0 | 2 |
3 #define NUMCH 3 | |
4 | |
76 | 5 char cord = 0, cpat = 0, crow = 0, drmt = 0xff, drms = 0; |
0 | 6 |
7 char auditype; | |
8 | |
9 int plrbeep[2]; | |
76 | 10 int musatempo = 5; |
0 | 11 |
76 | 12 int freku[12] = |
13 { | |
14 0x157, 0x16b, 0x181, 0x198, 0x1b0, 0x1ca, | |
15 0x1e5, 0x202, 0x220, 0x241, 0x263, 0x287 | |
16 }; | |
17 | |
18 char plst = 0; | |
0 | 19 |
20 /*char ison[3]={1,1,1};*/ | |
76 | 21 char hvilk[3] = { 0xfe, 0xfe, 0xfe }; |
0 | 22 |
76 | 23 int lizayz = 0; |
0 | 24 |
25 | |
69
c13a2f8c5b10
Rename files and some minor cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
26 void playtick() |
c13a2f8c5b10
Rename files and some minor cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
27 { |
76 | 28 plst++; |
29 | |
30 if (plst == musatempo) | |
31 { | |
32 int l; | |
33 unsigned char mark, mkrl; | |
0 | 34 |
76 | 35 for (l = 0; l < NUMCH; l++) |
36 { | |
0 | 37 |
76 | 38 mkrl = mark = trax[cpat][l][crow]; |
69
c13a2f8c5b10
Rename files and some minor cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents:
0
diff
changeset
|
39 |
76 | 40 if (mark < 0xf0) |
41 mkrl = mark += lizayz; | |
0 | 42 |
76 | 43 if (auditype == 2) |
44 plrbeep[l] = mark; | |
0 | 45 |
76 | 46 if (mark == 0xfa) |
47 { | |
48 musatempo = 8; | |
49 lizayz = -16; | |
50 } | |
0 | 51 |
76 | 52 if (mark == 0xfb) |
53 if (auditype == 2) | |
54 { | |
55 if (crow & 1) | |
56 mark = 0xfe; | |
57 else | |
58 mark = hvilk[l]; | |
59 plrbeep[l] = mark; | |
60 } | |
0 | 61 |
76 | 62 if (mark == 0xfe) |
63 gbsound(l, 0); | |
64 | |
65 if (mark == 0xfd) | |
66 musatempo = 16; | |
67 if (mark == 0xfc) | |
68 musatempo = 4; | |
0 | 69 |
76 | 70 if (mark < 0xf0) |
71 { | |
0 | 72 |
76 | 73 if (mark == mkrl) |
74 hvilk[l] = mark; | |
75 if ((mark & 15) >= 12) | |
76 mark += 4; | |
0 | 77 |
76 | 78 gbsound(l, (mark & 15) + ((mark >> 4) * 12)); |
0 | 79 |
76 | 80 } |
81 } | |
0 | 82 |
76 | 83 crow++; |
84 if (crow == 64) | |
85 { | |
86 crow = 0; | |
87 cord++; | |
88 cpat = patord[cord]; | |
89 if (cpat == 99) | |
90 { | |
91 cord = 0; | |
92 cpat = patord[cord]; | |
93 } | |
94 } | |
95 plst = 0; | |
96 } | |
0 | 97 } |