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

Function UpdateColorTable

src/drivers/win/memview.cpp:691–821  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

689}
690
691void UpdateColorTable()
692{
693 UNDOSTRUCT *tmp; //mbg merge 7/18/06 removed struct qualifier
694 int i,j;
695 if(!hMemView)return;
696 for(i = 0;i < DataAmount;i++)
697 {
698 if((i+CurOffset >= CursorStartAddy) && (i+CurOffset <= CursorEndAddy))
699 {
700 CurBGColorList[i] = MKRGB(HexHlBack); //Highlighter color bg - 2 columns
701 DimBGColorList[i] = MKRGB(HexHlShdBack);
702 CurTextColorList[i] = MKRGB(HexHlFore); //Highlighter color text - 2 columns
703 DimTextColorList[i] = MKRGB(HexHlShdFore);
704 continue;
705 }
706
707 CurBGColorList[i] = MKRGB(HexBack); //Regular color bb - 2columns
708 DimBGColorList[i] = MKRGB(HexBack); //Regular color bb - 2columns
709 CurTextColorList[i] = MKRGB(HexFore); //Regular color text - 2 columns
710 DimTextColorList[i] = MKRGB(HexFore); //Regular color text - 2 columns
711 }
712
713 for (j=0;j<hexBookmarks.bookmarkCount;j++)
714 {
715 if(hexBookmarks[j].editmode != EditingMode) continue;
716 if(((int)hexBookmarks[j].address >= CurOffset) && ((int)hexBookmarks[j].address < CurOffset+DataAmount))
717 {
718 CurTextColorList[hexBookmarks[j].address - CurOffset] = MKRGB(HexBookmark); // Green for Bookmarks
719 DimTextColorList[hexBookmarks[j].address - CurOffset] = MKRGB(HexBookmark); // Green for Bookmarks
720 }
721 }
722
723 switch (EditingMode)
724 {
725 case MODE_NES_MEMORY:
726 for (int a = CurOffset; a < CurOffset + DataAmount; ++a)
727 if (FCEUI_FindCheatMapByte(a))
728 {
729 CurTextColorList[a - CurOffset] = MKRGB(HexFreeze);
730 DimTextColorList[a - CurOffset] = MKRGB(HexFreeze);
731 }
732 break;
733 case MODE_NES_FILE:
734 if (cdloggerdataSize)
735 {
736 int temp_offset;
737 for (i = 0; i < DataAmount; i++)
738 {
739 temp_offset = CurOffset + i - 16; // (minus NES header)
740 if (temp_offset >= 0)
741 {
742 if ((unsigned int)temp_offset < cdloggerdataSize)
743 {
744 // PRG
745 if ((cdloggerdata[temp_offset] & 3) == 3)
746 {
747 // the byte is both Code and Data - green
748 CurTextColorList[i] = MKRGB(CdlCodeData);

Callers 6

FCEUI_LoadGameVirtualFunction · 0.85
FlushUndoBufferFunction · 0.85
InputDataFunction · 0.85
ChangeMemViewFocusFunction · 0.85
MemViewCallBFunction · 0.85
UpdateCheatRelatedWindowFunction · 0.85

Calls 2

FCEUI_FindCheatMapByteFunction · 0.85
UpdateMemoryViewFunction · 0.85

Tested by

no test coverage detected