Jump to content

Recommended Posts

Posted (edited)

Just added some experimental handling of raster effects for cps2, finally, it's the consequence of having spent too much time on msh...

I read somewhere on the web that emulating raster effects is easy, the guy who wrote that spent too much time on mame which tends to hide the complexity of things with its interface, but raster effects are usually high risk programming, even on the original hardware, with time the clocks tend to de synchronize making this kind of programming unreliable, I saw the effects of that on some old atari st ! Anyway, the cps2 raster seems easier than neogeo, so it would have been a pity not to at least try them.

I tested only in 1 place so far, the lava level in msh attract mode, probably the easiest spot to reach using these effect.

I had to disable speed hacks for all cps2 games because of that, which is a pity because they are actually rarely used, but it's hard to disable a speed hack on the fly so the safest option is to disable them for all cps2 games for now. The result is not too bad for now, runs rather well even on a debug build with no optimization (but with the asm cpu cores which are fast even in debug mode).

It will probably create more bugs... but anyway there were places which were unplayable because they were not emulated, it will probably not be worse than that !

edit : and finally found a way to have the best of the 2, the speed hacks are temporarily disabled while handling rasters effects and they come back after that ! A little crazy, but fun !

Edited by Tux
Posted (edited)
12 hours ago, Tux said:

 

030000004c0500006802000011817200 = 0
03000000242f0000b700000000017200 = 1
The 1st number is the guid of the joystick, the 2nd number is the assigned index, starting at 0. You should have 2 guids here since you have 2 joypads, and 2 different indexes.

i see only one

03000000430b00000300000000000000 = 1

there is a way to know the id in this form via a tool or other? that I add this by hand to see what it gives.


1638650768-xsdeea.png

Edited by pmc2
Posted (edited)

Joy 2 ? It means it doesn't even have a proper name for the device !

Wow... !

Well, yeah there are test programs with sdl... I'll try to compile 1 for your windows... but you'll have to run it from the command line, this kind of program expects people to have a proper console... !

Here it is, controller.7z, unpack in a directory, add SDL2.dll (the one from raine), and run !

You should get info in the standard output, if your console is to crappy to see what it prints, redirect it, it might work without redirection on xp.

It allows to test all the controllers connected with more info than you'd ever want !

And I have added 2 exe in the archive by mistake, well the one is testgamecontroller.exe, you can try controllermap.exe if you want, it's to make a new mapping when you find a gamepad unknown to sdl2 (to recognize what is what in the controls).
 

controller.7z

Edited by Tux
Posted

@Tux
Thanks very much for your work.

Have a issue happening with controllers in 0.92 64.
Using PS3 controller.
Starting Raine using default inputs both digital pad and analog pad are used in gameplay.
The problem is holding digital pad in any direction (up-down-left-right) in less of one second is automatically unholded even continuing holding in same direction.

Posted
On 12/3/2021 at 6:18 PM, Tux said:

There was really no need for a video here. I am sure I tested this once and it worked, but I moved the test and it got corrupted where I moved it, and since I never use this mouse wheel, I never noticed ! Sorry, my bad. It's an easy fix at least (2 lines).
If you want some more technical detail : it's because sdl2 uses a strange struct for its event where all the parts are not defined at the same time but only when a specific event occured. Here the data of the mouse wheel was overwritten by the data of a mouse's button test... ! It's a test that didn't test the mousewheel event because previously there was no need, the mouse wheel was a mouse button event... ! Anyway it's fixed.

Hey Tux! Thanks a lot for the technical details!

 

On 12/3/2021 at 6:18 PM, Tux said:

Nope, not here. But from your screenshot, it's because of the insanely long path name you have, and the default small size of the window. Now maybe I should choose fullscreen as the default setting since the fullscreen is now reliable even in windows... Here it's the old default safe setting : a 640x480 window to be sure everyone can display it...

Now maybe the size of this path isn't taken enough to choose the font's size, but I am not sure anyway it could display all this length in a 640x480 window.

Try a fullscreen and talk again...

In full-screen the menu does show properly, as you can see here: https://imgur.com/a/uq2yW4p

