BackPonBeauty / Sega-Model-3-UI-for-20240128-

Release 1.1.1.9
44 stars 0 forks source link

RawInput Option Dissapeared #35

Closed NIGHTKILLER05 closed 3 months ago

NIGHTKILLER05 commented 3 months ago

The RawInput InputSystem is not present in the new build image

BackPonBeauty commented 3 months ago

Hello, bonjour, konnitiwa

I totally overlooked the rawinput item.

check latest release 1.1.1.0

DirectInput is an older API that supports a wide variety of input devices, but is rarely used in new games.

XInput is an API specifically for Xbox 360 and Xbox One controllers, and is widely used in new games.

Raw Input is a low-level API, used to get high-precision input data, and allows simultaneous support of multiple devices.

Each API is used for specific purposes and requirements. XInput is often used in new game development, and Raw Input may be used depending on specific needs. DirectInput is mainly used for legacy support.

Rawinput is used to control aiming in shooter games with mouse operations, or to control the accelerator and brake in racing games. I don't have an environment to verify whether this option works properly.

thanks

PonMi

NIGHTKILLER05 commented 3 months ago

Thank you for the answer, when you say "I totally overlooked" do you mean "on purpose"? that's my guess, because you mention you don't have something to check that option, in that case I have a pair of GUN4IR lightguns to be your betatester if you want.

By the way thank you for yor software's additions, they are great.

BackPonBeauty commented 3 months ago

hi thanks ur replay.

Actually, I don't know if the InputSystem option of Supermodel3 is working. It seems that the levers and buttons set in supermodel.ini ignore the InputType set in InputSystem.

Unfortunately, I disassembled the DinputType controller and replaced it with a Brook XB Fighting Board, so I don't have a DinputType controller on hand. As mentioned earlier, RawInput is used when using a mouse or light gun for aiming with a gun control type.

Even if the InputSystem is Xinput, I can control the aim with the mouse,

In conclusion, regardless of whether it is Dinput, Xinput, or RawInput, I think the control set in Supermodel.ini takes priority.

This is my opinion.

And I don't have an environment to verify it.

I will leave it to someone who knows more about it.

thanks

PonMi

WarpedPolygon commented 3 months ago

If I can chime in. You can actually set RawInput on a per game basis, it's used for the lightgun games mostly, not a lot of people use it for analog input, if any.

With Dinput and Xinput you'll still be able to control the mouse, but only 1 mouse. This is using normal windows drivers for that mouse. When in RawInput you can use 2 mice/lightguns, it's otherwise impossible (sorry if patronising). However, you can still use the controllers if you want. Meaning Xinput or Dinput (whatever you have set in the global settings ini) will be used at the same time. Think of RawInput as only applying to the mice and keyboard when applied per game.

Having a RawInput option is handy for those using 2 mice/lightguns only. Otherwise its better to use RawInput per game.

BTW I'm literally an expert on this emulator, not to toot my own horn. Do you want to look at my ini and see what I do differently?

NIGHTKILLER05 commented 3 months ago

If I can chime in. You can actually set RawInput on a per game basis, it's used for the lightgun games mostly, not a lot of people use it for analog input, if any.

With Dinput and Xinput you'll still be able to control the mouse, but only 1 mouse. This is using normal windows drivers for that mouse. When in RawInput you can use 2 mice/lightguns, it's otherwise impossible (sorry if patronising). However, you can still use the controllers if you want. Meaning Xinput or Dinput (whatever you have set in the global settings ini) will be used at the same time. Think of RawInput as only applying to the mice and keyboard when applied per game.

Having a RawInput option is handy for those using 2 mice/lightguns only. Otherwise its better to use RawInput per game.

BTW I'm literally an expert on this emulator, not to toot my own horn. Do you want to look at my ini and see what I do differently?

Thank you for your answer, WarpedPolygon. I am here because of you; I saw your video and copied your Supermodel's config files from EmuMovies. I am a big fan of yours and I am asking for the RawInput method in the GUI because I want to know the name/number of each of my two GUN4IRs to modify the supermodel.ini and use both in games like Jurassic Park and LA Machine Guns. I had to use an earlier version of this GUI to achieve that (they were labeled as MOUSE2 and MOUSE3). I tried using 'Arcade Guns Pro Utility 6.2' before, but that software didn't show me the correct names of my GUN4IR. That's why I am asking for that option back in this GUI. Thanks again for all your hard work on this and other emulators

BackPonBeauty commented 3 months ago

@WarpedPolygon Thank you for the detailed explanation.

I understand RawInput now.

I will explain how to fix this issue.

Changes to InputSystem are now immediately reflected in the ini file.

Bring up the key settings from Config at the bottom left of the Control tab, and press the "i" key to check the information.

Previously, the ini was written when LoadRom was executed or the UI was closed.

I think this fix will solve the problem.

Thanks

ponmi

BackPonBeauty commented 3 months ago

