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

Function HeaderEditorProc

src/drivers/win/header_editor.cpp:507–658  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

505}
506
507INT_PTR CALLBACK HeaderEditorProc(HWND hDlg, UINT uMsg, WPARAM wP, LPARAM lP)
508{
509
510 static iNES_HEADER* header;
511
512 switch (uMsg) {
513 case WM_INITDIALOG:
514 {
515 header = (iNES_HEADER*)lP;
516 if (!header)
517 goto wm_close;
518 else
519 InitHeaderEditDialog(hDlg, header);
520
521 // Put the window aside the main window when in game.
522 if (GameInfo)
523 CalcSubWindowPos(hDlg, NULL);
524
525 SetDlgItemText(hDlg, IDC_ROM_FILE_EDIT, LoadedRomFName);
526
527 char textHeader[16 * 3];
528 sprintf(textHeader, "%02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X", header->ID[0], header->ID[1], header->ID[2], header->ID[3], header->ROM_size, header->VROM_size, header->ROM_size, header->ROM_type2, header->ROM_type3, header->Upper_ROM_VROM_size, header->RAM_size, header->VRAM_size, header->TV_system, header->VS_hardware, header->misc_roms, header->expansion);
529 SetDlgItemText(hDlg, IDC_HEX_HEADER_EDIT, textHeader);
530
531 hFont = (HFONT)SendMessage(hDlg, WM_GETFONT, 0, 0);
532 LOGFONT lf;
533 GetObject(hFont, sizeof(LOGFONT), &lf);
534 strcpy(lf.lfFaceName, "Courier New");
535 hNewFont = CreateFontIndirect(&lf);
536 SendDlgItemMessage(hDlg, IDC_HEX_HEADER_EDIT, WM_SETFONT, (WPARAM)hNewFont, FALSE);
537 }
538 break;
539 case WM_COMMAND:
540 switch (HIWORD(wP))
541 {
542 case EN_UPDATE:
543 switch (LOWORD(wP))
544 {
545 case IDC_SUBMAPPER_EDIT:
546 case IDC_MISCELLANEOUS_ROMS_EDIT:
547 WriteHeaderData(hDlg);
548 }
549 break;
550 case CBN_EDITUPDATE:
551 case CBN_SELCHANGE:
552 switch (LOWORD(wP))
553 {
554 case IDC_MAPPER_COMBO:
555 case IDC_PRGROM_COMBO:
556 case IDC_PRGRAM_COMBO:
557 case IDC_PRGNVRAM_COMBO:
558 case IDC_CHRROM_COMBO:
559 case IDC_CHRRAM_COMBO:
560 case IDC_CHRNVRAM_COMBO:
561 case IDC_VS_SYSTEM_COMBO:
562 case IDC_VS_PPU_COMBO:
563 case IDC_SYSTEM_EXTEND_COMBO:
564 case IDC_INPUT_DEVICE_COMBO:

Callers

nothing calls this directly

Calls 12

InitHeaderEditDialogFunction · 0.85
CalcSubWindowPosFunction · 0.85
WriteHeaderDataFunction · 0.85
ToggleINES20Function · 0.85
ToggleExtendSystemListFunction · 0.85
ToggleVSSystemGroupFunction · 0.85
SetHeaderDataFunction · 0.85
ShowINESFileBoxFunction · 0.85
SaveINESFileFunction · 0.85

Tested by

no test coverage detected