Title

TL;DR

  • Signal description of the SNK Neo Geo Pocket Color
  • Pinout for the display connector
  • Demo capture driver written in C for the RP2350
  • Driver using only DMA/PIO for capturing (no CPU)
  • Integrated color correction table
  • Signal captures in Saleae Logic format

Introduction

After taking a look at the display signals of the Game Boy lineup and the WonderSwan, I got lucky and was offered a Neo Geo Pocket Color as a donation for signal analysis.

The device dates back to 1999. And let’s just say, given my age, I really should have known about it back then, but somehow completely missed it. So before accepting the offer, I had to do a bit of research to find out what I was actually getting myself into.

The Neo Geo Pocket is actually closely related to the Sega world, but was designed and sold by SNK. It is a much cleaner design than the Sega devices and could be seen as a direct competitor to the Game Boy Color and the WonderSwan Color.

This makes it a great fit for my “signal analysis series”.

Signals

Setup

The Neo Geo Pocket Color uses a reflective TFT display with a resolution of 160 × 152 pixels. The color palette consists of 4096 colors, with 146 colors displayed simultaneously. Looking at the PCB, we can find some labeled test points, including SPS, SPL, DCLK, R0-3, G0-3, and B0-3. This gives us a first hint of what kind of signals we should expect.

Signals on PCB

SPS (probably Start Pulse Scan) is commonly known today as VSYNC, while SPL (probably Start Pulse Line) is commonly known as HSYNC. The dot clock (DCLK) and R/G/B0-3 are self-explanatory.

After the WonderSwan Color, it’s good to see something familiar. All signals hooked up to the logic analyzer didn’t show anything unexpected. Let’s first have a look at the big picture.

Signal Overview

The image shows a whole frame. Between the VSYNC (SPS) and the first line of data, we can see some spacing. The pixel clock (DCLK) is only active during actual line data transfers, which are indicated by the active HSYNC.

When we dive a bit deeper, we can have a look at the PS and LP signals. The LP signal is kind of a line-end signal and might be used as a latch on the original display. I’m not sure about the PS signal, but it is the only constant signal apart from VSYNC. It provides a clock signal with approximately 12 kHz (6.144 MHz / 512) and a changing duty cycle of 90% or 50% during line data transfer.

LP and PS signal

Neither of these signals is really required to reconstruct the picture, so we will have a look at SPS, SPL, DCLK, and the R/G/B lines in the following.

Let’s start with SPS, SPL, and DCLK. There is quite some time between the VSYNC pulse and the start of the pixel data, but not much at the end of a frame. This can be quite handy when developing a driver and provides some additional setup time. I have measured a frame rate of 59.954 Hz, which reminds me a bit of the Game Boy’s 59.7-ish Hz.

VSYNC timing

After the VSYNC pulse, we get 153 HSYNC pulses. It has turned out that the last line doesn’t contain any relevant data and can be left out.

HSYNC timing

Within the provided captures, you will find a lot of falsely triggered HSYNC pulses. This is partially due to the probing method, but it also shows the sensitivity of the HSYNC line to noise, which I also experienced when writing the driver. I haven’t had these effects on any other platform so far with the same setup. Also, this time it wasn’t a grounding issue ;) I think this problem might simply disappear with a properly designed PCB, but it has to be taken into account and might be worth some further analysis.

Glitches on HSYNC

Looking closer at the pixel data within a line, we have a DCLK running at half the system clock (3.072 MHz) and 161 pulses per line.

Line details

The first pulse during HSYNC is high and has to be skipped in order to get a correct image.

Signal at start of the Line

The data on the data lines (R0–3, G0–3, and B0–3) is valid on the rising edge of the clock.

Data alignment

In comparison with the Game Boy Color and the Game Boy Advance, the signal can be captured in pretty much the same straightforward way. From the signal names and signal polarity to the handling of additional frames and pixels, it is identical. Only the resolution and timing are different. Also, there are only 12 data lines for the colors.

Demo Driver

The driver is intended to be used with the Open xGB Display board. It should run as well on any RP2350 (PiPico2) based board and maybe on an RP2040 (PiPico) when GPIO ports are modified. A nice option for testing e.g. is the WeAct RP2350B core board.

As mentioned, the signal is quite close to the Game Boy and Game Boy Advance. Still, I decided to adopt the WonderSwan capture driver for the NGPC. First, because I claimed in the WonderSwan post that it is easily adaptable to other platforms, and second, because it is able to run without CPU interaction. This means it can handle color translation and optionally color correction to, e.g., RGB555 or RGB565, which can then be transferred directly to a display.

I had to make some adjustments to the driver. As I mentioned, HSYNC sometimes triggers due to noise from the other signals. My test setup might not be the best in terms of signal integrity, but this was noticeable compared to other devices I have worked with. I added some hardening against these glitches to the driver, which can’t hurt even if it is used with a better setup.

Basically, the driver can be seen as approximately 200 lines of initialization code for the PIO (requiring 1 PIO with 3 SMs) and DMA units (requiring 4 channels). After this, the image data magically appears in a memory buffer.

Pinout

All display signals are available on a 36-pin, 0.5 mm-pitch FPC connector. The following voltage levels were measured without a display connected. The bold signals are required for capturing. The signal names are mostly taken from the PCB silkscreen.

Pin Voltage level Signal Comment Open xGB J4 RP2350 GPIO
1 14.4V DC LCD-specific voltage? - -
2 -9V DC LCD-specific voltage? - -
3 3V MOD High ripple - -
4 3V SPS VSYNC 3 43
5 3V CLS - - -
6 -14.4V PWM Static - -
7 -12V to -6V PWM 50% duty - -
8 -12V to -6V PWM 50% duty - -
9 -1.2V to - 4.1V PWM 50% duty - -
10 -1.2V to - 4.1V PWM 50% duty - -
11 3V SPL HSYNC 4 42
12 3V R0 RGB444 Red LSB 13 32
13 3V R1 - 14 33
14 3V R2 - 15 34
15 3V R3 RGB444 Red MSB 16 35
16 3V G0 RGB444 Green LSB 9 28
17 3V G1 - 10 29
18 3V G2 - 11 30
19 3V G3 RGB444 Green MSB 12 31
20 3V B0 RGB444 Blue LSB 5 24
21 3V B1 - 6 25
22 3V B2 - 7 26
23 3V B3 RGB444 Blue MSB 8 27
24 3V DC Low ripple static VCC? - -
25 0V GND - 1 -
26 3V PS - - -
27 3V LP - - -
28 3V DCLK Pixel clock 20 41
29 4.8V DC - - -
30 4V PWM 5.9kHz 50% - -
31 1V to 2.8V PWM 5.9kHz 50% - -
32 1.6V to 2.4V PWM 5.9kHz 50% - -
33 1.7V to 2.4V PWM 5.9kHz 50% - -
34 1.1V to 3.3V PWM 5.9kHz 50% - -
35 0.4V to 4.1V PWM 5.9kHz 50% - -
36 0 V GND - 2 -

Acknowledgements

A big thank you to sfiera for the generous donation! It gives me a dedicated device to experiment with, and dig deeper into the platform.

He also shares some really cool information and projects about retro gaming, for example:

Downloads

You will find the driver demo projects on codeberg.org: https://codeberg.org/embedded-ideas/ngpc_capture_demo