I tried enumerating the raw input devices connected to my PC. The list I received included devices that are not currently connected. It's likely that these are devices that were connected in the past and still have drivers installed. image When I filtered the list to only include devices of the mouse type, I got four results. In reality, I have two mice connected, and no Pentablet is connected. image Analyzing the source code of Supermodel3 would probably be the quickest way to understand this, but my guess is that Supermodel3 retrieves the raw input devices and assigns names like 'MOUSE1' and 'MOUSE2' to them. The OS does not assign names like 'MOUSE1'.

My hypothesis is that the naming rule, which is also a guess, assigns names in reverse order from the list of discovered devices.

WarpedPolygon commented 3 months ago

Yes, you are correct on all fronts.

Supermodel will grab the RAW devices connected and renumerate them in reverse order with MOUSE1 or MOUSE2. As 2 keyboards are not needed with Supermodel for any reason I don't think it applies raw to keyboards

WarpedPolygon commented 3 months ago

Thank you for your answer, WarpedPolygon. I am here because of you; I saw your video and copied your Supermodel's config files from EmuMovies. I am a big fan of yours and I am asking for the RawInput method in the GUI because I want to know the name/number of each of my two GUN4IRs to modify the supermodel.ini and use both in games like Jurassic Park and LA Machine Guns. I had to use an earlier version of this GUI to achieve that (they were labeled as MOUSE2 and MOUSE3). I tried using 'Arcade Guns Pro Utility 6.2' before, but that software didn't show me the correct names of my GUN4IR. That's why I am asking for that option back in this GUI. Thanks again for all your hard work on this and other emulators

Thanks mate! Yes having the RAW input option does make it easier to identify lightguns. @BackPonBeauty has done a fantastic with this UI and added it back in.

Honestly I think we should team up with the Supermodel guys and create a masterpiece of an emulator.

BackPonBeauty commented 3 months ago

@WarpedPolygon I've watched your YouTube. It's great.

@NIGHTKILLER05 @AllRetroGameLover

I wish I could add the ability to assign individual settings for each game... It seems difficult to me.

I'm using a translation engine to translate it into English. There may be some mistakes here and there, Sry

thanks

PonMi

WarpedPolygon commented 3 months ago

You can assign individual settings for each game easily. You can't do this with input mappings, but you can with every other option.

Below is how I have my per game stuff setup. You just need to create it's own section with the rom name in square brackets e.g e.g. [ scud ], any options added below will be applied per game. These need to be above the [ Global ] settings section in the ini file so Supermodel doesn't get confused.

[ daytona2 ] MusicVolume = 120 SoundVolume = 100 Balance = -10 InputJoy1XSaturation = 165

[ dayto2pe ] MusicVolume = 120 SoundVolume = 100 Balance = -10 InputJoy1XSaturation = 165

[ dirtdvls ] MusicVolume = 100 SoundVolume = 130 Balance = -20 InputJoy1XSaturation = 118

[ getbassur ] WideScreen =0 WideBackground = 0 MusicVolume = 100 SoundVolume = 110 Balance = 10

[ eca ] MusicVolume = 100 SoundVolume = 100 Balance = -35

[ fvipers2 ] LegacySoundDSP = 1 MusicVolume = 100 SoundVolume = 170 Balance = 10

[ harley ] MusicVolume = 100 SoundVolume = 100 Balance = 10

[ lamachin ] MusicVolume = 100 SoundVolume = 115 Balance = 0 InputSystem=rawinput

[ lemans24 ] MusicVolume = 100 SoundVolume = 110 Balance = 0 InputJoy1XSaturation = 120

[ lostwsga ] MusicVolume = 100 SoundVolume = 105 Balance = 20 InputSystem=rawinput

[ magtruck ] MusicVolume = 100 SoundVolume = 100 Balance = 15

[ mgtrkbad ] MusicVolume = 100 SoundVolume = 100 Balance = 15

[ oceanhun ] MusicVolume = 100 SoundVolume = 100 Balance = 0 InputSystem=rawinput

[ oceanhuna ] MusicVolume = 100 SoundVolume = 100 Balance = 0 InputSystem=rawinput

[ scud ] MusicVolume = 200 SoundVolume = 60 Balance = 0 InputJoy1XSaturation = 170

[ scudplus ] MusicVolume = 200 SoundVolume = 60 Balance = 0 InputJoy1XSaturation = 170

[ skichamp ] MusicVolume = 100 SoundVolume = 200 Balance = 10 ForceFeedback=1

[ spikeofe ] MusicVolume = 120 SoundVolume = 120 Balance = 0

[ spikeout ] MusicVolume = 90 SoundVolume = 90 Balance = 0

[ srally2 ] LegacySoundDSP = 1 SoundVolume = 155 MusicVolume = 140 Balance = 15 PowerPCFrequency = 70 InputJoy1XSaturation = 155

[ srally2dx ] LegacySoundDSP = 1 SoundVolume = 155 MusicVolume = 140 Balance = 15 PowerPCFrequency = 70 InputJoy1XSaturation = 155

[ swtrilgy ] MusicVolume = 100 SoundVolume = 100 Balance = 0 InputSystem=rawinput

