| 110 | } |
| 111 | |
| 112 | void JASOscillator::update() { |
| 113 | if (_1C == 4) { |
| 114 | s16 x = mDirectRelease & 0x3FFF; |
| 115 | if (_04 < x) { |
| 116 | updateCurrentValue(x); |
| 117 | } else { |
| 118 | _08 = _10; |
| 119 | _1C = 0; |
| 120 | } |
| 121 | return; |
| 122 | } |
| 123 | |
| 124 | if (_1C == 2) return; |
| 125 | |
| 126 | const Point *table; |
| 127 | if (_1C == 1) { |
| 128 | table = mData->mTable; |
| 129 | } else { |
| 130 | table = mData->rel_table; |
| 131 | } |
| 132 | |
| 133 | if (table == NULL) { |
| 134 | _1C = 2; |
| 135 | return; |
| 136 | } |
| 137 | |
| 138 | while (_04 >= table[_14]._2) { |
| 139 | _04 -= table[_14]._2; |
| 140 | _08 = _10; |
| 141 | _14++; |
| 142 | _0C = _08; |
| 143 | const s16 *ps = &table[_14]._0; |
| 144 | switch(ps[0]) { |
| 145 | case 0xf: |
| 146 | _1C = 0; |
| 147 | return; |
| 148 | case 0xe: |
| 149 | _1C = 2; |
| 150 | return; |
| 151 | case 0xd: |
| 152 | _14 = ps[2]; |
| 153 | break; |
| 154 | default: |
| 155 | _18 = ps[0]; |
| 156 | _10 = ps[2] / 32768.0f; |
| 157 | break; |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | updateCurrentValue(table[_14]._2); |
| 162 | } |
| 163 | |
| 164 | void JASOscillator::updateCurrentValue(f32 x) { |
| 165 | static const f32 *table_list[4] = { |
no outgoing calls
no test coverage detected