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

Function GetRomAddress

src/debug.cpp:310–319  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308}
309
310int GetRomAddress(int A){
311 int i;
312 uint8 *p = GetNesPRGPointer(A-=NES_HEADER_SIZE);
313 for(i = 16;i < 32;i++){
314 if((&Page[i][i<<11] <= p) && (&Page[i][(i+1)<<11] > p))break;
315 }
316 if(i == 32)return -1; //not found
317
318 return (i<<11) + (p-&Page[i][i<<11]);
319}
320
321uint8 *GetNesPRGPointer(int A){
322 return PRGptr[0]+A;

Callers 1

UpdatePatcherFunction · 0.85

Calls 1

GetNesPRGPointerFunction · 0.85

Tested by

no test coverage detected