[ vf3 ] MusicVolume = 100 SoundVolume = 110 Balance = -5

[ vf3tb ] MusicVolume = 100 SoundVolume = 110 Balance = -5

[ von2 ] MusicVolume = 100 SoundVolume = 100 Balance = 0

[ vs2 ] MusicVolume = 100 SoundVolume = 110 Balance = -10 WideScreen = 0 WideBackground = 0

[ vs298 ] MusicVolume = 100 SoundVolume = 110 Balance = -10 WideScreen = 0 WideBackground = 0

[ vs2v991 ] MusicVolume = 100 SoundVolume = 110 Balance = -10 WideScreen = 0 WideBackground = 0

WarpedPolygon commented 3 months ago

@NIGHTKILLER05 "I saw your video and copied your Supermodel's config files from EmuMovies."

Did you get my configs from emumovies or launchbox?

BackPonBeauty commented 3 months ago

@WarpedPolygon Thank you.

I understand that you can assign them individually in the ini file.

What I want to achieve is to get and reflect which mouse and which button are pressed when the user has multiple mice connected.

For now, I can enumerate device names with RawInputTypeMouse, but it is a complicated ID and the user cannot easily distinguish which device name and actual device.

I want to assign the enumerated devices in reverse order, such as mouse1, mouse2, and hook the input to display it.

I am thinking of a mechanism to prepare a separate graphical UI for key settings and set them individually and easily.

If I can do that, all that remains is to write the individual settings to the ini file as you showed me,

Currently, I have the code to hook the rawinput of multiple mice, but I cannot get the contents. I cannot get "which mouse button was pressed and released on which number."

Please give me a little time.

It may not be technically possible, so please do not get your hopes up.

PonMi

WarpedPolygon commented 3 months ago

@BackPonBeauty

Ahh I see now. Supermodel is notorious for causing windows to change mouse indexing. So if you have MOUSE3 set and its working, it probably won't be the same on the next boot. This is a pain in the bum and has hounded lightgun users for a while.

If you can get this working with stable indexing, or an easy way to reset it between games, you'll be a god among mortals.

BackPonBeauty commented 3 months ago

Supermodel is notorious for causing windows to change mouse indexing.

image

NIGHTKILLER05 commented 3 months ago

@NIGHTKILLER05 "I saw your video and copied your Supermodel's config files from EmuMovies."

Did you get my configs from emumovies or launchbox?

Hi, sorry for my mistake, I got them from LaunchBox site, thank you.

BackPonBeauty commented 3 months ago

I was able to hook up the state of multiple mice with rawinput. I could get up to 5 buttons for left click, right click, and movement. However, if Supermodel3 changes the mouse number of rawinput every time it's started, this is a serious problem. I'd like it to be a problem that only applies to light guns, but I'm not sure. Do light guns need infrared light bars like the Wii?

image

NIGHTKILLER05 commented 3 months ago

Thank you BackPonBeauty, I have 2 lightguns I made following the GUN4IR project, and that kind of guns uses IR leds in each side of the screen:

large_display_TV_LEDs

BackPonBeauty commented 3 months ago

thanks

A light gun needs an infrared light bar.

Maybe the light bar or the gun or both are powered by USB.

What could cause the mouse index to change?

In Windows, if USB selective suspend is enabled in the power options, the USB device will be suspended if there is no activity on it for a certain period of time.

However, I think the time it takes to disconnect varies depending on the USB device.

I think the light gun is suspended very quickly.

usb-selectve-suspend

I have USB selective suspend disabled and have never had a problem, it's in the power options.

Supermodel3 does not recognize controllers that were not plugged in at boot time even if they are plugged in after boot.

Sorry if you know this.

PonMi - @Working

WarpedPolygon commented 3 months ago

There are a lot of lightguns now that do not require a sensor bar, for e.g. Sinden & GUN4IR. Everything is handled through one USB. The lightgun scene now primarily use these.

Windows tends to switch mouse indexing only when in RAWINPUT. This doesn't just happen with Supermodel. Windows will switch indexing when an app is launched or sometimes just randomly. I'm not sure why though.

This is of course only an issue if you are trying to keep track of where the indexing is, which is what we are trying to do. For 'MOUSE3' to work the windows indexing needs to have the mouse we want to use in the same position. As long as this happens it'll work. But it changes arbitrarily....

The best workaround I have seen for this is in Flycast standalone. They assign the unique VID mouse number to the specific RAWINPUT mapping file. So when the emulator calls for the mapping file to assign a device it looks for the unique VID number, not the index position. Bypassing the issue. The only downside, if you change mice you'll need to remap as the VID's will be different. But a tiny price to pay.

BackPonBeauty commented 3 months ago

If my guess is correct, the mouse number should match the mouse number in the key config.

I've created a test version.

Select the Control tab.

You'll see the mouse number, the button pressed, and the X,Y,Z(Wheel) deltas in real time.

Could you please confirm that it matches the mouse number shown in the key config prompt?

Forward and back don't work in this version.

