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

Function MMC1PRG

src/boards/fns.cpp:54–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54static void MMC1PRG(void) {
55 uint8 offs_16banks = DRegs[1] & 0x10;
56 uint8 prg_reg = DRegs[3] & 0xF;
57
58 setprg8r(0x10, 0x6000, DRegs[1] & 3);
59
60 switch (DRegs[0] & 0xC) {
61 case 0xC:
62 setprg16(0x8000, (prg_reg + offs_16banks));
63 setprg16(0xC000, 0xF + offs_16banks);
64 break;
65 case 0x8:
66 setprg16(0xC000, (prg_reg + offs_16banks));
67 setprg16(0x8000, offs_16banks);
68 break;
69 case 0x0:
70 case 0x4:
71 setprg16(0x8000, ((prg_reg & ~1) + offs_16banks));
72 setprg16(0xc000, ((prg_reg & ~1) + offs_16banks + 1));
73 break;
74 }
75}
76
77static void MMC1MIRROR(void) {
78 switch (DRegs[0] & 3) {

Callers 3

DECLFWFunction · 0.70
MMC1_RestoreFunction · 0.70
MMC1CMResetFunction · 0.70

Calls 2

setprg8rFunction · 0.85
setprg16Function · 0.85

Tested by

no test coverage detected