But the path isn't that big, is it? I guess the glitch happens because this dialog does not resize to the 640x480 window, that's why it becomes unreadable. You have already fixed some things related to this resizable menus before, if I'm not wrong. 🤔 That's why I thought this one could be fixed too. Anyway, let's hope it doesn't break anyone's experience with the program eventually.

 

On 12/3/2021 at 6:18 PM, Tux said:

Already told, already replied, for now it's almost never used, I defy you to tell me in which game it's used for now, since you can't answer don't bother and leave this option alone.

I have some plan for it, but it will take time.

I'm sorry for this one, I just thought you had fixed it, then I went to test it and reported it wasn't working yet.  But it was an interesting testing in the end because now we know the crash has to do with the Xinput, since my Dinput controllers don't trigger it.

 

On 12/3/2021 at 6:18 PM, Tux said:

I am sorry I don't see it neither. Already discussed, you didn't reply what I posted last time... !

But I did! It's in the other thread. It's because there are so many messages and quotations that you may have missed it. Here it is:

On 11/30/2021 at 3:21 PM, mer-curious said:

I don't know if it's really bi-linear, but that's the most common filtering effect for emulators. It applies a smoothing effect to the picture. Take a look:

https://imgur.com/a/rycFR0N

The smoothing effect shows as soon as the game is loaded, even before hitting "Play game". And it also happens if you change one CPS2 game for another too, not just from different drivers/systems.

And then I reported this issue again here because I didn't know whether you had tried to fix it. Anyway, it's not fixed yet.

 

On 12/3/2021 at 6:18 PM, Tux said:

Same comment as up there : Raine can't do any magic, it can't display things properly if it doesn't have enough room for that. Go to fullscreen it will make things easier.

This title is way too long anyway, but I chose to keep the original here, if you want I can put "kof98" instead, this way you won't complain !

I'm sorry for bothering you with these little nuisances about the GUI. I just care about it being as usable and orderly as possible for the default configuration and possibly for new Raine users too. And since we didn't have this distortion in the previous (SDL1.2) versions, I thought maybe it was something unexpected and so it could possibly be fixed. Unfortunately I cannot help you with coding, otherwise I would try.

 

On 12/3/2021 at 6:18 PM, Tux said:

Yeah it's generic, it's the inputs for "2 players 6 buttons" configuration which was changed (for cps2). I didn't try to test all the games, but you found something very specific here, it's rare to see a behavior like that on an unmapped input.

Thank you so much again for your work in this crazy bug!

 

On 12/3/2021 at 6:18 PM, Tux said:

edit : on 2nd thought I added some code to cope with these too long titles for the display area, I hate dealing with this stuff, but it will make things easier later so it's a bad for a future good... ! You'll be able to test that again in 640x480 and it should work. No magic here, it cuts the strings in this case.

Thank you again for your incredible work and time!

Posted (edited)
5 hours ago, Augusto said:

@Tux
Thanks very much for your work.

Have a issue happening with controllers in 0.92 64.
Using PS3 controller.
Starting Raine using default inputs both digital pad and analog pad are used in gameplay.
The problem is holding digital pad in any direction (up-down-left-right) in less of one second is automatically unholded even continuing holding in same direction.

I'm also experiencing some issues with my D-input controllers. The d-pad curiously works fine in the GUI but not in the game. I've noticed that in the Inputs menu the directions are automatically assigned to "Stick 0", but my controller doesn't have this stick. So I manually map the directions to "Stick 2" (which seems to be my d-pad), but it still doesn't react in the game.

Xinput works fine, but XBox 360 controller's d-pad is not ideal for 2D fighting games, unfortunately. 😕

Edited by mer-curious
Posted (edited)
7 hours ago, mer-curious said:

I'm also experiencing some issues with my D-input controllers. The d-pad curiously works fine in the GUI but not in the game. I've noticed that in the Inputs menu the directions are automatically assigned to "Stick 0", but my controller doesn't have this stick. So I manually map the directions to "Stick 2" (which seems to be my d-pad), but it still doesn't react in the game.

