Hi all,
I've been compiling the latest CVS version of dosbox 0.65 as the orignal one available seems to just give me a black screen on my gp2x mk II
I finally got the CVS version to compile and it now does work on my gp2x (games actually now start) but it seems that the input does not work.
I'm reusing the code from the orignal port which had the code as this...
The init code in dosbox looks like this
I added the SDL_JoystickOpen(0); as that was in the wiki document but I don't know if it's needed.
Can anyone see anything wrong with this?
I'm guessing it must have worked in the orignal version.
I don't have a breakout box for my gp2x so it's a bit hard to debug. - it's a bit late now (4:13am - GMT) and I think I'll rest before working on this tomorrow again.
If I get the dosbox port to accept input I'll be releasing it for people who had the blackscreen problem with the orignal port.
Please note this is my first time messing with the gp2x so I'm pritty new at getting stuff to work
Regards
bOing
I've been compiling the latest CVS version of dosbox 0.65 as the orignal one available seems to just give me a black screen on my gp2x mk II
I finally got the CVS version to compile and it now does work on my gp2x (games actually now start) but it seems that the input does not work.
I'm reusing the code from the orignal port which had the code as this...
Code:
case SDL_JOYBUTTONDOWN:
case SDL_JOYBUTTONUP:
jpr(("SDL_JOYBUTTONxx which=%d button=%d\n", event.jbutton.which, event.jbutton.button));
/*
we're going to do a real ugly hack for the GP2X here...
we get the button events for 19 buttons on stick 0
so we're going to turn them into key events for lowercase letters
starting with 'a' (scancode 97)
*/
{
int tmp_button = event.jbutton.button;
if (event.type == SDL_JOYBUTTONDOWN)
{
event.type = SDL_KEYDOWN;
event.key.state = SDL_PRESSED;
}
else
{
event.type = SDL_KEYUP;
event.key.state = SDL_RELEASED;
}
event.key.keysym.scancode = 0; // hope no one looks
event.key.keysym.sym = (SDLKey)(97 + tmp_button);
event.key.keysym.mod = KMOD_NONE;
event.key.keysym.unicode = 0; // again, hope nobody looks
}
// and fall through to...
default:
void MAPPER_CheckEvent(SDL_Event * event);
MAPPER_CheckEvent(&event);
}
The init code in dosbox looks like this
Code:
( SDL_Init( SDL_INIT_AUDIO|SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_CDROM
|SDL_INIT_NOPARACHUTE|SDL_INIT_JOYSTICK) < 0 ) E_Exit("Can't init SDL %s",SDL_GetError());
SDL_JoystickOpen(0);
I added the SDL_JoystickOpen(0); as that was in the wiki document but I don't know if it's needed.
Can anyone see anything wrong with this?
I'm guessing it must have worked in the orignal version.
I don't have a breakout box for my gp2x so it's a bit hard to debug. - it's a bit late now (4:13am - GMT) and I think I'll rest before working on this tomorrow again.
If I get the dosbox port to accept input I'll be releasing it for people who had the blackscreen problem with the orignal port.
Please note this is my first time messing with the gp2x so I'm pritty new at getting stuff to work
Regards
bOing