Because my mouse has different keys assigned and I don't want to change them.

If your mouse polling rate, XY movement amount, and wheel movement amount settings are different from mine, the XYZ deltas may not be displayed correctly.

The important thing is the mouse number.

image

Sega Model 3 UI for 20240128+TEST.zip

WarpedPolygon commented 3 months ago

The mouse number is showing as it should be. For me this is MOUSE1.

Even if I change the Mouse number in the ini file it still shows correctly (what it actually is) in the UI. I have confirmed this by using the remapping tool to confirm the correct mouse number.

I even changed the indexing to a different number to confirm it works no matter the index placement.

Looks to be showing what the mouse number actually is no matter what is set in the INI. Which is what we want. Awesome work. You should be able to use the key config as reference for the correct mouse number at all times even if windows changes it. Excellent idea btw.

FYI windows defender didn't like the exe. This on it's own allows for a quick reference to change in the ini file to correct number. Is it possible to show both mice in the UI?

WarpedPolygon commented 3 months ago

It would be awesome to apply the mouse number the the ini file with each game boot. I know that's a tall order, but as I said, you'd be a god....

BackPonBeauty commented 3 months ago

@WarpedPolygon thanks replay

I think this problem will progress in a good direction.

The logic is almost done. (In my head). I don't know what's going on in my head.

Users sometimes do things that developers don't expect. (No, not sometimes, but almost always.) lol ;P

difficult to get Sinden & Gun4IR in Japan. I'm planning to buy a USB sensor bar and a Wii remote controller.

Please wait for the next update.

PonMi(Hentai)

BackPonBeauty commented 3 months ago

I have received reports that Windows Defender and some virus detection software are causing problems.

I cannot reproduce this problem.

I suspect that it is because the exe file is not signed.

I will fix this soon.

Thanks

I'm going to bed now. You too, sleep. Sweet dreams

PonMi (insomnia)

WarpedPolygon commented 3 months ago

Awesome. Thanks so much for the hard work.

Yes, users will always do unexpected things. To much to predict.

I'm thinking if the ini can be automatically edited with the mouse number that shows in the UI (from the key config), before a game is booted, that would be awesome and should work every time.

If you need any testing done let me know.

Night

BackPonBeauty commented 3 months ago

Hello everyone

Would you like to hear good news or bad news?

Today, I received a light bar and a Wii controller from Amazon, but the Wii controller was defective so I threw it in the trash. I should have bought the official product.

By the way, when you pull the trigger of the light gun, which key is assigned by default? Left mouse button? Right mouse button? Well, either way is fine.

Will the light gun be recognized as a mouse on Windows? If it is a mouse, even if you have two light guns, there will only be one mouse pointer. Can you move the mouse pointer with either light gun?

The good news is, yes, it will be completed soon.

BackPonBeauty commented 3 months ago

According to Games.xml, 'L.A.Machineguns : Rage of the Machines' is 'analog_gun', but is this wrong?

WarpedPolygon commented 3 months ago

Ahh no, I made the mistake of buying crappy PS3 controllers from Amazon. They are also in the bin.

Yes, all modern lightguns are essentially just mice. They have ID's as lightguns but really all they do is just control the cursor. When in RAWINPUT they generally show as mice. They will always show as mice in the key config for Supermodel.

Also, L.A Machineguns is analog_gun. The only actual light gun game that doesn't use X/Y analog coordinates is Lost World, but ONLY when in the 'gun' mode. It is preferable to have lost world as 'analog_gun' as it wont screen flash.

Excellent news, I can't wait to have no issues with indexing. People are gonna be stoked. Is it ok to make a video on it when done?

BackPonBeauty commented 3 months ago

@WarpedPolygon
thanks and thanks all LightGunners

First, let me assume that this is based on my environment.

The input device is a mouse. I have two mice of the same manufacturer and model number.

I have only tried games with an Input type of analog_gun in Games.xml.

There are no problems with The Ocean Hunter.

The Lost World is a little bit off aim. Adjusting the DPI and polling rate may solve the problem.

I sometimes cannot control L.A.Machineguns.

For some reason, the window seems to lose focus, but I can control it by returning focus with Alt+Tab. There seems to be no problem in full screen, and the aim is correct. I think it is a problem with my environment. Long-term testing is required.

I will upload a test version here after checking it a little more.

I need to create a how to use. I will think about explaining that as well.

image

WarpedPolygon commented 3 months ago

Awesome solution!

Using 'gun' instead of 'analog_gun' doesn't impact the MOUSE positioning.

When 'gun' is set it's using inputs from the 'Light guns' section of the ini file. When set to 'analog_gun' it's getting inputs from the 'Analog guns' section of the ini file. This is only applicable to Lost World, as there was 2 versions, an analog xy version and a traditional light gun version.

I have attached an nvram for all the light gun games that are pre calibrated with analog_gun, if you're not already using my pre config. This should make Lost World accurate and LA Guns not lose control. Let me know if this doesn't work, as they are aspect ratio specific depending on windows settings.

