MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / SIRegisterPollingHandler

Function SIRegisterPollingHandler

src/dolphin/src/si/SIBios.c:275–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273}
274
275BOOL SIRegisterPollingHandler(__OSInterruptHandler handler)
276{
277 BOOL enabled;
278 int i;
279
280 enabled = OSDisableInterrupts();
281 for (i = 0; i < 4; ++i)
282 {
283 if (RDSTHandler[i] == handler)
284 {
285 OSRestoreInterrupts(enabled);
286 return TRUE;
287 }
288 }
289 for (i = 0; i < 4; ++i)
290 {
291 if (RDSTHandler[i] == 0)
292 {
293 RDSTHandler[i] = handler;
294 SIEnablePollingInterrupt(TRUE);
295 OSRestoreInterrupts(enabled);
296 return TRUE;
297 }
298 }
299 OSRestoreInterrupts(enabled);
300 return FALSE;
301}
302
303BOOL SIUnregisterPollingHandler(__OSInterruptHandler handler)
304{

Callers 1

PADSetSamplingCallbackFunction · 0.85

Calls 2

OSDisableInterruptsFunction · 0.85
SIEnablePollingInterruptFunction · 0.85

Tested by

no test coverage detected