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

Function GetMemViewData

src/drivers/win/memview.cpp:661–689  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

659}
660
661int GetMemViewData(uint32 i)
662{
663 switch (EditingMode)
664 {
665 case MODE_NES_MEMORY:
666 return GetMem(i);
667 case MODE_NES_PPU:
668 i &= 0x3FFF;
669 if (i < 0x2000)return VPage[(i) >> 10][(i)];
670 //NSF PPU Viewer crash here (UGETAB) (Also disabled by 'MaxSize = 0x2000')
671 if (GameInfo->type == GIT_NSF)
672 return (0);
673 else
674 {
675 if (i < 0x3F00)
676 return vnapage[(i >> 10) & 0x3][i & 0x3FF];
677 return READPAL_MOTHEROFALL(i & 0x1F);
678 }
679 break;
680 case MODE_NES_OAM:
681 return SPRAM[i & 0xFF];
682 case MODE_NES_FILE:
683 //todo: use getfiledata() here
684 if (i < 16) return *((unsigned char *)&head + i);
685 if (i < 16 + PRGsize[0])return PRGptr[0][i - 16];
686 if (i < 16 + PRGsize[0] + CHRsize[0])return CHRptr[0][i - 16 - PRGsize[0]];
687 }
688 return 0;
689}
690
691void UpdateColorTable()
692{

Callers 3

UpdateMemoryViewFunction · 0.85
MemViewCallBFunction · 0.85
FindNextFunction · 0.85

Calls 2

GetMemFunction · 0.85
READPAL_MOTHEROFALLFunction · 0.85

Tested by

no test coverage detected