Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Game Gear H488, Colour-bus, CRAM, and Unused VDP pins

Reply to topic
Author Message
  • Joined: 14 Aug 2000
  • Posts: 740
  • Location: Adelaide, Australia
Reply with quote
Game Gear H488, Colour-bus, CRAM, and Unused VDP pins
Post Posted: Wed Jan 13, 2021 2:24 am
I searched the forums for this and it looks like nobody has posted specifically on this info so I thought I'd start a new post.

I'm currently repairing a “2 ASIC” EU Game Gear. While doing so I had a poke around the VDP and SCA. Here's what I've found:

H488
H488 is a sort of HYSNC signal. It has a short high pulse at 15.7k during HSYNC. There's no change in operation between GG-mode and SMS-mode. So it doesn't appear to be some sort of signal from the SCA to notify the VDP of GG-mode or SMS-mode. As such, the VDP has no way of knowing if it is in GG-mode or SMS-mode. This leads to the next point.

CRAM is in the SCA
As the VDP doesn't know whether its in GG-mode or SMS-mode, it's up to the SCA to adjust the colour depth accordingly, as well as the scaling, etc. That would therefore put the CRAM in the SCA and not the VDP. This is in line with other Sega VDP of the period in arcade machines and the Megadrive where the VDP had external CRAM and "Colour" bus between the VDP and CRAM. This leads me on to the next point.

Colour Bus
CPA0, CPA1, CPA2, CPA3, CPB therefore appears to be a “Colour Bus” between the VDP and SCA where CPA0-CPA3 is the 4-bit palette entry for the pixel currently being output, and CPB indicates whether the pixel is using the first or second colour palette.

Unused VDP pins
I had a poke around the 9 unused pins of the VDP. With HSYNC and VSYNC present but not used, I thought some of these pins may be the “analog” RBG and audio outputs. But it doesn't appear to be the case.
I saw no output on these pins. Pulling some of the pins high through a 4k7 resistor didn’t activate any output on the other pins. There may be a hidden bit in one of the VDP registers to turn on these pins, who knows.
  View user's profile Send private message
  • Joined: 28 Sep 1999
  • Posts: 1197
Reply with quote
Post Posted: Wed Jan 13, 2021 3:22 am
Wow this is really great stuff. Nice research!

Your description of the color bus and CRAM in the SCA definitely helps to explain how the TMS9918 modes work. I suppose they'd need to allocate another pin to inform the SCA if the VDP is in SMS or TMS mode, and then add a hardwired palette to the SCA. Probably too costly to do all that given how few games would need it.

Since H488 is triggered on every line I wonder if it's used horizontal positioning/centering of the GG display area within the full VDP frame. Then in SMS mode the SCA would just ignore the pulse perhaps.
  View user's profile Send private message Visit poster's website
  • Joined: 14 Aug 2000
  • Posts: 740
  • Location: Adelaide, Australia
Reply with quote
Game Gear H488, Colour-bus, CRAM, and Unused VDP pins
Post Posted: Wed Jan 13, 2021 1:50 pm
I think H488 must be used as the Horizontal Sync signal. HBLANK and VBLANK are connected to the SCA but HSYNC and VSYNC are not. H488 blips a 0.2uS-wide (i.e. 1-pixel wide) pulse that is fired 0.2uS before /HSYNC goes high again.
DSC_2646.JPG (326.48 KB)
Game Gear VDP 315-5377 H488 and HSYNC timing
DSC_2646.JPG

  View user's profile Send private message
  • Joined: 31 Oct 2007
  • Posts: 853
  • Location: Estonia, Rapla city
Reply with quote
Post Posted: Thu Jan 14, 2021 8:38 am
Yeah, palette is applied in the SCA aswell as windowing(+scaling for LCD), and IO mapping in GG and SMS modes. If SCA had different pins to control windowing and IO mapping it would be possible to do "full screen" GG stuff with video output mods but unfortunately that also means IO stuff changes to how it works in SMS mode and games will crash lol.

It is in my todo list to make a replacement SMS board using GG VDP to get perfect compatibility with TMS, SMS and GG at the same time... but hands are full and I don't really play anything much anymore...

Also the PSG sound channels are all separated on GG VDP, everyone is output on its own pin and SCA can control if any goes into L, R or both outputs. There's a pin connected to headphone connector that forces mono output, when nothing is connected so that all sounds are present on internal speaker.
  View user's profile Send private message Visit poster's website
  • Joined: 28 Sep 1999
  • Posts: 1197
Reply with quote
Post Posted: Fri Jan 15, 2021 3:38 pm
Does this mean that the SCA duplicates some of the VDP logic for CRAM access so it can snoop I/O writes and maintain the palette data internally?

