Skip to content

Commit fdbc873

Browse files
authoredJan 21, 2024
Merge pull request #5 from SergioMartin86/minorFixes
Optimizations to control reading
2 parents 8886aad + 86470e3 commit fdbc873

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
 

‎source/quickerNES/core.hpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -871,10 +871,10 @@ size_t serializeLiteState(uint8_t *buffer) const
871871
// to do: to aid with recording, doesn't emulate transparent latch,
872872
// so a game that held strobe at 1 and read $4016 or $4017 would not get
873873
// the current A status as occurs on a NES
874-
unsigned long result = joypad.joypad_latches[addr & 1];
875-
if (!(joypad.w4016 & 1))
876-
joypad.joypad_latches[addr & 1] = (result >> 1) | 0x80000000;
877-
return result & 1;
874+
if (joypad.w4016 & 1) return 0;
875+
const uint8_t result = joypad.joypad_latches[addr & 1] & 1;
876+
joypad.joypad_latches[addr & 1] >>= 1;
877+
return result;
878878
}
879879

880880
if (addr == Apu::status_addr)

‎tests/rcProAmII.race1.test

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"Expected ROM SHA1": "8C68582BDAA32FBC8C7CD858991D4E00D3B1569C",
44
"Initial State File": "",
55
"Sequence File": "rcProAmII.race1.sol",
6-
"Disable State Blocks": [ ],
6+
"Disable State Blocks": [ "SRAM", "NTAB", "SPRT", "CTRL", "APUR" ],
77
"Controller 1 Type": "FourScore1",
88
"Controller 2 Type": "FourScore2"
99
}

0 commit comments

Comments
 (0)
Please sign in to comment.