| 658 | } |
| 659 | |
| 660 | void 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 | |
| 688 | void SetHeaderData(HWND hwnd, iNES_HEADER* header) { |
| 689 |
no test coverage detected