Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimizations to control reading #5

Merged
merged 1 commit into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions source/quickerNES/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,10 +871,10 @@ size_t serializeLiteState(uint8_t *buffer) const
// to do: to aid with recording, doesn't emulate transparent latch,
// so a game that held strobe at 1 and read $4016 or $4017 would not get
// the current A status as occurs on a NES
unsigned long result = joypad.joypad_latches[addr & 1];
if (!(joypad.w4016 & 1))
joypad.joypad_latches[addr & 1] = (result >> 1) | 0x80000000;
return result & 1;
if (joypad.w4016 & 1) return 0;
const uint8_t result = joypad.joypad_latches[addr & 1] & 1;
joypad.joypad_latches[addr & 1] >>= 1;
return result;
}

if (addr == Apu::status_addr)
Expand Down
2 changes: 1 addition & 1 deletion tests/rcProAmII.race1.test
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Expected ROM SHA1": "8C68582BDAA32FBC8C7CD858991D4E00D3B1569C",
"Initial State File": "",
"Sequence File": "rcProAmII.race1.sol",
"Disable State Blocks": [ ],
"Disable State Blocks": [ "SRAM", "NTAB", "SPRT", "CTRL", "APUR" ],
"Controller 1 Type": "FourScore1",
"Controller 2 Type": "FourScore2"
}