Using the arduino as a SNES controller

I've seen a lot of things about using a snes controller as input for an arduino, but currently I own a snes and am wondering if it is at all possible to use the arduino for an input for a snes. I have some code written, with clock and latch as inputs and data as an output, but the results are far from even reasonably good. Wondering if any of you have done the same or have some tips?

I could upload my current code if need be.

Thanks in advance,
P

Can you post your current code? I'm going to be attempting this exact same thing in the coming weeks and would love to have some code to go off of. I'll be sure to keep you updated on my progress.

Here's the new code (I've started over on the project), but it seems the interrupts are never firing, any tips?

I'm using a Due.

const int PIN_DATA = 12; // SNES 4 - RED
const int PIN_LATCH = 11; // SNES 3 - ORANGE
const int PIN_CLOCK = 10; // SNES 2 - YELLOW

const int BTN_1 = 20;
const int BTN_2 = 21;

unsigned long lTime;
unsigned long temp;

int clk = 0;

bool buttons[] = {HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH, HIGH};
//                B     Y     Slct  Strt  Up    Down  Left  Rght  A     X     L     R     ----  ----  ----  ----

void setup()
{
  pinMode(PIN_DATA, OUTPUT);
  pinMode(PIN_LATCH, INPUT_PULLUP);
  pinMode(PIN_CLOCK, INPUT_PULLUP);
  
  pinMode(BTN_1, INPUT_PULLUP);
  pinMode(BTN_2, INPUT_PULLUP);

  pinMode(LED_BUILTIN, OUTPUT);

  attachInterrupt(PIN_LATCH, latch, RISING);
  //attachInterrupt(PIN_LATCH, serialFirstButton, FALLING);
  attachInterrupt(PIN_CLOCK, sampleButton, RISING);
}

void sampleButton()
{
  digitalWrite(PIN_DATA, buttons[clk++]);
}

void serialFirstButton()
{
  digitalWrite(PIN_DATA, buttons[clk]);  
}

void latch()
{
  buttons[6] = digitalRead(BTN_1);
  buttons[7] = digitalRead(BTN_2);

  clk = 0;
  
  lTime = micros();
}

void loop()
{
}

Here's the reference I'm using: Sci.Electronics FAQ: Repair: SNES Protocols

After doing a rudimentary search I found these, which were more help than the code I've written so far:

https://forum.arduino.cc/index.php?topic=351069.0