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

Function Sync

src/boards/178.cpp:85–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83//}
84
85static void Sync(void) {
86 uint32 sbank = reg[1] & 0x7;
87 uint32 bbank = reg[2];
88 setchr8(0);
89 setprg8r(0x10, 0x6000, reg[3] & 3);
90 if (reg[0] & 2) { // UNROM mode
91 setprg16(0x8000, (bbank << 3) | sbank);
92 if (reg[0] & 4)
93 setprg16(0xC000, (bbank << 3) | 6 | (reg[1] & 1));
94 else
95 setprg16(0xC000, (bbank << 3) | 7);
96 } else { // NROM mode
97 uint32 bank = (bbank << 3) | sbank;
98 if (reg[0] & 4) {
99 setprg16(0x8000, bank);
100 setprg16(0xC000, bank);
101 } else
102 setprg32(0x8000, bank >> 1);
103 }
104 setmirror((reg[0] & 1) ^ 1);
105}
106
107static DECLFW(M178Write) {
108 reg[A & 3] = V;

Callers 3

DECLFWFunction · 0.70
M178PowerFunction · 0.70
StateRestoreFunction · 0.70

Calls 5

setchr8Function · 0.85
setprg8rFunction · 0.85
setprg16Function · 0.85
setprg32Function · 0.85
setmirrorFunction · 0.85

Tested by

no test coverage detected