Is the the cursor locked to the window when in windowed mode or can the cursor move outside of the window when playing? NVRAM.zip

BackPonBeauty commented 3 months ago

how to use When InputType is rawinput and InputType is analog_gun, pressing the LoadRoms button displays the control setup window. I haven't tested it with a light gun because I don't have one. Click "Player1 Shoot Me!" with the mouse you want to control with Player1. Click "Player2 Shoot Me!" with the mouse you want to control with Player2, and then press "OK". Supermodel3 will start.

If my logic is correct, you should be able to play without any problems.

In my environment, I think I had to enter L.A.Machineguns into test mode once and run Inputtest. It may be a problem with NVRAM. At first, the aim didn't move.

If you want to know the mouse number before starting Supermodel, press the smallest button on the far right. Enable RawInputHook.

I'll tell you how it works.

The index of the mouse or light gun cannot be determined. You must specify it in the setup window when starting. As mentioned earlier, this logic enumerates the mouse types of the rawinput device and assigns them indexes in reverse order.

Then it hooks the rawinput input with winproc and reflects the detected index.

Look at the source code for more details, and once I've made some more modifications I'll officially release it and update the source code.

I've uploaded a verification version here.

Sega Model 3 UI RawInput_IndexFix_Alpha.zip

BackPonBeauty commented 3 months ago

@WarpedPolygon Hey there

Thanks for the reply.

I didn't answer some of your questions.

Is it ok to make a video on it when done?

Of course it's OK! Please introduce it in a cool way.

Is the the cursor locked to the window when in windowed mode or can the cursor move outside of the window when playing?

I was using a 1920x1080 display with borderless windows mode, so I think the cursor jumped out and lost focus. It happens with other games too.

I think it jumped out to the left on a dual display with the right as the main and the left as the sub.

Thanks

Ponmi (@taking a little break)

WarpedPolygon commented 3 months ago

Well that was fast.

So, I have tested it, a lot lol.

The hooker works and shows mouse number the first connected mouse just fine. All of my additional mice shows as unknown. Unfortunately, the inputs do not load when the ini file has "Unknown Mouse" as the ID/tag. I believe this must use a "MOUSEX" ID/tag in order to work at all.

Instead of 'Unknown mouse' it needs to be 'MOUSE'

If any of my second mice showed as a MOUSE number I believe it would just work. All mice should always be determined as a 'MOUSE' in the key config irrespective of make model etc, it should never give an UnknownMouse result.

What are you using to get an UnkownMouse outcome?

You'll have to forgive me, I'm knowledgeable but I'm a idiot when it comes to code.

BackPonBeauty commented 3 months ago

When the UI starts, it enumerates the rawinput mice and assigns them an index. This is done only once when the UI starts. Mice connected after the UI starts are not assigned an index, so they become unknown in the rawinputhook, but they are detected again when the setup window is displayed, so they should not become unknown.

But it is happening.

An investigation is needed.

Did you test a light gun or a mouse?

WarpedPolygon commented 3 months ago

I'm using mice.

This is only happening with the second mouse. The mouse number that comes first is always picked up by the rawinputhook and it assigns the correct inputs in the setup window.

The second mouse is picked up as unknown even if connected before booting the UI.

BackPonBeauty commented 3 months ago

The code enumerates rawinput devices and assigns indexes to the mice in reverse order.

The reason the mouse becomes unknown is the wrong mouse driver.

Another possible cause is a momentary disconnection.

Could you tell me the manufacturer and model of your unknown mouse?

I picked up my tablet from the trash and tried connecting it.

It updated the driver and asked me to restart Windows. When I checked with rawinputhooker without restarting, it became an unknown mouse. When I checked after restarting Windows, they were correctly assigned index numbers.

I think there is a problem with the driver.

In theory, the code assigns an index to all rawinput devices that are determined to be mice.

I made a slight modification. When I change rawinputhook from Disable to Enable,

the index is cleared and the mouse type of the rawinput device is assigned an index again.

In my environment, the mouse of PLAYER1 randomly disconnects during play.

This may be due to a driver conflict because I use the same model number of mouse. Sometimes the mouse freezes for a short time even on Windows.

I've used a mouse from a different manufacturer and it hasn't disconnected yet.

Thanks

PonMi (eat sea creatures as sushi)

WarpedPolygon commented 3 months ago

So after checking my device list in Windows, all my additional mice show as generic USB Optical Mouse, not with a make and model. I have 3 connected in total, with 2 being generic 'USB Optical Mouse'.

The one that has a make and model in windows shows as, DELL MS116 USB Optical Mouse.

The other 2 that show as USB Optical Mouse are: Logitech B100 & 3rd Party Crap mouse with no model number. I cant find drivers for these or update the current ones, as I believe it's using a generic one.

In the Supermodel Key Config, any mouse irrespective of the make and model will show as a MOUSE number. Is it possible to just take the mouse number direct from the key config?

WarpedPolygon commented 3 months ago

Like, directly hook into the key config removing the need for the mice to be identified by something other than Supermodel.

