Mednafen Members Members   Search Search   Help Help   Register Register   Login Login   Home Home
Home » Mednafen » Development » SDL2
Show: Today's Messages  :: Show Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
SDL2 [message #3524] Sat, 07 June 2014 11:03 Go to next message
kfg_  [PM]
Hi,

I've ported Mednafen to SDL2 and would like to get this work upstream.

You can find a patch for Mednafen 0.9.35.1 here.

Since keyboard input is now mostly based on scancodes instead of Keycodes the key definitions in an exsisting mednafen config won't work and all keys have to be reassigned, but everything else should work as is (otherwise it's a bug ofc Smile ).
Re: SDL2 [message #3528 is a reply to message #3524 ] Wed, 11 June 2014 18:16 Go to previous messageGo to next message
Administrator  [PM]
Why do you call SDL_GetScancodeFromKey() instead of just using the "scancode" member of "keysym"?

I should just rewrite/refactor most of the code in video.cpp and trash overlay.cpp, it's ancient and messy and a lot of it has lost its relevance with SDL2...


Anyway, I'm holding off on moving to SDL2 until the next Debian stable major release(which will include SDL2).

When I do, I intend to preserve compatibility with existing key mappings in Mednafen's configuration file, by changing how keyboard mappings are stored and doing some sort of translation of old-format mappings, either at startup or constantly during runtime.

[Updated on: Wed, 11 June 2014 18:20]

Re: SDL2 [message #3529 is a reply to message #3524 ] Wed, 11 June 2014 18:33 Go to previous messageGo to next message
Administrator  [PM]
The CEVT_SET_GRAB_INPUT handling looks broken, you need to also use "SDL_SetWindowGrab()", and dereference the pointer to get the state value to pass to it and the mouse relative motion function.

Though the whole handling of input grabbing and relative mouse motion may need to be reworked, depending on how SDL2 changed the semantics.

[Updated on: Wed, 11 June 2014 18:34]

Re: SDL2 [message #3530 is a reply to message #3528 ] Thu, 12 June 2014 12:17 Go to previous messageGo to next message
kfg_  [PM]
Thanks for the Feedback.

Administrator wrote on Wed, 11 June 2014 19:16

Why do you call SDL_GetScancodeFromKey() instead of just using the "scancode" member of "keysym"?


No particular reason. I just didn't think about keysym having it as a member. I'll fix it.

Administrator wrote on Wed, 11 June 2014 19:16


Anyway, I'm holding off on moving to SDL2 until the next Debian stable major release(which will include SDL2).

When I do, I intend to preserve compatibility with existing key mappings in Mednafen's configuration file, by changing how keyboard mappings are stored and doing some sort of translation of old-format mappings, either at startup or constantly during runtime.


I see.

Administrator wrote on Wed, 11 June 2014 19:34


The CEVT_SET_GRAB_INPUT handling looks broken, you need to also use "SDL_SetWindowGrab()", and dereference the pointer to get the state value to pass to it and the mouse relative motion function.

Though the whole handling of input grabbing and relative mouse motion may need to be reworked, depending on how SDL2 changed the semantics.



Right i'll fix that too.

I compiled Mednafen with mingw-w64 and noticed that the Windows version still had some sdl 1.2 code in ClearBackBuffer in src/drivers/video.cpp. I'm not sure if the problem mentioned in the comment there is fixed with SDL2 and i don't know how to test it either so i'll port the workaround.

Update:
New patch with fixes for the mentioned issues and updated for Version 0.9.36.2 here

[Updated on: Sun, 06 July 2014 11:07]

Re: SDL2 [message #4182 is a reply to message #3530 ] Tue, 08 September 2015 03:41 Go to previous messageGo to next message
athei  [PM]
I applied your patch. Works on OS X as far as I see. What is not working is switching from fullscreen back to windowed mode. When I press Alt+Enter in fullscreen i just get a black screen. I have to press Esc to quit then because there is no going back to fullscreen either.
Re: SDL2 [message #4315 is a reply to message #3524 ] Fri, 29 January 2016 10:12 Go to previous message
tapek  [PM]
Any new version of this patch ?
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic:Compiling Mednafen 0.9.22-WIP fails with PSX enabled on Intel Mac OS X 10.5.8 [SOLVED]
Next Topic:Lynx Headerless ROMs
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ ]

Current Time: Sat May 18 12:28:23 CDT 2024
.:: Contact :: Home ::.

Powered by FUDforum.
Copyright © FUDforum Bulletin Board Software