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

Function GetPRGAddress

src/debug.cpp:254–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

252}
253
254int GetPRGAddress(int A){
255 int result;
256 if(A > 0xFFFF)
257 return -1;
258 if (GameInfo->type == GIT_FDS) {
259 if (A < 0xE000) {
260 result = &Page[A >> 11][A] - PRGptr[1];
261 if ((result > (int)PRGsize[1]) || (result < 0))
262 return -1;
263 else
264 return result;
265 } else {
266 result = &Page[A >> 11][A] - PRGptr[0];
267 if ((result > (int)PRGsize[0]) || (result < 0))
268 return -1;
269 else
270 return result + PRGsize[1];
271 }
272 } else {
273 result = &Page[A >> 11][A] - PRGptr[0];
274 if ((result > (int)PRGsize[0]) || (result < 0))
275 return -1;
276 else
277 return result;
278 }
279}
280
281/**
282* Returns the bank for a given offset.

Callers 5

LogDPCMFunction · 0.85
LogCDVectorsFunction · 0.85
LogCDDataFunction · 0.85
FCEUD_TraceInstructionFunction · 0.85
FCEUD_TraceInstructionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected