SDL2

Technical discussion for those interested in Supermodel development and Model 3 reverse engineering. Prospective contributors welcome.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

Re: SDL2

Postby Spindizzi » Mon Nov 13, 2017 3:03 am

Re,
making a rapid build with only sdl_quit message (normal way from sdl2)
closing window works if rawinput not activated but if rawinput activated, keys and mouse don't work (hard to quit, must use task manager to kill task, lol)

no go with my option of mixing windows and sdl2 events
Spindizzi
 
Posts: 196
Joined: Thu Nov 17, 2016 8:55 am
Location: France

Re: SDL2

Postby Bart » Mon Nov 13, 2017 11:49 am

I just looked over the diff. It'll need some work to remove the SDL references bleeding into Model3/. All SDL stuff should be abstracted into the SDL sub-system only (OSD/ subdirectory). Most of it looks straightforward. I don't know anything about RawInput. Doesn't sound like fun :oops:
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: SDL2

Postby Bart » Sun Dec 03, 2017 5:26 pm

Sorry for the radio silence but I've been very busy with my HoloLens projects. They're much more time consuming than I thought and I need to get them wrapped up this month. I built SDL2 on my machine the other day and will hopefully be able to look at this in the coming week or two. I'm unsure about how to handle the RawInput stuff. That may take a while to figure out. I'd hate to lose RawInput mode as it seems several people do use it for dual lightgun play.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: SDL2

Postby luisfcorreia » Wed Jan 03, 2018 4:42 am

Hey peeps!

I'm back for a little more digging into this very fine emulator.

What's the current status regarding migration to SDL2?

I can try and apply that large patch into current SVN trunk.

Cheers!

Happy new year
luisfcorreia
 
Posts: 13
Joined: Tue Aug 09, 2016 1:13 am

Re: SDL2

Postby Bart » Fri Jan 05, 2018 6:21 pm

Haven't had time to look at it again but I would really like to get this integrated. It seems that one obstacle was making sure RawInput still works as before. That is essential to dual mouse and keyboard support, which some people actually do use to play games like Lost World with friends.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: SDL2

Postby Spindizzi » Wed Apr 04, 2018 2:50 am

Hello,
Bart, if you have a little time to look at this...

So after applying sdl2 diff from Jason on svn722
As explained before, this leads to have a choice in DirectInputSystem.cpp (CDirectInputSystem::Poll())
either we use polling windows message method (PeekMessage)
->window closing cross box doesn't work (Supermodel.exe lostwsga.zip)
->rawinput works (Supermodel.exe -input-system=rawinput lostwsga.zip)
or we use polling sdl message method (SDL_PollEvent)
->window closing cross box works (Supermodel.exe lostwsga.zip)
->rawinput doesn't work (Supermodel.exe -input-system=rawinput lostwsga.zip)

I may have found a way to have all working normally
if we did that in the polling sdl message and by removing the window message process:

Code: Select all
SDL_Event e;
SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE); //disabled by default
while (SDL_PollEvent(&e))
   {
      if (e.type == SDL_QUIT)
         return false;    
      else if (e.type == SDL_SYSWMEVENT)
      {
         //SDL_SysWMmsg *wmMsg = e.syswm.msg;
         if (m_useRawInput)   ProcessRawInput((HRAWINPUT)e.syswm.msg->msg.win.lParam);
      }
   }


I've got that
->window closing cross box works (but not working in rawinput mode. I guess this is because mouses are captured in raw mode) (Supermodel.exe lostwsga.zip)
->rawinput works (Supermodel.exe -input-system=rawinput lostwsga.zip)

Does that sound right for you ?
++

-----------------------

Edit:

Re,
Ian, a question for you
what do you think of this video ?
look at shadow and light brakes
1st part is svn 722 with sdl1 (normal), 2nd part is svn 722 with sdl2
https://yadi.sk/i/TY7Z256F3U6Fxy
I got the same symptom when I tried sdl2, years ago. So when Jason posted the sdl2 diff, I checked the shadows and if I remember well, I didn't get this trouble. but now, problem returns
Very strange...
++
Spindizzi
 
Posts: 196
Joined: Thu Nov 17, 2016 8:55 am
Location: France

Re: SDL2

Postby Ian » Wed Apr 04, 2018 8:07 am

try peekmessage with PM_NOREMOVE
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: SDL2

Postby Spindizzi » Wed Apr 04, 2018 8:47 am

I reverted my change to peekmessage instead of SDL_PollEvent but it's the same
Spindizzi
 
Posts: 196
Joined: Thu Nov 17, 2016 8:55 am
Location: France

Re: SDL2

Postby Ian » Wed Apr 04, 2018 9:08 am

I'll have a look when I have a bit
Been spending a bit of time trying to work out the crazy timing problems with supermodel, think I've made some progress. Well with the 2d layer anyway, not looked at the 3d layer yet
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: SDL2

Postby Spindizzi » Wed Apr 04, 2018 10:16 am

Do not worry anymore about that
I restart the VC project from scratch, adding sdl2.0.0.8 to the project, adding mod from Jason and my mod from above, and all is ok now :P
I may have selected a wrong option in the old project (optimisation or other....)
++
Spindizzi
 
Posts: 196
Joined: Thu Nov 17, 2016 8:55 am
Location: France

Previous

Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 1 guest