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

Function ToggleINES20

src/drivers/win/header_editor.cpp:385–442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383}
384
385void ToggleINES20(HWND hwnd, bool ines20)
386{
387 // only ines 2.0 has these values
388 // these are always have when in 2.0
389 // Submapper#
390 EnableWindow(GetDlgItem(hwnd, IDC_SUBMAPPER_TEXT), ines20);
391 EnableWindow(GetDlgItem(hwnd, IDC_SUBMAPPER_EDIT), ines20);
392 // PRG NVRAM
393 EnableWindow(GetDlgItem(hwnd, IDC_PRGNVRAM_COMBO), ines20);
394 EnableWindow(GetDlgItem(hwnd, IDC_PRGNVRAM_TEXT), ines20);
395 // CHR RAM
396 EnableWindow(GetDlgItem(hwnd, IDC_CHRRAM_COMBO), ines20);
397 EnableWindow(GetDlgItem(hwnd, IDC_CHRRAM_TEXT), ines20);
398 // CHR NVRAM
399 EnableWindow(GetDlgItem(hwnd, IDC_CHRNVRAM_COMBO), ines20);
400 EnableWindow(GetDlgItem(hwnd, IDC_CHRNVRAM_TEXT), ines20);
401 // Dendy in Region Groupbox
402 EnableWindow(GetDlgItem(hwnd, IDC_RADIO_REGION_DENDY), ines20);
403 // Multiple in Regtion Groupbox
404 EnableWindow(GetDlgItem(hwnd, IDC_RADIO_REGION_DUAL), ines20);
405 // Extend in System Groupbox
406 EnableWindow(GetDlgItem(hwnd, IDC_RADIO_SYSTEM_EXTEND), ines20);
407 // Input Device
408 EnableWindow(GetDlgItem(hwnd, IDC_INPUT_DEVICE_COMBO), ines20);
409 EnableWindow(GetDlgItem(hwnd, IDC_INPUT_DEVICE_TEXT), ines20);
410 // Miscellaneous ROMs
411 EnableWindow(GetDlgItem(hwnd, IDC_MISCELLANEOUS_ROMS_EDIT), ines20);
412 EnableWindow(GetDlgItem(hwnd, IDC_MISCELLANEOUS_ROMS_TEXT), ines20);
413
414 // enable extend dialog only when ines 2.0 and extend button is checked
415 ToggleExtendSystemList(hwnd, ines20 && IsDlgButtonChecked(hwnd, IDC_RADIO_SYSTEM_EXTEND) == BST_CHECKED);
416 // enable vs dialog only when ines 2.0 and vs button is checked
417 ToggleVSSystemGroup(hwnd, ines20 && IsDlgButtonChecked(hwnd, IDC_RADIO_SYSTEM_VS) == BST_CHECKED);
418
419
420 // hide "Battery / PRG-NVRAM" checkbox in ines 2.0 and show PRG NVRAM combo box, negative on the contary, because ines 1.0 has nowhere to set actural size, it can only determin it exists or not.
421 ShowWindow(GetDlgItem(hwnd, IDC_CHECK_BATTERYNVRAM), ines20 ? SW_HIDE : SW_SHOW);
422 ShowWindow(GetDlgItem(hwnd, IDC_PRGNVRAM_COMBO), ines20 ? SW_SHOW : SW_HIDE);
423 ShowWindow(GetDlgItem(hwnd, IDC_PRGNVRAM_TEXT), ines20 ? SW_SHOW : SW_HIDE);
424
425 EnableWindow(GetDlgItem(hwnd, IDC_CHECK_BATTERYNVRAM), TRUE);
426 EnableWindow(GetDlgItem(hwnd, IDC_PRGNVRAM_COMBO), TRUE);
427 EnableWindow(GetDlgItem(hwnd, IDC_PRGNVRAM_TEXT), TRUE);
428
429
430 // 10th byte for the unofficial ines properties
431 // Unofficial Properties
432 EnableWindow(GetDlgItem(hwnd, IDC_CHECK_UNOFFICIAL), !ines20);
433 ToggleUnofficialPropertiesEnabled(hwnd, ines20, IsDlgButtonChecked(hwnd, IDC_CHECK_UNOFFICIAL) == BST_CHECKED);
434
435 // ines 1.0 doesn't support Dendy region, switch it to PAL
436 if (!ines20 && IsDlgButtonChecked(hwnd, IDC_RADIO_REGION_DENDY) == BST_CHECKED)
437 CheckRadioButton(hwnd, IDC_RADIO_REGION_NTSC, IDC_RADIO_REGION_DENDY, IDC_RADIO_REGION_PAL);
438 // ines 1.0 doesn't support extend system, switch it to normal
439 if (!ines20 && IsDlgButtonChecked(hwnd, IDC_RADIO_SYSTEM_EXTEND) == BST_CHECKED)
440 CheckRadioButton(hwnd, IDC_RADIO_SYSTEM_NORMAL, IDC_RADIO_SYSTEM_EXTEND, IDC_RADIO_SYSTEM_NORMAL);
441
442}

Callers 6

InitHeaderEditDialogFunction · 0.85
HeaderEditorProcFunction · 0.85
SetHeaderDataFunction · 0.85
iNes1ClickedMethod · 0.85
iNes2ClickedMethod · 0.85
setHeaderDataMethod · 0.85

Calls 3

ToggleExtendSystemListFunction · 0.85
ToggleVSSystemGroupFunction · 0.85

Tested by

no test coverage detected