If so does that imply the VDP doesn't have any CRAM? (or for the sake of repurposing old designs, it does, but it isn't used for anything?)
  View user's profile Send private message Visit poster's website
  • Joined: 31 Oct 2007
  • Posts: 853
  • Location: Estonia, Rapla city
Reply with quote
Post Posted: Fri Jan 15, 2021 5:12 pm
VDP has no CRAM in it, or at least I don't think it does. There is no output on it that reflects palette state in any way, only index into palette. There's also no signals coming from it that could indicate SCA that palette access was being made so SCA must be trying to emulate some functionality of VDP to make things work.
  View user's profile Send private message Visit poster's website
  • Joined: 25 Jul 2007
  • Posts: 716
  • Location: Melbourne, Australia
Reply with quote
Post Posted: Sat Jan 16, 2021 7:24 am
I was intrigued by your research so I hooked up a logic analyzer to those pins. I don't have the technical know-how to analyses the data but I have attached screenshots at various zooms and the Saleae Logic capture file if you want to have a deep dive yourself to see the specific timing (requires Logic 2 Alpha version).

One thing I will note regarding H488 is as you noticed it does pulse on HBLANK, there are times I notice when all pins except CPB pulse on VBLANK.
Capture1.JPG (171.73 KB)
Capture1.JPG
Capture2.JPG (228.73 KB)
Capture2.JPG
Capture3.JPG (144.19 KB)
Capture3.JPG
Capture4.JPG (147.18 KB)
Capture4.JPG
Capture5.JPG (255.12 KB)
Capture5.JPG
Capture6.JPG (134.91 KB)
Capture6.JPG
Capture7.JPG (122.19 KB)
Capture7.JPG
VDP to SDA2.zip (4.06 MB)
Saleae Logic capture file

  View user's profile Send private message
  • Joined: 25 Jul 2007
  • Posts: 716
  • Location: Melbourne, Australia
Reply with quote
Post Posted: Sat Jan 16, 2021 8:00 am
Seems that last capture the GG may not have been booting the game, so here's another capture where I verified the game was still booting (Columns).

  View user's profile Send private message
  • Joined: 14 Aug 2000
  • Posts: 740
  • Location: Adelaide, Australia
Reply with quote
Game Gear H488, Colour-bus, CRAM, and Unused VDP pins
Post Posted: Sun Jan 17, 2021 1:26 am
Legend.

Did you snoop any of the N.C. pins with the LA? I'm wondering if these are somehow enabled, or if they were set aside for the analog AV outputs for a later revision of the VDP and disconnected in this revision.

@Charles, no doubt the SCA has to process writes to CRAM via port $BF. But that's trivial to do compared to everything else it does.
  View user's profile Send private message
  • Joined: 25 Jul 2007
  • Posts: 716
  • Location: Melbourne, Australia
Reply with quote
Post Posted: Sun Jan 17, 2021 3:55 am
Everything except pin 43 is pretty much dead (pin 80 not shown in the picture because I only have 8 inputs).
nccap1.JPG (114.17 KB)
nccap1.JPG
nccap2.jpg (133.16 KB)
nccap2.jpg
nccap3.jpg (133.1 KB)
nccap3.jpg

  View user's profile Send private message
  • Joined: 14 Aug 2000
  • Posts: 740
  • Location: Adelaide, Australia
Reply with quote
Game Gear H488, Colour-bus, CRAM, and Unused VDP pins
Post Posted: Sun Jan 17, 2021 6:37 am
That's interesting. Pin 43 is right amongst the VRAM bus pins.

The waveform has a period of 375nS which is very close to the time for 2 pixels.

The snapshot shows the duty cycle is 33% for about 10 pixels.

Then it goes to a 50% duty cycle for 9 pixels worth of time.

Before it returns to a 33% duty cycle.
  View user's profile Send private message
  • Joined: 25 Jul 2007
  • Posts: 716
  • Location: Melbourne, Australia
Reply with quote
Post Posted: Sun Jan 17, 2021 7:20 am
As it's a pretty constant signal then, would that likely make it some sort of pixel clock?
  View user's profile Send private message
  • Joined: 14 Aug 2000
  • Posts: 740
  • Location: Adelaide, Australia
Reply with quote
Game Gear H488, Colour-bus, CRAM, and Unused VDP pins
Post Posted: Sun Jan 17, 2021 12:46 pm
It's doesn't look like a clock or sync signal because they don't change duty cycle like that. It could be some sort of unused address strobe for VRAM, maybe a /RAS or /CAS? Hard to say.
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!