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

Function UpdateCaption

src/drivers/win/memview.cpp:613–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

611char* EditString[4] = {"RAM","PPU","OAM","ROM"};
612
613void UpdateCaption()
614{
615 static char str[1000];
616
617 if (CursorEndAddy == -1)
618 {
619 if (EditingMode == MODE_NES_FILE)
620 {
621 if (CursorStartAddy < 16)
622 sprintf(str, "Hex Editor - ROM Header: 0x%X", CursorStartAddy);
623 else if (CursorStartAddy - 16 < (int)PRGsize[0])
624 sprintf(str, "Hex Editor - (PRG) ROM: 0x%X", CursorStartAddy);
625 else if (CursorStartAddy - 16 - PRGsize[0] < (int)CHRsize[0])
626 sprintf(str, "Hex Editor - (CHR) ROM: 0x%X", CursorStartAddy);
627 } else
628 {
629 sprintf(str, "Hex Editor - %s: 0x%X", EditString[EditingMode], CursorStartAddy);
630 }
631
632 if (EditingMode == MODE_NES_MEMORY && symbDebugEnabled)
633 {
634 // when watching RAM we may as well see Symbolic Debug names
635 loadNameFiles();
636 Name* node = findNode(getNamesPointerForAddress(CursorStartAddy), CursorStartAddy);
637 if (node && node->name)
638 {
639 strcat(str, " - ");
640 strcat(str, node->name);
641 }
642 for (int i = 0; i < RegNameCount; i++) {
643 if (!symbRegNames) break;
644 int test = 0;
645 sscanf(RegNames[i].offset, "$%4x", &test);
646 if (test == CursorStartAddy) {
647 strcat(str, " - ");
648 strcat(str, RegNames[i].name);
649 }
650 }
651 }
652 } else
653 {
654 sprintf(str, "Hex Editor - %s: 0x%X - 0x%X (0x%X)",
655 EditString[EditingMode], CursorStartAddy, CursorEndAddy, CursorEndAddy - CursorStartAddy + 1);
656 }
657 SetWindowText(hMemView,str);
658 return;
659}
660
661int GetMemViewData(uint32 i)
662{

Callers 4

IDC_TRACER_LOG_WndProcFunction · 0.85
ChangeMemViewFocusFunction · 0.85
MemViewCallBFunction · 0.85
DoMemViewFunction · 0.85

Calls 3

loadNameFilesFunction · 0.85
findNodeFunction · 0.85

Tested by

no test coverage detected