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 emulator to SDL2 #8

Closed
midwan opened this issue Sep 11, 2016 · 10 comments
Closed

SDL2 | Port emulator to SDL2 #8

midwan opened this issue Sep 11, 2016 · 10 comments
Assignees
Projects

Comments

@midwan
Copy link
Collaborator

midwan commented Sep 11, 2016

The emulator currently uses SDL1 internally, for input events, graphics drawing (combined with DispManX), audio and joystick support.

We should move it to SDL2 which provides a more modern approach, hardware acceleration and enhanced joystick input features.

@midwan midwan self-assigned this Sep 11, 2016
@midwan
Copy link
Collaborator Author

midwan commented Sep 22, 2016

Note: Guichan is outdated, no longer updated and does not play well with SDL2.
Moving to Guisan instead seems like the obvious choice: https://github.com/kallisti5/guisan

@midwan
Copy link
Collaborator Author

midwan commented Sep 25, 2016

The SDL2 packages available from the Jessie repository require/expect a X-environment and do not open a window from the console.

Will try compiling SDL2 from source with explicitly defining what features should be enabled/disabled, as mentioned here: https://solarianprogrammer.com/2015/01/22/raspberry-pi-raspbian-getting-started-sdl-2/

@midwan
Copy link
Collaborator Author

midwan commented Sep 25, 2016

Confirmed, compiling SDL2 from source and defining the necessary options seems to produce a version that works without X11.

@midwan
Copy link
Collaborator Author

midwan commented Sep 25, 2016

Note: Do NOT enable the experimental OpenGL driver on Raspbian. It breaks things like DispmanX and SDL2 without X11.

@midwan
Copy link
Collaborator Author

midwan commented Sep 25, 2016

Proof of concept, using Guisan, SDL2 and hardware accelerated display:
img_20160925_231941-25

@Fourdee
Copy link

Fourdee commented Sep 26, 2016

@midwan

Note: Do NOT enable the experimental OpenGL driver on Raspbian. It breaks things like DispmanX and SDL2 without X11.

I ran into similar issues when compiling DXX-rebirth for RPi. I wanted to support both FBdev and OpenGL for RPi.
I had to compile 2 binaries. One for FBdev (--disable-video-opengl) and the other with OpenGL. Both work great :)

Might be worth a shot at compiling with --disable-video-opengl? Should work on the RPi OpenGL driver.

@midwan
Copy link
Collaborator Author

midwan commented Sep 26, 2016

I tried compiling SDL2 with --disable-video-opengl but if the OpenGL driver is enabled, my applications don't start (no display is initialized). If I disable the OpenGL driver, they work again.

The same happens with any apps using DispManX directly, they fail when the OpenGL driver is enabled, work when it's not.

@midwan midwan changed the title Add support for SDL2 Migrate to SDL2 Oct 3, 2016
@midwan
Copy link
Collaborator Author

midwan commented Oct 3, 2016

UAE's GUI is now working under SDL2, except one glitch in the Configurations list (only one entry appears, with a larger than normal row height). This needs to be fixed in the original Guichan (now Guisan) code that calculates the row height and list items there.

The emulation screen is not working correctly yet, needs more time to fix. It actually opens a screen 4 times larger than what was expected, with incorrect colors (maybe RGB format issue?) and it's very slow.

@midwan
Copy link
Collaborator Author

midwan commented Jan 17, 2017

Note to self: the graphics corruption issue is related to the RGB format used (if it's 32-bit) in combination with the Pandora "copy to 16 bit" routines, located in picasso96.cpp. Investigate if those are really needed on the Pi and take them away if they are not.

@midwan
Copy link
Collaborator Author

midwan commented Jan 23, 2017

Graphics corruption issue is now fixed.
Need to look into #41 next.

@midwan midwan changed the title Migrate to SDL2 SDL2 | Port emulator to SDL2 Jan 24, 2017
@midwan midwan closed this as completed Feb 23, 2017
@midwan midwan moved this from In Progress to Done in SDL2 Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
SDL2
Done
Development

No branches or pull requests

2 participants