From a33bcb9e69d6f64d278eda2abfe5368b7f68359d Mon Sep 17 00:00:00 2001 From: Timothy Friez <31223405+timville85@users.noreply.github.com> Date: Fri, 3 Dec 2021 22:00:02 -0500 Subject: [PATCH] Restore 24th NTT Button + Remove PD7 clock Adjusted the mask for the NTT buttons to allow the "disconnect" button to work, and also fixed an extraenous high/low being generated on PD7. --- SNESNTTControllersUSB/SNESNTTControllersUSB.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SNESNTTControllersUSB/SNESNTTControllersUSB.ino b/SNESNTTControllersUSB/SNESNTTControllersUSB.ino index 94b852f..5f42e1d 100644 --- a/SNESNTTControllersUSB/SNESNTTControllersUSB.ino +++ b/SNESNTTControllersUSB/SNESNTTControllersUSB.ino @@ -139,7 +139,7 @@ void loop() { while(1) buttons[gp] &= 0xC3F; } else if(controllerType[gp] == NTT) // SNES NTT Data Keypad - buttons[gp] &= 0x3FFFFFF; + buttons[gp] &= 0xFFFFFFF; else // SNES Gamepad buttons[gp] &= 0xFFF; } @@ -236,8 +236,8 @@ void sendLatch() void sendClock() { // Send a clock pulse to (S)NES controller(s) - PORTD |= B10000001; // Set HIGH + PORTD |= B00000001; // Set HIGH DELAY_CYCLES(CYCLES_CLOCK); - PORTD &= ~B10000001; // Set LOW + PORTD &= ~B00000001; // Set LOW DELAY_CYCLES(CYCLES_PAUSE); }