Precompiled Allegro 0.3 With The All-buttons Patch?


el_pango

Member
Joined
May 31, 2006
Messages
145
Location
California
Hi,

Can someone post a precompiled liballeg.a (not just the patch) that contains support for start, select and the volume keys? I am unable to build it on my machine from sources. Apologies if this is inappropriately categorized. If this exists somewhere, I apologise also - can someone tell me where to download this?
 
I have, but it's at work on my laptop and I'm on hols for the next 2 weeks :(
Either you'll have to wait or maybe someone else can help..?
My one also has a fix to the uninitialised blitter problem (black screen) and also a fix to the vsync code that appears to 'work better' (haven't tried releasing it anywhere yet as there are some other improvments I'd like to look at as well - but never have time).
 
kevcal said:
Okay, I'll have a tidy up after my hols :) and update it.
Thanks so much for this.

Would it be possible to make a few small changes to gp2x_joy.c before compiling and posting? I have written a quick hack that adds faked analogue support using the eight-way switch layout of the joypad:

CODE

/*** to go in joy_init() ***/
//joy[0].flags = JOYFLAG_DIGITAL;
joy[0].flags = JOYFLAG_ANALOGUE | JOYFLAG_DIGITAL; // el_pango 2007 03 09

joy[0].num_sticks = 1;
//joy[0].stick[0].flags = JOYFLAG_DIGITAL;
joy[0].stick[0].flags = JOYFLAG_ANALOGUE | JOYFLAG_DIGITAL; // el_pango 2007 03 09


/*** to go in joy_poll() ***/
// el_pango 2007 03 09 - fake analogue directions based
// on which switches are closed to yield all 16 possible
// directions
switch(gpio_m)
{
// straight up
case 0xFE: joy[0].stick[0].axis[0].pos = 0;
joy[0].stick[0].axis[1].pos = -128;
break;

// up and slightly left
case 0xFC: joy[0].stick[0].axis[0].pos = -48;
joy[0].stick[0].axis[1].pos = -96;
break;

// up and left
case 0xFD: joy[0].stick[0].axis[0].pos = -96;
joy[0].stick[0].axis[1].pos = -96;
break;

// left and slightly up
case 0xF9: joy[0].stick[0].axis[0].pos = -96;
joy[0].stick[0].axis[1].pos = -48;
break;

// left
case 0xFB: joy[0].stick[0].axis[0].pos = -128;
joy[0].stick[0].axis[1].pos = 0;
break;

// slightly down and left
case 0xF3: joy[0].stick[0].axis[0].pos = -96;
joy[0].stick[0].axis[1].pos = 48;
break;

// down and left
case 0xF7: joy[0].stick[0].axis[0].pos = -96;
joy[0].stick[0].axis[1].pos = 96;
break;

// down and slightly left
case 0xE7: joy[0].stick[0].axis[0].pos = -48;
joy[0].stick[0].axis[1].pos = 96;
break;

// down
case 0xEF: joy[0].stick[0].axis[0].pos = 0;
joy[0].stick[0].axis[1].pos = 128;
break;


// up and slightly right
case 0x7E: joy[0].stick[0].axis[0].pos = 48;
joy[0].stick[0].axis[1].pos = -96;
break;

// up and right
case 0x7F: joy[0].stick[0].axis[0].pos = 96;
joy[0].stick[0].axis[1].pos = -96;
break;

// right and slightly up
case 0x3F: joy[0].stick[0].axis[0].pos = 96;
joy[0].stick[0].axis[1].pos = -48;
break;

// right
case 0xBF: joy[0].stick[0].axis[0].pos = 128;
joy[0].stick[0].axis[1].pos = 0;
break;

// slightly down and right
case 0x9F: joy[0].stick[0].axis[0].pos = 96;
joy[0].stick[0].axis[1].pos = 48;
break;

// down and right
case 0xDF: joy[0].stick[0].axis[0].pos = 96;
joy[0].stick[0].axis[1].pos = 96;
break;

// down and slightly right
case 0xCF: joy[0].stick[0].axis[0].pos = 48;
joy[0].stick[0].axis[1].pos = 96;
break;

// user not doing anything with the stick
default: joy[0].stick[0].axis[0].pos = 0;
joy[0].stick[0].axis[1].pos = 0;
}



This yields sixteen distinct directions, which might be handy for some kinds of game that need slightly finer-grained control.

Thanks again!

PS: this was already tested at least once and verified to work (Simon Parzer included it in Alex 4). I just can't get it to build on my machine XD
 
Last edited by a moderator:
Back
Top