From 2fd0f726f82f8f1579e75576051310e0ba7f3767 Mon Sep 17 00:00:00 2001 From: Barry Peddycord III Date: Sat, 15 Jun 2013 15:08:52 -0300 Subject: [PATCH] Update mappers.js When I code NES games, I often use the following code in order to handle the controller: LDX #9 STX $4016 DEX STX $4016 loop: LDA $4016 DEX BNE loop This works because when I write a 9 followed by an 8 to the controller, the only bit that actually counts is the LSB. The original code requires me to write exactly a 1, but that seems restrictive, and is not consistent with other emulators. --- source/mappers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/mappers.js b/source/mappers.js index fbe9aa21..6d0ed9a5 100644 --- a/source/mappers.js +++ b/source/mappers.js @@ -250,7 +250,7 @@ JSNES.Mappers[0].prototype = { case 0x4016: // Joystick 1 + Strobe - if (value === 0 && this.joypadLastWrite === 1) { + if ((value&1) === 0 && (this.joypadLastWrite&1) === 1) { this.joy1StrobeState = 0; this.joy2StrobeState = 0; }