emulator ID I/O port

Page 1/7
| 2 | 3 | 4 | 5 | 6

By hap

Paragon (2038)

hap's picture

30-05-2009, 12:45

Following the discussion in the meisei 1.3 newspost it's clear that it can be useful to MSX software developers to have an emulator detector. As emulators get more accurate with every release, it will eventually be near-impossible to detect one. So I'm proposing a dedicated I/O port for this. If openMSX and/or dvik follows, I'll add it to meisei too.

I/O port: dunno yet which.
After writing "h", write "i" to it, consecutive reads will return ":", "D", then a couple of values indicating the emulator (eg. 1 for blueMSX, 2 for openMSX, 3 for ESE3, etc), emulator version, and other parameters we may find useful.
On reset, invalid writes, and after the reads are done, this port will behave as unmapped.

If openMSX agrees to add this, mayhaps dvik can reveal his openMSX-detection secret. ;)

Login or register to post comments

By Manuel

Ascended (18151)

Manuel's picture

30-05-2009, 13:33

But, what's the use of emulator detection? IMHO, this shouldn't exist. Instead, emulators should be improved to support the software that runs on real machines properly... There shouldn't be a need to detect emulators at all.

By hap

Paragon (2038)

hap's picture

30-05-2009, 13:38

dvik's reason to add it to Lotus F3 was fair, to prevent people submitting highscores when cheating, eg. disabling collision in an emu, or savestating their way through a race.

By wolf_

Ambassador_ (9892)

wolf_'s picture

30-05-2009, 13:57

It could be useful to have detection, to use an emulator's bonus features to enhance your game. Think of the custom palette in meisei, just to name something.

By hap

Paragon (2038)

hap's picture

30-05-2009, 14:15

Such a bonus enhancement would be specific to a single emulator, eg. being able to control meisei psg toy or custom palette, would you really use it? Tongue

By Tanni

Hero (556)

Tanni's picture

30-05-2009, 15:43

It seems to be a very good idea, hap! A program should be able to detect if it's run by an emulator -- and especially by which one. In addition to get the emulator code, it should also provide the emulator's name and version, so the software need not hold these names in an extra array, which would save valuable memory space.

Manuel, there may be programs besides games which would become more convenient if they would be able to deal with several features of an emulator. Imagine, if a software would be able to detect that it is emulated and knows the actual emulator and version, there could be communication with it's emulator. Consider the possibilities! The software might tell the emulator to change emulation speed (by sending the particular control sequences), gets access to external devices (disk drives, USB, etc.) via the emulator. It would go beyond just emulating a legacy system and encourage people to write new software for MSX (which of course is then not to be executed at the real hardware).

See here for further possibilities:

www.bluemsx.com/blueforum/viewtopic.php?t=1620

External file system access via an emulator

I would like to do some text analysis with blueMSX and Turbo Pascal on texts I've written under Windows. Of course, it would be possible to put these texts into .dsk-files using the diskmanager, but it would be more convenient to have direct access to the external filesystem of the computer.

I also want to code some/have some Pascal programs on blueMSX which do text output. It would be very convenient to have direct access to them, because the Turbo Pascal editor I use in MSX only supports 40 characters per line; so using the Windows notepad editor is more convenient for writing and modifying the texts.

Besides emulator identification, to implement external file system access, some I/O ports could be dedicated for communication between MSX-software and the emulator. It would be necessary to devise an interface for that.

Maybe it also could be done via the AUX device of MSXDOS?

Was AUX ever used for something in MSX?

By hap

Paragon (2038)

hap's picture

30-05-2009, 16:00

It's in the same category as wolf_'s suggestion, not my initial plan.
Actually, isn't that already possible with "dir as disk"?

By Tanni

Hero (556)

Tanni's picture

30-05-2009, 16:10

Maybe, but it would be nice to have this. And if we start assigning I/O-ports for emulation purposes, we should go straightforward and do it well and proper and ..., you know what I mean.

I still use blueMSX 2.4, once installed a higher version, but reinstalled 2.4 for whatever reason, so I don't know about ''dir as disk'', shame on me!

By dvik

Prophet (2200)

dvik's picture

30-05-2009, 17:28

I think an I/O port could be useful. I think its also nice to get the version of the emulator, to do for example patches like what I did in Utopia for blueMSX.

By Edwin

Paragon (1182)

Edwin's picture

30-05-2009, 18:02

If you're going to do something like that, I agree with Tanni. Make a generic Emulator Interface Port to communicate with the emulator. Define a set of generic functions and the rest is up to the emulator programmers. I'm personally thinking of setting breakpoints from code. That way you can have a breakpoint at a certain location even though it changes while modifying code.

An interface like that could be useful for the 1chipMSX as well. Any maybe you could even make it in hardware. Tongue Then it would be more a Machine Interface.

By hap

Paragon (2038)

hap's picture

30-05-2009, 18:04

I'd go for 2 bytes with that, one for emu ID, one for version, or would you rather have multiple bytes (2,8,1), and/or a string ("blueMSX\0", "meisei\0")?

What do other MSX Software developers think about the "hi are you an emulator?" "oh yes sir I am!", useful? useless? Chance it'd be abused? (if (is_emu) { give mean message and lock up(); }

*edit* Edwin: ok, what functions? Smile ld b,b is common as software breakpoint btw.

Page 1/7
| 2 | 3 | 4 | 5 | 6