Unique hardware identifiers?

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Unique hardware identifiers?

Post by djcouchycouch » Sun Jan 19, 2014 6:28 pm

Hi,

Is there any way to get some kind of unique information out of a stock Genesis? Something like a serial number or some other kind of unique or semi-unique information that would differentiate a given console from another? Or a set of others?

I don't imagine there's much, or at all, but I figured I'd ask anyway.

Thanks!
djcc

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Sun Jan 19, 2014 6:31 pm

You cannot distinguish individual machines.

You can differentiate TMSS and non TMSS machines, and with some magic it is probably possible to differentiate MD2 from MD1, that aspect I think nemsis can fill in more about.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

djcouchycouch
Very interested
Posts: 710
Joined: Sat Feb 18, 2012 2:44 am

Post by djcouchycouch » Sun Jan 19, 2014 6:58 pm

How about behaviour? Is there some part (I donno, like ram or a sound chip) that behaves slightly differently depending on version? One version has a result that is slightly different or the timing is slighting longer/shorter?

Trying to see if there's anything that could be used as a deterministic seed. Like I said, it doesn't have to be unique per machine.

Ideas for using this would be to generate a unique level depending on what machine its running on.

It's just a mental exercise at the moment :)

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Sun Jan 19, 2014 10:05 pm

There are a few tricks you can use. I don't know if you can totally distinguish on the level you'd want, but here's what I know you can use:

1. 0xA10001, bits 0-3. This holds a hardware version number, which is set to 0 for the original model, and 1 for TMSS models. It may actually be higher than 1 on later hardware versions, I have no idea. I've never tested this register on each system I have. I don't believe you can distinguish between "Mega Drive 1" and "Mega Drive 2" systems using this though, a lot of systems with the first case design have TMSS.

2. VDP VSRAM size. The VSRAM is 0x50 bytes on all systems I've tested, except the "Genesis 3", where it's 0x80 bytes. You can test this by trying to write to the address range 0x50-0x7F and seeing if you can read it back properly.

3. VDP CRAM unused bits. The "Nomad" seems to have a different mapped CRAM bit pattern from memory. I need to go back and look at this further. It's possible it has a higher or lower colour depth. At any rate, it seemed to be detectable from code by abusing the VDP FIFO structure.

4. VDP extended VRAM. The "Teradrive" has 0x20000 VRAM size, which can be enabled in the VDP. Enabling this mode then performing VRAM writes and reads will show if the extended VRAM is present, as the data won't be read back correctly if the memory is missing.

5. YM2612 access delay timing. There's a game called "Hellfire" where the music plays at half speed on a Mega Drive 2 (or a Mega Drive 1 VA7, but this is rare and you can probably ignore this slight overlap). This is because this version of the system, and all later versions, use an embedded YM3438 rather than a discrete YM2612, which has different access timing. This is repeatable and reliable, so if you did some tests on the YM2612 busy flag in the status register, by performing some YM2612 register writes and measuring how long on average it takes for the busy flag to be cleared, you should be able to measure a clear difference between the two systems. I've never done this myself, the busy flag timing of the YM2612 is still on my "to do" list, but if you get stuck, analysing the sound driver in Hellfire will be able to reveal whatever the difference here is.

And of course, the 32x and MegaCD addons are detectable, and you can distinguish between the versions of the MegaCD by checking the present BIOS version. The LaserActive PAC-S1/S10 can also be detected through MegaCD bios version checking, as can the CDX/MultiMega, WonderMega, and X'Eye I believe.

That's everything I'm aware of. I doubt you'll be able to find any way to distinguish between the VA7 and a "Mega Drive 2" since the hardware is virtually identical I believe, but if you ignore that one model number, you should be able to pretty well pick everything else up with the above tricks. I don't know of any difference in timing from the Z80, M68000, or VDP that could be used to narrow things down further. It is possible that there are other tricks that could be discovered though, in particular there may be differences in access delays when taking ownership of the Z80 bus from the M68000, or when the Z80 is performing M68000 banked memory access. You'd have to construct some timing tests and do these measurements on the hardware.

Mask of Destiny
Very interested
Posts: 616
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Mon Jan 20, 2014 7:02 pm

Nemesis wrote:2. VDP VSRAM size. The VSRAM is 0x50 bytes on all systems I've tested, except the "Genesis 3", where it's 0x80 bytes. You can test this by trying to write to the address range 0x50-0x7F and seeing if you can read it back properly.
Another way to check for the Genesis 3 is to use the TAS instruction. It's broken on everything except the Genesis 3 (the set part doesn't happen on earlier consoles).

