Skip to content

Commit

Permalink
Clean up #1
Browse files Browse the repository at this point in the history
  • Loading branch information
jdgleaver committed Mar 16, 2021
1 parent 1f51a86 commit c718e01
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 67 deletions.
2 changes: 0 additions & 2 deletions cmake/mips32-linux-gcc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ if("${MODEL}" STREQUAL "rs97")
set(MIPS_FLAGS "${MIPS_FLAGS} -DRS97 -DGCW_ZERO")
elseif("${MODEL}" STREQUAL "rg350")
set(MIPS_FLAGS "${MIPS_FLAGS} -DRG350 -DGCW_ZERO")
else()
elseif("${MODEL}" STREQUAL "pg2")
set(MIPS_FLAGS "${MIPS_FLAGS} -DPG2 -DGCW_ZERO")
else()
elseif("${MODEL}" STREQUAL "pg2v2")
set(MIPS_FLAGS "${MIPS_FLAGS} -DPG2V2 -DRG350 -DGCW_ZERO")
else()
Expand Down
4 changes: 2 additions & 2 deletions src/port/sdl/frontend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2202,9 +2202,9 @@ static void ShowMenu(MENU *menu)
port_printf(menu->x - 3 * 8, menu->y + cur * 10, "-->");

// general copyrights info
#if defined(RG350)&&!defined(PG2V2)
#if defined(RG350) && !defined(PG2V2)
port_printf(8 * 8, 10, "pcsx4all 2.4 for RG350");
#elif defined(RG350)&&defined(PG2V2)
#elif defined(RG350) && defined(PG2V2)
port_printf(8 * 8, 10, "pcsx4all 2.4 for POCKETGO2 v2");
#elif defined(PG2)
port_printf(8 * 8, 10, "pcsx4all 2.4 for POCKETGO2");
Expand Down
102 changes: 39 additions & 63 deletions src/port/sdl/port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,54 +728,41 @@ static struct {
int key;
int bit;
} keymap[] = {
{ SDLK_UP, DKEY_UP },
{ SDLK_DOWN, DKEY_DOWN },
{ SDLK_LEFT, DKEY_LEFT },
{ SDLK_RIGHT, DKEY_RIGHT },
#ifdef PG2
{ SDLK_LSHIFT, DKEY_SQUARE },
{ SDLK_LCTRL, DKEY_CIRCLE },
{ SDLK_SPACE, DKEY_TRIANGLE },
{ SDLK_LALT, DKEY_CROSS },
{ SDLK_TAB, DKEY_L1 },
{ SDLK_BACKSPACE, DKEY_R1 },
{ SDLK_RSHIFT, DKEY_L2 },
{ SDLK_RALT, DKEY_R2 },
{ SDLK_ESCAPE, DKEY_SELECT },
#elif RG350
{ SDLK_LSHIFT, DKEY_SQUARE },
{ SDLK_LCTRL, DKEY_CIRCLE },
{ SDLK_SPACE, DKEY_TRIANGLE },
{ SDLK_LALT, DKEY_CROSS },
{ SDLK_TAB, DKEY_L1 },
{ SDLK_BACKSPACE, DKEY_R1 },
{ SDLK_PAGEUP, DKEY_L2 },
{ SDLK_PAGEDOWN, DKEY_R2 },
#ifdef PG2V2
#else
{ SDLK_KP_DIVIDE, DKEY_L3 },
{ SDLK_KP_PERIOD, DKEY_R3 },
{ SDLK_UP, DKEY_UP },
{ SDLK_DOWN, DKEY_DOWN },
{ SDLK_LEFT, DKEY_LEFT },
{ SDLK_RIGHT, DKEY_RIGHT },
#if defined(GCW_ZERO)
{ SDLK_LSHIFT, DKEY_SQUARE },
{ SDLK_LCTRL, DKEY_CIRCLE },
{ SDLK_SPACE, DKEY_TRIANGLE },
{ SDLK_LALT, DKEY_CROSS },
{ SDLK_TAB, DKEY_L1 },
{ SDLK_BACKSPACE, DKEY_R1 },
{ SDLK_ESCAPE, DKEY_SELECT },
#if defined(PG2)
{ SDLK_RSHIFT, DKEY_L2 },
{ SDLK_RALT, DKEY_R2 },
#elif defined(RG350)
{ SDLK_PAGEUP, DKEY_L2 },
{ SDLK_PAGEDOWN, DKEY_R2 },
#if !defined(PG2V2)
{ SDLK_KP_DIVIDE, DKEY_L3 },
{ SDLK_KP_PERIOD, DKEY_R3 },
#endif
#endif
{ SDLK_ESCAPE, DKEY_SELECT },
#elif GCW_ZERO
{ SDLK_LSHIFT, DKEY_SQUARE },
{ SDLK_LCTRL, DKEY_CIRCLE },
{ SDLK_SPACE, DKEY_TRIANGLE },
{ SDLK_LALT, DKEY_CROSS },
{ SDLK_TAB, DKEY_L1 },
{ SDLK_BACKSPACE, DKEY_R1 },
#else
{ SDLK_a, DKEY_SQUARE },
{ SDLK_x, DKEY_CIRCLE },
{ SDLK_s, DKEY_TRIANGLE },
{ SDLK_z, DKEY_CROSS },
{ SDLK_q, DKEY_L1 },
{ SDLK_w, DKEY_R1 },
{ SDLK_e, DKEY_L2 },
{ SDLK_r, DKEY_R2 },
{ SDLK_BACKSPACE, DKEY_SELECT },
{ SDLK_a, DKEY_SQUARE },
{ SDLK_x, DKEY_CIRCLE },
{ SDLK_s, DKEY_TRIANGLE },
{ SDLK_z, DKEY_CROSS },
{ SDLK_q, DKEY_L1 },
{ SDLK_w, DKEY_R1 },
{ SDLK_e, DKEY_L2 },
{ SDLK_r, DKEY_R2 },
{ SDLK_BACKSPACE, DKEY_SELECT },
#endif
{ SDLK_RETURN, DKEY_START },
{ SDLK_RETURN, DKEY_START },
{ 0, 0 }
};

