Re: [hatari-devel] EKO system regression

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Le 06/10/2019 à 10:06, Thorsten Otto a écrit :
On Sonntag, 6. Oktober 2019 09:47:08 CEST Thomas Huth wrote:
Opinions?

I would do the chaining again as before. Demos are certainly not the only
programs that redirect the gemdos vector, and you'll never know whats they are
trying to achieve. The safest way should be to catch only the calls that would
otherwise go to the ROM, by putting your routine at the end of the chain.

If you don't want to put the code in the cartridge again: another option would
be to insert your illegal opcode directly in the ROM, at the start of the
gemdos dispatcher there. The addresses of all tos versions should be known,
only problem is that they not only depend on the TOS version, but also on the
TOS language.

Hi

I'm not sure it's required to add some illegal opcode or patch the ROM. Maybe another solution could be to add code in the exception() generic handler : when an exception occurs, check its number to see if it's the number for trap 1, 13 or 14 for example. Then check if the resulting exception vector is located in rom or not. if it's located in rom, call the C code to intercept HD emulation, else don't do know anything special.

of course, one problem happens if a program change trap 1 vector to point to another location in ROM instead of the "official" trap 1 vector ; in that case this would call the HD emulation, which would be wrong.

All that put together, maybe the safest way would be build a list of all known tos and for each tos to store in that list the address in rom of the handler for trap 1, 13, 14 or any other handler we could want to patch (line A ?). This list could also contain an MD5 of each ROM so that Hatari could confirm a ROM is genuine or not. There're several language varations for each version, but in the end maybe it's only 30-40 ROM, which is not that much and the list if finite (this is for atari's tos, emutos can certainly be handled in some ways)

what do you think ?

In the end, I think it would be really important if the HD code could become "stealth" and no game or demo refuse to start when HD emulation is ON (which is the case for several protections)

Nicolas




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/