Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL2 port? #25

Open
vanfanel opened this issue Mar 7, 2021 · 11 comments
Open

SDL2 port? #25

vanfanel opened this issue Mar 7, 2021 · 11 comments

Comments

@vanfanel
Copy link

vanfanel commented Mar 7, 2021

Hi there, @DavidGriffith

I added SDL2-based overlay support to Hypseus, a Daphne fork from several years ago. It's here:
https://github.com/btolab/hypseus.git

The problem is that Hypseus seems mostly inactive (except for my own fixes) and for example it's missing some features from current Daphne, which your repository seems to care about.

So, what about a tag-teamed SDL2 port of the sources in this repository? Seems that Daphne "core" is pretty much decoupled from SDL, being src/video/video.cpp the only video-related code depending on SDL specifics, right?
Of course SDL1 would still be supported: Seems that Matt hasn't ported Daphne to SDL2 yet, has he?

@DavidGriffith
Copy link
Owner

It appears that Matt hasn't done much of anything with Daphne as of the past few years... which is why I started this repository. I'm unaware of any efforts to do SDL2 besides yours. Given that Hypseus seems more active than this repository, I think it would be best to port changes from here to there.

@DirtBagXon
Copy link

Hey @DavidGriffith , @vanfanel

As you may know I have played with David's fork of Daphne and a standalone Singe I discovered a little while ago.

I forked the Hypseus codebase after the recent activity and used that experience which came up with:

https://github.com/DirtBagXon/hypseus-singe

Kinda huge changes on Jeffery's codebase now, so didn't want to push a merge request, but if you guys wanted to pile in, more than happy for any help...

@vanfanel
Copy link
Author

vanfanel commented Apr 3, 2021

@DirtBagXon This is great! I have dreamed of an updated, better SDL2 Hypseus for a while now.
I put a lot of work on the overlays implementation on Hypseus (possibly because of my inexperience back then!) and seeing the code being worked on again is very, very nice indeed.

Hypseus itself was a present for me. SDL1-only programs are just broken by now on modern systems, so seeing Daphne ported to SDL2 was also a dream come true.

How can I help? I don't have much time these days, but consider me on board with regard to this :)

BTW, maybe we should pursue a common codebase?
There's this repo, there's Hypseus, and there's hypseus-singe, which I believe it's the future.
Maybe we should ask Jeffrey about joining efforts? Hypseus hasn't been updated in years, except for my small bugfixes regarding it's convoluted overlays implementation.

@DirtBagXon
Copy link

For the moment I am pushing on with my hypseus-singe fork, I did try and ping Jefferey but didn't get a response.

I am currently looking at getting some of the Singe 2 overlays working with font_say(). They work fine in earlier Singe games. I don't know if you are familiar with these games?

But see what you can find and improve on, we are lacking a screenshot function and ActionMax game support. But I'm sure you can improve on the stuff I have done ;)

@vanfanel
Copy link
Author

vanfanel commented Apr 4, 2021

@DirtBagXon I have been building this today, and the new fonts and overlays look very nice! :)

However, I am unable to use my game controller anymore: DPAD directions are recognized, but not the normal buttons (I have an X360-compatible pad from 8BitDo), so for example I can' use the sword in Dragon's Lair.
On old Hypseus, I can use one of my pad's buttons for the sword.

I have been searching high and low on the docs and on the .ini files, but I can't see how to assign action buttons and coin-input/start buttons to an SDL2 gamecontroller.
Can you please point me in the right direction?

@DirtBagXon
Copy link

Heya,

To be honest I don't use joypads, I was asked by the RetroPie guys to clear out the joystick controls, so that they could assign manually.

Here is the commit that pulled them out:
DirtBagXon/hypseus-singe@0e8ac2c

SDL2 documentation sucks, but this Reddit post seems useful, with the use of jstest /dev/input/js0

https://www.reddit.com/r/RetroPie/comments/fb4xlh/daphne_controls_i_mean_what/

Even the SDL2 main KeyCode page is now giving a 404 (was fine last week), however this seems to have cached it:

https://www.freepascal-meets-sdl.net/sdl-2-0-key-code-lookup-table/

I will have a play, but if you find anything useful let me know.

Also it may be worthwhile asking some of the guys at https://retropie.org.uk/forum/

They are picking up on Hypseus Singe at the moment.....

@DirtBagXon
Copy link

DirtBagXon commented Apr 4, 2021

Here might be a pointer....

https://retropie.org.uk/forum/topic/8971/daphne-joystick-mapping-problem/11

Perhaps we should move this conversation out of David's Repo too - maybe to the RetroPie forum ?

Edit: I have managed to enable SWORD by using jstest /dev/input/js0 and mapping my js button 10:

KEY_BUTTON1 = 1073742048 0 11

Button 10 (+1) to the third parameter on KEY_BUTTON1 in hypinput.ini

It appears the SDL key scancodes don't come into this as far as the user is concerned.

I mapped multiple buttons using just jstest and the third parameter of key definitions in hypinput.ini - The trick is to +1 to the button number jstest reports, as '0' is reserved. All working.

@vanfanel
Copy link
Author

vanfanel commented Apr 4, 2021

@DirtBagXon That sounds good! That thread is about mangling with xboxdrv (puag!) which I wouldn't touch with a 10mts pole- SDL2 is enough, external programs sending around inputs are an awful solution.

Now, your solution seems to work! Maybe it's just a matter of documenting it.

What does that 1073742048 sequence mean? Is that the keyboard scancode?

EDIT: I was also able to configure the rest of the buttons this way, even COIN and START, everything is set to my controller now. Great!!!

Another VERY good thing is that hypinout.ini is read from the same directory where I put the hypseus executable. That is VERY good too! Makes the system self-contained without the need of hidden files on $HOME. Keep it like this, please :)

And yes, we should move this to David's or better yet, to https://github.com/DirtBagXon/hypseus-singe

@DirtBagXon
Copy link

"What does that 1073742048 sequence mean?"

https://github.com/DirtBagXon/hypseus-singe/blob/master/doc/keylist.txt

@DirtBagXon
Copy link

@vanfanel

FYI, I have documented joystick config in the latest commit. Within hypinput.ini itself

https://github.com/DirtBagXon/hypseus-singe/blob/master/doc/hypinput.ini

@DavidGriffith
Copy link
Owner

Here might be a pointer....

https://retropie.org.uk/forum/topic/8971/daphne-joystick-mapping-problem/11

Perhaps we should move this conversation out of David's Repo too - maybe to the RetroPie forum ?

Feel free to continue whatever discussion you like about Daphne and Singe here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants