|
ForumsSega Master System / Mark III / Game GearSG-1000 / SC-3000 / SF-7000 / OMV |
Home - Forums - Games - Scans - Maps - Cheats - Credits Music - Videos - Development - Hacks - Translations - Homebrew |
![]() |
Author | Message |
---|---|
|
Read joypad through Game Gear's cartridge Pins
![]() |
Greating,
For a personal project, I will need to do something a bit tricky that requieres some good knowledge in Sega hardware and electronic obv. Maybe for some of you it will seems simple but anyway, here is what I'm trying to do : Getting joystick informations from a Game Gear cartridge slot. To be more precise and after reading the GG Hardware Reference Manual I have to retrieve data from 8 pins (D0-D7), each bit to 0 meaning that corresponding button is pressed. But, when am I supposed to read this data as D0-D7 are used for a lot of other things ? BTW I'm planing to redirect those 8 pins to a esp32's GPIO in order to process data. Thanks for your help |
|
![]() ![]() |
|
|
![]() |
Greating to you too @Galix! ;)
Assuming that the Game Gear works like a Master System in this respect and drives the cartridge port buses while reading from the control port (it may not!), then you just need to decode the I/O read request in addition to reading the data port. Since most of what you need is read through port $DC in software, you can fully decode the read by registering the values on the data port only when address lines A7:0 read 11011100, and when #RD is 0, and when #IOREQ is 0. You might be able to get away with a partial decode. The SMS decodes only A7, A6 and A0, in which case you'd be looking for a 1, 1 and 0 respectively; but I know the GG has some more ports and itself fully decodes all the address lines, so it might not be enough. Will get back to you. EDIT: quickly flicking through this doc one might guess that a partial decode of A6, A7 and A0 would probably work. The start / pause button is a bit different - for that you need to watch the #NMI line, which I don't think is exposed through the cart slot :( If you really need to catch it, you could maybe watch for a memory read to address $0066 where #M1 is 0 and #RFSH is 1 - I think! |
|
![]() ![]() ![]() |
|
|
![]() Last edited by Maxim on Wed Sep 06, 2023 12:28 pm; edited 1 time in total |
I guess it’s worth mentioning that this would be snooping on the bus while a game is running. If there is no game then it won’t work. Depending on what you’re trying to achieve, you might instead have to create a ROM to drive the host system to do what you need; but it can also then present the results to you in a form that’s easier to handle, eg by writing it to another memory or IO address. | |
![]() ![]() ![]() |
|
|
![]() |
Hmmm, that is a very interesting thought — I hadn't considered that! You're right, you could write a ROM which polled the control port constantly and then send the results to your snooper in whatever form you wanted. That said, the amount of logic you'd need to decode an arbitrary memory or I/O operation I think would broadly similar to what you'd need to decode a true read from the control port. |
|
![]() ![]() ![]() |
|
|
![]() |
Indeed - but you could combine the start button and regular controls reading together on the Z80 side so you’d only need to snoop one thing. | |
![]() ![]() ![]() |
|
|
![]() |
Thank you gentlemen for all this clear explanations !! :)
Did I mentionned that I wanted to use Joystick with the Tuner TV ? My project is simply to transform a Tuner TV to a RetroPie player that works on any Game Gear. But I discovered there is a "TV" pin that allows to change de cartridge data mapping and I hope joystick is not disabled (I also saw that most of the pins a not connected but I can fix this.) I will compare values with a random game and with a tuner TV ... and hope I still receive the buttons infos ¯\_(ツ)_/¯ I'll tell you |
|
![]() ![]() |
|
|
![]() |
When in TV mode, the whole Game Gear is shut down and the cartridge port is just an LCD interface. There’s no CPU, no ROM or RAM, and nothing reading the buttons. Sorry, I don’t think this is possible. | |
![]() ![]() ![]() |
|
|
![]() |
Argh thanks Maxim :')
Guess my remaining options will be : - Wireless Pad - Modify a Game Gear to expose a USB interface I don't want to modify my Game Gears, so I'm good to buy an other one. Anyway, thanks again for your precious help guys |
|
![]() ![]() |
![]() |