Emulator and TMSS

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Emulator and TMSS

Post by KanedaFr » Wed Sep 10, 2014 8:46 am

Hi,

Is there an emulator which correctly emulate TMSS ?
I know Fusion could load the Genesis rom (and so the TMSS) but does it hang like it should (http://segaretro.org/TradeMark_Security_System)

I ask because I'm fixing some games which is not TMSS ready and I only have pre-TMSS genny 1 so no way to fully test my hack (:

It works on Fusion with TMSS but it is enough ?

twosixonetwo
Very interested
Posts: 58
Joined: Tue Feb 25, 2014 3:38 pm

Post by twosixonetwo » Wed Sep 10, 2014 8:57 am

I'm not quite sure I understand what you want: Do you want it to hang, or to not hang?

Either way, I am quite sure that TMSS is well researched so you should be safe by doing what toe segaretro article says if you want it NOT to hang on TMSS machines, or to make sure your rom does not comply with this if you want it to hang.

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Wed Sep 10, 2014 9:34 am

I want it to hang ;)

Of course I'm following sega retro article (and some others hint from people here) but I can't test it :(

twosixonetwo
Very interested
Posts: 58
Joined: Tue Feb 25, 2014 3:38 pm

Post by twosixonetwo » Wed Sep 10, 2014 9:52 am

Are you sure your bios rom is working?
I tested the behaviour in Fusion with a bios rom and it worked like it should:

Original game:
Shows TMSS screen, then plays game.

Hacked rom without "SEGA" at 0x100:
Black screen

(Without the bios rom both versions ran)

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed Sep 10, 2014 10:32 am

I was in your case Kaneda and as far I searched no emulator emulate correctly the TMSS security lock. When I tested on real hardware it appeared you have to write 'SEGA' in the security register (A14000) in a short period of time after cold boot before accessing VDP. If you don't do that, any write to the VDP will lock the system.
Last edited by Stef on Wed Sep 10, 2014 12:25 pm, edited 1 time in total.

twosixonetwo
Very interested
Posts: 58
Joined: Tue Feb 25, 2014 3:38 pm

Post by twosixonetwo » Wed Sep 10, 2014 11:30 am

Are you sure not even Exodus emulates this correctly? At least it explicitly has an option for using TMSS with and without VDP lockout, I didn't test it though.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Wed Sep 10, 2014 12:23 pm

To be honest i was even not able to make Exodus working with TMSS.
I setup the genesis bios but for some reasons it was not using it or not booting correctly. It's a shame because Exodus has many interesting features but it does have many problems on my system. For instance i have to unload all modules and reload them one by one (megadrive, controller, rom loader...) to boot correctly a rom (otherwise i obtain a gray screen). It's really a pain as i do have to reconfigure controller buttons every time for instance.

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

Post by Mask of Destiny » Wed Sep 10, 2014 2:51 pm

I'm planning on adding support for TMSS to BlastEm, but it hasn't been a huge priority. I could probably through together a quick implementation over the weekend (wouldn't necessarily be accurate if there are any timing constraints, but better than nothing), but I don't know how useful that would be for you since you're on Windows from what I remember. I could produce a new Windows build, but it would have the same limitations as the last one (no Z80 and at least one other 32-bit related bug).

KanedaFr
Administrateur
Posts: 1139
Joined: Tue Aug 29, 2006 10:56 am
Contact:

Post by KanedaFr » Wed Sep 10, 2014 2:54 pm

I don't need it NOW
I"m just listing the available solution...

It seems a cheap MD2 is the easy one.
I just hope my SMD works on MD2 ;)

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Wed Sep 10, 2014 8:12 pm

It's emulated in Genesis Plus GX so if you have a modded Wii you can test it easily too. On windows, there is the Retroarch port but it has more limited features and non-TMSS model is forced by default. It could quickly be added as a new core setting though if this is really needed.

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Sep 11, 2014 7:47 am

Is the emulation really accurate ? I don't think any emulator take attention to the limited time period allowed to write the security register but I can confirm it exists on real hardware.

Eke
Very interested
Posts: 884
Joined: Wed Feb 28, 2007 2:57 pm
Contact:

Post by Eke » Thu Sep 11, 2014 9:20 am

From the available patent, TMSS is really simple, it latches data written to $a140xx and compares the last string written to "SEGA" string. When VDP address is accessed, CPU is halted (probably using HALT or RESET signal since VDP generates DTACK itself) if string comparator fails.

http://www.google.com/patents/US5155768

This is how I emulated it at least, there does not seem to be any delay or specific timing involved, my guess is that it will always lock at some point because any software has to access VDP if you want something else than a black screen.

But maybe there is more than what they described in patent. Are you sure there was no code trying to access VDP before your first write to the register ?

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Post by Stef » Thu Sep 11, 2014 12:37 pm

Yeah i already read the patent but i believe it does not give every details. Actually i got a game which was not working on my NTSC system (but worked in PAL), i modified the code to write the security code "earlier" (it had some weird init processing) and it worked in both NTSC / PAL case. I verified the original code was not accessing VDP port before writing security code but it was not enough to make it work. Maybe i missed something as i believe others games write the security code "not that early" and it works.

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

Post by Nemesis » Tue Sep 16, 2014 5:42 am

TMSS support in Exodus was fairly last minute, and not based on any hardware tests. No guarantees at all that it works the same way as the real hardware at this point. This is one of many things that needs to be addressed in order to truly make Exodus hardware-exact. Implementing (optional) hardware lockups for access to areas that don't assert DTACK hasn't even been done though, and that was higher on my list than hardware-exact TMSS support.

Post Reply