Opened 14 years ago

Closed 13 years ago

Last modified 12 months ago

#8516 closed patch

Very basic GP2X Backend

Reported by: djwillis Owned by: sev-
Priority: normal Component: Port: GP2X
Keywords: Cc:



Attached is a very quick patch to start the ball
rolling regards eventually making a GP2X backend

This is not SVN quality by a long shot but it is
somewhere for me to post updates and get feedback as I
whip it into shape and clean up some of the more horrid
things (controller mapping springs to mind). The port
itself is pretty stable and supports most (all?) of the
games supported by ScummVM using the GP2X’s hardware
downscalar when needed for the SVGA games.

The patch is a quick one taken from my working SVN
folder minus any of the current core hacks I have in
there (things like switching functions on GameID and
playing with zoomed rects).
This version is largely hacked off the SDL backend this
however is lightly to not be the case forever. It need
the hardware optimised versions of SDL for the GP2X
linked in when building to facilitate use of things
like the hardware scalar and blitter.

It needs some major cleanup and a few formatting tweaks
to bring it in line with the ScummVM standards but I
thought it was best to get something posted up or I
would never get around to it ;-) (I seem to have no
free time at the moment).

Features of this patch:

New GP2X backend (backends/gp2x) largely based off SDL
with GP2X specific tweaks (enough hacks to justify
keeping it separate to SDL in my view).
Minor changes (via #IFDEF’s) to several files in the
core engine (FMOPL, Saves, that sort of thing).
Patches to the configure script to make the GP2X a
valid target.

I have been doing GP2X releases for some time based
largely on this code (with some core hacks) and hosting
them on my site at


John Willis

Ticket imported from: #1432376. Ticket imported from: patches/621.

Attachments (2) (44.5 KB ) - added by djwillis 13 years ago.
scummvm - gp2x - backend and patch - 2006-09-30 (44.6 KB ) - added by djwillis 13 years ago.
Update to - scummvm - gp2x - backend and patch - 2006-09-30

Download all attachments as: .zip

Change History (14)

comment:1 by fingolfin, 13 years ago

Owner: set to SF/wonst719

comment:2 by fingolfin, 13 years ago

So, what's the status of this? And how does it compare to the gp32 backend
(AFAIK the GP2x is the successor of the GP32) -- any code sharing possible?

comment:3 by djwillis, 13 years ago

Hi Max,

The port is still under active development outside this
patch, (in fact my local tree is based on SVN with the code
moved to /backend/platforms).
I have been working on stabilising the port, better using
the GP2X specifics and ironing out a few bugs prior to
updating the attached source (and the current lack of a
working GP2X is adding to this temporary hiatus).

As for the port and its relationship with the GP32 in simple
terms there is none (other then me hacking around with both
ports at one time or another).
The GP2X is more the ‘spiritual’ successor to the GP32, it
is not made by the same company and other then them both
sharing an ARM920 CPU the options for code sharing are
superficial for the most part. The GP2X is a very different
ScummVM platform in some ways (well can run more engines) as
you have access to a bit more RAM, a good POSIX OS (RTEMS or
Linux) and things like hardware scalars, blitters etc.
anyway that’s enough about that ;).

For reference, this GP2X backend is hacked off of the
generic SDL backend as a starting point and in that respect
has more in common with the Nokia 770/Maemo backend (SDL
based on a low spec portable device). The medium term idea
was to move it to fit better within the small systems
backend framework as that develops.


John Willis

comment:4 by SF/wonst719, 13 years ago

I think I can't do anything with GP2X backend. :)

comment:5 by SF/wonst719, 13 years ago

Owner: SF/wonst719 removed

comment:6 by djwillis, 13 years ago

Just added a zip with an updated patch and the
backends/platform/gp2x dir.

Not had a chance to test this as heavily as I would have
liked before submitting as I have had other family
commitments. I did this patch bundle on a borrowed machine
without so much as a decent *nix toolset but it builds
cleanly and a quick eye-ball shows that the core changes are
fairly minor and not to evil (I hope, can somebody who knows
configure scripts well check I have not broken anything
there :o).

There are a fair few new features in the port compared to
earlier patches and a corresponding amount of bugs but it's
in a decent enough state to build and roll with. Most bugs
are engine specific (Simon and Sky mostly), other engines
are largely working very well (few save issues and the odd
blitting problem).


comment:7 by fingolfin, 13 years ago

Some comments:

* Your change to common/config-manager.cpp is odd. You
changed code which used to be marked as UNIX-only to
"not-GP2x". Any particular reason for that?

* The configure changes look OK.

* The change to backends/saves/savefile.cpp seems odd...
You force the user to store things inside the game data
dir, and no other spot is allowed.

comment:8 by djwillis, 13 years ago

Hi Max,

Reasons for those 'odd' changes (or at least the logic
behind them).
I should have put comments in the code (my fault for doing
things in a rush).

* common/config-manager.cpp

The GP2X is UNIX/Linux (and defines UNIX) but I don't want
this one UNIX define set as for a number of reasons.

You can end up with nasty things like home dir being on a
read only NAND partition on the GP2X in some firmware
versions so I want to override that and force the file to be
in the folder the executable is launched from. However
looking at that file again I have no idea what possessed me
to do the hack quite like I did. Not exactly clean for other
platforms maybe a If UNIX and NOT GP2X and a separate If
GP2X would be better.

• backends/saves/savefile.cpp

Thinking about this maybe something in gui/options.cpp and
friends or in the default config setup would be cleaner and
more customisable?

Again, this change is very similar to the above hack. Games
are run from a read/write SD card so it’s a known ‘good’
location to save to. This should be possible to override by
the user as you mentioned but at the time this was the
quickest (and dirtiest) way to get around the risk of ending
up with it trying to save under the read only home dir etc.

Both the above hacks also reflect that the GP2X whist
running Linux does not expose much of it’s UNIX’ness to the
default target user (you copy files on and off the root of
the SD card (seen as /mnt/sd) via a the GP2X showing as a
USB mass storage device.

As it’s aimed as a games console my idea was to keep
everything under the users choice of root ScummVM folder.
Thinking about it maybe ScummVMroot/saves would be a better
idea as a default. I don’t want the default saves ending up
somewhere the user cannot easily get at them and anything
that ends up in home or outside /mnt/sd is just that. Not
all users of a games console relish the use of SSH’ing into
the device to poke around.

Hope that explains if not justifies the thought process
behind the hacks ;). As for cleaner, better ways to get the
same general results please shout.


by djwillis, 13 years ago

scummvm - gp2x - backend and patch - 2006-09-30

comment:9 by djwillis, 13 years ago

Updated patch and removed 'odd' core tweaks and commented
code where they really are needed (Read only HOME dir).

The only one that may still be out of sorts is the ifdef
hack in FMOPL to set the GP2X to low quality I guess.

by djwillis, 13 years ago

Update to - scummvm - gp2x - backend and patch - 2006-09-30

comment:10 by sev-, 13 years ago

I reviewed the patch, and after short discussion with
DJWillis even patches to fmopl.cpp will go away in his next
patch version. Additional notes were also passed to him.

Otherwise the patch looks completely OK to commit.

comment:11 by sev-, 13 years ago

Owner: set to sev-
Status: newclosed

comment:12 by digitall, 12 months ago

Component: Port: GP2X
Note: See TracTickets for help on using tickets.