New device letters

For anything related to IO (joypad, serial, XE...)

Moderator: BigEvilCorporation

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

New device letters

Post by Sik » Sun Sep 29, 2019 2:22 am

Turns out that my attempts to bring Saturn peripherals to Mega Drive (through an adapter) have opened a can of worms regarding the device field in the ROM header. Saturn games have a similar field in their header and letters seem to be assigned more or less to the Saturn counterparts, but that's a problem in our case as they clearly aren't compatible, e.g. Saturn controllers are not even remotely compatible with Mega Drive controllers, the 3D controller has nothing to do with the analog joystick, etc.

When I wanted to assign a letter for the Saturn controller my first thought was "S", but it turns out Sega already assigned that to the steering wheel (and I wouldn't put it past people to try to make use of the steering wheel in homebrew or hacks if adapters become more common). And the Saturn's letter for its controller is predictably "J", which obviously we can't use for it…

Another issue comes with the keyboard, since "K" nominally means keyboard, but on the Mega Drive in practice it ended up being used to refer to the Ten Key Pad (Mega Anser reports "K" in its device field), which has nothing to do with the Saturn keyboard.

I'd say something about the mouse but Sega straight up reused the packet format, so Saturn and Mega Drive mouses are compatible (lol)


Anyway, does anybody have any suggestions about how we should map support for Saturn peripherals on a Mega Drive? I know most of the ROM header goes ignored in practice and that the device field is one of the worst offenders but keeping it usable as much as possible would be nice. One idea I had was to use lowercase letters but it feels awkward (on the other hand, all of the Saturn peripherals seem to be identified by letters).

For context, list taken from "SEGA SATURN TECHNICAL BULLETIN #40":
  • J: controller
  • A: mission stick
  • M: mouse
  • K: keyboard
  • S: steering wheel
  • T: multitap
  • G: lightgun
  • C: Saturn-to-Saturn cable
  • P: MPEG card
  • F: floppy drive
  • D: modem
  • X: XBAND
Sik is pronounced as "seek", not as "sick".

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

Re: New device letters

Post by TmEE co.(TM) » Sun Sep 29, 2019 11:42 am

Use lowercase letters too not just uppercase ones, or perhaps just set the top bit to show it is saturn peripheral and not MD.
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

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: New device letters

Post by Sik » Mon Sep 30, 2019 1:41 am

Yeah, I'm starting to lean towards lowercase letters too. It just feels awkward when everything else is uppercase but it does seem like the most surefire way to avoid conflicts and avoid having to wait for people to settle on something (and, huh, I need two of those right now).

If not going with that, somebody on Twitter suggested using "8" (for 8 button) because the 6-button controller uses "6":
https://twitter.com/ExtrordinaryBen/sta ... 3786969088
though it's quite misleading since the 6-button controller is technically 7 button by that definition :​O) (Saturn's R is 6-button's Mode)
Sik is pronounced as "seek", not as "sick".

Miquel
Very interested
Posts: 514
Joined: Sat Jul 30, 2016 12:33 am

Re: New device letters

Post by Miquel » Mon Sep 30, 2019 7:30 pm

I never understood it: what’s the practical usage of this field?
HELP. Spanish TVs are brain washing people to be hostile to me.

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: New device letters

Post by Sik » Tue Oct 01, 2019 1:32 am

I think there was the idea for BlastEm to look at this field to give decent peripheral defaults for games that aren't in the ROM database (sadly a bunch of games put bullshit here and will need to be special cased, especially the Codemasters ones which claim to support everything). Other emulators could do the same thing too.

But yeah, it's mostly to keep the ROM header valid. Technically, as far as real hardware is concerned, the only thing that matters is to have "SEGA" at $000100 :​P
Sik is pronounced as "seek", not as "sick".

Miquel
Very interested
Posts: 514
Joined: Sat Jul 30, 2016 12:33 am

Re: New device letters

Post by Miquel » Tue Oct 01, 2019 10:14 am

Perhaps it was used for internal testing on Sega headquarters just before gold production, to know with which type of input they should test the game. Just speculating.

And, yes it could be useful for and emulator for choosing the default device.
HELP. Spanish TVs are brain washing people to be hostile to me.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Re: New device letters

Post by Chilly Willy » Tue Oct 01, 2019 2:50 pm

I also like the idea of lower case for Saturn peripherals. And yes, absolutely nothing in the header matters in the slightest for actual hardware other than the "SEGA" at 0x100, and that's only if you don't have hardware on your cart that allows bypassing the TMS protection like Jorge's carts.

Miquel
Very interested
Posts: 514
Joined: Sat Jul 30, 2016 12:33 am

Re: New device letters

Post by Miquel » Tue Oct 01, 2019 3:28 pm

Concerning the 8 button saturn pad on megadrive, I think the key factor is how data is served; if it follows the exact same pattern as 6 button megadrive pad, just two more bits for L and R (or however are labeled on saturn) I think it should add the character “8”.

So the string for a game compatible with 3 button pad, 6 button pad and Saturn 8 button pad, I think, should be:
“J68”

I believe the same idea follows for other devices. If it’s a completely a new bit arrangement, or sequences of bytes, it should just use a new letter.
HELP. Spanish TVs are brain washing people to be hostile to me.

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: New device letters

Post by Sik » Wed Oct 02, 2019 10:38 am

It's a completely different protocol (albeit they kept the button order similar… with R in place of where Mode usually goes).

Mind, 6-button controller is the exception to the rule (and the reason why you have to include "6" only if the extra buttons are actually used for anything), pretty much every other peripheral that can have a character is incompatible with anything else. As for why letter or not: remember "4" is the Team Player (the multitap), which definitely has its own completely unique protocol :​P

Anyway, I guess I'll go with lowercase letters then (making the device field in Arkagis so far "J6Mkj"… gosh, that one is getting absurd)
Sik is pronounced as "seek", not as "sick".

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

Re: New device letters

Post by TmEE co.(TM) » Thu Oct 03, 2019 7:18 pm

Ok, so you support the Saturn stuff in your game ? How would the MD port pins be connected to the Saturn port ? I'm not sure any standard exists...
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

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Re: New device letters

Post by Chilly Willy » Thu Oct 03, 2019 11:14 pm

TmEE co.(TM) wrote:
Thu Oct 03, 2019 7:18 pm
Ok, so you support the Saturn stuff in your game ? How would the MD port pins be connected to the Saturn port ? I'm not sure any standard exists...
The Saturn has the same lines as the MD, just a different connector. Using Saturn controllers on the MD is as easy as splicing two extension cables together.

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: New device letters

Post by Sik » Fri Oct 04, 2019 5:34 am

Yep, I even documented the pinouts:
https://plutiedev.com/io-pinout

Better yet, if you do it the other way (Mega Drive to Saturn), the SMPC will actually recognize some of the Mega Drive peripherals and a lot of Saturn games should be able to recognize them (albeit a 6-button controller won't have a L button, so try to pick a game that doesn't need L).

From what I recall, the rumor was that Atari went lawsuit happy demanding royalties over the use of DE-9 shaped ports (le sigh) and Sega decided to change the shape in response. This definitely would explain why the Saturn uses different plugs but still has the same lines.
Sik is pronounced as "seek", not as "sick".

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Re: New device letters

Post by Chilly Willy » Fri Oct 04, 2019 2:10 pm

The lawsuit with Sega was over horizontal scrolling, which Sega lost. Nintendo settled with Atari on the same thing out of court. The controller lawsuit from Atari was against Commodore in the 80s, and was NOT about the connector, it was about the shape of the controller itself. Atari had a design patent on the shape of the 2600 joystick, and Commodore made a clone of it for the VIC 20. Atari sued using the designed patent on the shape. I'd more likely suspect they changed because those old DE-9 connectors aren't very reliable in the long term. You'll replace more DE-9 connectors on old systems/consoles than anything else.

I suspect the horizontal scrolling suit is probably why VDP2 bares no resemblance to how the old VDP does tiles/planes. It probably wasn't so much making things better as in making it DIFFERENT to avoid another lawsuit.

Miquel
Very interested
Posts: 514
Joined: Sat Jul 30, 2016 12:33 am

Re: New device letters

Post by Miquel » Sat Oct 05, 2019 12:50 pm

Sik, I think there are two approaches here:

a) Every distinct device has its own letter. In that case lowercase is confusing.

