Showing posts with label SDL. Show all posts
Showing posts with label SDL. Show all posts

Wednesday, April 13, 2016

ScummVM for PlayBook and BB10

Started to scratch an itch as nobody seemed to have done a proper native port of ScummVM for the PlayBook or BlackBerry 10 devices.

It runs and the games seems to work. Now what is needed is some way to handle left/right clicks, F5 and other keyboard shortcuts.

Native ScummVM on BlackBerry PlayBook



Wednesday, June 12, 2013

Killing zombies on a BlackBerry 10 device from CLI

I'm porting a SDL based game to BlackBerry 10. The app does not yet handle the swipe-up + exit gesture properly and gets stuck in the background.

I don't know exactly what happens but the app is still running and I can't restart it and the app window  is also hidden from the task list view. Restarting fixes it obviously, but there must be a more sane way to kill it.

So what to do? The obvious way, ssh into it and running something like, say:

ps | grep appname
kill -9 

But nooo.. the paranoid people at BlackBerry has removed the QNX ps command from the BB10 Core OS.

$ ps
sh: ps: cannot execute - No such file or directory
$ which ps
which: no ps in /usr/bin:/bin:/usr/sbin:/sbin

So now what? I did ask on the forums for some help, got a link to a application for slaying zombies, but that did seem a bit overkill for a simple thing like this, so a quick dive into the code slayer showed that QNX has a /proc filesystem listing all the processes. Obviously to make it a PITA the permissions are all dr-x--x--x

But here, a poor mans ps command:

for i in /proc/*/cmdline ; do echo $i; cat $i; done

Find the line that prints out the cmdline for your app and get the pid from the line above, kill -9 it and there you have it!

Monday, December 31, 2012

Getting started with SDL on BB10 and the Playbook

BlackBerry provides SDL for the available for BlackBerry 10 and the PlayBook, with a nice touch screen helper library to make it easier to create touch screen controls with minimal or even no modification to original apps.

The instructions on how to use SDL after building everything is quite lacking on the web site so, I'll document my findings here for anyone else that is interested and also as a reminder for myself.

Anyway, start with cloning TouchControlOverlay and SDL from the RIM github repo. I won't go into the details here. And remember to source the bbndk evironment first.

Ok, now you should have the sources. Start with building and installing  TouchControlOverlay

cd TouchControlOverlay
make
make install

Next, building SDL. I prefer to use an out-of-source build directory, makes it easier to build for both BB10 and PlayBook from the same source.

$ mkdir sdlbb10
$ cd sdlbb10
$ ../SDL/configure  --prefix=/home/milang/bbndk/target_10_0_9_1673/qnx6/armle-v7 \
--host=arm-unknown-nto-qnx8.0.0eabi \
--without-x --enable-pthreads \
--enable-audio --enable-video-playbook \
LDFLAGS="-lscreen -lasound -lpps -lm -lpng14 -lbps -lxml2 -lEGL -lGLESv2" \
CPPFLAGS="-D__PLAYBOOK__ -D__QNXNTO__"
$ make

Install SDL
$ make install

Ok, now SDL is installed nicely. Next edit the bbndk-env.sh script and add

PKG_CONFIG_PATH=${QNX_TARGET}/armle-v7/lib/pkgconfig
export PKG_CONFIG_PATH

in the end of the file. Re-source it or set the PKG_CONFIG_PATH manually. What this does is enable pkg-config enabled sources to find SDL (and other software that uses pkg-config to get options). For example the SDL libraries that we will add next, SDL_net and SDL_image. But that will come in another post.