Nemesis wrote:This is because this version of the system, and all later versions, use an embedded YM3438 rather than a discrete YM2612, which has different access timing.
I believe the VA3 and VA4 MD2/Genesis 2 models have a discrete YM2612 too.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Mon Jan 20, 2014 7:05 pm

Only VA2.x has discrete YM2612. Rest have normal MD2 ASIC or one that appeared in first Genny3 variation. There's two Genny3's and I imagine only the last one has working TAS and extra VSRAM.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Mask of Destiny
Very interested
Posts: 616
Joined: Thu Nov 30, 2006 6:30 am

Post by Mask of Destiny » Mon Jan 20, 2014 7:41 pm

TmEE co.(TM) wrote:Only VA2.x has discrete YM2612.
Doh, you are correct. I got my versions confused.

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Wed Jan 22, 2014 1:34 am

There's two Genny3's and I imagine only the last one has working TAS and extra VSRAM.
Are there really? I'd never heard that. I'm glad I apparently got the later one then.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Wed Jan 22, 2014 2:46 am

MD2 VA4 and Genny3 VA1 share same ASIC. Genny3 VA0 is something nobody has seen so far. VA2 should be only one with TAS and more VSRAM.

Perhaps you could take a look what unit you have ?
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Nemesis
Very interested
Posts: 791
Joined: Wed Nov 07, 2007 1:09 am
Location: Sydney, Australia

Post by Nemesis » Wed Jan 22, 2014 3:16 am

Ok, just cracked my MD3 open, and it's actually a VA1, or at least, it matches the images of a VA1 board I've seen online. The ASIC is 315-5960, same as MD2 VA4. There's no actual revision number marked though. Are we sure this isn't actually the first revision, and it's VA1 that's unknown? The serial number is AG81315854, and the logo is the "GENESIS®" version, which debunks a guideline I saw mentioned on the Sega-16 forums about that indicating a VA2 model.

I have no idea if this unit has working TAS handling, I've never tested that. It does have the extended VSRAM though, this is the unit I did testing on when I found out about it.

TmEE co.(TM)
Very interested
Posts: 2440
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Post by TmEE co.(TM) » Wed Jan 22, 2014 4:22 am

That is the same ASIC as MD2 VA4.

The VA is etched into the PCB, shourd be in lower right.
Mida sa loed ? Nagunii aru ei saa ;)
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen

Huge
Very interested
Posts: 197
Joined: Sat Dec 13, 2008 11:50 pm

Post by Huge » Thu Jan 23, 2014 3:37 am

The serial number should make it possible to identify the hardware inside but it just so happens that the Megadrive did not follow the standard Sega serial numbers until later.
Megadrive 2 did, but it either did not do it consistently, or I just don't have enough test cases.
Nemesis wrote:Ok, just cracked my MD3 open, and it's actually a VA1, or at least, it matches the images of a VA1 board I've seen online. The ASIC is 315-5960, same as MD2 VA4. There's no actual revision number marked though. Are we sure this isn't actually the first revision, and it's VA1 that's unknown? The serial number is AG81315854, and the logo is the "GENESIS®" version, which debunks a guideline I saw mentioned on the Sega-16 forums about that indicating a VA2 model.

I have no idea if this unit has working TAS handling, I've never tested that. It does have the extended VSRAM though, this is the unit I did testing on when I found out about it.
The serial AG81315854 means manufactured by Majesco, in 1998, VA1 hardware, #315854. Genesis 3s with a VA2 board start with AG82. The fourth character (three if the manufacturer code is only one character) is nearly always the board revision number for every Sega hardware made in the 90s, except for the Megadrive 1 (which starts it with letters, cycles up to 0, then stays there for all VA4+ units), and the Megadrive 2 (seems that VA0/1/2 units are all listed as 0, but VA3 and 4 are properly listed in the serial).
Megadrive 3 follows that rule properly though. Actually, I think all 90s Sega hardware does minus the Master System 1, MD1, and partially the MD2, and the Dreamcast which used a new system. Most everything else I recall follows the system fine.

The 315-5960, 315-6123, and 315-5965 (Saturn SCSP) all have a 68k integrated. I don't know which ones have the TAS command working. There are two Saturn games that hanged up on the integrated version.

Megadrive 2 VA4 and Megadrive 3 VA1 uses 315-5960, Megadrive 3 VA2 uses 315-6123.
The 315-5960 is usually next to two RAM chips, and the 315-6123 is only paired with one RAM chip. Plus the video encoder, oscillator, and the necessary caps and resistors for I/o.

The 315-6123 was also sold on its own as a commemorative item in Japan as the Megadrive processor...

Post Reply