b) For sake of simplicity let’s group similar devices into groups, same letter if possible, or if there are small differences using letters that are more coincidental.

Which plan is best depends on intention.
HELP. Spanish TVs are brain washing people to be hostile to me.

Sik
Very interested
Posts: 939
Joined: Thu Apr 10, 2008 3:03 pm
Contact:

Re: New device letters

Post by Sik » Sat Oct 05, 2019 3:01 pm

The important part is that they're distinct byte values (and using lowercase actually does fulfil that requirement).
Chilly Willy wrote:
Fri Oct 04, 2019 2:10 pm
The lawsuit with Sega was over horizontal scrolling, which Sega lost. Nintendo settled with Atari on the same thing out of court. The controller lawsuit from Atari was against Commodore in the 80s, and was NOT about the connector, it was about the shape of the controller itself. Atari had a design patent on the shape of the 2600 joystick, and Commodore made a clone of it for the VIC 20. Atari sued using the designed patent on the shape. I'd more likely suspect they changed because those old DE-9 connectors aren't very reliable in the long term. You'll replace more DE-9 connectors on old systems/consoles than anything else.

I suspect the horizontal scrolling suit is probably why VDP2 bares no resemblance to how the old VDP does tiles/planes. It probably wasn't so much making things better as in making it DIFFERENT to avoid another lawsuit.
I think there were several things going on at once (Atari was really desperate for money, they probably sued for just about everything they could think on). No idea of the controller stuff got tossed in or not.

But if it wasn't rushed at last minute then it feels kind of stupid that they kept the original connections instead of getting rid of legacy stuff (and in particular, enforcing the SMPC protocol instead of allowing direct access). Honestly not sure what's going on.

At least now we have a way to get a bunch more of peripherals by borrowing them from Saturn lol
Sik is pronounced as "seek", not as "sick".

Post Reply