Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PPSSPP for Pi
10-03-2015, 07:41 AM
Post: #61
RE: PPSSPP for Pi
Well, the good news is I got it to build. The bad news is that it doesn't actually run, just gives the message "EGL Error: Unable to get display!" if run from the command line or "Unable to create EGL display." if run from an xterm.

My build process for reference:

First step: install dependencies
Quote:$ sudo apt-get install cmake libsdl1.2-dev

Second: more dependencies, install SDL2 manually
Quote:$ wget (URL to latest SDL2 source tarball goes here, 2.0.3 tonight)
$ tar xvzf SDL2-2.0.3.tar.gz
$ cd SDL2-2.0.3/
$ ./configure --host=armv7l-raspberry-linux-gnueabihf
$ make -j4
$ sudo make install

Third: checkout and prepare the PPSSPP source:
Quote:pi@raspberrypi ~ $ git clone (PPSSPP source from github) ppsspp
pi@raspberrypi ~ $ cd ppsspp
pi@raspberrypi ~/ppsspp $
pi@raspberrypi ~/ppsspp $ git submodule update --init
pi@raspberrypi ~/ppsspp $ cd SDL
pi@raspberrypi ~/ppsspp/SDL $ ./buildassets.sh
pi@raspberrypi ~/ppsspp/SDL $ cd ..

Fourth, CMakeLists.txt needs a bit of editing, change the section:
Quote:if(RPI)
include_directories(/opt/vc/include /opt/vc/include/interface/vcos/pthreads)
link_directories(/opt/vc/lib)
set(OPENGL_LIBRARIES GLESv2 bcm_host)
elseif(USING_GLES2 AND NOT IOS)
set(OPENGL_LIBRARIES GLESv2)
elseif(NOT IOS)
include(FindOpenGL REQUIRED)
endif()
to read :
Quote:if(RPI)
include_directories(/opt/vc/include /opt/vc/include/interface/vcos/pthreads /opt/vc/include/interface/vmcs_host/linux)
link_directories(/opt/vc/lib)
set(OPENGL_LIBRARIES GLESv2 bcm_host GL X11)
elseif(USING_GLES2 AND NOT IOS)
set(OPENGL_LIBRARIES GLESv2)
elseif(NOT IOS)
include(FindOpenGL REQUIRED)
endif()

One more bit of editing, GPU/Common/VertexDecoderArm.cpp uses "offestof", which, for whatever reason, is not defined in Raspbian's C++ libraries. Add the following line after the #includes in that file.
Quote:#define offsetof(st, m) __builtin_offsetof(st, m)

Then.
Quote:pi@raspberrypi ~/ppsspp $ ./b.sh

Wait while it compiles and links.
Find all posts by this user
Quote this message in a reply
10-04-2015, 08:46 PM
Post: #62
RE: PPSSPP for Pi
Well, I've gotten a little further by using USING_FBDEV and forcing it to link against /opt/vc/lib/libGLESv2.so instead of the default libGLES object.

Now it gets as far as

Quote:EGL ERROR: Unable to query for available configs.
Segmentation Fault

Help?
Find all posts by this user
Quote this message in a reply
10-24-2015, 09:03 AM (This post was last modified: 10-24-2015 09:03 AM by arutema.)
Post: #63
RE: PPSSPP for Pi
1.1.1 seems to compile on Pi with fewer hacks than previous versions.

Now up to
Quote:16:50:227 Core/Config.cpp:859 I[LOAD]: Loading controller config: /home/pi/.config/ppsspp/PSP/SYSTEM/controls.ini
16:50:227 Core/Config.cpp:864 E[LOAD]: Failed to read /home/pi/.config/ppsspp/PSP/SYSTEM/controls.ini. Setting controller config to default.
pure virtual method called
terminate called without an active exception
Pixels: 1680 x 1050
Virtual pixels: 1680 x 1050

