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

Function InputConCallB

src/drivers/win/input.cpp:1495–1812  ·  view source on GitHub ↗

Callback function of the input configuration dialog.

Source from the content-addressed store, hash-verified

1493
1494//Callback function of the input configuration dialog.
1495INT_PTR CALLBACK InputConCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
1496{
1497 switch(uMsg)
1498 {
1499 case WM_INITDIALOG:
1500 // Update the disable UDLR checkbox based on the current value
1501 CheckDlgButton(hwndDlg,BTN_ALLOW_LRUD,allowUDLR?BST_CHECKED:BST_UNCHECKED);
1502
1503 //update the fourscore checkbox
1504 CheckDlgButton(hwndDlg,CHECK_ENABLE_FOURSCORE,(eoptions & EO_FOURSCORE)?BST_CHECKED:BST_UNCHECKED);
1505
1506 //update the microphone checkbox
1507 CheckDlgButton(hwndDlg,CHECK_ENABLE_MICROPHONE,replaceP2StartWithMicrophone?BST_CHECKED:BST_UNCHECKED);
1508
1509 // Initialize the controls for the input ports
1510 for(unsigned int port = 0; port < NUMBER_OF_PORTS; port++)
1511 {
1512 // Initialize the combobox
1513 for(unsigned int current_device = 0; current_device < NUMBER_OF_NES_DEVICES; current_device++)
1514 {
1515 SendDlgItemMessage(hwndDlg,
1516 COMBO_PAD1 + port,
1517 CB_ADDSTRING, 0,
1518 (LPARAM)(LPSTR)ESI_Name((ESI)current_device)
1519 );
1520 }
1521
1522 // Fix to deal with corrupted config.
1523 if (InputType[port]>SI_COUNT || InputType[port]<0)
1524 InputType[port]=SI_UNSET;
1525
1526 // Update the combobox selection according to the
1527 // currently selected input mode.
1528 SendDlgItemMessage(hwndDlg,
1529 COMBO_PAD1 + port,
1530 CB_SETCURSEL,
1531 InputType[port],
1532 (LPARAM)(LPSTR)0
1533 );
1534
1535 // Enable the configuration button if necessary.
1536 EnableWindow(
1537 GetDlgItem(hwndDlg, BTN_PORT1 + port),
1538 configurable_nes[InputType[port]]
1539 );
1540
1541 // Update the label that displays the input device.
1542 SetDlgItemText(
1543 hwndDlg,
1544 TXT_PAD1 + port,
1545 (LPTSTR)ESI_Name((ESI)InputType[port])
1546 );
1547 }
1548
1549 // Initialize the Famicom combobox
1550 for(unsigned current_device = 0; current_device < NUMBER_OF_FAMICOM_DEVICES; current_device++)
1551 {
1552 SendDlgItemMessage(

Callers

nothing calls this directly

Calls 14

ESI_NameFunction · 0.85
ESIFC_NameFunction · 0.85
MakeButtStringFunction · 0.85
CenterWindowOnScreenFunction · 0.85
UpdateFourscoreStateFunction · 0.85
FCEUMOV_ModeFunction · 0.85
FCEU_printfFunction · 0.85
UpdateComboPadFunction · 0.85
UpdateComboFamFunction · 0.85
DoTBConfigFunction · 0.85
PresetExportFunction · 0.85
PresetImportFunction · 0.85

Tested by

no test coverage detected