Xinput works fine, but XBox 360 controller's d-pad is not ideal for 2D fighting games, unfortunately. 😕

well normally all controllers have a stick 0, it''s just the 1st stick ! You might eventually want to try the controller.7z file I attached in a post up there to see what it reports when it sees your controllers.

After some thinking : if you see "stick 0" it means that your gamepad is not recognized as a game controller, but as a simple joystick, meaning it works exactly as in sdl-1.2, and you won't have any dpad redirection because it can't recognize the dpad in this case. But you'll be probably able to remap the dpad to anything (hum, just maybe, try it and tell me, I think I removed the hat detection for the joystick and maybe I should have left it for this kind of case).

Yes I know, it's not very clear, maybe I should find some way to inform the user in this case.
I wanted to test with an old ps2 gamepad of mine because it's unlikely they added a mapping for that in sdl2, but I currently lost its adapter to be able to plug it to the pc... If I ever find it again, I'll test !
Until now for info, that's what the controllermap.exe program in the test archive I provided is for. To make a mapping for unknown gamepads. If you feel like it, you can try it, launch it by redirecting its output to a file like that : controllermap > log

As they describe it :

    Press the buttons on your controller when indicated
    (Your controller may look different than the picture)
    If you want to correct a mistake, press backspace or the back button on your device
    To skip a button, press SPACE or click/touch the screen
    To exit, press ESC

There will probably be buttons you don't have, so you'll have to use the space key to skip them. In the end it should output a mapping, send the log file and I'll include it in the next version.
It's possible to include this to raine to allow users to make their own mappings, but I think most people will already have a recognized game pad. This setup is the one used by all 3 major consoles right now, and all gamepads sold these days follow the same rules...

It's easy to add the option to be able to remap the dpad as 4 buttons instead of having it for movement alone, could be used for combinations, if you are interested it can be done...

Edited by Tux
Posted

mer-curios: about your "blurring" effect, no you didn't answer the part where I said I didn't really understand what you said, this is handled by the filtering option  in rendering options, near or linear, linear giving this effect (but very light), and near underlining pixels. Now when the game starts behind the gui, it's not opengl directly, it's just rendering to some sdl texture using their api, so the filtering option is ignored here. Then what do you mean exactly in all this mess ?

Posted (edited)
9 hours ago, Augusto said:

@Tux
Thanks very much for your work.

Have a issue happening with controllers in 0.92 64.
Using PS3 controller.
Starting Raine using default inputs both digital pad and analog pad are used in gameplay.
The problem is holding digital pad in any direction (up-down-left-right) in less of one second is automatically unholded even continuing holding in same direction.

No luck for you, I also have a ps3 controller, the simplest model, the one without rumble I forgot how they are called, so old that one of the 4 main buttons has stopped working, I keep it anyway to test things like that.

It's working wonderfully well (at least for the directions from the dpad) both in windows and in linux !

I even tested by using the nail to touch just the edge of the dpad so that it makes a loud noise when going up and down and the control is selected for about 0.1s only, works perfectly, you see the direction "blink" in test mode and revert to central position.

I have no idea how you do that, and I am not sure I want to know anyway... !

Is it windows 10 ? If so really no idea !

(and I even tested with the other controller which is a cheap xbox controller clone I found on amazon, same thing, no problem, both in linux and windows).

The only way I can think of to do that is to use at the same time the stick and the dpad until you succeed to make raine nuts, I am not sure I could do that, but I won't even try because it doesn't make any sense, use either the stick or the dpad, but not both at the same time !

Edited by Tux
Posted
14 hours ago, Tux said:

Here it is, controller.7z, unpack in a directory, add SDL2.dll (the one from raine), and run !

You should get info in the standard output, if your console is to crappy to see what it prints, redirect it, it might work without redirection on xp


The problem with this kind of program is that it considers that you need an x360 controller, it's not my case at all (clearly less buttons) so impossible to map everything and exit the program to display the result . What does Mame use as a system? is it so different as the system in raine?

Posted
1 hour ago, pmc2 said:


