annotate src/adplug/core/adl.cxx @ 2913:113454baecf8

lots of changes: most important - bookmarks code almost finished, fixed bold-text gui bug, and others...
author Calin Crisan ccrisan@gmail.com
date Fri, 15 Aug 2008 16:00:43 +0200
parents 368f8ee0a95f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1 /*
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2 * adl.cpp - ADL player adaption by Simon Peter <dn.tlp@gmx.net>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
3 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
4 * Original ADL player by Torbjorn Andersson and Johannes Schickel
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
5 * 'lordhoto' <lordhoto at scummvm dot org> of the ScummVM project.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
6 */
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
7
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
8 /* ScummVM - Scumm Interpreter
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
9 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
10 * This file is licensed under both GPL and LGPL
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
11 * Copyright (C) 2006 The ScummVM project
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
12 * Copyright (C) 2006 Torbjorn Andersson and Johannes Schickel
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
13 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
14 * GPL License
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
15 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
16 * This program is free software; you can redistribute it and/or
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
17 * modify it under the terms of the GNU General Public License
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
18 * as published by the Free Software Foundation; either version 2
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
19 * of the License, or (at your option) any later version.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
20
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
21 * This program is distributed in the hope that it will be useful,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
24 * GNU General Public License for more details.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
25
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
26 * You should have received a copy of the GNU General Public License
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
27 * along with this program; if not, write to the Free Software
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
28 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
29 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
30 * LPGL License
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
31 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
32 * This library is free software; you can redistribute it and/or
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
33 * modify it under the terms of the GNU Lesser General Public
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
34 * License as published by the Free Software Foundation; either
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
35 * version 2.1 of the License, or (at your option) any later version.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
36
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
37 * This library is distributed in the hope that it will be useful,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
38 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
39 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
40 * Lesser General Public License for more details.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
41
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
42 * You should have received a copy of the GNU Lesser General Public
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
43 * License along with this library; if not, write to the Free Software
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
44 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
45 *
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
46 */
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
47
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
48 #include <inttypes.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
49 #include <stdarg.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
50 #include <assert.h>
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
51
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
52 #include "adl.h"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
53 #include "debug.h"
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
54
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
55 #ifdef ADL_DEBUG
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
56 # define warning(...) AdPlug_LogWrite(__VA_ARGS__); \
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
57 AdPlug_LogWrite("\n")
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
58
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
59 # define debugC(i1, i2, ...) AdPlug_LogWrite(__VA_ARGS__); \
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
60 AdPlug_LogWrite("\n")
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
61 #else
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
62 # define kDebugLevelSound 1
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
63
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
64 static inline void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
65 warning (const char *str, ...)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
66 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
67 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
68
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
69 static inline void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
70 debugC (int i1, int i2, const char *str, ...)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
71 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
72 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
73 #endif
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
74
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
75 // #define warning(...)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
76 // #define debugC(i1, i2, ...)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
77
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
78 #define ARRAYSIZE(x) ((int)(sizeof(x) / sizeof(x[0])))
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
79
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
80 // Basic Adlib Programming:
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
81 // http://www.gamedev.net/reference/articles/article446.asp
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
82
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
83 #define CALLBACKS_PER_SECOND 72
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
84
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
85 typedef uint8_t uint8;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
86 typedef int8_t int8;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
87 typedef uint16_t uint16;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
88 typedef int16_t int16;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
89 typedef uint32_t uint32;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
90 typedef int32_t int32;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
91 typedef uint8_t byte;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
92
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
93 static inline uint16
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
94 READ_LE_UINT16 (const void *ptr)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
95 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
96 const byte *b = (const byte *) ptr;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
97 return (b[1] << 8) + b[0];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
98 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
99
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
100 static inline uint16
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
101 READ_BE_UINT16 (const void *ptr)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
102 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
103 const byte *b = (const byte *) ptr;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
104 return (b[0] << 8) + b[1];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
105 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
106
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
107 class AdlibDriver
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
108 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
109 public:
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
110 AdlibDriver (Copl * opl);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
111 ~AdlibDriver ();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
112
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
113 int callback (int opcode, ...);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
114 void callback ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
115
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
116 // AudioStream API
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
117 // int readBuffer(int16 *buffer, const int numSamples) {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
118 // int32 samplesLeft = numSamples;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
119 // memset(buffer, 0, sizeof(int16) * numSamples);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
120 // while (samplesLeft) {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
121 // if (!_samplesTillCallback) {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
122 // callback();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
123 // _samplesTillCallback = _samplesPerCallback;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
124 // _samplesTillCallbackRemainder += _samplesPerCallbackRemainder;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
125 // if (_samplesTillCallbackRemainder >= CALLBACKS_PER_SECOND) {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
126 // _samplesTillCallback++;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
127 // _samplesTillCallbackRemainder -= CALLBACKS_PER_SECOND;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
128 // }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
129 // }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
130
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
131 // int32 render = MIN(samplesLeft, _samplesTillCallback);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
132 // samplesLeft -= render;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
133 // _samplesTillCallback -= render;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
134 // YM3812UpdateOne(_adlib, buffer, render);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
135 // buffer += render;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
136 // }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
137 // return numSamples;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
138 // }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
139
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
140 bool isStereo () const
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
141 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
142 return false;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
143 }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
144 bool endOfData () const
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
145 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
146 return false;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
147 }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
148 // int getRate() const { return _mixer->getOutputRate(); }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
149
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
150 struct OpcodeEntry
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
151 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
152 typedef int (AdlibDriver::*DriverOpcode) (va_list & list);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
153 DriverOpcode function;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
154 const char *name;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
155 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
156
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
157 void setupOpcodeList ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
158 const OpcodeEntry *_opcodeList;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
159 int _opcodesEntries;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
160
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
161 int snd_ret0x100 (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
162 int snd_ret0x1983 (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
163 int snd_initDriver (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
164 int snd_deinitDriver (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
165 int snd_setSoundData (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
166 int snd_unkOpcode1 (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
167 int snd_startSong (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
168 int snd_unkOpcode2 (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
169 int snd_unkOpcode3 (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
170 int snd_readByte (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
171 int snd_writeByte (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
172 int snd_getSoundTrigger (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
173 int snd_unkOpcode4 (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
174 int snd_dummy (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
175 int snd_getNullvar4 (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
176 int snd_setNullvar3 (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
177 int snd_setFlag (va_list & list);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
178 int snd_clearFlag (va_list & list);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
179
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
180 // These variables have not yet been named, but some of them are partly
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
181 // known nevertheless:
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
182 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
183 // unk16 - Sound-related. Possibly some sort of pitch bend.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
184 // unk18 - Sound-effect. Used for secondaryEffect1()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
185 // unk19 - Sound-effect. Used for secondaryEffect1()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
186 // unk20 - Sound-effect. Used for secondaryEffect1()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
187 // unk21 - Sound-effect. Used for secondaryEffect1()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
188 // unk22 - Sound-effect. Used for secondaryEffect1()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
189 // unk29 - Sound-effect. Used for primaryEffect1()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
190 // unk30 - Sound-effect. Used for primaryEffect1()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
191 // unk31 - Sound-effect. Used for primaryEffect1()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
192 // unk32 - Sound-effect. Used for primaryEffect2()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
193 // unk33 - Sound-effect. Used for primaryEffect2()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
194 // unk34 - Sound-effect. Used for primaryEffect2()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
195 // unk35 - Sound-effect. Used for primaryEffect2()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
196 // unk36 - Sound-effect. Used for primaryEffect2()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
197 // unk37 - Sound-effect. Used for primaryEffect2()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
198 // unk38 - Sound-effect. Used for primaryEffect2()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
199 // unk39 - Currently unused, except for updateCallback56()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
200 // unk40 - Currently unused, except for updateCallback56()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
201 // unk41 - Sound-effect. Used for primaryEffect2()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
202
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
203 struct Channel
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
204 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
205 uint8 opExtraLevel2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
206 uint8 *dataptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
207 uint8 duration;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
208 uint8 repeatCounter;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
209 int8 baseOctave;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
210 uint8 priority;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
211 uint8 dataptrStackPos;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
212 uint8 *dataptrStack[4];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
213 int8 baseNote;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
214 uint8 unk29;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
215 uint8 unk31;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
216 uint16 unk30;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
217 uint16 unk37;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
218 uint8 unk33;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
219 uint8 unk34;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
220 uint8 unk35;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
221 uint8 unk36;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
222 uint8 unk32;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
223 uint8 unk41;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
224 uint8 unk38;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
225 uint8 opExtraLevel1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
226 uint8 spacing2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
227 uint8 baseFreq;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
228 uint8 tempo;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
229 uint8 position;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
230 uint8 regAx;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
231 uint8 regBx;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
232 typedef void (AdlibDriver::*Callback) (Channel &);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
233 Callback primaryEffect;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
234 Callback secondaryEffect;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
235 uint8 fractionalSpacing;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
236 uint8 opLevel1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
237 uint8 opLevel2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
238 uint8 opExtraLevel3;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
239 uint8 twoChan;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
240 uint8 unk39;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
241 uint8 unk40;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
242 uint8 spacing1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
243 uint8 durationRandomness;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
244 uint8 unk19;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
245 uint8 unk18;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
246 int8 unk20;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
247 int8 unk21;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
248 uint8 unk22;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
249 uint16 offset;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
250 uint8 tempoReset;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
251 uint8 rawNote;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
252 int8 unk16;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
253 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
254
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
255 void primaryEffect1 (Channel & channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
256 void primaryEffect2 (Channel & channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
257 void secondaryEffect1 (Channel & channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
258
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
259 void resetAdlibState ();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
260 void writeOPL (byte reg, byte val);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
261 void initChannel (Channel & channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
262 void noteOff (Channel & channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
263 void unkOutput2 (uint8 num);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
264
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
265 uint16 getRandomNr ();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
266 void setupDuration (uint8 duration, Channel & channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
267
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
268 void setupNote (uint8 rawNote, Channel & channel, bool flag = false);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
269 void setupInstrument (uint8 regOffset, uint8 * dataptr, Channel & channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
270 void noteOn (Channel & channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
271
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
272 void adjustVolume (Channel & channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
273
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
274 uint8 calculateOpLevel1 (Channel & channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
275 uint8 calculateOpLevel2 (Channel & channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
276
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
277 uint16 checkValue (int16 val)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
278 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
279 if (val < 0)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
280 val = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
281 else if (val > 0x3F)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
282 val = 0x3F;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
283 return val;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
284 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
285
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
286 // The sound data has at least two lookup tables:
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
287 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
288 // * One for programs, starting at offset 0.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
289 // * One for instruments, starting at offset 500.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
290
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
291 uint8 *getProgram (int progId)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
292 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
293 return _soundData + READ_LE_UINT16 (_soundData + 2 * progId);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
294 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
295
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
296 uint8 *getInstrument (int instrumentId)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
297 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
298 return _soundData + READ_LE_UINT16 (_soundData + 500 + 2 * instrumentId);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
299 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
300
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
301 void setupPrograms ();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
302 void executePrograms ();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
303
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
304 struct ParserOpcode
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
305 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
306 typedef int (AdlibDriver::*POpcode) (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
307 uint8 value);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
308 POpcode function;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
309 const char *name;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
310 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
311
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
312 void setupParserOpcodeTable ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
313 const ParserOpcode *_parserOpcodeTable;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
314 int _parserOpcodeTableSize;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
315
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
316 int update_setRepeat (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
317 int update_checkRepeat (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
318 int update_setupProgram (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
319 int update_setNoteSpacing (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
320 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
321 int update_jump (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
322 int update_jumpToSubroutine (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
323 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
324 int update_returnFromSubroutine (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
325 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
326 int update_setBaseOctave (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
327 int update_stopChannel (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
328 int update_playRest (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
329 int update_writeAdlib (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
330 int update_setupNoteAndDuration (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
331 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
332 int update_setBaseNote (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
333 int update_setupSecondaryEffect1 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
334 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
335 int update_stopOtherChannel (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
336 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
337 int update_waitForEndOfProgram (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
338 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
339 int update_setupInstrument (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
340 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
341 int update_setupPrimaryEffect1 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
342 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
343 int update_removePrimaryEffect1 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
344 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
345 int update_setBaseFreq (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
346 int update_setupPrimaryEffect2 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
347 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
348 int update_setPriority (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
349 int updateCallback23 (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
350 int updateCallback24 (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
351 int update_setExtraLevel1 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
352 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
353 int update_setupDuration (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
354 int update_playNote (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
355 int update_setFractionalNoteSpacing (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
356 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
357 int update_setTempo (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
358 int update_removeSecondaryEffect1 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
359 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
360 int update_setChannelTempo (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
361 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
362 int update_setExtraLevel3 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
363 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
364 int update_setExtraLevel2 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
365 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
366 int update_changeExtraLevel2 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
367 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
368 int update_setAMDepth (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
369 int update_setVibratoDepth (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
370 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
371 int update_changeExtraLevel1 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
372 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
373 int updateCallback38 (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
374 int updateCallback39 (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
375 int update_removePrimaryEffect2 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
376 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
377 int updateCallback41 (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
378 int update_resetToGlobalTempo (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
379 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
380 int update_nop1 (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
381 int update_setDurationRandomness (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
382 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
383 int update_changeChannelTempo (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
384 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
385 int updateCallback46 (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
386 int update_nop2 (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
387 int update_setupRhythmSection (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
388 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
389 int update_playRhythmSection (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
390 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
391 int update_removeRhythmSection (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
392 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
393 int updateCallback51 (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
394 int updateCallback52 (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
395 int updateCallback53 (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
396 int update_setSoundTrigger (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
397 uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
398 int update_setTempoReset (uint8 * &dataptr, Channel & channel, uint8 value);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
399 int updateCallback56 (uint8 * &dataptr, Channel & channel, uint8 value);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
400
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
401 // These variables have not yet been named, but some of them are partly
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
402 // known nevertheless:
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
403 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
404 // _unkValue1 - Unknown. Used for updating _unkValue2
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
405 // _unkValue2 - Unknown. Used for updating _unkValue4
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
406 // _unkValue3 - Unknown. Used for updating _unkValue2
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
407 // _unkValue4 - Unknown. Used for updating _unkValue5
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
408 // _unkValue5 - Unknown. Used for controlling updateCallback24().
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
409 // _unkValue6 - Unknown. Rhythm section volume?
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
410 // _unkValue7 - Unknown. Rhythm section volume?
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
411 // _unkValue8 - Unknown. Rhythm section volume?
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
412 // _unkValue9 - Unknown. Rhythm section volume?
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
413 // _unkValue10 - Unknown. Rhythm section volume?
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
414 // _unkValue11 - Unknown. Rhythm section volume?
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
415 // _unkValue12 - Unknown. Rhythm section volume?
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
416 // _unkValue13 - Unknown. Rhythm section volume?
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
417 // _unkValue14 - Unknown. Rhythm section volume?
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
418 // _unkValue15 - Unknown. Rhythm section volume?
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
419 // _unkValue16 - Unknown. Rhythm section volume?
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
420 // _unkValue17 - Unknown. Rhythm section volume?
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
421 // _unkValue18 - Unknown. Rhythm section volume?
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
422 // _unkValue19 - Unknown. Rhythm section volume?
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
423 // _unkValue20 - Unknown. Rhythm section volume?
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
424 // _unkTable[] - Probably frequences for the 12-tone scale.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
425 // _unkTable2[] - Unknown. Currently only used by updateCallback46()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
426 // _unkTable2_1[] - One of the tables in _unkTable2[]
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
427 // _unkTable2_2[] - One of the tables in _unkTable2[]
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
428 // _unkTable2_3[] - One of the tables in _unkTable2[]
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
429
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
430 int32 _samplesPerCallback;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
431 int32 _samplesPerCallbackRemainder;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
432 int32 _samplesTillCallback;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
433 int32 _samplesTillCallbackRemainder;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
434
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
435 int _lastProcessed;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
436 int8 _flagTrigger;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
437 int _curChannel;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
438 uint8 _soundTrigger;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
439 int _soundsPlaying;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
440
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
441 uint16 _rnd;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
442
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
443 uint8 _unkValue1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
444 uint8 _unkValue2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
445 uint8 _unkValue3;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
446 uint8 _unkValue4;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
447 uint8 _unkValue5;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
448 uint8 _unkValue6;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
449 uint8 _unkValue7;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
450 uint8 _unkValue8;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
451 uint8 _unkValue9;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
452 uint8 _unkValue10;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
453 uint8 _unkValue11;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
454 uint8 _unkValue12;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
455 uint8 _unkValue13;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
456 uint8 _unkValue14;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
457 uint8 _unkValue15;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
458 uint8 _unkValue16;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
459 uint8 _unkValue17;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
460 uint8 _unkValue18;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
461 uint8 _unkValue19;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
462 uint8 _unkValue20;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
463
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
464 int _flags;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
465
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
466 uint8 *_soundData;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
467
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
468 uint8 _soundIdTable[0x10];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
469 Channel _channels[10];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
470
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
471 uint8 _vibratoAndAMDepthBits;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
472 uint8 _rhythmSectionBits;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
473
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
474 uint8 _curRegOffset;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
475 uint8 _tempo;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
476
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
477 const uint8 *_tablePtr1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
478 const uint8 *_tablePtr2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
479
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
480 static const uint8 _regOffset[];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
481 static const uint16 _unkTable[];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
482 static const uint8 *_unkTable2[];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
483 static const uint8 _unkTable2_1[];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
484 static const uint8 _unkTable2_2[];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
485 static const uint8 _unkTable2_3[];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
486 static const uint8 _unkTables[][32];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
487
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
488 Copl *opl;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
489 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
490
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
491 AdlibDriver::AdlibDriver (Copl * newopl):opl (newopl)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
492 {
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
493 setupOpcodeList ();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
494 setupParserOpcodeTable ();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
495
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
496 // _mixer = mixer;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
497
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
498 _flags = 0;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
499 // _adlib = makeAdlibOPL(getRate());
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
500 // assert(_adlib);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
501
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
502 memset (_channels, 0, sizeof (_channels));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
503 _soundData = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
504
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
505 _vibratoAndAMDepthBits = _curRegOffset = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
506
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
507 _lastProcessed = _flagTrigger = _curChannel = _rhythmSectionBits = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
508 _soundsPlaying = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
509 _rnd = 0x1234;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
510
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
511 _tempo = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
512 _soundTrigger = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
513
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
514 _unkValue3 = 0xFF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
515 _unkValue1 = _unkValue2 = _unkValue4 = _unkValue5 = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
516 _unkValue6 = _unkValue7 = _unkValue8 = _unkValue9 = _unkValue10 = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
517 _unkValue11 = _unkValue12 = _unkValue13 = _unkValue14 = _unkValue15 =
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
518 _unkValue16 = _unkValue17 = _unkValue18 = _unkValue19 = _unkValue20 = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
519
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
520 _tablePtr1 = _tablePtr2 = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
521
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
522 // _mixer->setupPremix(this);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
523
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
524 // _samplesPerCallback = getRate() / CALLBACKS_PER_SECOND;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
525 // _samplesPerCallbackRemainder = getRate() % CALLBACKS_PER_SECOND;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
526 _samplesTillCallback = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
527 _samplesTillCallbackRemainder = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
528 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
529
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
530 AdlibDriver::~AdlibDriver ()
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
531 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
532 // _mixer->setupPremix(0);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
533 // OPLDestroy(_adlib);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
534 // _adlib = 0;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
535 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
536
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
537 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
538 AdlibDriver::callback (int opcode, ...)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
539 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
540 // lock();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
541 if (opcode >= _opcodesEntries || opcode < 0)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
542 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
543 warning ("AdlibDriver: calling unknown opcode '%d'", opcode);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
544 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
545 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
546
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
547 debugC (9, kDebugLevelSound, "Calling opcode '%s' (%d)",
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
548 _opcodeList[opcode].name, opcode);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
549
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
550 va_list args;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
551 va_start (args, opcode);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
552 int returnValue = (this->*(_opcodeList[opcode].function)) (args);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
553 va_end (args);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
554 // unlock();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
555 return returnValue;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
556 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
557
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
558 // Opcodes
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
559
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
560 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
561 AdlibDriver::snd_ret0x100 (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
562 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
563 return 0x100;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
564 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
565
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
566 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
567 AdlibDriver::snd_ret0x1983 (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
568 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
569 return 0x1983;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
570 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
571
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
572 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
573 AdlibDriver::snd_initDriver (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
574 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
575 _lastProcessed = _soundsPlaying = 0;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
576 resetAdlibState ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
577 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
578 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
579
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
580 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
581 AdlibDriver::snd_deinitDriver (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
582 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
583 resetAdlibState ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
584 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
585 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
586
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
587 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
588 AdlibDriver::snd_setSoundData (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
589 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
590 if (_soundData)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
591 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
592 delete[]_soundData;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
593 _soundData = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
594 }
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
595 _soundData = va_arg (list, uint8 *);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
596 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
597 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
598
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
599 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
600 AdlibDriver::snd_unkOpcode1 (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
601 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
602 warning ("unimplemented snd_unkOpcode1");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
603 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
604 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
605
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
606 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
607 AdlibDriver::snd_startSong (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
608 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
609 int songId = va_arg (list, int);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
610 _flags |= 8;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
611 _flagTrigger = 1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
612
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
613 uint8 *ptr = getProgram (songId);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
614 uint8 chan = *ptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
615
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
616 if ((songId << 1) != 0)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
617 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
618 if (chan == 9)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
619 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
620 if (_flags & 2)
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
621 return 0;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
622 }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
623 else
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
624 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
625 if (_flags & 1)
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
626 return 0;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
627 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
628 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
629
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
630 _soundIdTable[_soundsPlaying++] = songId;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
631 _soundsPlaying &= 0x0F;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
632
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
633 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
634 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
635
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
636 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
637 AdlibDriver::snd_unkOpcode2 (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
638 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
639 warning ("unimplemented snd_unkOpcode2");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
640 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
641 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
642
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
643 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
644 AdlibDriver::snd_unkOpcode3 (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
645 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
646 int value = va_arg (list, int);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
647 int loop = value;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
648 if (value < 0)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
649 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
650 value = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
651 loop = 9;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
652 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
653 loop -= value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
654 ++loop;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
655
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
656 while (loop--)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
657 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
658 _curChannel = value;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
659 Channel & channel = _channels[_curChannel];
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
660 channel.priority = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
661 channel.dataptr = 0;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
662 if (value != 9)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
663 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
664 noteOff (channel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
665 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
666 ++value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
667 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
668
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
669 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
670 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
671
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
672 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
673 AdlibDriver::snd_readByte (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
674 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
675 int a = va_arg (list, int);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
676 int b = va_arg (list, int);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
677 uint8 *ptr = getProgram (a) + b;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
678 return *ptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
679 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
680
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
681 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
682 AdlibDriver::snd_writeByte (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
683 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
684 int a = va_arg (list, int);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
685 int b = va_arg (list, int);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
686 int c = va_arg (list, int);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
687 uint8 *ptr = getProgram (a) + b;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
688 uint8 oldValue = *ptr;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
689 *ptr = (uint8) c;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
690 return oldValue;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
691 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
692
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
693 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
694 AdlibDriver::snd_getSoundTrigger (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
695 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
696 return _soundTrigger;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
697 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
698
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
699 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
700 AdlibDriver::snd_unkOpcode4 (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
701 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
702 warning ("unimplemented snd_unkOpcode4");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
703 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
704 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
705
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
706 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
707 AdlibDriver::snd_dummy (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
708 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
709 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
710 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
711
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
712 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
713 AdlibDriver::snd_getNullvar4 (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
714 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
715 warning ("unimplemented snd_getNullvar4");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
716 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
717 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
718
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
719 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
720 AdlibDriver::snd_setNullvar3 (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
721 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
722 warning ("unimplemented snd_setNullvar3");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
723 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
724 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
725
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
726 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
727 AdlibDriver::snd_setFlag (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
728 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
729 int oldFlags = _flags;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
730 _flags |= va_arg (list, int);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
731 return oldFlags;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
732 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
733
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
734 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
735 AdlibDriver::snd_clearFlag (va_list & list)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
736 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
737 int oldFlags = _flags;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
738 _flags &= ~(va_arg (list, int));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
739 return oldFlags;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
740 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
741
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
742 // timer callback
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
743
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
744 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
745 AdlibDriver::callback ()
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
746 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
747 // lock();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
748 --_flagTrigger;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
749 if (_flagTrigger < 0)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
750 _flags &= ~8;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
751 setupPrograms ();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
752 executePrograms ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
753
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
754 uint8 temp = _unkValue3;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
755 _unkValue3 += _tempo;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
756 if (_unkValue3 < temp)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
757 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
758 if (!(--_unkValue2))
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
759 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
760 _unkValue2 = _unkValue1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
761 ++_unkValue4;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
762 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
763 }
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
764 // unlock();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
765 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
766
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
767 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
768 AdlibDriver::setupPrograms ()
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
769 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
770 while (_lastProcessed != _soundsPlaying)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
771 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
772 uint8 *ptr = getProgram (_soundIdTable[_lastProcessed]);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
773 uint8 chan = *ptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
774 uint8 priority = *ptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
775
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
776 // Only start this sound if its priority is higher than the one
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
777 // already playing.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
778
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
779 Channel & channel = _channels[chan];
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
780
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
781 if (priority >= channel.priority)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
782 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
783 initChannel (channel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
784 channel.priority = priority;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
785 channel.dataptr = ptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
786 channel.tempo = 0xFF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
787 channel.position = 0xFF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
788 channel.duration = 1;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
789 unkOutput2 (chan);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
790 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
791
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
792 ++_lastProcessed;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
793 _lastProcessed &= 0x0F;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
794 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
795 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
796
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
797 // A few words on opcode parsing and timing:
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
798 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
799 // First of all, We simulate a timer callback 72 times per second. Each timeout
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
800 // we update each channel that has something to play.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
801 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
802 // Each channel has its own individual tempo, which is added to its position.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
803 // This will frequently cause the position to "wrap around" but that is
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
804 // intentional. In fact, it's the signal to go ahead and do more stuff with
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
805 // that channel.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
806 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
807 // Each channel also has a duration, indicating how much time is left on the
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
808 // its current task. This duration is decreased by one. As long as it still has
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
809 // not reached zero, the only thing that can happen is that the note is turned
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
810 // off depending on manual or automatic note spacing. Once the duration reaches
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
811 // zero, a new set of musical opcodes are executed.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
812 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
813 // An opcode is one byte, followed by a variable number of parameters. Since
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
814 // most opcodes have at least one one-byte parameter, we read that as well. Any
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
815 // opcode that doesn't have that one parameter is responsible for moving the
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
816 // data pointer back again.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
817 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
818 // If the most significant bit of the opcode is 1, it's a function; call it.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
819 // The opcode functions return either 0 (continue), 1 (stop) or 2 (stop, and do
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
820 // not run the effects callbacks).
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
821 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
822 // If the most significant bit of the opcode is 0, it's a note, and the first
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
823 // parameter is its duration. (There are cases where the duration is modified
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
824 // but that's an exception.) The note opcode is assumed to return 1, and is the
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
825 // last opcode unless its duration is zero.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
826 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
827 // Finally, most of the times that the callback is called, it will invoke the
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
828 // effects callbacks. The final opcode in a set can prevent this, if it's a
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
829 // function and it returns anything other than 1.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
830
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
831 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
832 AdlibDriver::executePrograms ()
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
833 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
834 // Each channel runs its own program. There are ten channels: One for
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
835 // each Adlib channel (0-8), plus one "control channel" (9) which is
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
836 // the one that tells the other channels what to do.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
837
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
838 for (_curChannel = 9; _curChannel >= 0; --_curChannel)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
839 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
840 int result = 1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
841
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
842 if (!_channels[_curChannel].dataptr)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
843 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
844 continue;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
845 }
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
846
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
847 Channel & channel = _channels[_curChannel];
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
848 _curRegOffset = _regOffset[_curChannel];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
849
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
850 if (channel.tempoReset)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
851 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
852 channel.tempo = _tempo;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
853 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
854
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
855 uint8 backup = channel.position;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
856 channel.position += channel.tempo;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
857 if (channel.position < backup)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
858 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
859 if (--channel.duration)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
860 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
861 if (channel.duration == channel.spacing2)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
862 noteOff (channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
863 if (channel.duration == channel.spacing1 && _curChannel != 9)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
864 noteOff (channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
865 }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
866 else
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
867 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
868 // An opcode is not allowed to modify its own
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
869 // data pointer except through the 'dataptr'
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
870 // parameter. To enforce that, we have to work
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
871 // on a copy of the data pointer.
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
872 //
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
873 // This fixes a subtle music bug where the
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
874 // wrong music would play when getting the
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
875 // quill in Kyra 1.
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
876 uint8 *dataptr = channel.dataptr;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
877 while (dataptr)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
878 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
879 uint8 opcode = *dataptr++;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
880 uint8 param = *dataptr++;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
881
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
882 if (opcode & 0x80)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
883 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
884 opcode &= 0x7F;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
885 if (opcode >= _parserOpcodeTableSize)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
886 opcode = _parserOpcodeTableSize - 1;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
887 debugC (9, kDebugLevelSound,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
888 "Calling opcode '%s' (%d) (channel: %d)",
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
889 _parserOpcodeTable[opcode].name, opcode, _curChannel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
890 result =
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
891 (this->*(_parserOpcodeTable[opcode].function)) (dataptr,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
892 channel, param);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
893 channel.dataptr = dataptr;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
894 if (result)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
895 break;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
896 }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
897 else
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
898 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
899 debugC (9, kDebugLevelSound,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
900 "Note on opcode 0x%02X (duration: %d) (channel: %d)",
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
901 opcode, param, _curChannel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
902 setupNote (opcode, channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
903 noteOn (channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
904 setupDuration (param, channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
905 if (param)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
906 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
907 channel.dataptr = dataptr;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
908 break;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
909 }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
910 }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
911 }
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
912 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
913 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
914
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
915 if (result == 1)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
916 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
917 if (channel.primaryEffect)
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
918 (this->*(channel.primaryEffect)) (channel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
919 if (channel.secondaryEffect)
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
920 (this->*(channel.secondaryEffect)) (channel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
921 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
922 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
923 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
924
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
925 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
926
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
927 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
928 AdlibDriver::resetAdlibState ()
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
929 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
930 debugC (9, kDebugLevelSound, "resetAdlibState()");
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
931 _rnd = 0x1234;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
932
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
933 // Authorize the control of the waveforms
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
934 writeOPL (0x01, 0x20);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
935
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
936 // Select FM music mode
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
937 writeOPL (0x08, 0x00);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
938
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
939 // I would guess the main purpose of this is to turn off the rhythm,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
940 // thus allowing us to use 9 melodic voices instead of 6.
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
941 writeOPL (0xBD, 0x00);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
942
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
943 int loop = 10;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
944 while (loop--)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
945 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
946 if (loop != 9)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
947 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
948 // Silence the channel
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
949 writeOPL (0x40 + _regOffset[loop], 0x3F);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
950 writeOPL (0x43 + _regOffset[loop], 0x3F);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
951 }
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
952 initChannel (_channels[loop]);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
953 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
954 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
955
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
956 // Old calling style: output0x388(0xABCD)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
957 // New calling style: writeOPL(0xAB, 0xCD)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
958
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
959 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
960 AdlibDriver::writeOPL (byte reg, byte val)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
961 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
962 opl->write (reg, val);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
963 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
964
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
965 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
966 AdlibDriver::initChannel (Channel & channel)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
967 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
968 debugC (9, kDebugLevelSound, "initChannel(%lu)",
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
969 (long) (&channel - _channels));
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
970 memset (&channel.dataptr, 0,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
971 sizeof (Channel) - ((char *) &channel.dataptr - (char *) &channel));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
972
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
973 channel.tempo = 0xFF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
974 channel.priority = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
975 // normally here are nullfuncs but we set 0 for now
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
976 channel.primaryEffect = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
977 channel.secondaryEffect = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
978 channel.spacing1 = 1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
979 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
980
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
981 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
982 AdlibDriver::noteOff (Channel & channel)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
983 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
984 debugC (9, kDebugLevelSound, "noteOff(%lu)", (long) (&channel - _channels));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
985
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
986 // The control channel has no corresponding Adlib channel
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
987
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
988 if (_curChannel >= 9)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
989 return;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
990
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
991 // When the rhythm section is enabled, channels 6, 7 and 8 are special.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
992
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
993 if (_rhythmSectionBits && _curChannel >= 6)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
994 return;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
995
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
996 // This means the "Key On" bit will always be 0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
997 channel.regBx &= 0xDF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
998
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
999 // Octave / F-Number / Key-On
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1000 writeOPL (0xB0 + _curChannel, channel.regBx);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1001 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1002
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1003 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1004 AdlibDriver::unkOutput2 (uint8 chan)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1005 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1006 debugC (9, kDebugLevelSound, "unkOutput2(%d)", chan);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1007
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1008 // The control channel has no corresponding Adlib channel
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1009
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1010 if (chan >= 9)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1011 return;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1012
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1013 // I believe this has to do with channels 6, 7, and 8 being special
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1014 // when Adlib's rhythm section is enabled.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1015
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1016 if (_rhythmSectionBits && chan >= 6)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1017 return;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1018
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1019 uint8 offset = _regOffset[chan];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1020
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1021 // The channel is cleared: First the attack/delay rate, then the
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1022 // sustain level/release rate, and finally the note is turned off.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1023
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1024 writeOPL (0x60 + offset, 0xFF);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1025 writeOPL (0x63 + offset, 0xFF);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1026
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1027 writeOPL (0x80 + offset, 0xFF);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1028 writeOPL (0x83 + offset, 0xFF);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1029
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1030 writeOPL (0xB0 + chan, 0x00);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1031
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1032 // ...and then the note is turned on again, with whatever value is
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1033 // still lurking in the A0 + chan register, but everything else -
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1034 // including the two most significant frequency bit, and the octave -
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1035 // set to zero.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1036 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1037 // This is very strange behaviour, and causes problems with the ancient
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1038 // FMOPL code we borrowed from AdPlug. I've added a workaround. See
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1039 // fmopl.cpp for more details.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1040 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1041 // More recent versions of the MAME FMOPL don't seem to have this
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1042 // problem, but cannot currently be used because of licensing and
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1043 // performance issues.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1044 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1045 // Ken Silverman's Adlib emulator (which can be found on his Web page -
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1046 // http://www.advsys.net/ken - and as part of AdPlug) also seems to be
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1047 // immune, but is apparently not as feature complete as MAME's.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1048
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1049 writeOPL (0xB0 + chan, 0x20);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1050 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1051
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1052 // I believe this is a random number generator. It actually does seem to
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1053 // generate an even distribution of almost all numbers from 0 through 65535,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1054 // though in my tests some numbers were never generated.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1055
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1056 uint16
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1057 AdlibDriver::getRandomNr ()
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1058 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1059 _rnd += 0x9248;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1060 uint16 lowBits = _rnd & 7;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1061 _rnd >>= 3;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1062 _rnd |= (lowBits << 13);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1063 return _rnd;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1064 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1065
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1066 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1067 AdlibDriver::setupDuration (uint8 duration, Channel & channel)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1068 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1069 debugC (9, kDebugLevelSound, "setupDuration(%d, %lu)", duration,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1070 (long) (&channel - _channels));
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1071 if (channel.durationRandomness)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1072 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1073 channel.duration =
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1074 duration + (getRandomNr () & channel.durationRandomness);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1075 return;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1076 }
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1077 if (channel.fractionalSpacing)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1078 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1079 channel.spacing2 = (duration >> 3) * channel.fractionalSpacing;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1080 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1081 channel.duration = duration;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1082 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1083
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1084 // This function may or may not play the note. It's usually followed by a call
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1085 // to noteOn(), which will always play the current note.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1086
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1087 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1088 AdlibDriver::setupNote (uint8 rawNote, Channel & channel, bool flag)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1089 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1090 debugC (9, kDebugLevelSound, "setupNote(%d, %lu)", rawNote,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1091 (long) (&channel - _channels));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1092
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1093 channel.rawNote = rawNote;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1094
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1095 int8 note = (rawNote & 0x0F) + channel.baseNote;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1096 int8 octave = ((rawNote + channel.baseOctave) >> 4) & 0x0F;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1097
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1098 // There are only twelve notes. If we go outside that, we have to
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1099 // adjust the note and octave.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1100
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1101 if (note >= 12)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1102 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1103 note -= 12;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1104 octave++;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1105 }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1106 else if (note < 0)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1107 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1108 note += 12;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1109 octave--;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1110 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1111
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1112 // The calculation of frequency looks quite different from the original
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1113 // disassembly at a first glance, but when you consider that the
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1114 // largest possible value would be 0x0246 + 0xFF + 0x47 (and that's if
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1115 // baseFreq is unsigned), freq is still a 10-bit value, just as it
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1116 // should be to fit in the Ax and Bx registers.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1117 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1118 // If it were larger than that, it could have overflowed into the
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1119 // octave bits, and that could possibly have been used in some sound.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1120 // But as it is now, I can't see any way it would happen.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1121
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1122 uint16 freq = _unkTable[note] + channel.baseFreq;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1123
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1124 // When called from callback 41, the behaviour is slightly different:
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1125 // We adjust the frequency, even when channel.unk16 is 0.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1126
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1127 if (channel.unk16 || flag)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1128 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1129 const uint8 *table;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1130
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1131 if (channel.unk16 >= 0)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1132 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1133 table = _unkTables[(channel.rawNote & 0x0F) + 2];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1134 freq += table[channel.unk16];
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1135 }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1136 else
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1137 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1138 table = _unkTables[channel.rawNote & 0x0F];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1139 freq -= table[-channel.unk16];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1140 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1141 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1142
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1143 channel.regAx = freq & 0xFF;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1144 channel.regBx =
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1145 (channel.regBx & 0x20) | (octave << 2) | ((freq >> 8) & 0x03);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1146
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1147 // Keep the note on or off
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1148 writeOPL (0xA0 + _curChannel, channel.regAx);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1149 writeOPL (0xB0 + _curChannel, channel.regBx);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1150 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1151
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1152 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1153 AdlibDriver::setupInstrument (uint8 regOffset, uint8 * dataptr,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1154 Channel & channel)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1155 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1156 debugC (9, kDebugLevelSound, "setupInstrument(%d, %p, %lu)", regOffset,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1157 (const void *) dataptr, (long) (&channel - _channels));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1158 // Amplitude Modulation / Vibrato / Envelope Generator Type /
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1159 // Keyboard Scaling Rate / Modulator Frequency Multiple
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1160 writeOPL (0x20 + regOffset, *dataptr++);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1161 writeOPL (0x23 + regOffset, *dataptr++);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1162
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1163 uint8 temp = *dataptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1164
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1165 // Feedback / Algorithm
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1166
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1167 // It is very likely that _curChannel really does refer to the same
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1168 // channel as regOffset, but there's only one Cx register per channel.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1169
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1170 writeOPL (0xC0 + _curChannel, temp);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1171
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1172 // The algorithm bit. I don't pretend to understand this fully, but
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1173 // "If set to 0, operator 1 modulates operator 2. In this case,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1174 // operator 2 is the only one producing sound. If set to 1, both
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1175 // operators produce sound directly. Complex sounds are more easily
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1176 // created if the algorithm is set to 0."
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1177
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1178 channel.twoChan = temp & 1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1179
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1180 // Waveform Select
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1181 writeOPL (0xE0 + regOffset, *dataptr++);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1182 writeOPL (0xE3 + regOffset, *dataptr++);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1183
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1184 channel.opLevel1 = *dataptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1185 channel.opLevel2 = *dataptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1186
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1187 // Level Key Scaling / Total Level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1188 writeOPL (0x40 + regOffset, calculateOpLevel1 (channel));
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1189 writeOPL (0x43 + regOffset, calculateOpLevel2 (channel));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1190
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1191 // Attack Rate / Decay Rate
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1192 writeOPL (0x60 + regOffset, *dataptr++);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1193 writeOPL (0x63 + regOffset, *dataptr++);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1194
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1195 // Sustain Level / Release Rate
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1196 writeOPL (0x80 + regOffset, *dataptr++);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1197 writeOPL (0x83 + regOffset, *dataptr++);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1198 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1199
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1200 // Apart from playing the note, this function also updates the variables for
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1201 // primary effect 2.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1202
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1203 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1204 AdlibDriver::noteOn (Channel & channel)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1205 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1206 debugC (9, kDebugLevelSound, "noteOn(%lu)", (long) (&channel - _channels));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1207
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1208 // The "note on" bit is set, and the current note is played.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1209
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1210 channel.regBx |= 0x20;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1211 writeOPL (0xB0 + _curChannel, channel.regBx);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1212
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1213 int8 shift = 9 - channel.unk33;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1214 uint16 temp = channel.regAx | (channel.regBx << 8);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1215 channel.unk37 = ((temp & 0x3FF) >> shift) & 0xFF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1216 channel.unk38 = channel.unk36;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1217 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1218
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1219 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1220 AdlibDriver::adjustVolume (Channel & channel)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1221 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1222 debugC (9, kDebugLevelSound, "adjustVolume(%lu)",
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1223 (long) (&channel - _channels));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1224 // Level Key Scaling / Total Level
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1225
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1226 writeOPL (0x43 + _regOffset[_curChannel], calculateOpLevel2 (channel));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1227 if (channel.twoChan)
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1228 writeOPL (0x40 + _regOffset[_curChannel], calculateOpLevel1 (channel));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1229 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1230
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1231 // This is presumably only used for some sound effects, e.g. Malcolm blowing up
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1232 // the trees in the intro (but not the effect where he "booby-traps" the big
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1233 // tree) and turning Kallak to stone. Related functions and variables:
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1234 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1235 // update_setupPrimaryEffect1()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1236 // - Initialises unk29, unk30 and unk31
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1237 // - unk29 is not further modified
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1238 // - unk30 is not further modified, except by update_removePrimaryEffect1()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1239 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1240 // update_removePrimaryEffect1()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1241 // - Deinitialises unk30
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1242 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1243 // unk29 - determines how often the notes are played
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1244 // unk30 - modifies the frequency
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1245 // unk31 - determines how often the notes are played
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1246
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1247 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1248 AdlibDriver::primaryEffect1 (Channel & channel)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1249 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1250 debugC (9, kDebugLevelSound, "Calling primaryEffect1 (channel: %d)",
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1251 _curChannel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1252 uint8 temp = channel.unk31;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1253 channel.unk31 += channel.unk29;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1254 if (channel.unk31 >= temp)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1255 return;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1256
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1257 // Initialise unk1 to the current frequency
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1258 uint16 unk1 = ((channel.regBx & 3) << 8) | channel.regAx;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1259
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1260 // This is presumably to shift the "note on" bit so far to the left
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1261 // that it won't be affected by any of the calculations below.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1262 uint16 unk2 = ((channel.regBx & 0x20) << 8) | (channel.regBx & 0x1C);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1263
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1264 int16 unk3 = (int16) channel.unk30;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1265
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1266 if (unk3 >= 0)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1267 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1268 unk1 += unk3;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1269 if (unk1 >= 734)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1270 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1271 // The new frequency is too high. Shift it down and go
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1272 // up one octave.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1273 unk1 >>= 1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1274 if (!(unk1 & 0x3FF))
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1275 ++unk1;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1276 unk2 = (unk2 & 0xFF00) | ((unk2 + 4) & 0xFF);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1277 unk2 &= 0xFF1C;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1278 }
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1279 }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1280 else
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1281 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1282 unk1 += unk3;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1283 if (unk1 < 388)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1284 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1285 // The new frequency is too low. Shift it up and go
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1286 // down one octave.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1287 unk1 <<= 1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1288 if (!(unk1 & 0x3FF))
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1289 --unk1;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1290 unk2 = (unk2 & 0xFF00) | ((unk2 - 4) & 0xFF);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1291 unk2 &= 0xFF1C;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1292 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1293 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1294
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1295 // Make sure that the new frequency is still a 10-bit value.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1296 unk1 &= 0x3FF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1297
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1298 writeOPL (0xA0 + _curChannel, unk1 & 0xFF);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1299 channel.regAx = unk1 & 0xFF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1300
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1301 // Shift down the "note on" bit again.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1302 uint8 value = unk1 >> 8;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1303 value |= (unk2 >> 8) & 0xFF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1304 value |= unk2 & 0xFF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1305
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1306 writeOPL (0xB0 + _curChannel, value);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1307 channel.regBx = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1308 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1309
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1310 // This is presumably only used for some sound effects, e.g. Malcolm entering
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1311 // and leaving Kallak's hut. Related functions and variables:
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1312 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1313 // update_setupPrimaryEffect2()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1314 // - Initialises unk32, unk33, unk34, unk35 and unk36
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1315 // - unk32 is not further modified
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1316 // - unk33 is not further modified
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1317 // - unk34 is a countdown that gets reinitialised to unk35 on zero
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1318 // - unk35 is based on unk34 and not further modified
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1319 // - unk36 is not further modified
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1320 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1321 // noteOn()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1322 // - Plays the current note
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1323 // - Updates unk37 with a new (lower?) frequency
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1324 // - Copies unk36 to unk38. The unk38 variable is a countdown.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1325 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1326 // unk32 - determines how often the notes are played
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1327 // unk33 - modifies the frequency
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1328 // unk34 - countdown, updates frequency on zero
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1329 // unk35 - initialiser for unk34 countdown
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1330 // unk36 - initialiser for unk38 countdown
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1331 // unk37 - frequency
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1332 // unk38 - countdown, begins playing on zero
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1333 // unk41 - determines how often the notes are played
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1334 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1335 // Note that unk41 is never initialised. Not that it should matter much, but it
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1336 // is a bit sloppy.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1337
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1338 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1339 AdlibDriver::primaryEffect2 (Channel & channel)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1340 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1341 debugC (9, kDebugLevelSound, "Calling primaryEffect2 (channel: %d)",
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1342 _curChannel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1343 if (channel.unk38)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1344 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1345 --channel.unk38;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1346 return;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1347 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1348
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1349 uint8 temp = channel.unk41;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1350 channel.unk41 += channel.unk32;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1351 if (channel.unk41 < temp)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1352 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1353 uint16 unk1 = channel.unk37;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1354 if (!(--channel.unk34))
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1355 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1356 unk1 ^= 0xFFFF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1357 ++unk1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1358 channel.unk37 = unk1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1359 channel.unk34 = channel.unk35;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1360 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1361
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1362 uint16 unk2 = (channel.regAx | (channel.regBx << 8)) & 0x3FF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1363 unk2 += unk1;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1364
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1365 channel.regAx = unk2 & 0xFF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1366 channel.regBx = (channel.regBx & 0xFC) | (unk2 >> 8);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1367
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1368 // Octave / F-Number / Key-On
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1369 writeOPL (0xA0 + _curChannel, channel.regAx);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1370 writeOPL (0xB0 + _curChannel, channel.regBx);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1371 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1372 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1373
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1374 // I don't know where this is used. The same operation is performed several
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1375 // times on the current channel, using a chunk of the _soundData[] buffer for
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1376 // parameters. The parameters are used starting at the end of the chunk.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1377 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1378 // Since we use _curRegOffset to specify the final register, it's quite
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1379 // unlikely that this function is ever used to play notes. It's probably only
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1380 // used to modify the sound. Another thing that supports this idea is that it
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1381 // can be combined with any of the effects callbacks above.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1382 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1383 // Related functions and variables:
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1384 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1385 // update_setupSecondaryEffect1()
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1386 // - Initialies unk18, unk19, unk20, unk21, unk22 and offset
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1387 // - unk19 is not further modified
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1388 // - unk20 is not further modified
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1389 // - unk22 is not further modified
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1390 // - offset is not further modified
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1391 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1392 // unk18 - determines how often the operation is performed
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1393 // unk19 - determines how often the operation is performed
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1394 // unk20 - the start index into the data chunk
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1395 // unk21 - the current index into the data chunk
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1396 // unk22 - the operation to perform
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1397 // offset - the offset to the data chunk
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1398
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1399 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1400 AdlibDriver::secondaryEffect1 (Channel & channel)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1401 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1402 debugC (9, kDebugLevelSound, "Calling secondaryEffect1 (channel: %d)",
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1403 _curChannel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1404 uint8 temp = channel.unk18;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1405 channel.unk18 += channel.unk19;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1406 if (channel.unk18 < temp)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1407 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1408 if (--channel.unk21 < 0)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1409 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1410 channel.unk21 = channel.unk20;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1411 }
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1412 writeOPL (channel.unk22 + _curRegOffset,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1413 _soundData[channel.offset + channel.unk21]);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1414 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1415 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1416
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1417 uint8
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1418 AdlibDriver::calculateOpLevel1 (Channel & channel)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1419 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1420 int8 value = channel.opLevel1 & 0x3F;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1421
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1422 if (channel.twoChan)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1423 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1424 value += channel.opExtraLevel1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1425 value += channel.opExtraLevel2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1426 value += channel.opExtraLevel3;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1427 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1428
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1429 // Preserve the scaling level bits from opLevel1
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1430
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1431 return checkValue (value) | (channel.opLevel1 & 0xC0);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1432 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1433
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1434 uint8
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1435 AdlibDriver::calculateOpLevel2 (Channel & channel)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1436 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1437 int8 value = channel.opLevel2 & 0x3F;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1438
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1439 value += channel.opExtraLevel1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1440 value += channel.opExtraLevel2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1441 value += channel.opExtraLevel3;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1442
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1443 // Preserve the scaling level bits from opLevel2
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1444
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1445 return checkValue (value) | (channel.opLevel2 & 0xC0);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1446 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1447
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1448 // parser opcodes
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1449
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1450 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1451 AdlibDriver::update_setRepeat (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1452 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1453 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1454 channel.repeatCounter = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1455 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1456 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1457
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1458 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1459 AdlibDriver::update_checkRepeat (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1460 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1461 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1462 ++dataptr;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1463 if (--channel.repeatCounter)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1464 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1465 int16 add = READ_LE_UINT16 (dataptr - 2);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1466 dataptr += add;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1467 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1468 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1469 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1470
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1471 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1472 AdlibDriver::update_setupProgram (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1473 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1474 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1475 if (value == 0xFF)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1476 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1477
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1478 uint8 *ptr = getProgram (value);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1479 uint8 chan = *ptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1480 uint8 priority = *ptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1481
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1482 Channel & channel2 = _channels[chan];
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1483
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1484 if (priority >= channel2.priority)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1485 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1486 _flagTrigger = 1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1487 _flags |= 8;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1488 initChannel (channel2);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1489 channel2.priority = priority;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1490 channel2.dataptr = ptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1491 channel2.tempo = 0xFF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1492 channel2.position = 0xFF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1493 channel2.duration = 1;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1494 unkOutput2 (chan);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1495 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1496
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1497 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1498 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1499
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1500 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1501 AdlibDriver::update_setNoteSpacing (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1502 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1503 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1504 channel.spacing1 = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1505 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1506 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1507
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1508 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1509 AdlibDriver::update_jump (uint8 * &dataptr, Channel & channel, uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1510 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1511 --dataptr;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1512 int16 add = READ_LE_UINT16 (dataptr);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1513 dataptr += 2;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1514 dataptr += add;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1515 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1516 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1517
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1518 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1519 AdlibDriver::update_jumpToSubroutine (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1520 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1521 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1522 --dataptr;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1523 int16 add = READ_LE_UINT16 (dataptr);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1524 dataptr += 2;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1525 channel.dataptrStack[channel.dataptrStackPos++] = dataptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1526 dataptr += add;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1527 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1528 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1529
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1530 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1531 AdlibDriver::update_returnFromSubroutine (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1532 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1533 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1534 dataptr = channel.dataptrStack[--channel.dataptrStackPos];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1535 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1536 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1537
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1538 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1539 AdlibDriver::update_setBaseOctave (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1540 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1541 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1542 channel.baseOctave = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1543 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1544 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1545
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1546 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1547 AdlibDriver::update_stopChannel (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1548 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1549 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1550 channel.priority = 0;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1551 if (_curChannel != 9)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1552 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1553 noteOff (channel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1554 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1555 dataptr = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1556 return 2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1557 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1558
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1559 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1560 AdlibDriver::update_playRest (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1561 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1562 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1563 setupDuration (value, channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1564 noteOff (channel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1565 return (value != 0);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1566 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1567
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1568 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1569 AdlibDriver::update_writeAdlib (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1570 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1571 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1572 writeOPL (value, *dataptr++);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1573 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1574 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1575
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1576 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1577 AdlibDriver::update_setupNoteAndDuration (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1578 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1579 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1580 setupNote (value, channel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1581 value = *dataptr++;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1582 setupDuration (value, channel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1583 return (value != 0);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1584 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1585
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1586 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1587 AdlibDriver::update_setBaseNote (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1588 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1589 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1590 channel.baseNote = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1591 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1592 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1593
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1594 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1595 AdlibDriver::update_setupSecondaryEffect1 (uint8 * &dataptr,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1596 Channel & channel, uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1597 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1598 channel.unk18 = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1599 channel.unk19 = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1600 channel.unk20 = channel.unk21 = *dataptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1601 channel.unk22 = *dataptr++;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1602 channel.offset = READ_LE_UINT16 (dataptr);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1603 dataptr += 2;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1604 channel.secondaryEffect = &AdlibDriver::secondaryEffect1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1605 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1606 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1607
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1608 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1609 AdlibDriver::update_stopOtherChannel (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1610 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1611 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1612 Channel & channel2 = _channels[value];
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1613 channel2.duration = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1614 channel2.priority = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1615 channel2.dataptr = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1616 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1617 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1618
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1619 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1620 AdlibDriver::update_waitForEndOfProgram (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1621 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1622 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1623 uint8 *ptr = getProgram (value);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1624 uint8 chan = *ptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1625
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1626 if (!_channels[chan].dataptr)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1627 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1628 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1629 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1630
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1631 dataptr -= 2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1632 return 2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1633 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1634
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1635 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1636 AdlibDriver::update_setupInstrument (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1637 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1638 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1639 setupInstrument (_curRegOffset, getInstrument (value), channel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1640 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1641 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1642
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1643 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1644 AdlibDriver::update_setupPrimaryEffect1 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1645 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1646 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1647 channel.unk29 = value;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1648 channel.unk30 = READ_BE_UINT16 (dataptr);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1649 dataptr += 2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1650 channel.primaryEffect = &AdlibDriver::primaryEffect1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1651 channel.unk31 = 0xFF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1652 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1653 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1654
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1655 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1656 AdlibDriver::update_removePrimaryEffect1 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1657 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1658 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1659 --dataptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1660 channel.primaryEffect = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1661 channel.unk30 = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1662 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1663 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1664
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1665 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1666 AdlibDriver::update_setBaseFreq (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1667 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1668 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1669 channel.baseFreq = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1670 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1671 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1672
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1673 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1674 AdlibDriver::update_setupPrimaryEffect2 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1675 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1676 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1677 channel.unk32 = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1678 channel.unk33 = *dataptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1679 uint8 temp = *dataptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1680 channel.unk34 = temp + 1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1681 channel.unk35 = temp << 1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1682 channel.unk36 = *dataptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1683 channel.primaryEffect = &AdlibDriver::primaryEffect2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1684 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1685 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1686
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1687 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1688 AdlibDriver::update_setPriority (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1689 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1690 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1691 channel.priority = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1692 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1693 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1694
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1695 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1696 AdlibDriver::updateCallback23 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1697 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1698 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1699 value >>= 1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1700 _unkValue1 = _unkValue2 = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1701 _unkValue3 = 0xFF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1702 _unkValue4 = _unkValue5 = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1703 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1704 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1705
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1706 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1707 AdlibDriver::updateCallback24 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1708 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1709 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1710 if (_unkValue5)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1711 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1712 if (_unkValue4 & value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1713 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1714 _unkValue5 = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1715 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1716 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1717 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1718
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1719 if (!(value & _unkValue4))
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1720 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1721 ++_unkValue5;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1722 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1723
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1724 dataptr -= 2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1725 channel.duration = 1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1726 return 2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1727 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1728
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1729 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1730 AdlibDriver::update_setExtraLevel1 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1731 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1732 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1733 channel.opExtraLevel1 = value;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1734 adjustVolume (channel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1735 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1736 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1737
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1738 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1739 AdlibDriver::update_setupDuration (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1740 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1741 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1742 setupDuration (value, channel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1743 return (value != 0);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1744 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1745
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1746 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1747 AdlibDriver::update_playNote (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1748 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1749 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1750 setupDuration (value, channel);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1751 noteOn (channel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1752 return (value != 0);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1753 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1754
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1755 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1756 AdlibDriver::update_setFractionalNoteSpacing (uint8 * &dataptr,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1757 Channel & channel, uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1758 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1759 channel.fractionalSpacing = value & 7;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1760 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1761 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1762
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1763 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1764 AdlibDriver::update_setTempo (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1765 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1766 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1767 _tempo = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1768 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1769 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1770
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1771 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1772 AdlibDriver::update_removeSecondaryEffect1 (uint8 * &dataptr,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1773 Channel & channel, uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1774 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1775 --dataptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1776 channel.secondaryEffect = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1777 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1778 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1779
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1780 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1781 AdlibDriver::update_setChannelTempo (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1782 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1783 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1784 channel.tempo = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1785 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1786 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1787
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1788 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1789 AdlibDriver::update_setExtraLevel3 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1790 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1791 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1792 channel.opExtraLevel3 = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1793 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1794 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1795
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1796 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1797 AdlibDriver::update_setExtraLevel2 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1798 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1799 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1800 int channelBackUp = _curChannel;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1801
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1802 _curChannel = value;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1803 Channel & channel2 = _channels[value];
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1804 channel2.opExtraLevel2 = *dataptr++;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1805 adjustVolume (channel2);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1806
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1807 _curChannel = channelBackUp;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1808 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1809 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1810
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1811 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1812 AdlibDriver::update_changeExtraLevel2 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1813 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1814 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1815 int channelBackUp = _curChannel;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1816
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1817 _curChannel = value;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1818 Channel & channel2 = _channels[value];
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1819 channel2.opExtraLevel2 += *dataptr++;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1820 adjustVolume (channel2);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1821
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1822 _curChannel = channelBackUp;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1823 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1824 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1825
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1826 // Apart from initialising to zero, these two functions are the only ones that
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1827 // modify _vibratoAndAMDepthBits.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1828
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1829 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1830 AdlibDriver::update_setAMDepth (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1831 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1832 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1833 if (value & 1)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1834 _vibratoAndAMDepthBits |= 0x80;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1835 else
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1836 _vibratoAndAMDepthBits &= 0x7F;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1837
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1838 writeOPL (0xBD, _vibratoAndAMDepthBits);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1839 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1840 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1841
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1842 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1843 AdlibDriver::update_setVibratoDepth (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1844 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1845 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1846 if (value & 1)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1847 _vibratoAndAMDepthBits |= 0x40;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1848 else
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1849 _vibratoAndAMDepthBits &= 0xBF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1850
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1851 writeOPL (0xBD, _vibratoAndAMDepthBits);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1852 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1853 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1854
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1855 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1856 AdlibDriver::update_changeExtraLevel1 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1857 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1858 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1859 channel.opExtraLevel1 += value;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1860 adjustVolume (channel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1861 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1862 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1863
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1864 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1865 AdlibDriver::updateCallback38 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1866 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1867 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1868 int channelBackUp = _curChannel;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1869
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1870 _curChannel = value;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1871 Channel & channel2 = _channels[value];
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1872 channel2.duration = channel2.priority = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1873 channel2.dataptr = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1874 channel2.opExtraLevel2 = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1875
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1876 if (value != 9)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1877 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1878 uint8 outValue = _regOffset[value];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1879
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1880 // Feedback strength / Connection type
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1881 writeOPL (0xC0 + _curChannel, 0x00);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1882
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1883 // Key scaling level / Operator output level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1884 writeOPL (0x43 + outValue, 0x3F);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1885
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1886 // Sustain Level / Release Rate
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1887 writeOPL (0x83 + outValue, 0xFF);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1888
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1889 // Key On / Octave / Frequency
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1890 writeOPL (0xB0 + _curChannel, 0x00);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1891 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1892
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1893 _curChannel = channelBackUp;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1894 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1895 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1896
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1897 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1898 AdlibDriver::updateCallback39 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1899 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1900 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1901 uint16 unk = *dataptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1902 unk |= value << 8;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1903 unk &= getRandomNr ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1904
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1905 uint16 unk2 = ((channel.regBx & 0x1F) << 8) | channel.regAx;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1906 unk2 += unk;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1907 unk2 |= ((channel.regBx & 0x20) << 8);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1908
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1909 // Frequency
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1910 writeOPL (0xA0 + _curChannel, unk2 & 0xFF);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1911
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1912 // Key On / Octave / Frequency
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1913 writeOPL (0xB0 + _curChannel, (unk2 & 0xFF00) >> 8);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1914
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1915 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1916 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1917
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1918 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1919 AdlibDriver::update_removePrimaryEffect2 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1920 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1921 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1922 --dataptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1923 channel.primaryEffect = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1924 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1925 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1926
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1927 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1928 AdlibDriver::updateCallback41 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1929 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1930 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1931 channel.unk16 = value;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1932 setupNote (channel.rawNote, channel, true);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1933 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1934 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1935
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1936 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1937 AdlibDriver::update_resetToGlobalTempo (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1938 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1939 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1940 --dataptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1941 channel.tempo = _tempo;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1942 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1943 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1944
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1945 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1946 AdlibDriver::update_nop1 (uint8 * &dataptr, Channel & channel, uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1947 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1948 --dataptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1949 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1950 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1951
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1952 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1953 AdlibDriver::update_setDurationRandomness (uint8 * &dataptr,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1954 Channel & channel, uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1955 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1956 channel.durationRandomness = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1957 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1958 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1959
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1960 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1961 AdlibDriver::update_changeChannelTempo (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1962 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1963 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1964 int tempo = channel.tempo + (int8) value;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1965
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1966 if (tempo <= 0)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1967 tempo = 1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1968 else if (tempo > 255)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1969 tempo = 255;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1970
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1971 channel.tempo = tempo;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1972 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1973 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1974
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1975 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1976 AdlibDriver::updateCallback46 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1977 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1978 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1979 uint8 entry = *dataptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1980 _tablePtr1 = _unkTable2[entry++];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1981 _tablePtr2 = _unkTable2[entry];
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1982 if (value == 2)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1983 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1984 // Frequency
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1985 writeOPL (0xA0, _tablePtr2[0]);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1986 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1987 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1988 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1989
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1990 // TODO: This is really the same as update_nop1(), so they should be combined
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1991 // into one single update_nop().
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1992
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1993 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1994 AdlibDriver::update_nop2 (uint8 * &dataptr, Channel & channel, uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
1995 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1996 --dataptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1997 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1998 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
1999
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2000 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2001 AdlibDriver::update_setupRhythmSection (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2002 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2003 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2004 int channelBackUp = _curChannel;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2005 int regOffsetBackUp = _curRegOffset;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2006
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2007 _curChannel = 6;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2008 _curRegOffset = _regOffset[6];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2009
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2010 setupInstrument (_curRegOffset, getInstrument (value), channel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2011 _unkValue6 = channel.opLevel2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2012
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2013 _curChannel = 7;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2014 _curRegOffset = _regOffset[7];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2015
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2016 setupInstrument (_curRegOffset, getInstrument (*dataptr++), channel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2017 _unkValue7 = channel.opLevel1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2018 _unkValue8 = channel.opLevel2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2019
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2020 _curChannel = 8;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2021 _curRegOffset = _regOffset[8];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2022
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2023 setupInstrument (_curRegOffset, getInstrument (*dataptr++), channel);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2024 _unkValue9 = channel.opLevel1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2025 _unkValue10 = channel.opLevel2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2026
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2027 // Octave / F-Number / Key-On for channels 6, 7 and 8
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2028
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2029 _channels[6].regBx = *dataptr++ & 0x2F;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2030 writeOPL (0xB6, _channels[6].regBx);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2031 writeOPL (0xA6, *dataptr++);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2032
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2033 _channels[7].regBx = *dataptr++ & 0x2F;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2034 writeOPL (0xB7, _channels[7].regBx);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2035 writeOPL (0xA7, *dataptr++);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2036
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2037 _channels[8].regBx = *dataptr++ & 0x2F;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2038 writeOPL (0xB8, _channels[8].regBx);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2039 writeOPL (0xA8, *dataptr++);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2040
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2041 _rhythmSectionBits = 0x20;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2042
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2043 _curRegOffset = regOffsetBackUp;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2044 _curChannel = channelBackUp;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2045 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2046 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2047
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2048 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2049 AdlibDriver::update_playRhythmSection (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2050 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2051 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2052 // Any instrument that we want to play, and which was already playing,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2053 // is temporarily keyed off. Instruments that were off already, or
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2054 // which we don't want to play, retain their old on/off status. This is
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2055 // probably so that the instrument's envelope is played from its
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2056 // beginning again...
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2057
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2058 writeOPL (0xBD, (_rhythmSectionBits & ~(value & 0x1F)) | 0x20);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2059
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2060 // ...but since we only set the rhythm instrument bits, and never clear
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2061 // them (until the entire rhythm section is disabled), I'm not sure how
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2062 // useful the cleverness above is. We could perhaps simply turn off all
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2063 // the rhythm instruments instead.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2064
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2065 _rhythmSectionBits |= value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2066
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2067 writeOPL (0xBD, _vibratoAndAMDepthBits | 0x20 | _rhythmSectionBits);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2068 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2069 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2070
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2071 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2072 AdlibDriver::update_removeRhythmSection (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2073 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2074 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2075 --dataptr;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2076 _rhythmSectionBits = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2077
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2078 // All the rhythm bits are cleared. The AM and Vibrato depth bits
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2079 // remain unchanged.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2080
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2081 writeOPL (0xBD, _vibratoAndAMDepthBits);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2082 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2083 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2084
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2085 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2086 AdlibDriver::updateCallback51 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2087 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2088 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2089 uint8 value2 = *dataptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2090
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2091 if (value & 1)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2092 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2093 _unkValue12 = value2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2094
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2095 // Channel 7, op1: Level Key Scaling / Total Level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2096 writeOPL (0x51,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2097 checkValue (value2 + _unkValue7 + _unkValue11 + _unkValue12));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2098 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2099
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2100 if (value & 2)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2101 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2102 _unkValue14 = value2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2103
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2104 // Channel 8, op2: Level Key Scaling / Total Level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2105 writeOPL (0x55,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2106 checkValue (value2 + _unkValue10 + _unkValue13 + _unkValue14));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2107 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2108
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2109 if (value & 4)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2110 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2111 _unkValue15 = value2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2112
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2113 // Channel 8, op1: Level Key Scaling / Total Level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2114 writeOPL (0x52,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2115 checkValue (value2 + _unkValue9 + _unkValue16 + _unkValue15));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2116 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2117
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2118 if (value & 8)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2119 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2120 _unkValue18 = value2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2121
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2122 // Channel 7, op2: Level Key Scaling / Total Level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2123 writeOPL (0x54,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2124 checkValue (value2 + _unkValue8 + _unkValue17 + _unkValue18));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2125 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2126
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2127 if (value & 16)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2128 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2129 _unkValue20 = value2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2130
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2131 // Channel 6, op2: Level Key Scaling / Total Level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2132 writeOPL (0x53,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2133 checkValue (value2 + _unkValue6 + _unkValue19 + _unkValue20));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2134 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2135
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2136 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2137 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2138
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2139 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2140 AdlibDriver::updateCallback52 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2141 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2142 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2143 uint8 value2 = *dataptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2144
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2145 if (value & 1)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2146 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2147 _unkValue11 =
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2148 checkValue (value2 + _unkValue7 + _unkValue11 + _unkValue12);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2149
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2150 // Channel 7, op1: Level Key Scaling / Total Level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2151 writeOPL (0x51, _unkValue11);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2152 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2153
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2154 if (value & 2)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2155 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2156 _unkValue13 =
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2157 checkValue (value2 + _unkValue10 + _unkValue13 + _unkValue14);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2158
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2159 // Channel 8, op2: Level Key Scaling / Total Level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2160 writeOPL (0x55, _unkValue13);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2161 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2162
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2163 if (value & 4)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2164 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2165 _unkValue16 =
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2166 checkValue (value2 + _unkValue9 + _unkValue16 + _unkValue15);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2167
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2168 // Channel 8, op1: Level Key Scaling / Total Level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2169 writeOPL (0x52, _unkValue16);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2170 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2171
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2172 if (value & 8)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2173 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2174 _unkValue17 =
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2175 checkValue (value2 + _unkValue8 + _unkValue17 + _unkValue18);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2176
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2177 // Channel 7, op2: Level Key Scaling / Total Level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2178 writeOPL (0x54, _unkValue17);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2179 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2180
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2181 if (value & 16)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2182 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2183 _unkValue19 =
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2184 checkValue (value2 + _unkValue6 + _unkValue19 + _unkValue20);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2185
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2186 // Channel 6, op2: Level Key Scaling / Total Level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2187 writeOPL (0x53, _unkValue19);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2188 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2189
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2190 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2191 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2192
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2193 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2194 AdlibDriver::updateCallback53 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2195 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2196 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2197 uint8 value2 = *dataptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2198
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2199 if (value & 1)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2200 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2201 _unkValue11 = value2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2202
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2203 // Channel 7, op1: Level Key Scaling / Total Level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2204 writeOPL (0x51, checkValue (value2 + _unkValue7 + _unkValue12));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2205 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2206
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2207 if (value & 2)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2208 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2209 _unkValue13 = value2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2210
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2211 // Channel 8, op2: Level Key Scaling / Total Level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2212 writeOPL (0x55, checkValue (value2 + _unkValue10 + _unkValue14));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2213 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2214
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2215 if (value & 4)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2216 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2217 _unkValue16 = value2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2218
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2219 // Channel 8, op1: Level Key Scaling / Total Level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2220 writeOPL (0x52, checkValue (value2 + _unkValue9 + _unkValue15));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2221 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2222
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2223 if (value & 8)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2224 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2225 _unkValue17 = value2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2226
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2227 // Channel 7, op2: Level Key Scaling / Total Level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2228 writeOPL (0x54, checkValue (value2 + _unkValue8 + _unkValue18));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2229 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2230
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2231 if (value & 16)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2232 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2233 _unkValue19 = value2;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2234
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2235 // Channel 6, op2: Level Key Scaling / Total Level
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2236 writeOPL (0x53, checkValue (value2 + _unkValue6 + _unkValue20));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2237 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2238
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2239 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2240 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2241
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2242 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2243 AdlibDriver::update_setSoundTrigger (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2244 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2245 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2246 _soundTrigger = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2247 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2248 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2249
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2250 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2251 AdlibDriver::update_setTempoReset (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2252 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2253 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2254 channel.tempoReset = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2255 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2256 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2257
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2258 int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2259 AdlibDriver::updateCallback56 (uint8 * &dataptr, Channel & channel,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2260 uint8 value)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2261 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2262 channel.unk39 = value;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2263 channel.unk40 = *dataptr++;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2264 return 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2265 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2266
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2267 // static res
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2268
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2269 #define COMMAND(x) { &AdlibDriver::x, #x }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2270
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2271 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2272 AdlibDriver::setupOpcodeList ()
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2273 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2274 static const OpcodeEntry opcodeList[] = {
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2275 COMMAND (snd_ret0x100),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2276 COMMAND (snd_ret0x1983),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2277 COMMAND (snd_initDriver),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2278 COMMAND (snd_deinitDriver),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2279 COMMAND (snd_setSoundData),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2280 COMMAND (snd_unkOpcode1),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2281 COMMAND (snd_startSong),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2282 COMMAND (snd_unkOpcode2),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2283 COMMAND (snd_unkOpcode3),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2284 COMMAND (snd_readByte),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2285 COMMAND (snd_writeByte),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2286 COMMAND (snd_getSoundTrigger),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2287 COMMAND (snd_unkOpcode4),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2288 COMMAND (snd_dummy),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2289 COMMAND (snd_getNullvar4),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2290 COMMAND (snd_setNullvar3),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2291 COMMAND (snd_setFlag),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2292 COMMAND (snd_clearFlag)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2293 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2294
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2295 _opcodeList = opcodeList;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2296 _opcodesEntries = ARRAYSIZE (opcodeList);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2297 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2298
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2299 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2300 AdlibDriver::setupParserOpcodeTable ()
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2301 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2302 static const ParserOpcode parserOpcodeTable[] = {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2303 // 0
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2304 COMMAND (update_setRepeat),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2305 COMMAND (update_checkRepeat),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2306 COMMAND (update_setupProgram),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2307 COMMAND (update_setNoteSpacing),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2308
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2309 // 4
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2310 COMMAND (update_jump),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2311 COMMAND (update_jumpToSubroutine),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2312 COMMAND (update_returnFromSubroutine),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2313 COMMAND (update_setBaseOctave),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2314
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2315 // 8
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2316 COMMAND (update_stopChannel),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2317 COMMAND (update_playRest),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2318 COMMAND (update_writeAdlib),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2319 COMMAND (update_setupNoteAndDuration),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2320
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2321 // 12
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2322 COMMAND (update_setBaseNote),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2323 COMMAND (update_setupSecondaryEffect1),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2324 COMMAND (update_stopOtherChannel),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2325 COMMAND (update_waitForEndOfProgram),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2326
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2327 // 16
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2328 COMMAND (update_setupInstrument),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2329 COMMAND (update_setupPrimaryEffect1),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2330 COMMAND (update_removePrimaryEffect1),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2331 COMMAND (update_setBaseFreq),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2332
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2333 // 20
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2334 COMMAND (update_stopChannel),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2335 COMMAND (update_setupPrimaryEffect2),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2336 COMMAND (update_stopChannel),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2337 COMMAND (update_stopChannel),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2338
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2339 // 24
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2340 COMMAND (update_stopChannel),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2341 COMMAND (update_stopChannel),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2342 COMMAND (update_setPriority),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2343 COMMAND (update_stopChannel),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2344
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2345 // 28
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2346 COMMAND (updateCallback23),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2347 COMMAND (updateCallback24),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2348 COMMAND (update_setExtraLevel1),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2349 COMMAND (update_stopChannel),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2350
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2351 // 32
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2352 COMMAND (update_setupDuration),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2353 COMMAND (update_playNote),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2354 COMMAND (update_stopChannel),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2355 COMMAND (update_stopChannel),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2356
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2357 // 36
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2358 COMMAND (update_setFractionalNoteSpacing),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2359 COMMAND (update_stopChannel),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2360 COMMAND (update_setTempo),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2361 COMMAND (update_removeSecondaryEffect1),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2362
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2363 // 40
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2364 COMMAND (update_stopChannel),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2365 COMMAND (update_setChannelTempo),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2366 COMMAND (update_stopChannel),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2367 COMMAND (update_setExtraLevel3),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2368
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2369 // 44
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2370 COMMAND (update_setExtraLevel2),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2371 COMMAND (update_changeExtraLevel2),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2372 COMMAND (update_setAMDepth),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2373 COMMAND (update_setVibratoDepth),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2374
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2375 // 48
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2376 COMMAND (update_changeExtraLevel1),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2377 COMMAND (update_stopChannel),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2378 COMMAND (update_stopChannel),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2379 COMMAND (updateCallback38),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2380
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2381 // 52
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2382 COMMAND (update_stopChannel),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2383 COMMAND (updateCallback39),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2384 COMMAND (update_removePrimaryEffect2),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2385 COMMAND (update_stopChannel),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2386
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2387 // 56
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2388 COMMAND (update_stopChannel),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2389 COMMAND (updateCallback41),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2390 COMMAND (update_resetToGlobalTempo),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2391 COMMAND (update_nop1),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2392
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2393 // 60
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2394 COMMAND (update_setDurationRandomness),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2395 COMMAND (update_changeChannelTempo),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2396 COMMAND (update_stopChannel),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2397 COMMAND (updateCallback46),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2398
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2399 // 64
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2400 COMMAND (update_nop2),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2401 COMMAND (update_setupRhythmSection),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2402 COMMAND (update_playRhythmSection),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2403 COMMAND (update_removeRhythmSection),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2404
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2405 // 68
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2406 COMMAND (updateCallback51),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2407 COMMAND (updateCallback52),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2408 COMMAND (updateCallback53),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2409 COMMAND (update_setSoundTrigger),
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2410
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2411 // 72
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2412 COMMAND (update_setTempoReset),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2413 COMMAND (updateCallback56),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2414 COMMAND (update_stopChannel)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2415 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2416
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2417 _parserOpcodeTable = parserOpcodeTable;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2418 _parserOpcodeTableSize = ARRAYSIZE (parserOpcodeTable);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2419 }
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2420
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2421 #undef COMMAND
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2422
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2423 // This table holds the register offset for operator 1 for each of the nine
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2424 // channels. To get the register offset for operator 2, simply add 3.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2425
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2426 const uint8
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2427 AdlibDriver::_regOffset[] = {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2428 0x00, 0x01, 0x02, 0x08, 0x09, 0x0A, 0x10, 0x11,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2429 0x12
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2430 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2431
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2432 // Given the size of this table, and the range of its values, it's probably the
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2433 // F-Numbers (10 bits) for the notes of the 12-tone scale. However, it does not
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2434 // match the table in the Adlib documentation I've seen.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2435
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2436 const uint16
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2437 AdlibDriver::_unkTable[] = {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2438 0x0134, 0x0147, 0x015A, 0x016F, 0x0184, 0x019C, 0x01B4, 0x01CE, 0x01E9,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2439 0x0207, 0x0225, 0x0246
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2440 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2441
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2442 // These tables are currently only used by updateCallback46(), which only ever
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2443 // uses the first element of one of the sub-tables.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2444
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2445 const uint8 *
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2446 AdlibDriver::_unkTable2[] = {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2447 AdlibDriver::_unkTable2_1,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2448 AdlibDriver::_unkTable2_2,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2449 AdlibDriver::_unkTable2_1,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2450 AdlibDriver::_unkTable2_2,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2451 AdlibDriver::_unkTable2_3,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2452 AdlibDriver::_unkTable2_2
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2453 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2454
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2455 const uint8
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2456 AdlibDriver::_unkTable2_1[] = {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2457 0x50, 0x50, 0x4F, 0x4F, 0x4E, 0x4E, 0x4D, 0x4D,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2458 0x4C, 0x4C, 0x4B, 0x4B, 0x4A, 0x4A, 0x49, 0x49,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2459 0x48, 0x48, 0x47, 0x47, 0x46, 0x46, 0x45, 0x45,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2460 0x44, 0x44, 0x43, 0x43, 0x42, 0x42, 0x41, 0x41,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2461 0x40, 0x40, 0x3F, 0x3F, 0x3E, 0x3E, 0x3D, 0x3D,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2462 0x3C, 0x3C, 0x3B, 0x3B, 0x3A, 0x3A, 0x39, 0x39,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2463 0x38, 0x38, 0x37, 0x37, 0x36, 0x36, 0x35, 0x35,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2464 0x34, 0x34, 0x33, 0x33, 0x32, 0x32, 0x31, 0x31,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2465 0x30, 0x30, 0x2F, 0x2F, 0x2E, 0x2E, 0x2D, 0x2D,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2466 0x2C, 0x2C, 0x2B, 0x2B, 0x2A, 0x2A, 0x29, 0x29,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2467 0x28, 0x28, 0x27, 0x27, 0x26, 0x26, 0x25, 0x25,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2468 0x24, 0x24, 0x23, 0x23, 0x22, 0x22, 0x21, 0x21,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2469 0x20, 0x20, 0x1F, 0x1F, 0x1E, 0x1E, 0x1D, 0x1D,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2470 0x1C, 0x1C, 0x1B, 0x1B, 0x1A, 0x1A, 0x19, 0x19,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2471 0x18, 0x18, 0x17, 0x17, 0x16, 0x16, 0x15, 0x15,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2472 0x14, 0x14, 0x13, 0x13, 0x12, 0x12, 0x11, 0x11,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2473 0x10, 0x10
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2474 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2475
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2476 // no don't ask me WHY this table exsits!
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2477 const uint8
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2478 AdlibDriver::_unkTable2_2[] = {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2479 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2480 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2481 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2482 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2483 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2484 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2485 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2486 0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2487 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2488 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2489 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2490 0x58, 0x59, 0x5A, 0x5B, 0x5C, 0x5D, 0x5E, 0x6F,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2491 0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2492 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2493 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2494 0x78, 0x79, 0x7A, 0x7B, 0x7C, 0x7D, 0x7E, 0x7F
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2495 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2496
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2497 const uint8
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2498 AdlibDriver::_unkTable2_3[] = {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2499 0x40, 0x40, 0x40, 0x3F, 0x3F, 0x3F, 0x3E, 0x3E,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2500 0x3E, 0x3D, 0x3D, 0x3D, 0x3C, 0x3C, 0x3C, 0x3B,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2501 0x3B, 0x3B, 0x3A, 0x3A, 0x3A, 0x39, 0x39, 0x39,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2502 0x38, 0x38, 0x38, 0x37, 0x37, 0x37, 0x36, 0x36,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2503 0x36, 0x35, 0x35, 0x35, 0x34, 0x34, 0x34, 0x33,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2504 0x33, 0x33, 0x32, 0x32, 0x32, 0x31, 0x31, 0x31,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2505 0x30, 0x30, 0x30, 0x2F, 0x2F, 0x2F, 0x2E, 0x2E,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2506 0x2E, 0x2D, 0x2D, 0x2D, 0x2C, 0x2C, 0x2C, 0x2B,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2507 0x2B, 0x2B, 0x2A, 0x2A, 0x2A, 0x29, 0x29, 0x29,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2508 0x28, 0x28, 0x28, 0x27, 0x27, 0x27, 0x26, 0x26,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2509 0x26, 0x25, 0x25, 0x25, 0x24, 0x24, 0x24, 0x23,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2510 0x23, 0x23, 0x22, 0x22, 0x22, 0x21, 0x21, 0x21,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2511 0x20, 0x20, 0x20, 0x1F, 0x1F, 0x1F, 0x1E, 0x1E,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2512 0x1E, 0x1D, 0x1D, 0x1D, 0x1C, 0x1C, 0x1C, 0x1B,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2513 0x1B, 0x1B, 0x1A, 0x1A, 0x1A, 0x19, 0x19, 0x19,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2514 0x18, 0x18, 0x18, 0x17, 0x17, 0x17, 0x16, 0x16,
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2515 0x16, 0x15
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2516 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2517
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2518 // This table is used to modify the frequency of the notes, depending on the
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2519 // note value and unk16. In theory, we could very well try to access memory
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2520 // outside this table, but in reality that probably won't happen.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2521 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2522 // This could be some sort of pitch bend, but I have yet to see it used for
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2523 // anything so it's hard to say.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2524
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2525 const uint8
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2526 AdlibDriver::_unkTables[][32] = {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2527 // 0
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2528 {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x08,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2529 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2530 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x19,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2531 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21},
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2532 // 1
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2533 {0x00, 0x01, 0x02, 0x03, 0x04, 0x06, 0x07, 0x09,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2534 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2535 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x1A,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2536 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x22, 0x24},
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2537 // 2
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2538 {0x00, 0x01, 0x02, 0x03, 0x04, 0x06, 0x08, 0x09,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2539 0x0A, 0x0C, 0x0D, 0x0E, 0x0F, 0x11, 0x12, 0x13,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2540 0x14, 0x15, 0x16, 0x17, 0x19, 0x1A, 0x1C, 0x1D,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2541 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x24, 0x25, 0x26},
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2542 // 3
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2543 {0x00, 0x01, 0x02, 0x03, 0x04, 0x06, 0x08, 0x0A,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2544 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x11, 0x12, 0x13,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2545 0x14, 0x15, 0x16, 0x17, 0x18, 0x1A, 0x1C, 0x1D,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2546 0x1E, 0x1F, 0x20, 0x21, 0x23, 0x25, 0x27, 0x28},
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2547 // 4
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2548 {0x00, 0x01, 0x02, 0x03, 0x04, 0x06, 0x08, 0x0A,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2549 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x11, 0x13, 0x15,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2550 0x16, 0x17, 0x18, 0x19, 0x1B, 0x1D, 0x1F, 0x20,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2551 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x28, 0x2A},
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2552 // 5
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2553 {0x00, 0x01, 0x02, 0x03, 0x05, 0x07, 0x09, 0x0B,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2554 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x13, 0x15,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2555 0x16, 0x17, 0x18, 0x19, 0x1B, 0x1D, 0x1F, 0x20,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2556 0x21, 0x22, 0x23, 0x25, 0x27, 0x29, 0x2B, 0x2D},
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2557 // 6
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2558 {0x00, 0x01, 0x02, 0x03, 0x05, 0x07, 0x09, 0x0B,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2559 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x13, 0x15,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2560 0x16, 0x17, 0x18, 0x1A, 0x1C, 0x1E, 0x21, 0x24,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2561 0x25, 0x26, 0x27, 0x29, 0x2B, 0x2D, 0x2F, 0x30},
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2562 // 7
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2563 {0x00, 0x01, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2564 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x13, 0x15, 0x18,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2565 0x19, 0x1A, 0x1C, 0x1D, 0x1F, 0x21, 0x23, 0x25,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2566 0x26, 0x27, 0x29, 0x2B, 0x2D, 0x2F, 0x30, 0x32},
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2567 // 8
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2568 {0x00, 0x01, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0D,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2569 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x14, 0x17, 0x1A,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2570 0x19, 0x1A, 0x1C, 0x1E, 0x20, 0x22, 0x25, 0x28,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2571 0x29, 0x2A, 0x2B, 0x2D, 0x2F, 0x31, 0x33, 0x35},
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2572 // 9
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2573 {0x00, 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0E,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2574 0x0F, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1A, 0x1B,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2575 0x1C, 0x1D, 0x1E, 0x20, 0x22, 0x24, 0x26, 0x29,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2576 0x2A, 0x2C, 0x2E, 0x30, 0x32, 0x34, 0x36, 0x39},
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2577 // 10
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2578 {0x00, 0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0E,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2579 0x0F, 0x10, 0x12, 0x14, 0x16, 0x19, 0x1B, 0x1E,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2580 0x1F, 0x21, 0x23, 0x25, 0x27, 0x29, 0x2B, 0x2D,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2581 0x2E, 0x2F, 0x31, 0x32, 0x34, 0x36, 0x39, 0x3C},
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2582 // 11
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2583 {0x00, 0x01, 0x03, 0x05, 0x07, 0x0A, 0x0C, 0x0F,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2584 0x10, 0x11, 0x13, 0x15, 0x17, 0x19, 0x1B, 0x1E,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2585 0x1F, 0x20, 0x22, 0x24, 0x26, 0x28, 0x2B, 0x2E,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2586 0x2F, 0x30, 0x32, 0x34, 0x36, 0x39, 0x3C, 0x3F},
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2587 // 12
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2588 {0x00, 0x02, 0x04, 0x06, 0x08, 0x0B, 0x0D, 0x10,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2589 0x11, 0x12, 0x14, 0x16, 0x18, 0x1B, 0x1E, 0x21,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2590 0x22, 0x23, 0x25, 0x27, 0x29, 0x2C, 0x2F, 0x32,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2591 0x33, 0x34, 0x36, 0x38, 0x3B, 0x34, 0x41, 0x44},
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2592 // 13
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2593 {0x00, 0x02, 0x04, 0x06, 0x08, 0x0B, 0x0D, 0x11,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2594 0x12, 0x13, 0x15, 0x17, 0x1A, 0x1D, 0x20, 0x23,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2595 0x24, 0x25, 0x27, 0x29, 0x2C, 0x2F, 0x32, 0x35,
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2596 0x36, 0x37, 0x39, 0x3B, 0x3E, 0x41, 0x44, 0x47}
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2597 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2598
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2599 // #pragma mark -
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2600
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2601 // At the time of writing, the only known case where Kyra 1 uses sound triggers
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2602 // is in the castle, to cycle between three different songs.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2603
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2604 const int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2605 CadlPlayer::_kyra1SoundTriggers[] = {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2606 0, 4, 5, 3
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2607 };
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2608
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2609 const int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2610 CadlPlayer::_kyra1NumSoundTriggers =
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2611 ARRAYSIZE (CadlPlayer::_kyra1SoundTriggers);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2612
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2613 CadlPlayer::CadlPlayer (Copl * newopl):CPlayer (newopl), numsubsongs (0), _trackEntries (),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2614 _soundDataPtr (0)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2615 {
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2616 memset (_trackEntries, 0, sizeof (_trackEntries));
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2617 _driver = new AdlibDriver (newopl);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2618 assert (_driver);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2619
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2620 _sfxPlayingSound = -1;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2621 // _soundFileLoaded = "";
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2622
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2623 _soundTriggers = _kyra1SoundTriggers;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2624 _numSoundTriggers = _kyra1NumSoundTriggers;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2625
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2626 init ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2627 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2628
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2629 CadlPlayer::~CadlPlayer ()
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2630 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2631 delete[]_soundDataPtr;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2632 _soundDataPtr = 0;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2633 delete _driver;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2634 _driver = 0;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2635 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2636
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2637 bool
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2638 CadlPlayer::init ()
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2639 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2640 _driver->callback (2);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2641 _driver->callback (16, int (4));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2642 return true;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2643 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2644
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2645 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2646 CadlPlayer::process ()
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2647 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2648 uint8 trigger = _driver->callback (11);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2649
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2650 if (trigger < _numSoundTriggers)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2651 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2652 int soundId = _soundTriggers[trigger];
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2653
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2654 if (soundId)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2655 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2656 playTrack (soundId);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2657 }
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2658 }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2659 else
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2660 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2661 warning ("Unknown sound trigger %d", trigger);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2662 // TODO: At this point, we really want to clear the trigger...
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2663 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2664 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2665
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2666 // void CadlPlayer::setVolume(int volume) {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2667 // }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2668
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2669 // int CadlPlayer::getVolume() {
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2670 // return 0;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2671 // }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2672
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2673 // void CadlPlayer::loadMusicFile(const char *file) {
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2674 // loadSoundFile(file);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2675 // }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2676
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2677 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2678 CadlPlayer::playTrack (uint8 track)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2679 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2680 play (track);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2681 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2682
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2683 // void CadlPlayer::haltTrack() {
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2684 // unk1();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2685 // unk2();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2686 // //_engine->_system->delayMillis(3 * 60);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2687 // }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2688
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2689 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2690 CadlPlayer::playSoundEffect (uint8_t track)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2691 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2692 play (track);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2693 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2694
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2695 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2696 CadlPlayer::play (uint8_t track)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2697 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2698 uint8 soundId = _trackEntries[track];
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2699 if ((int8) soundId == -1 || !_soundDataPtr)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2700 return;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2701 soundId &= 0xFF;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2702 _driver->callback (16, 0);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2703 // while ((_driver->callback(16, 0) & 8)) {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2704 // We call the system delay and not the game delay to avoid concurrency issues.
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2705 // _engine->_system->delayMillis(10);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2706 // }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2707 if (_sfxPlayingSound != -1)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2708 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2709 // Restore the sounds's normal values.
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2710 _driver->callback (10, _sfxPlayingSound, int (1), int (_sfxPriority));
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2711 _driver->callback (10, _sfxPlayingSound, int (3),
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2712 int (_sfxFourthByteOfSong));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2713 _sfxPlayingSound = -1;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2714 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2715
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2716 int chan = _driver->callback (9, soundId, int (0));
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2717
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2718 if (chan != 9)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2719 {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2720 _sfxPlayingSound = soundId;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2721 _sfxPriority = _driver->callback (9, soundId, int (1));
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2722 _sfxFourthByteOfSong = _driver->callback (9, soundId, int (3));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2723
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2724 // In the cases I've seen, the mysterious fourth byte has been
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2725 // the parameter for the update_setExtraLevel3() callback.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2726 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2727 // The extra level is part of the channels "total level", which
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2728 // is a six-bit value where larger values means softer volume.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2729 //
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2730 // So what seems to be happening here is that sounds which are
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2731 // started by this function are given a slightly lower priority
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2732 // and a slightly higher (i.e. softer) extra level 3 than they
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2733 // would have if they were started from anywhere else. Strange.
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2734
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2735 int newVal = ((((-_sfxFourthByteOfSong) + 63) * 0xFF) >> 8) & 0xFF;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2736 newVal = -newVal + 63;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2737 _driver->callback (10, soundId, int (3), newVal);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2738 newVal = ((_sfxPriority * 0xFF) >> 8) & 0xFF;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2739 _driver->callback (10, soundId, int (1), newVal);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2740 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2741
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2742 _driver->callback (6, soundId);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2743 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2744
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2745 // void CadlPlayer::beginFadeOut() {
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2746 // playSoundEffect(1);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2747 // }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2748
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2749 bool
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2750 CadlPlayer::load (VFSFile * fd, const CFileProvider & fp)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2751 {
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2752 binistream *f = fp.open (fd);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2753 std::string filename (fd->uri);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2754
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2755 // file validation section
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2756 if (!f || !fp.extension (filename, ".adl"))
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2757 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2758 fp.close (f);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2759 return false;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2760 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2761
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2762 // if (_soundFileLoaded == file)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2763 // return;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2764
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2765 // if (_soundDataPtr) {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2766 // haltTrack();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2767 // }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2768
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2769 uint8 *file_data = 0;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2770 uint32 file_size = 0;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2771
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2772 // char filename[25];
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2773 // sprintf(filename, "%s.ADL", file);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2774
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2775 // file_data = _engine->resource()->fileData(filename, &file_size);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2776 // if (!file_data) {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2777 // warning("Couldn't find music file: '%s'", filename);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2778 // return;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2779 // }
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2780
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2781 unk2 ();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2782 unk1 ();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2783
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2784 file_size = fp.filesize (f);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2785 file_data = new uint8[file_size];
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2786 f->readString ((char *) file_data, file_size);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2787
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2788 _driver->callback (8, int (-1));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2789 _soundDataPtr = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2790
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2791 uint8 *p = file_data;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2792 memcpy (_trackEntries, p, 120 * sizeof (uint8));
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2793 p += 120;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2794
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2795 int soundDataSize = file_size - 120;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2796
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2797 _soundDataPtr = new uint8[soundDataSize];
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2798 assert (_soundDataPtr);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2799
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2800 memcpy (_soundDataPtr, p, soundDataSize * sizeof (uint8));
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2801
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2802 delete[]file_data;
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2803 file_data = p = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2804 file_size = 0;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2805
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2806 _driver->callback (4, _soundDataPtr);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2807
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2808 // _soundFileLoaded = file;
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2809
964
368f8ee0a95f [svn] Sync with upstream. Subsong improvements for ADL, new JBM player.
chainsaw
parents: 955
diff changeset
2810 // find last subsong
368f8ee0a95f [svn] Sync with upstream. Subsong improvements for ADL, new JBM player.
chainsaw
parents: 955
diff changeset
2811 for(int i = 199; i >= 0; i--)
368f8ee0a95f [svn] Sync with upstream. Subsong improvements for ADL, new JBM player.
chainsaw
parents: 955
diff changeset
2812 if(_trackEntries[i] != 0xff) {
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2813 numsubsongs = i + 1;
964
368f8ee0a95f [svn] Sync with upstream. Subsong improvements for ADL, new JBM player.
chainsaw
parents: 955
diff changeset
2814 break;
368f8ee0a95f [svn] Sync with upstream. Subsong improvements for ADL, new JBM player.
chainsaw
parents: 955
diff changeset
2815 }
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2816 fp.close (f);
964
368f8ee0a95f [svn] Sync with upstream. Subsong improvements for ADL, new JBM player.
chainsaw
parents: 955
diff changeset
2817 cursubsong = 2;
368f8ee0a95f [svn] Sync with upstream. Subsong improvements for ADL, new JBM player.
chainsaw
parents: 955
diff changeset
2818 rewind();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2819 return true;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2820 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2821
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2822 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2823 CadlPlayer::rewind (int subsong)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2824 {
964
368f8ee0a95f [svn] Sync with upstream. Subsong improvements for ADL, new JBM player.
chainsaw
parents: 955
diff changeset
2825 if(subsong == -1) subsong = cursubsong;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2826 opl->init ();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2827 opl->write (1, 32);
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2828 playSoundEffect (subsong);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2829 cursubsong = subsong;
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2830 update ();
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2831 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2832
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2833 unsigned int
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2834 CadlPlayer::getsubsongs ()
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2835 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2836 return numsubsongs;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2837 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2838
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2839 bool
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2840 CadlPlayer::update ()
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2841 {
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2842 bool songend = true;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2843
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2844 // if(_trackEntries[cursubsong] == 0xff)
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2845 // return false;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2846
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2847 _driver->callback ();
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2848
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2849 for (int i = 0; i < 10; i++)
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2850 if (_driver->_channels[i].dataptr != NULL)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2851 songend = false;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2852
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2853 return !songend;
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2854 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2855
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2856 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2857 CadlPlayer::unk1 ()
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2858 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2859 playSoundEffect (0);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2860 //_engine->_system->delayMillis(5 * 60);
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2861 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2862
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2863 void
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2864 CadlPlayer::unk2 ()
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2865 {
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2866 playSoundEffect (0);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2867 }
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2868
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2869 CPlayer *
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2870 CadlPlayer::factory (Copl * newopl)
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2871 {
955
4709ce4e209e [svn] Run indent -ts4 -nut -bli0 -cdw on this messy lot. Upstream is not consistent with whitespace anyway, no loss there.
chainsaw
parents: 869
diff changeset
2872 return new CadlPlayer (newopl);
0
13389e613d67 [svn] - initial import of audacious-plugins tree (lots to do)
nenolod
parents:
diff changeset
2873 }