From 039629c70d97649745e6025b3e402e9957ef081e Mon Sep 17 00:00:00 2001 From: SiENcE Date: Wed, 22 Sep 2010 22:12:35 +0000 Subject: [PATCH] -fixes for caanoo --- unix/keydef.h | 5 +++-- unix/unix.cpp | 26 ++------------------------ 2 files changed, 5 insertions(+), 26 deletions(-) diff --git a/unix/keydef.h b/unix/keydef.h index f4cd0b8..b7c73f8 100644 --- a/unix/keydef.h +++ b/unix/keydef.h @@ -1,3 +1,4 @@ +/* #ifdef CAANOO #define A_1 0 @@ -15,7 +16,7 @@ #define RIGHT_1 14 #else - +*/ #define A_1 0 #define B_1 1 #define X_1 2 @@ -56,4 +57,4 @@ #define CTRLL 32 #define CTRLR 33 -#endif +//#endif diff --git a/unix/unix.cpp b/unix/unix.cpp index a172c6f..df1401a 100644 --- a/unix/unix.cpp +++ b/unix/unix.cpp @@ -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] ) ) { @@ -1166,8 +1164,6 @@ void S9xProcessEvents (bool8_32 block) gp2x_sound_volume(vol, vol); } break; - } - break; case SDL_JOYBUTTONUP: switch(event.jbutton.button) @@ -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; @@ -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; @@ -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);