You should be able to just let Supermodel ID them as "MOUSEx" then take the number direct from the key config and apply to the ini on boot, with nothing in between causing an Unknown Mouse outcome.

If all controls are already configured/set, all you'd need to change/edit is the MOUSE number in the ini. This will also prevent any issues with overriding custom inputs.

Please forgive me, I'm not sure what is actually possible so if I'm talking nonsense, let me know.

WarpedPolygon commented 3 months ago

@NIGHTKILLER05

See what you've done haha

NIGHTKILLER05 commented 3 months ago

@NIGHTKILLER05

See what you've done haha

hehehe, I see, by the way if you guys need some kind of testing with 2 GUN4IR or even 2 Aimtracks, I have them and I am ready to make any kind of esoteric tests.

BackPonBeauty commented 3 months ago

Let me start with the conclusion.

Mice that use standard Windows drivers are recognized as HID by rawinputtype and cannot be identified. They do not have values ​​for the number of buttons or polling rate (sampling rate). Strictly speaking, they probably have these, but they cannot be obtained.

The mice I used for the test were, well, strictly speaking, three types and one pen tablet. These can obtain the mouse index.

PXL_20240711_085059388

Then I remembered the Elecom EX-G that I had in the trash.

PXL_20240711_155333006

It's cheap but quite usable. The driver is also standard for Windows. And of course, it is recognized as HID by rawinputtype and cannot be assigned an index. What a pain. But for some reason, a driver is provided for this mouse. When you install the driver, it properly becomes rawinputtype = mouse.

When I bought it, it was about $10 on Amazon, but now it's $17 for some reason. But it's still cheap.

Buy a mouse that has a driver provided.

thanks

