Kujako
Champion
Here's the data sheet. Will work on this a bit when I can (work and such is distracting me).I had since reinstalled my laptop so I had to dig through the backup I made before I wiped it. Here's what I found:
C:// Basic NEC µPD4701AC test code // // Wire up the Arduino pins to the chip based on the comments below. // You will use digital pins 2-11 as inputs and analog pins 0-4 as outputs. // // In addition: // * Use 10KΩ pullup resistors on the three button inputs // * Use 4.7KΩ pullup resistors on the four X1/X2/Y1/Y2 inputs void setup() { Serial.begin(9600); // D0-D7 pinMode(2, INPUT); pinMode(3, INPUT); pinMode(4, INPUT); pinMode(5, INPUT); pinMode(6, INPUT); pinMode(7, INPUT); pinMode(8, INPUT); pinMode(9, INPUT); // !SF pinMode(10, INPUT); // !CF pinMode(11, INPUT); // Reset X & Y pinMode(A0, OUTPUT); pinMode(A1, OUTPUT); digitalWrite(A0, LOW); digitalWrite(A1, LOW); // !CS pinMode(A2, OUTPUT); digitalWrite(A2, HIGH); // X/Y pinMode(A3, OUTPUT); digitalWrite(A3, LOW); // U/L pinMode(A4, OUTPUT); digitalWrite(A4, LOW); } byte readByte() { byte b; for (int i = 0; i < 8; i++) { b |= digitalRead(i+2) << i; } return b; } void loop() { byte left, middle, right; uint16_t x, y; // Read CF & SF interrupt pins if (!(digitalRead(10) && digitalRead(11))) { // CS low digitalWrite(A2, LOW); // X counter low byte (X/Y=0 U/L=0) digitalWrite(A3, LOW); digitalWrite(A4, LOW); x = readByte(); // X counter high byte (X/Y=0 U/L=1) digitalWrite(A3, LOW); digitalWrite(A4, HIGH); x |= uint16_t(readByte()) << 8; // Pick out the button status from the upper nibble of the upper byte left = x & 0x4000 ? 1 : 0; right = x & 0x2000 ? 1 : 0; middle = x & 0x1000 ? 1 : 0; // Mask out the upper nibble of the upper byte x &= 0xfff; // Y counter low byte (X/Y=1 U/L=0) digitalWrite(A3, HIGH); digitalWrite(A4, LOW); y = readByte(); // Y counter high byte (X/Y=1 U/L=1) digitalWrite(A3, HIGH); digitalWrite(A4, HIGH); y |= uint16_t(readByte() & 0xf) << 8; // Mask out the button status this time Serial.print("L="); Serial.print(left); Serial.print(" M="); Serial.print(middle); Serial.print(" R="); Serial.print(right); Serial.print(" X="); Serial.print(x); Serial.print(" Y="); Serial.println(y); // CS high again digitalWrite(A2, HIGH); } }
I think you will need the datasheet to know what the pinout on the chip is.
i tested in game.

So we can have a feedback on a conceptual controller.