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

Function UpdatePatcher

src/drivers/win/debugger.cpp:2725–2757  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2723}
2724
2725void UpdatePatcher(HWND hwndDlg){
2726 char str[75]; //mbg merge 7/18/06 changed from unsigned
2727 uint8 *p;
2728 if(iapoffset != -1){
2729 EnableWindow(GetDlgItem(hwndDlg,IDC_ROMPATCHER_PATCH_DATA),TRUE);
2730 EnableWindow(GetDlgItem(hwndDlg,IDC_ROMPATCHER_BTN_APPLY),TRUE);
2731
2732 if(GetRomAddress(iapoffset) != -1)sprintf(str,"Current Data at NES ROM Address: %04X, .NES file Address: %04X",GetRomAddress(iapoffset),iapoffset);
2733 else sprintf(str,"Current Data at .NES file Address: %04X",iapoffset);
2734
2735 SetDlgItemText(hwndDlg,IDC_ROMPATCHER_CURRENT_DATA_BOX,str);
2736
2737 sprintf(str,"%04X",GetRomAddress(iapoffset));
2738 SetDlgItemText(hwndDlg,IDC_ROMPATCHER_DISASSEMBLY,str);
2739
2740 if(GetRomAddress(iapoffset) != -1)SetDlgItemText(hwndDlg,IDC_ROMPATCHER_DISASSEMBLY,DisassembleLine(GetRomAddress(iapoffset)));
2741 else SetDlgItemText(hwndDlg,IDC_ROMPATCHER_DISASSEMBLY,"Not Currently Loaded in ROM for disassembly");
2742
2743 p = GetNesPRGPointer(iapoffset-16);
2744 sprintf(str,"%02X %02X %02X %02X %02X %02X %02X %02X",
2745 p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7]);
2746 SetDlgItemText(hwndDlg,IDC_ROMPATCHER_CURRENT_DATA,str);
2747
2748 } else {
2749 SetDlgItemText(hwndDlg,IDC_ROMPATCHER_CURRENT_DATA_BOX,"No Offset Selected");
2750 SetDlgItemText(hwndDlg,IDC_ROMPATCHER_CURRENT_DATA,"");
2751 SetDlgItemText(hwndDlg,IDC_ROMPATCHER_DISASSEMBLY,"");
2752 EnableWindow(GetDlgItem(hwndDlg,IDC_ROMPATCHER_PATCH_DATA),FALSE);
2753 EnableWindow(GetDlgItem(hwndDlg,IDC_ROMPATCHER_BTN_APPLY),FALSE);
2754 }
2755 if((GameInfo->type != GIT_CART) && (GameInfo->type != GIT_VSUNI))EnableWindow(GetDlgItem(hwndDlg,IDC_ROMPATCHER_BTN_SAVE),FALSE);
2756 else EnableWindow(GetDlgItem(hwndDlg,IDC_ROMPATCHER_BTN_SAVE),TRUE);
2757}
2758
2759/// Updates debugger controls that should be enabled/disabled if a game is loaded.
2760/// @param enable Flag that indicates whether the menus should be enabled (1) or disabled (0).

Callers 1

PatcherCallBFunction · 0.85

Calls 3

GetRomAddressFunction · 0.85
DisassembleLineFunction · 0.85
GetNesPRGPointerFunction · 0.85

Tested by

no test coverage detected