The problem with this kind of program is that it considers that you need an x360 controller, it's not my case at all (clearly less buttons) so impossible to map everything and exit the program to display the result . What does Mame use as a system? is it so different as the system in raine?

Really... Did you at least read what I wrote ?

I don't want a mapping, I just want the output of the testgamecontroller.exe, including names and guids of the controllers found, that's all.

Really I am starting to understand these old open source licenses which stated "the program is provided AS IS", meaning you can do something out of it good, you can't ? We don't care !

Posted

Je passe en français tant pis j'ai du mal à dire ce que je pense autrement :)

Donc j'ai lu et j'ai testé les 2 exe, le testgamecontroller ne donne rien on dirait qu'il ne se passe rien, pas de log non plus donc je sais pas trop quoi te dire de plus peut-être que je suis miro c'est possible ou que je n'ai pas compris un truc c'est possible, je revérifierai.
Après je doute très fortement que le problème soit xp ici, mais bien le système de détection des pad qui a changé entre 91.21 et après et visiblement avec le style d'adaptateur que j'ai (+ pilotes utilisés qui le gère) faut croire que ca a posé problème. J'essayerai cette configuration de joypad sous 10 pour voir, ceci dit cette anomalie n'a jamais eu lieu dans aucun autre ému ancien comme récent.
Donc peut etre que ca n'affecte que mon test mais peut-être pas, je signale juste quelque chose qui me parait anormal, c'est du bonus d'information c'est tout, je le fait QUE pour ton information personnel si ca t'aide a un truc c'est uniquement comme ca qu'il faut le comprendre, si après ca gave pas de soucis on zap car ca ne touche peut-être que ma config mais sinon ca peut etre une aide pour une meilleure gestion par la suite et pour le plus grand nombre ;)


g translate

Posted (edited)
1 hour ago, pmc2 said:

Je passe en français tant pis j'ai du mal à dire ce que je pense autrement :)

Donc j'ai lu et j'ai testé les 2 exe, le testgamecontroller ne donne rien on dirait qu'il ne se passe rien, pas de log non plus donc je sais pas trop quoi te dire de plus peut-être que je suis miro c'est possible ou que je n'ai pas compris un truc c'est possible, je revérifierai.
Après je doute très fortement que le problème soit xp ici, mais bien le système de détection des pad qui a changé entre 91.21 et après et visiblement avec le style d'adaptateur que j'ai (+ pilotes utilisés qui le gère) faut croire que ca a posé problème. J'essayerai cette configuration de joypad sous 10 pour voir, ceci dit cette anomalie n'a jamais eu lieu dans aucun autre ému ancien comme récent.
Donc peut etre que ca n'affecte que mon test mais peut-être pas, je signale juste quelque chose qui me parait anormal, c'est du bonus d'information c'est tout, je le fait QUE pour ton information personnel si ca t'aide a un truc c'est uniquement comme ca qu'il faut le comprendre, si après ca gave pas de soucis on zap car ca ne touche peut-être que ma config mais sinon ca peut etre une aide pour une meilleure gestion par la suite et pour le plus grand nombre ;)


g translate

the new part here is mainly the guid as I probably told already, it seems your xp returns only 1 guid for the 2 controllers here, maybe I should have included that basic testjoystick in the archive, but normally you should get some output on stdout even with no recognized game pad connected, here is what I get when I connect my microsoft sidewinder pro, which is obviously not a gamepad (gamecontroller as they call it) :

INFO: Joystick 0: Microsoft SideWinder Precision Pro (USB) (guid 030000005e0400000800000000010000, VID 0x045e, PID 0x0008, player index = -1)
INFO: Rumble supported
INFO: PS3 Controller 1: PS3 Controller (guid 030000004c0500006802000011810000, VID 0x054c, PID 0x0268, player index = 0)
INFO: Rumble supported
INFO: XBox One Controller 2: Generic X-Box pad (guid 03000000242f0000b700000000010000, VID 0x2f24, PID 0x00b7, player index = 1)
INFO: There are 2 game controller(s) attached (3 joystick(s))
INFO: Game controller device 1 added.
INFO: Game controller device 2 added.