PonMi(@haven't slept in about three days)

WarpedPolygon commented 3 months ago

Ok I see, no proper driver no good.

I think all the LightGuns have proper drivers so they should just show as desired.

@NIGHTKILLER05 Are you up for testing this out with your lightguns as we don't actually have one between us lol?

NIGHTKILLER05 commented 3 months ago

With pleasure, just let me reach my home tonight, make the test with both GUN4IR and then you guys will hear about me.

WarpedPolygon commented 3 months ago

I would recommend using a backup of the emu and then use the "Sega Model 3 UI RawInput_IndexFix_Alpha.zip" PonMi provided a few comments back.

Make sure to have everything plugged in and connected before running the UI. Lemme know if you get stuck or need anything.

NIGHTKILLER05 commented 3 months ago

Ok, I copied the emulator folder, uncompress "Sega.Model.3.UI.RawInput_IndexFix_Alpha.zip" inside It, overwrite the existing .exe, opened the UI, "Controls" - "Input System - Rawinput" - "Config".

Then in the CMD window I press "Enter" and then the trigger of my first Gun4IR lightgun, and it was recognized as "MOUSE3_RIGHT_BUTTON.

After that, in the second line I press "Enter" again and then I pressed the trigger of the second Gun4IR lightgun, and It was recognized as "MOUSE1_RIGHT_BUTTON"

image

In the third line I only typed "i" to show the input information:

P1 Coin [KEY_3,JOY1_BUTTON7]: Ret/c/s/a/r/Up/Down/b/h/q/Esc?

Input System Settings

Input System: RawInput/DirectInput

Keyboards: 1: HID Keyboard Device 2: HID Keyboard Device 3: HID Keyboard Device Mice: 1: HID-compliant mouse 2: HID-compliant mouse 3: HID-compliant mouse Joysticks: 1: GUN4IR Pro Micro P1 2: GUN4IR Pro Micro P2

Keyboard 1 Settings: Sensitivity = 25 % Decay Speed = 50 % Keyboard 2 Settings: Sensitivity = 25 % Decay Speed = 50 % Keyboard 3 Settings: Sensitivity = 25 % Decay Speed = 50 % Mouse 1 Settings: X-Axis Dead Zone = 0 % Y-Axis Dead Zone = 0 % Z-Axis Dead Zone = 0 % Mouse 2 Settings: X-Axis Dead Zone = 0 % Y-Axis Dead Zone = 0 % Z-Axis Dead Zone = 0 % Mouse 3 Settings: X-Axis Dead Zone = 0 % Y-Axis Dead Zone = 0 % Z-Axis Dead Zone = 0 % Joystick 1 Settings: X-Axis Min Value = -32768 X-Axis Center/Off Value = 0 X-Axis Max Value = 32767 X-Axis Dead Zone = 7 % X-Axis Saturation = 100 % Y-Axis Min Value = -32768 Y-Axis Center/Off Value = 0 Y-Axis Max Value = 32767 Y-Axis Dead Zone = 7 % Y-Axis Saturation = 100 % Z-Axis Min Value = -32768 Z-Axis Center/Off Value = 0 Z-Axis Max Value = 32767 Z-Axis Dead Zone = 3 % Z-Axis Saturation = 100 % RX-Axis Min Value = -32768 RX-Axis Center/Off Value = 0 RX-Axis Max Value = 32767 RX-Axis Dead Zone = 3 % RX-Axis Saturation = 100 % RY-Axis Min Value = -32768 RY-Axis Center/Off Value = 0 RY-Axis Max Value = 32767 RY-Axis Dead Zone = 3 % RY-Axis Saturation = 100 % RZ-Axis Min Value = -32768 RZ-Axis Center/Off Value = 0 RZ-Axis Max Value = 32767 RZ-Axis Dead Zone = 3 % RZ-Axis Saturation = 100 % Joystick 2 Settings: X-Axis Min Value = -32768 X-Axis Center/Off Value = 0 X-Axis Max Value = 32767 X-Axis Dead Zone = 7 % X-Axis Saturation = 100 % Y-Axis Min Value = -32768 Y-Axis Center/Off Value = 0 Y-Axis Max Value = 32767 Y-Axis Dead Zone = 7 % Y-Axis Saturation = 100 % Z-Axis Min Value = -32768 Z-Axis Center/Off Value = 0 Z-Axis Max Value = 32767 Z-Axis Dead Zone = 3 % Z-Axis Saturation = 100 % RX-Axis Min Value = -32768 RX-Axis Center/Off Value = 0 RX-Axis Max Value = 32767 RX-Axis Dead Zone = 3 % RX-Axis Saturation = 100 % RY-Axis Min Value = -32768 RY-Axis Center/Off Value = 0 RY-Axis Max Value = 32767 RY-Axis Dead Zone = 3 % RY-Axis Saturation = 100 % RZ-Axis Min Value = -32768 RZ-Axis Center/Off Value = 0 RZ-Axis Max Value = 32767 RZ-Axis Dead Zone = 3 % RZ-Axis Saturation = 100 %

And that information is somewhat accurate, I mean I have 2 Gun4Ir, made with 2 Arduino Pro Micro, but I don't have 3 mice and 3 keyboard, I only have 1 mouse and 1 Keyboard, but maybe the system is detecting the Gun4IR also as a mouse and keyboard, but It's just a theory.

BackPonBeauty commented 3 months ago

修正したバージョンをを試してください。 Try the revised version.

Sega Model 3 UI alpha2.zip

image

NIGHTKILLER05 commented 3 months ago

You are fast my friend !!

I got the same results:

Common Controls: P1 Start [KEY_1,JOY1_BUTTON9]: Ret/c/s/a/r/Down/h/b/q/Esc? Setting... MOUSE3_RIGHT_BUTTON P2 Start [KEY_2,JOY2_BUTTON9]: Ret/c/s/a/r/Up/Down/b/h/q/Esc? Setting... MOUSE1_RIGHT_BUTTON P1 Coin [KEY_3,JOY1_BUTTON10]: Ret/c/s/a/r/Up/Down/b/h/q/Esc?

Input System Settings

Input System: RawInput/DirectInput

Keyboards: 1: HID Keyboard Device 2: HID Keyboard Device 3: HID Keyboard Device Mice: 1: HID-compliant mouse 2: HID-compliant mouse 3: HID-compliant mouse Joysticks: 1: GUN4IR Pro Micro P1 2: GUN4IR Pro Micro P2

Keyboard 1 Settings: Sensitivity = 25 % Decay Speed = 50 % Keyboard 2 Settings: Sensitivity = 25 % Decay Speed = 50 % Keyboard 3 Settings: Sensitivity = 25 % Decay Speed = 50 % Mouse 1 Settings: X-Axis Dead Zone = 0 % Y-Axis Dead Zone = 0 % Z-Axis Dead Zone = 0 % Mouse 2 Settings: X-Axis Dead Zone = 0 % Y-Axis Dead Zone = 0 % Z-Axis Dead Zone = 0 % Mouse 3 Settings: X-Axis Dead Zone = 0 % Y-Axis Dead Zone = 0 % Z-Axis Dead Zone = 0 % Joystick 1 Settings: X-Axis Min Value = -32768 X-Axis Center/Off Value = 0 X-Axis Max Value = 32767 X-Axis Dead Zone = 3 % X-Axis Saturation = 100 % Y-Axis Min Value = -32768 Y-Axis Center/Off Value = 0 Y-Axis Max Value = 32767 Y-Axis Dead Zone = 3 % Y-Axis Saturation = 100 % Z-Axis Min Value = -32768 Z-Axis Center/Off Value = 0 Z-Axis Max Value = 32767 Z-Axis Dead Zone = 3 % Z-Axis Saturation = 100 % RX-Axis Min Value = -32768 RX-Axis Center/Off Value = 0 RX-Axis Max Value = 32767 RX-Axis Dead Zone = 3 % RX-Axis Saturation = 100 % RY-Axis Min Value = -32768 RY-Axis Center/Off Value = 0 RY-Axis Max Value = 32767 RY-Axis Dead Zone = 3 % RY-Axis Saturation = 100 % RZ-Axis Min Value = -32768 RZ-Axis Center/Off Value = 0 RZ-Axis Max Value = 32767 RZ-Axis Dead Zone = 3 % RZ-Axis Saturation = 100 % Joystick 2 Settings: X-Axis Min Value = -32768 X-Axis Center/Off Value = 0 X-Axis Max Value = 32767 X-Axis Dead Zone = 3 % X-Axis Saturation = 100 % Y-Axis Min Value = -32768 Y-Axis Center/Off Value = 0 Y-Axis Max Value = 32767 Y-Axis Dead Zone = 3 % Y-Axis Saturation = 100 % Z-Axis Min Value = -32768 Z-Axis Center/Off Value = 0 Z-Axis Max Value = 32767 Z-Axis Dead Zone = 3 % Z-Axis Saturation = 100 % RX-Axis Min Value = -32768 RX-Axis Center/Off Value = 0 RX-Axis Max Value = 32767 RX-Axis Dead Zone = 3 % RX-Axis Saturation = 100 % RY-Axis Min Value = -32768 RY-Axis Center/Off Value = 0 RY-Axis Max Value = 32767 RY-Axis Dead Zone = 3 % RY-Axis Saturation = 100 % RZ-Axis Min Value = -32768 RZ-Axis Center/Off Value = 0 RZ-Axis Max Value = 32767 RZ-Axis Dead Zone = 3 % RZ-Axis Saturation = 100 %

But It's good thing, right? I mean, the system is naming "MOUSE3", "MOUSE1" to the lightguns.

WarpedPolygon commented 3 months ago

@NIGHTKILLER05

You don't need to use the config at all.

1.Select RawInput tin the UI.

  1. Start a LightGun Game.
  2. In the box that pops up simply shoot the "Player 1" box with 1st lightgun.
  3. Shoot "Player 2" box with second player.
  4. Load Game

This will assign the mouse indexing and set the controls for you. It will clear all controller inputs also.

NIGHTKILLER05 commented 3 months ago

Hi guys!

Hey, that's a fine piece of software, I followed the steps that WarpedPolygon suggested, both lightguns are detected and autoconfigured in Ocean Hunter (oceanhun) and Lost World (lostwsga), and inside the game I can play in 2 player mode, It's beautiful. By the way, It doesn't work with L.A. Machineguns, I configure the guns, but for some reason I can not move the crosshairs ingame, and Star Wars Trilogy do not have the option to detect the guns.

image

supermodel.ini

.....


; Light guns (Lost World)
InputGunLeft = "KEY_LEFT"               ; digital, move gun left
InputGunRight = "KEY_RIGHT"             ; digital, move gun right
InputGunUp = "KEY_UP"                   ; digital, move gun up
InputGunDown = "KEY_DOWN"               ; digital, move gun down
InputGunX = MOUSE3_XAXIS
InputGunY = MOUSE3_YAXIS
InputTrigger = MOUSE3_LEFT_BUTTON
InputOffscreen = MOUSE3_RIGHT_BUTTON
InputAutoTrigger = 0                    ; automatic reload when off-screen
InputGunLeft2 = "NONE"
InputGunRight2 = "NONE"
InputGunUp2 = "NONE"
InputGunDown2 = "NONE"
InputGunX2 = MOUSE1_XAXIS
InputGunY2 = MOUSE1_YAXIS
InputTrigger2 = MOUSE1_LEFT_BUTTON
InputOffscreen2 = MOUSE1_RIGHT_BUTTON
InputAutoTrigger2 = 0

; Analog guns (Ocean Hunter, LA Machineguns)
InputAnalogGunLeft = "KEY_LEFT"               ; digital, move gun left
InputAnalogGunRight = "KEY_RIGHT"             ; digital, move gun right
InputAnalogGunUp = "KEY_UP"                   ; digital, move gun up
InputAnalogGunDown = "KEY_DOWN"               ; digital, move gun down
InputAnalogGunX = MOUSE3_XAXIS
InputAnalogGunY = MOUSE3_YAXIS
InputAnalogTriggerLeft = MOUSE3_LEFT_BUTTON
InputAnalogTriggerRight = MOUSE3_RIGHT_BUTTON
InputAnalogGunLeft2 = "NONE"
InputAnalogGunRight2 = "NONE"
InputAnalogGunUp2 = "NONE"
InputAnalogGunDown2 = "NONE"
InputAnalogGunX2 = MOUSE1_XAXIS
InputAnalogGunY2 = MOUSE1_YAXIS
InputAnalogTriggerLeft2 = MOUSE1_LEFT_BUTTON
InputAnalogTriggerRight2 = MOUSE1_RIGHT_BUTTON

games.xml

...

  <game name="lamachin">
    <identity>
      <title>L.A. Machineguns: Rage of the Machines</title>
      <version>Japan</version>
      <manufacturer>Sega</manufacturer>
      <year>1998</year>
    </identity>
    <hardware>
      <platform>Sega Model 3</platform>
      <stepping>2.1</stepping>
      <real3d_pci_id>0x16C311DB</real3d_pci_id>
      <inputs>
        <input type="common" />
        <input type="analog_gun1" />
        <input type="analog_gun2" />
      </inputs>