How to use the menu with SNAC controllers and other USER_IO controller solutions

https://github.com/MiSTer-devel/Main_MiSTer/wiki

Moderators: Mug UK, Zorro 2, spiny, Greenious, Sorgelig, Moderator Team

Locked
benitoss
Retro freak
Retro freak
Posts: 14
Joined: Tue Nov 26, 2019 4:17 pm

How to use the menu with SNAC controllers and other USER_IO controller solutions

Post by benitoss »

One of the disadvantages using SNAC and other USB3.0 I/O native controller connections is the lack of control of the menu options in the same way that the USB Controllers can do it.
With a simple modification in 2 files in Mister firmware, and adding a one new SPI code in the Framework , we can get that

The changes are in the GITHUB --> https://github.com/benitoss/MiSTer_project

In Menu Framework
menu.sv --> inside the instance hps_io , we add new variable .joy_db9(joy_db9)
sys/hps_io.v -->
  • we add the new variable input [15:0] joy_db9
    line 489 we add a new SPI code to send data to the firmware: 'h37: io_dout <= joy_db9;
In the Firmware
user_io.h --> Added the new SPI code 0x37 : #define UIO_DB9_GET 0x37

user_io.cpp -->
  • Line 40 --> added variables
    Line 1587 -> added uint16_t check_DB9_change() function
    Line 2206 --> added in the poling the function check_DB9_change();
So every joy option is associated to a one key, cursor directions to the directions of the joy, and button 1 and button 2 to Enter and ESC.
We have until 16 bits to asotiate more functions with a simple modification inside check_DB9_change() function

The question is, please could the official code reserve the SPI code 0x37 for the handle the menu with the USER_IO pins of the Mister ???

Thansks
dshadoff
Atari maniac
Atari maniac
Posts: 97
Joined: Sun Dec 29, 2019 9:07 pm

Re: How to use the menu with SNAC controllers and other USER_IO controller solutions

Post by dshadoff »

I don’t see how one can make the assumption that SNAC controllers would have any uniformity whatsoever.
Across systems, the IO signals are not used the same way; the signalling protocols have very little overlap, and even on the same system, for different controllers (i.e. mouse, joypad), the approach to interpreting the response is entirely different.

You would need a driver for each of every possible controller, and it would need to self-identify...
benitoss
Retro freak
Retro freak
Posts: 14
Joined: Tue Nov 26, 2019 4:17 pm

Re: How to use the menu with SNAC controllers and other USER_IO controller solutions

Post by benitoss »

dshadoff wrote:I don’t see how one can make the assumption that SNAC controllers would have any uniformity whatsoever.
Across systems, the IO signals are not used the same way; the signalling protocols have very little overlap, and even on the same system, for different controllers (i.e. mouse, joypad), the approach to interpreting the response is entirely different.

You would need a driver for each of every possible controller, and it would need to self-identify...
I don't assume that, I only am speaking in the data transference from the Core to the Firmware via SPI connection.
The proposed system uses a 16 bits variable to send to firmware and simulate pressing the keys of the keyboard (in the same way that a USB controller does). To send that 16 bit variable , we need a SPI special code, now we use 0X37. Any system can use the same code
The basic idea is that I have created a 16 bit variable to send from FPGA pins (USER_IO) to the firmware the signals to control the menu.
SNAC , LLAPI and other systems based in USER_IO of the USB3.0 port can use it in the same way. In fact it is totally independent of the system used.
It is Universal !!!!
benitoss
Retro freak
Retro freak
Posts: 14
Joined: Tue Nov 26, 2019 4:17 pm

Re: How to use the menu with SNAC controllers and other USER_IO controller solutions

Post by benitoss »

Maybe the title is better in this way

"Reservation of one SPI ID to transfer data form USER_IO to handle the menu"

I only ask for the reservation of code 0X37 or any other for that !!!!
User avatar
kitrinx
Captain Atari
Captain Atari
Posts: 192
Joined: Wed Sep 26, 2018 6:03 am

Re: How to use the menu with SNAC controllers and other USER_IO controller solutions

Post by kitrinx »

The purpose of SNAC is to provide a native controller port to the core with nothing intermediate. ie just wires, for maximum compatibility with unusual peripherals. What you want would require interpreting every protocol as well. SNAC's primary function is for things that cannot be represented by USB controllers, anyway, such as light guns.
benitoss
Retro freak
Retro freak
Posts: 14
Joined: Tue Nov 26, 2019 4:17 pm

Re: How to use the menu with SNAC controllers and other USER_IO controller solutions

Post by benitoss »

kitrinx wrote:The purpose of SNAC is to provide a native controller port to the core with nothing intermediate. ie just wires, for maximum compatibility with unusual peripherals. What you want would require interpreting every protocol as well. SNAC's primary function is for things that cannot be represented by USB controllers, anyway, such as light guns.
I know perfectly the purpose of SNAC, but one of the first problem using SNAC is the native controller cannot handle the menu when you press F12 or show the menu, it requires Keyboard or the use of a USB Joystick. With my solution you can handle the menu with the native controller.
That is the Key !!!

But I only want an officially reservation of one ID SPI code to connect with the firmware. Only that !!!
Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6348
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: How to use the menu with SNAC controllers and other USER_IO controller solutions

Post by Sorgelig »

As Kitrinx said, the purpose of SNAC is for unusual specific peripheral.
It was never intended to be used for standard controllers. USB is the way to control the MiSTer. 1ms poll gives the same response time, no need to reinvent the wheel.
Locked

Return to “MiSTer”