in the startup process before terminating. From what digging i've been able to do, this may be related to not having any form of FFMPEG linked it. Trying to force it to link FFMPEG, and will share my CMakeLists.txt if tomorrow's session resolves that problem.
Find all posts by this user
Quote this message in a reply
10-24-2015, 04:33 PM
Post: #64
RE: PPSSPP for Pi
No luck.

I'm attaching my CMakeLists.txt. Can someone tell me if that's at fault, or the code itself?

Should I just give up and get a barebones x86_64 system for my emulator project?


Attached File(s)
.txt  CMakeLists.txt (Size: 50.21 KB / Downloads: 25)
Find all posts by this user
Quote this message in a reply
10-24-2015, 05:51 PM
Post: #65
RE: PPSSPP for Pi
iirc, when I was switching to rpi2, i had to block compile NEON/armv7 stuff
(i've read somewhere, some time ago that rpi2's cpu has/had(?) problems with NEON, or was it not compatible with it?, i dunno now, also, my old compile from rpi worked okay while i couldn't compile or run(segfault) rpi2 armv7 build)

so code-wise I had to comment out in CmakeLists.txt":
-armv7 detection
Code:
# Detect CPU from CMAKE configuration. Toolchains should set this up
if(CMAKE_SYSTEM_PROCESSOR)
    if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm")
        set(ARM ON)
#       if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^armv7")
#           set(ARMV7 ON)
#       endif()
    elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR
        ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^amd64" OR
        ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86")
        set(X86 ON)
    elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^mips")
        set(MIPS ON)
    endif()
endif()
- and NEON-related stuff
Code:
set(CommonExtra)
if(ARM)
    set(CommonExtra ${CommonExtra}
        Common/ArmCPUDetect.cpp
        Common/ArmThunk.cpp)
#       Common/ColorConvNEON.cpp)

see if that'll fix anything. If not, I'll try to extract from CMakeCache.txt the values I've used.
Find all posts by this user
Quote this message in a reply
10-24-2015, 06:34 PM
Post: #66
RE: PPSSPP for Pi
(10-24-2015 05:51 PM)Sim_Piko Wrote:  iirc, when I was switching to rpi2, i had to block compile NEON/armv7 stuff
(i've read somewhere, some time ago that rpi2's cpu has/had(?) problems with NEON, or was it not compatible with it?, i dunno now, also, my old compile from rpi worked okay while i couldn't compile or run(segfault) rpi2 armv7 build)

so code-wise I had to comment out in CmakeLists.txt":
-armv7 detection
Code:
# Detect CPU from CMAKE configuration. Toolchains should set this up
if(CMAKE_SYSTEM_PROCESSOR)
    if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm")
        set(ARM ON)
#       if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^armv7")
#           set(ARMV7 ON)
#       endif()
    elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR
        ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^amd64" OR
        ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86")
        set(X86 ON)
    elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^mips")
        set(MIPS ON)
    endif()
endif()
- and NEON-related stuff
Code:
set(CommonExtra)
if(ARM)
    set(CommonExtra ${CommonExtra}
        Common/ArmCPUDetect.cpp
        Common/ArmThunk.cpp)
#       Common/ColorConvNEON.cpp)

see if that'll fix anything. If not, I'll try to extract from CMakeCache.txt the values I've used.

EUREKA! That's got it booting. Having some problem setting up my controller though. Got to dig into that tonight, maybe just try a different controller.
Find all posts by this user
Quote this message in a reply
10-24-2015, 06:52 PM (This post was last modified: 10-24-2015 06:55 PM by Sim_Piko.)
Post: #67
RE: PPSSPP for Pi
It's probably because SDL/SDLjoystick.h has hard-coded button config (for xbox360 pad probably(it says that literally in comment above definitions):
Code:
#ifdef _WIN32
(config for windows)
#else
        SDLJoyButtonMap[0] = NKCODE_DPAD_UP;
        SDLJoyButtonMap[1] = NKCODE_DPAD_DOWN;
        SDLJoyButtonMap[2] = NKCODE_DPAD_LEFT;
        SDLJoyButtonMap[3] = NKCODE_DPAD_RIGHT;
        SDLJoyButtonMap[4] = NKCODE_BUTTON_10;
        SDLJoyButtonMap[5] = NKCODE_BUTTON_9;
        SDLJoyButtonMap[6] = NKCODE_BUTTON_5;
        SDLJoyButtonMap[7] = NKCODE_BUTTON_6;
        SDLJoyButtonMap[8] = NKCODE_BUTTON_7;
        SDLJoyButtonMap[9] = NKCODE_BUTTON_8;
        SDLJoyButtonMap[10] = NKCODE_BUTTON_SELECT;
        SDLJoyButtonMap[11] = NKCODE_BUTTON_2;
        SDLJoyButtonMap[12] = NKCODE_BUTTON_3;
        SDLJoyButtonMap[13] = NKCODE_BUTTON_4;
        SDLJoyButtonMap[14] = NKCODE_BUTTON_1;
        SDLJoyButtonMap[15] = NKCODE_BUTTON_11;

I had to 'fix' it to look like this:
Code:
#ifdef _WIN32
(config for windows, untouched)
#else
        SDLJoyButtonMap[0] = NKCODE_BUTTON_1;
        SDLJoyButtonMap[1] = NKCODE_BUTTON_2;
        SDLJoyButtonMap[2] = NKCODE_BUTTON_3;
        SDLJoyButtonMap[3] = NKCODE_BUTTON_4;
        SDLJoyButtonMap[4] = NKCODE_BUTTON_5;
        SDLJoyButtonMap[5] = NKCODE_BUTTON_6;
        SDLJoyButtonMap[6] = NKCODE_BUTTON_7;
        SDLJoyButtonMap[7] = NKCODE_BUTTON_8;
        SDLJoyButtonMap[8] = NKCODE_BUTTON_9;
        SDLJoyButtonMap[9] = NKCODE_BUTTON_10;
        SDLJoyButtonMap[10] = NKCODE_BUTTON_11;
        SDLJoyButtonMap[11] = NKCODE_BUTTON_12;
        SDLJoyButtonMap[12] = NKCODE_BUTTON_13;
        SDLJoyButtonMap[13] = NKCODE_BUTTON_14;
        SDLJoyButtonMap[14] = NKCODE_BUTTON_15;
        SDLJoyButtonMap[15] = NKCODE_BUTTON_16;
Don't know if that breaks some pad config, but at least fixed my usb gamepad.
Find all posts by this user
Quote this message in a reply
10-25-2015, 05:55 AM
Post: #68
RE: PPSSPP for Pi
Thanks, that got my gamepad mostly working. Now to figure out some weirdness with the keyboard. It seems as soon as I launch ppsspp, the keyboard stops responding, and doesn't start again until I send the bash process a SIGHUP over my handy SSH session.
Find all posts by this user
Quote this message in a reply
10-25-2015, 09:22 AM
Post: #69
RE: PPSSPP for Pi
Keyboard issues are partially fixed by installing libudev-dev and rebuilding SDL2 and PPSSPP. It recognizes the keyboard now, but the shell still won't respond to keyboard input after exiting PPSSPP.
Find all posts by this user
Quote this message in a reply
10-25-2015, 01:19 PM (This post was last modified: 10-25-2015 08:58 PM by Sim_Piko.)
Post: #70
RE: PPSSPP for Pi
Easiest workaround for that is pressing 'Alt + SysRq + R' (SysRq is usually on same key with PrintScreen )

Code-wise, at sdl2's video init, the keyboard is 'locked' so it can't spam all keypresses to shell (SDL_EVDEV_Init() function is probably doing that).
The 'unlock keyboard' function is hidden under SDL_EVDEV_Quit(), which is ran after executing SDL_VideoQuit() (to be specific, it's in "src/video/raspberry/SDL_rpivideo.c", under RPI_VideoQuit()).
That VideoQuit function is somehow not executed at ppsspp's exit, leaving keyboard in 'dead' state.
I remember i've tried to do something with it, but i can't remember or find any code changes i've made, either in ppsspp(and/or 'native') nor in sdl2 :/
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: