Neo Geo Track Ball Games

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.
Here's the data sheet. Will work on this a bit when I can (work and such is distracting me).
 

Attachments

I doubled up my spinner circuit and hooked up a trackball, so I now have an 8-bit counter for each axis. I think all I'm missing are a pair of 74x157 ICs to multiplex both counters and then I can select which counter is fed to the joystick inputs, selected by the X / Y select pin. I presume it's simply held low to select X and held high to select Y, or vice versa.

It's then a case of turning it into some sort of PCB.

 
That'd be appreciated, having a hard time even finding pinouts for these things.
I shared the pinout earlier in the thread:
 
Hello at all,
Got my trackball yesterday and trying to get it work !
I got to the point that the axes move, the counter is correct but I'm doing something wrong with the CN4.6 (!X /Y) signal.
I have to expect a signal that oscillates from 5v to 0 in output from neogeo to select the axis?
I'm testing from MV1B cn4 connect pin 6 but its always low.
Thanks for help.
 
Hello at all,
Got my trackball yesterday and trying to get it work !
I got to the point that the axes move, the counter is correct but I'm doing something wrong with the CN4.6 (!X /Y) signal.
I have to expect a signal that oscillates from 5v to 0 in output from neogeo to select the axis?
Based on the data dump from @nauman that's how I assume it works.
I'm testing from MV1B cn4 connect pin 6 but its always low.
You have the dedicated BIOS, and maybe also the game running?
 
Based on the data dump from @nauman that's how I assume it works.

You have the dedicated BIOS, and maybe also the game running?
I'm using unibios, counter is working.
Its moving but cant select axis.
Maybe its just becouse of unibios
 
just tested with 236-bios.sp1, its low :unsure: i tested in game.
I miss something.
CN4.6 the third pin from the top of cn4 on m1vb.

1769610133793.png
 
just tested with 236-bios.sp1, its low :unsure: i tested in game.
I miss something.
CN4.6 the third pin from the top of cn4 on m1vb.

1769610133793.png
I believe you are on the right output pin but when I took a look at the original SIT-board, it looks like the CON1 have pull-up/pull-down resistors (as well as a capacitor and a limiting resistor). My guess is that the output pin from the MVS does not have enough power to actually pull the line high and the line just becomes floating half the time and pulled-down the other half, making it look always low.
Try putting a high value resistor (~10K) between the line and 5V and see if the signal start making sense. But please make sure your input can handle the voltage you are connecting to so you don't burn the input IC.
 
That might just be that the output pin is of open drain/collector type, the MVS can drive the pin low, but leaves it floating otherwise, so you need to use a pull-up resistor to register a high. 10K should do the trick.

1769629845607.png
 
That might just be that the output pin is of open drain/collector type, the MVS can drive the pin low, but leaves it floating otherwise, so you need to use a pull-up resistor to register a high. 10K should do the trick.

1769629845607.png
I found out the problem:
pins is reverted:

CN4

8=gnd
7=reset
6=AirJet
5=out
4=out
3=out
2=out
1=select XY
 
@pierpa86 thanks for the information, the pinout I gave is correct at the SIT board end.
I got curious and found out the harness as you said reverts the pinout:

SIT ---- MVS
1 ------ 8
2 ------ 7
3 ------ 6
4 ------ 5
5 ------ 4
6 ------ 3
7 ------ 2
8 ------ 1

20260129_114023.jpg
 
Last edited:
I'm almost got it work but
@pierpa86 thanks for the information, the pinout I gave is correct at the SIT board end.
I got curious and found out the harness as you said reverts the pinout:

SIT ---- MVS
1 ------ 8
2 ------ 7
3 ------ 6
4 ------ 5
5 ------ 4
6 ------ 3
7 ------ 2
8 ------ 1

20260129_114023.jpg
Thanks for confirm,
So select its not CN4.6 but CN4.1

At moment i'm stuck on this problem.
Counter is ok but seems i have the ghost of X on Y
I dont understand the timing for write Y


 
At moment I’m writing bus only when select change, maybe 74HC573 can help ? ?(
 
Last edited:
If CN4.6 was X /!Y on my drawing (SIT side) then it should be CN4.3 on the MVS side.

The SIT board writes to the bus continously. You can see it as a 2 to 1 MUX, selecting between X and Y.
 
At moment I’m writing bus only when select change, maybe 74HC573 can help ? ?(
There is a small delay in the BIOS between the X / Y select and the actual reading of the input pin. It takes into account that the SIT-board needs some time to adjust the trackball output, but it also assumes the signal to be continues. You can either just continue writing the output of the joystick or, as you suggested, use a latch ic. Writing multiple times is not gonna cause an issue since the BIOS only reads it once per frame anyway.

Good job so far, you are very close now :)

edit: when I think about it, this could very well be an effect of a floating line so the answer might still be a missing pull-up resistor.
 
Last edited:
If CN4.6 was X /!Y on my drawing (SIT side) then it should be CN4.3 on the MVS side.

The SIT board writes to the bus continously. You can see it as a 2 to 1 MUX, selecting between X and Y.
Thanks to understand with me what happens here and why pinout is not matching on what i get.

This is baseline about NEO-D0 to OUT pins, they go in order from D0 pin4 to pin9 so OUT1 to OUT6


P1 Output 11P DB-15 Pin 10NEO-D0 Pin 4Trackball X / Y selectNo
P1 Output 21P DB-15 Pin 2NEO-D0 Pin 5DataYes
P1 Output 31P DB-15 Pin 9NEO-D0 Pin 6ClockYes
P2 Output 12P DB-15 Pin 10NEO-D0 Pin 7LatchYes
P2 Output 22P DB-15 Pin 2NEO-D0 Pin 8Card dispenserYes
P2 Output 32P DB-15 Pin 9NEO-D0 Pin 9Air JetYes

1769678854786.png


On MV1B we have NEO-SDR where OUT 1 to 6 they were not numbered, so lets find out.
What i have tested 100% sure:

CN4Pins to Neo-SDR
8=gnd
7=reset
6=out NEO-SDR PIN7 - Airjet - its respond from airjet test on bios (pin 9 OUT6 on NEO-D0)

So if the pins are sequential:
5=out NEO-SDR PIN8 - Card
4=out NEO-SDR PIN9 - Latch
3=out NEO-SDR PIN10 - Clock
2=out NEO-SDR PIN11 - Data
1=out NEO-SDR PIN12 - TrackBall (NEO-D0 Pin 4 - OUT1)

Now in my "almost working project" i'm using PIN CN4.1, using CN4.3 is not working.

What you think guys ?

1769678930385.png


Funny part ? Since i'm using RPI Pico on my project i can catch Airjet event and use it to control a rumble motor :-D So we can have a feedback on a conceptual controller.
 
Last edited:
Now in my "almost working project" i'm using PIN CN4.1, using CN4.3 is not working.
According to the pinout you posted above it would be CN4.6, but you have already determined that's the air jet. I need to redo my tests I guess.
That would also mean pins are ordered OUT1~6 on the NEO-D0 but OUT6~1 on the NEO-SDR.
 
Hello guys,
After a lot of testing i'm almost sure that pin Select is CN4.1 but i dont understand how to get timing correctly.
So maybe some one will have more luck than me.
Keep us updated on what new things you discover.
 
Current status:

Logic is:

When OUT1 = 1/0 - latch counter - let MVS read it multiple times.
Thats my first good try, but its still not playable

So I thought about using two different latches, one per axis, to freeze the counter asynchronously and prepare the data for the game before it was requested, to avoid creating the problem of two readings by the MVS for a moving data point.
I'm currently using two software latches and the 573 as a physical buffer.
This way, how to see the error is almost nonexistent, but I don't know where or why it's possible that the game controller could be thrown out of the play area due to an incorrect reading.

I don't know if it's still a timing issue or if the trackball isn't exactly perfect since it's old and has been dusted off.

The only working XY Select signal to me is CN4.1
I can also confirm that is working with with UNIBIOS 4 without any options.



F239666C-9F96-42F1-A1E2-9FB15F20F102.JPG
 
Last edited:
Back
Top