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

Function UNLOneBusPower

src/boards/onebus.cpp:249–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

247}
248
249static void UNLOneBusPower(void) {
250 uint32 i;
251 IRQReload = IRQCount = IRQa = 0;
252
253 memset(cpu410x, 0x00, sizeof(cpu410x));
254 memset(ppu201x, 0x00, sizeof(ppu201x));
255 memset(apu40xx, 0x00, sizeof(apu40xx));
256
257 SetupCartCHRMapping(0, PRGptr[0], PRGsize[0], 0);
258
259 for (i = 0; i < 64; i++) {
260 defapuread[i] = GetReadHandler(0x4000 | i);
261 defapuwrite[i] = GetWriteHandler(0x4000 | i);
262 }
263 SetReadHandler(0x4000, 0x403f, UNLOneBusReadAPU40XX);
264 SetWriteHandler(0x4000, 0x403f, UNLOneBusWriteAPU40XX);
265
266 SetReadHandler(0x8000, 0xFFFF, CartBR);
267 SetWriteHandler(0x2010, 0x201f, UNLOneBusWritePPU201X);
268 SetWriteHandler(0x4100, 0x410f, UNLOneBusWriteCPU410X);
269 SetWriteHandler(0x8000, 0xffff, UNLOneBusWriteMMC3);
270
271 if (WRAMSIZE) {
272 FCEU_CheatAddRAM(WRAMSIZE >> 10, 0x6000, WRAM);
273 SetWriteHandler(0x6000, 0x6000 + ((WRAMSIZE - 1) & 0x1fff), CartBW);
274 SetReadHandler(0x6000, 0x6000 + ((WRAMSIZE - 1) & 0x1fff), CartBR);
275 setprg8r(0x10, 0x6000, 0);
276 }
277
278 Sync();
279}
280
281static void UNLOneBusReset(void) {
282 IRQReload = IRQCount = IRQa = 0;

Callers

nothing calls this directly

Calls 8

SetupCartCHRMappingFunction · 0.85
GetReadHandlerFunction · 0.85
GetWriteHandlerFunction · 0.85
SetReadHandlerFunction · 0.85
SetWriteHandlerFunction · 0.85
FCEU_CheatAddRAMFunction · 0.85
setprg8rFunction · 0.85
SyncFunction · 0.70

Tested by

no test coverage detected