Skip to content

Commit

Permalink
-fixes for caanoo
Browse files Browse the repository at this point in the history
  • Loading branch information
SiENcE committed Sep 22, 2010
1 parent 97b5e93 commit 039629c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 26 deletions.
5 changes: 3 additions & 2 deletions unix/keydef.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/*
#ifdef CAANOO
#define A_1 0
Expand All @@ -15,7 +16,7 @@
#define RIGHT_1 14
#else

*/
#define A_1 0
#define B_1 1
#define X_1 2
Expand Down Expand Up @@ -56,4 +57,4 @@
#define CTRLL 32
#define CTRLR 33

#endif
//#endif
26 changes: 2 additions & 24 deletions unix/unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1151,8 +1151,6 @@ void S9xProcessEvents (bool8_32 block)
#ifdef CAANOO
keyssnes = SDL_JoystickOpen(0);
case SDL_JOYBUTTONDOWN:
switch(event.jbutton.button)
{
//QUIT Emulator
if ( SDL_JoystickGetButton(keyssnes, sfc_key[QUIT]) && SDL_JoystickGetButton(keyssnes, sfc_key[X_1] ) )
{
Expand All @@ -1166,8 +1164,6 @@ void S9xProcessEvents (bool8_32 block)
gp2x_sound_volume(vol, vol);
}
break;
}
break;

case SDL_JOYBUTTONUP:
switch(event.jbutton.button)
Expand Down Expand Up @@ -1554,27 +1550,7 @@ void gp2x_sound_volume(int l, int r)
l<<=8; l|=r;
ioctl(mixerdev, SOUND_MIXER_WRITE_VOLUME, &l);
}
/*
uint32 S9xReadJoypad (int which1)
{
uint32 val=0x80000000;
if (SDL_JoystickGetButton(keyssnes, 4)) val |= SNES_TL_MASK;
if (SDL_JoystickGetButton(keyssnes, 5)) val |= SNES_TR_MASK;
if (SDL_JoystickGetButton(keyssnes, 1)) val |= SNES_X_MASK;
if (SDL_JoystickGetButton(keyssnes, 3)) val |= SNES_Y_MASK;
if (SDL_JoystickGetButton(keyssnes, 2)) val |= SNES_B_MASK;
if (SDL_JoystickGetButton(keyssnes, 0)) val |= SNES_A_MASK;
if (SDL_JoystickGetButton(keyssnes, 6)) val |= SNES_START_MASK;
if (SDL_JoystickGetButton(keyssnes, 9)) val |= SNES_SELECT_MASK;
if (SDL_JoystickGetAxis(keyssnes, 1) < -20000) val |= SNES_UP_MASK;
if (SDL_JoystickGetAxis(keyssnes, 1) > 20000) val |= SNES_DOWN_MASK;
if (SDL_JoystickGetAxis(keyssnes, 0) < -20000) val |= SNES_LEFT_MASK;
if (SDL_JoystickGetAxis(keyssnes, 0) > 20000) val |= SNES_RIGHT_MASK;

return(val);
}
*/
uint32 S9xReadJoypad (int which1)
{
uint32 val=0x80000000;
Expand Down Expand Up @@ -1619,6 +1595,7 @@ uint32 S9xReadJoypad (int which1)
if (keyssnes[sfc_key[LEFT_1]] == SDL_PRESSED) val |= SNES_LEFT_MASK;
if (keyssnes[sfc_key[RIGHT_1]] == SDL_PRESSED) val |= SNES_RIGHT_MASK;
//player2
/*
if (keyssnes[sfc_key[UP_2]] == SDL_PRESSED) val |= SNES_UP_MASK;
if (keyssnes[sfc_key[DOWN_2]] == SDL_PRESSED) val |= SNES_DOWN_MASK;
if (keyssnes[sfc_key[LEFT_2]] == SDL_PRESSED) val |= SNES_LEFT_MASK;
Expand All @@ -1627,6 +1604,7 @@ uint32 S9xReadJoypad (int which1)
if (keyssnes[sfc_key[LD_2]] == SDL_PRESSED) val |= SNES_LEFT_MASK | SNES_DOWN_MASK;
if (keyssnes[sfc_key[RU_2]] == SDL_PRESSED) val |= SNES_RIGHT_MASK | SNES_UP_MASK;
if (keyssnes[sfc_key[RD_2]] == SDL_PRESSED) val |= SNES_RIGHT_MASK | SNES_DOWN_MASK;
*/
#endif

return(val);
Expand Down

0 comments on commit 039629c

Please sign in to comment.