[hatari-devel] Crosscompiling Hatari for GP2X Wiz

Matthias Arndt marndt at asmsoftware.de
Wed Mar 30 18:41:51 CEST 2011


Am Dienstag, den 29.03.2011, 23:36 +0300 schrieb Eero Tamminen:
> Hi,
> 
> On maanantai 28 maaliskuu 2011, Matthias Arndt wrote:
> > > That's similar to N800, so there shouldn't be any problem.
> > 
> > I just want to make sure we talk about the same functionality:
> > 
> > IF Button X on SDL_JOYSTICK(xy) IS PRESSED
> >  SIMULATE ATARI KEYPRESS <abc>
> > ENDIF
> > 
> > IF Button Y on SDL_JOYSTICK(xy) IS PRESSED
> > SIMULATE HOST KEYPRESS <abc>  e.q. open GUI, quit emulator
> > ENDIF
> 
> Oh, sorry, you were talking about mapping actual SDL joystick events
> to Atari keys.  For that there's no support in Hatari.

It should be easy to add to the joystick submodule. All I have to do is
enqueue SDL_events for keypresses. The question is how should I design
the API for this very specific patch?

A #define for the complete functionality and more for the mappings?
What I want to avoid are even more configuration options in the .ini
file.

> It's such a rare case that I don't think it should be in the UI, but if you
> can cleanly add support for configuring it from the config file, it's
> inclusion to Hatari could be considered.

I am considering a target specific C-file that needs to be added into
the compilation process if a special #define is set.

If all fails I could rewrite the joystick module just for use with my
target.


> Does the GP2X give joy events for its joystick, or are they mapped to
> joystick events just inside the GP2X SDL library?

A complete SDL_Joystick* structure is available but it only gives
joystick button events, no axis events. The button mapping is as
follows:

		#define GP2X_BUTTON_UP              (0)
		#define GP2X_BUTTON_DOWN            (4)
		#define GP2X_BUTTON_LEFT            (2)
		#define GP2X_BUTTON_RIGHT           (6)
		#define GP2X_BUTTON_UPLEFT          (1)
		#define GP2X_BUTTON_UPRIGHT         (7)
		#define GP2X_BUTTON_DOWNLEFT        (3)
		#define GP2X_BUTTON_DOWNRIGHT       (5)
		#define GP2X_BUTTON_CLICK           (18)
		#define GP2X_BUTTON_A               (12)
		#define GP2X_BUTTON_B               (13)
		#define GP2X_BUTTON_X               (14)
		#define GP2X_BUTTON_Y               (15)
		#define GP2X_BUTTON_L               (10)
		#define GP2X_BUTTON_R               (11)
		#define GP2X_BUTTON_MENU            (8)
		#define GP2X_BUTTON_SELECT          (9)
		#define GP2X_BUTTON_VOLUP           (16)
		#define GP2X_BUTTON_VOLDOWN         (17)

> 
> 
> > If so, how can I determine which event number I have to map as I only
> > have the standard SDL_Joystick defines available which give numbers
> > between 0 and 16.
> 
> Check doc/keymap-sample.txt on how to map the keys.
> 
> Attached are Atari and SDL helper programs.
> 
> (Hm, maybe I should add them under Hatari tests/-dir...)

This is a good idea to add indeed.
But if i go for a target specific joystick file, there won't be a need.

Matthias
-- 
Matthias Arndt <marndt at asmsoftware.de>
PGP-Key: http://www.final-memory.org/files/marndt.asc   ICQ: 40358321
>>> Jabber: simonsunnyboy at jabber.ccc.de <<<




More information about the hatari-devel mailing list