As you see I get the name + guid for each controller connected. So it's possible xp doesn't return any usable guid, making the whole system unusable here...

I'll think about that, but now that I have some indexes allowing to choose which joystick to use as 1st joystick, I find that convenient, and I don't feel like going back... I'll try to test this part on my xp, even without any display, I should be able to get something out of it...

After testing, it's a horrible environment to test that kind of thing, cmd eats all output, it's impossible to get any stdout output from any command, I guess you need to install mingw32 console at that point, but I won't go that far for an xp virtual machine.
As far as I can tell (I had trouble enabling the usb game controllers on the virtual machine, then it asked to install a stupid driver for them and failed), the joystick handling seems badly broken.

My advice : either stick to raine < 0.92 on xp, or don't use the joysticks.
I'll try to fix the index stuck at 1 in the next version, so you'll get it as 1st joystick instead of 2nd, but that's probably all that can be done, don't hope to use both at the same time...
But it's even unlikely that you would be able to use even 1 pad in this configuration, I couldn't get any result from even the simplest test program, testjoystick, which uses the most basic api for the joystick, I don't know if it's a problem of driver or something else in xp, and I won't loose more time on it, just don't use joysticks in this configuration, or go back to an older raine !

Edited by Tux
Posted
On 12/5/2021 at 3:14 AM, Tux said:

mer-curios: about your "blurring" effect, no you didn't answer the part where I said I didn't really understand what you said, this is handled by the filtering option  in rendering options, near or linear, linear giving this effect (but very light), and near underlining pixels. Now when the game starts behind the gui, it's not opengl directly, it's just rendering to some sdl texture using their api, so the filtering option is ignored here. Then what do you mean exactly in all this mess ?

Hey Tux! Now I think I understand what you meant. So, I don't change any of the default video options in this testing. I just load a game and the pixels are crystal clear, as expected. Then if I load another game in the same Raine session the picture becomes blurred (similar to a bi-linear filtering), either before and after leaving the GUI. This didn't happen before the SDL2 update.

 

On 12/5/2021 at 3:10 AM, Tux said:

But you'll be probably able to remap the dpad to anything (hum, just maybe, try it and tell me, I think I removed the hat detection for the joystick and maybe I should have left it for this kind of case).

I can remap it but strangely it doesn't work in the game, only in the GUI. Actually I don't even need to remap it to use it in the GUI.

I don't know if it's important, but in the "Game Controllers" properties in Windows it informs that the d-pad in my controller is a "point of view hat".

 

On 12/5/2021 at 3:10 AM, Tux said:

Yes I know, it's not very clear, maybe I should find some way to inform the user in this case.
I wanted to test with an old ps2 gamepad of mine because it's unlikely they added a mapping for that in sdl2, but I currently lost its adapter to be able to plug it to the pc... If I ever find it again, I'll test !
Until now for info, that's what the controllermap.exe program in the test archive I provided is for. To make a mapping for unknown gamepads. If you feel like it, you can try it, launch it by redirecting its output to a file like that : controllermap > log

Thank you for your assistance on this.

So I downloaded the zip and the program was not starting, it was asking for this DLL file: https://pt.dll-files.com/libgcc_s_dw2-1.dll.html

Then I placed this DLL in the executable folder and it finally launched. I guess I could generate the logs by doing "controllermap.exe > log" in Command Prompt. I'm attaching the files to this post.

Finally, I tried the testgamecontroller.exe but it returns an error that "SDL_GameControllerHasRumble was not located in the dynamic link library".

Anyway, I hope the logs can help you address the issues with my controllers. However, I'm afraid of how this is going to work with new users using newer controllers in Raine, especially d-input ones, which I suppose are the ones not currently working in the emulator.

Thank you so much again for your help and work.

 

PS: I don't know if this is an issue, but when I run controllermap.exe, it doesn't have the buttons' labels as we see here: https://github.com/glebm/opendingux-controllermap-sdl2/releases/tag/v0.1.1

Mine looks like this: https://imgur.com/a/VKJ0lOo

Controller Logs.7z

