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

Function DoHeadEdit

src/drivers/win/header_editor.cpp:660–686  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

658}
659
660void DoHeadEdit()
661{
662 if (hHeadEditor)
663 {
664 ShowWindow(hHeadEditor, SW_SHOWNORMAL);
665 SetForegroundWindow(hHeadEditor);
666 }
667 else
668 {
669 iNES_HEADER* header = (iNES_HEADER*)calloc(1, sizeof(iNES_HEADER));
670 if (GameInfo)
671 {
672 if (LoadHeader(hAppWnd, header))
673 CreateDialogParam(fceu_hInstance, MAKEINTRESOURCE(IDD_EDIT_HEADER), hAppWnd, HeaderEditorProc, (LPARAM)header);
674 else
675 free(header);
676 }
677 else {
678 // temporarily borrow LoadedRomFName, when no game is loaded, it is unused.
679 LoadedRomFName[0] = 0;
680 if (ShowINESFileBox(hAppWnd) && LoadHeader(hAppWnd, header))
681 DialogBoxParam(fceu_hInstance, MAKEINTRESOURCE(IDD_EDIT_HEADER), hAppWnd, HeaderEditorProc, (LPARAM)header);
682 else
683 free(header);
684 }
685 }
686}
687
688void SetHeaderData(HWND hwnd, iNES_HEADER* header) {
689

Callers 1

AppWndProcFunction · 0.85

Calls 2

ShowINESFileBoxFunction · 0.85
LoadHeaderFunction · 0.70

Tested by

no test coverage detected