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

Function Sync

src/boards/235.cpp:42–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40};
41
42static void Sync(void) {
43 if (unrom) {
44 int PRGPageCount = PRGROMSize / (16 * 1024);
45 setprg16(0x8000, PRGPageCount & 0xC0 | (unromData & 7));
46 setprg16(0xC000, PRGPageCount & 0xC0 | 7);
47 setmirror(MI_V);
48 } else {
49 uint8 bank = ((cmdreg & 0x300) >> 3) | (cmdreg & 0x1F);
50 if (bank >= (PRGROMSize / (32 * 1024))) {
51 openbus = 1;
52 } else {
53 if (cmdreg & 0x400)
54 setmirror(MI_0);
55 else
56 setmirror(((cmdreg >> 13) & 1) ^ 1);
57 if (cmdreg & 0x800) {
58 setprg16(0x8000, (bank << 1) | ((cmdreg >> 12) & 1));
59 setprg16(0xC000, (bank << 1) | ((cmdreg >> 12) & 1));
60 } else
61 setprg32(0x8000, bank);
62 }
63 }
64}
65
66static DECLFR(M235Read) {
67 if (openbus) {

Callers 4

DECLFWFunction · 0.70
M235ResetFunction · 0.70
M235PowerFunction · 0.70
M235RestoreFunction · 0.70

Calls 3

setprg16Function · 0.85
setmirrorFunction · 0.85
setprg32Function · 0.85

Tested by

no test coverage detected