Posted (edited)
6 hours ago, mer-curious said:

Hey Tux! Now I think I understand what you meant. So, I don't change any of the default video options in this testing. I just load a game and the pixels are crystal clear, as expected. Then if I load another game in the same Raine session the picture becomes blurred (similar to a bi-linear filtering), either before and after leaving the GUI. This didn't happen before the SDL2 update.

Thanks for the reply, I was in lack of feedback... !

Well sorry but I don't see that here, in windows or in linux. Screenshots maybe, e.g screenshot of a game when loaded 1st and the same game when loaded 2nd to see this effect in action ? By the way sorry, I just noticed the function to take screenshots from raine in opengl is broken, that's probably the one you'd need here since by default it saves at the size of your screen, just take a screenshot of your window then...

6 hours ago, mer-curious said:

 

I can remap it but strangely it doesn't work in the game, only in the GUI. Actually I don't even need to remap it to use it in the GUI.

Yeah that's the game part that I removed thanks. Yeah there are 2 separate functions to handle events ingame and in the gui, which is a problem but it's unavoidable.

6 hours ago, mer-curious said:

I don't know if it's important, but in the "Game Controllers" properties in Windows it informs that the d-pad in my controller is a "point of view hat".

Nope ! ;-)

6 hours ago, mer-curious said:

 

Thank you for your assistance on this.

So I downloaded the zip and the program was not starting, it was asking for this DLL file: https://pt.dll-files.com/libgcc_s_dw2-1.dll.html

Tsss it was in the dlls for raine 32 bits of course... !

6 hours ago, mer-curious said:

Then I placed this DLL in the executable folder and it finally launched. I guess I could generate the logs by doing "controllermap.exe > log" in Command Prompt. I'm attaching the files to this post.

Finally, I tried the testgamecontroller.exe but it returns an error that "SDL_GameControllerHasRumble was not located in the dynamic link library".

You messed up the SDL2.dll version, it used an old version here, just unpack the archive in the raine32 0.92.1 and it should get all it needs correctly, but anyway now that you have what looks like a working mapping you don't really need that anymore.

6 hours ago, mer-curious said:

Anyway, I hope the logs can help you address the issues with my controllers. However, I'm afraid of how this is going to work with new users using newer controllers in Raine, especially d-input ones, which I suppose are the ones not currently working in the emulator.

Thank you so much again for your help and work.

 

PS: I don't know if this is an issue, but when I run controllermap.exe, it doesn't have the buttons' labels as we see here: https://github.com/glebm/opendingux-controllermap-sdl2/releases/tag/v0.1.1

Mine looks like this: https://imgur.com/a/VKJ0lOo

I probably forgot a font, luckily it can work without it !

6 hours ago, mer-curious said:

And I have another question then, already : I actually didn't know when using sdl-1.2 that some gamepads handled the dpad as a hat when some others handled it as buttons, yours are both handling it as a hat apparently.
So the question is : in raine < 0.92, it tried to remap the events coming from a hat to joystick events, so how did it work ? You could use it for movement, or not at all ? Or could you remap it to something else, buttons actions ?
This code is not supposed to be used anymore if your controller is correctly recognized as a gamecontroller, which will be the case if we add these mappings you just made, so it's interesting to know how it worked before that...

Ok, your mappings seem to work, but bad news, they are platform specific, which means 1 mappings file for each platform ! :(

I still don't know if I should merge this mapping thing into raine or simply allow to remap it manually as before... Well in my case I have 2 gamepads which are already recognized as game controllers, so no problem here, I don't need these mappings, so I'll need some fedback for that.

The old code for sdl-1.2 remapped automatically the hat to a joystick axe which didn't exist... ! So it appeared as a joystick movement, but it worked in the end... I'll keep this for now I think...

We're not in a hurry so I'll wait at least a day to see if I get some news from your blurry effect, but I am starting to have a few interesting changes for a new release, even if this time there are not many changes... I'll release the next one for windows with your mappings as an external file "mappings" in the archive, you'll be able to test with and without it to see the difference...

Edited by Tux

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...