MCPcopy Create free account
hub / github.com/TASEmulators/fceux / InitInputInterface

Function InitInputInterface

src/drivers/sdl/input.cpp:1330–1417  ·  view source on GitHub ↗

* Initialize the input device interface between the emulation and the driver. */

Source from the content-addressed store, hash-verified

1328 * Initialize the input device interface between the emulation and the driver.
1329 */
1330void InitInputInterface ()
1331{
1332 void *InputDPtr;
1333
1334 int t = 0;
1335 int x = 0;
1336 int attrib;
1337
1338 memset( g_keyState, 0, sizeof(g_keyState) );
1339
1340 for (t = 0, x = 0; x < 2; x++)
1341 {
1342 attrib = 0;
1343 InputDPtr = 0;
1344
1345 switch (CurInputType[x])
1346 {
1347 case SI_POWERPADA:
1348 case SI_POWERPADB:
1349 InputDPtr = &powerpadbuf[x];
1350 break;
1351 case SI_GAMEPAD:
1352 case SI_SNES:
1353 InputDPtr = &JSreturn;
1354 break;
1355 case SI_ARKANOID:
1356 InputDPtr = MouseData;
1357 t |= 1;
1358 break;
1359 case SI_ZAPPER:
1360 InputDPtr = MouseData;
1361 t |= 1;
1362 attrib = 1;
1363 break;
1364 case SI_MOUSE:
1365 case SI_SNES_MOUSE:
1366 InputDPtr = MouseRelative;
1367 t |= 1;
1368 break;
1369 }
1370 FCEUI_SetInput (x, (ESI) CurInputType[x], InputDPtr, attrib);
1371 }
1372
1373 attrib = 0;
1374 InputDPtr = 0;
1375 switch (CurInputType[2])
1376 {
1377 case SIFC_SHADOW:
1378 InputDPtr = MouseData;
1379 t |= 1;
1380 attrib = 1;
1381 break;
1382 case SIFC_OEKAKIDS:
1383 InputDPtr = MouseData;
1384 t |= 1;
1385 attrib = 1;
1386 break;
1387 case SIFC_ARKANOID:

Callers 2

FCEUD_SetInputFunction · 0.70
DriverInitializeFunction · 0.70

Calls 3

FCEUI_SetInputFunction · 0.85
FCEUI_SetInputFCFunction · 0.85
FCEUI_SetInputFourscoreFunction · 0.85

Tested by

no test coverage detected