Expand Down Expand Up @@ -834,11 +821,9 @@ void joy_init()

player_controller[0].joy_left_ax0 = 127;
player_controller[0].joy_left_ax1 = 127;
#ifdef PG2
player_controller[0].id = 0x41;
player_controller[0].pad_mode = 0;
player_controller[0].pad_controllertype = 0;
#else
player_controller[0].joy_right_ax0 = 127;
player_controller[0].joy_right_ax1 = 127;

player_controller[0].Vib[0] = 0;
player_controller[0].Vib[1] = 0;
player_controller[0].VibF[0] = 0;
Expand All @@ -847,10 +832,7 @@ void joy_init()
player_controller[0].id = 0x41;
player_controller[0].pad_mode = 0;
player_controller[0].pad_controllertype = 0;
player_controller[0].joy_right_ax0 = 127;
player_controller[0].joy_right_ax1 = 127;
#endif


player_controller[0].configmode = 0;

Set_Controller_Mode();
Expand Down Expand Up @@ -880,9 +862,7 @@ void pad_update()
break;
case SDL_KEYDOWN:
switch (event.key.keysym.sym) {
#ifdef PG2
case SDLK_RCTRL:
#elif PG2V2
#if defined(PG2) || defined(PG2V2)
case SDLK_RCTRL:
#else
case SDLK_HOME:
Expand Down Expand Up @@ -928,9 +908,7 @@ void pad_update()
player_controller[0].joy_left_ax1 = (axisval + 0x8000) >> 8;
}
break;
#ifdef PG2
#elif PG2V2
#else
#if !defined(PG2) && !defined(PG2V2)
case 2: /* X axis */
axisval = event.jaxis.value;
player_controller[0].joy_right_ax0 = (axisval + 0x8000) >> 8;
Expand All @@ -942,9 +920,7 @@ void pad_update()
#endif
}
break;
#ifdef PG2
#elif PG2V2
#else
#if !defined(PG2) && !defined(PG2V2)
case SDL_JOYBUTTONDOWN:
if (event.jbutton.which == 0) {
pad1_buttons |= (1 << DKEY_L3);
Expand Down

0 comments on commit c718e01

Please sign in to comment.