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

Function FCEUPPU_GetCHR

src/ppu.cpp:402–413  ·  view source on GitHub ↗

this duplicates logic which is embedded in the ppu rendering code which figures out where to get CHR data from depending on various hack modes mostly involving mmc5. this might be incomplete.

Source from the content-addressed store, hash-verified

400//mostly involving mmc5.
401//this might be incomplete.
402uint8* FCEUPPU_GetCHR(uint32 vadr, uint32 refreshaddr) {
403 if (MMC5Hack) {
404 if (MMC5HackCHRMode == 1) {
405 uint8 *C = MMC5HackVROMPTR;
406 C += (((MMC5HackExNTARAMPtr[refreshaddr & 0x3ff]) & 0x3f & MMC5HackVROMMask) << 12) + (vadr & 0xfff);
407 C += (MMC50x5130 & 0x3) << 18; //11-jun-2009 for kuja_killer
408 return C;
409 } else {
410 return MMC5BGVRAMADR(vadr);
411 }
412 } else return VRAMADR(vadr);
413}
414
415//likewise for ATTR
416int FCEUPPU_GetAttr(int ntnum, int xt, int yt) {

Callers 3

DrawNameTableFunction · 0.85
DrawNameTableFunction · 0.85
mmc5_PPUReadFunction · 0.85

Calls 1

MMC5BGVRAMADRFunction · 0.85

Tested by

no test coverage detected