| 165 | } |
| 166 | |
| 167 | static void SIInterruptHandler(__OSInterrupt interrupt, OSContext* context) |
| 168 | { |
| 169 | u32 reg; |
| 170 | |
| 171 | reg = __SIRegs[13]; |
| 172 | |
| 173 | if ((reg & 0xc0000000) == 0xc0000000) |
| 174 | { |
| 175 | s32 chan; |
| 176 | u32 sr; |
| 177 | SICallback callback; |
| 178 | |
| 179 | chan = Si.chan; |
| 180 | sr = CompleteTransfer(); |
| 181 | callback = Si.callback; |
| 182 | Si.callback = 0; |
| 183 | |
| 184 | SITransferNext(chan); |
| 185 | |
| 186 | if (callback) |
| 187 | { |
| 188 | callback(chan, sr, context); |
| 189 | } |
| 190 | |
| 191 | sr = __SIRegs[14]; |
| 192 | sr &= 0xf000000 >> (8 * chan); |
| 193 | __SIRegs[14] = sr; |
| 194 | |
| 195 | if (Type[chan] == SI_ERROR_BUSY && !SIIsChanBusy(chan)) |
| 196 | { |
| 197 | static u32 cmdTypeAndStatus = 0 << 24; |
| 198 | SITransfer(chan, &cmdTypeAndStatus, 1, &Type[chan], 3, GetTypeCallback, |
| 199 | OSMicrosecondsToTicks(65)); |
| 200 | } |
| 201 | } |
| 202 | |
| 203 | if ((reg & 0x18000000) == 0x18000000) |
| 204 | { |
| 205 | int i; |
| 206 | u32 vcount; |
| 207 | u32 x; |
| 208 | |
| 209 | vcount = VIGetCurrentLine() + 1; |
| 210 | x = (Si.poll & 0x03ff0000) >> 16; |
| 211 | |
| 212 | for (i = 0; i < SI_MAX_CHAN; ++i) |
| 213 | { |
| 214 | if (SIGetResponseRaw(i)) |
| 215 | { |
| 216 | InputBufferVcount[i] = vcount; |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | for (i = 0; i < SI_MAX_CHAN; ++i) |
| 221 | { |
| 222 | if (!(Si.poll & (SI_CHAN0_BIT >> (31 - 7 + i)))) |
| 223 | { |
| 224 | continue; |
nothing calls this directly
no test coverage detected