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

Function Sync

src/boards/15.cpp:35–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33};
34
35static void Sync(void) {
36 int i;
37 setmirror(((latched >> 6) & 1) ^ 1);
38 switch (latchea & 3) {
39 case 0:
40 for (i = 0; i < 4; i++)
41 setprg8(0x8000 + (i << 13), ((latched & 0x3F) << 1) + i);
42 break;
43 case 2:
44 for (i = 0; i < 4; i++)
45 setprg8(0x8000 + (i << 13), ((latched & 0x3F) << 1) + (latched >> 7));
46 break;
47 case 1:
48 case 3:
49 for (i = 0; i < 4; i++) {
50 unsigned int b;
51 b = latched & 0x3F;
52 if (i >= 2 && !(latchea & 0x2))
53 b = b | 0x07;
54 setprg8(0x8000 + (i << 13), (i & 1) + (b << 1));
55 }
56 break;
57 }
58 setchr8(0);
59}
60
61static DECLFW(M15Write) {
62 latchea = A;

Callers 4

DECLFWFunction · 0.70
StateRestoreFunction · 0.70
M15PowerFunction · 0.70
M15ResetFunction · 0.70

Calls 3

setmirrorFunction · 0.85
setprg8Function · 0.85
setchr8Function · 0.85

Tested by

no test coverage detected