Skip to content

Commit 08813b8

Browse files
committed
Fix PS2 port.
1 parent 5d24f0d commit 08813b8

File tree

5 files changed

+62
-6
lines changed

5 files changed

+62
-6
lines changed

arch/ps2/CONFIG.PS2

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
[[ -z $PS2DEV ]] && { echo "\$PS2DEV is unset. Aborting"; exit 1; }
44

55
./config.sh --platform ps2 --prefix $PS2DEV/ps2sdk/ee --optimize-size \
6-
--disable-editor --disable-utils --enable-debug \
7-
--enable-meter --enable-extram #--enable-stdio-redirect "$@"
6+
--disable-editor --disable-helpsys --disable-utils \
7+
--enable-release --enable-meter --enable-extram \
8+
--enable-stdio-redirect "$@"

arch/ps2/Makefile.in

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ $(error "PS2DEV must be set in your environment.")
33
endif
44

55
CROSS_COMPILE = mips64r5900el-ps2-elf-
6+
BINEXT := .elf
67

78
# Disable rules that require target code to run natively.
89
SUPPRESS_HOST_TARGETS ?= 1
910

10-
PS2_CFLAGS = -D_EE
11+
PS2_CFLAGS = -D_EE -D__PS2__
1112
PS2_INCLUDES = -isystem $(PS2DEV)/ps2sdk/common/include -isystem $(PS2DEV)/ps2sdk/ports/include
1213
PS2_LDFLAGS = -T$(PS2DEV)/ps2sdk/ee/startup/linkfile -L$(PS2DEV)/ps2sdk/ports/lib \
1314
-L$(PS2DEV)/gsKit/lib -Wl,-zmax-page-size=128 -G0 -gdwarf-2 -gz
@@ -25,4 +26,7 @@ ARCH_CFLAGS += ${PS2_CFLAGS} ${PS2_INCLUDES}
2526
ARCH_CXXFLAGS += ${PS2_CFLAGS} ${PS2_INCLUDES}
2627
ARCH_LDFLAGS += ${PS2_LDFLAGS}
2728

29+
build: ${build}
30+
${CP} arch/ps2/pad.config ${build}
31+
2832
include arch/zip.inc

arch/ps2/pad.config

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# 1 Select
2+
# 2 L3
3+
# 3 R3
4+
# 4 Start
5+
# 5 Up
6+
# 6 Right
7+
# 7 Down
8+
# 8 Left
9+
# 9 L2
10+
# 10 R2
11+
# 11 L1
12+
# 12 R1
13+
# 13 Triangle
14+
# 14 Circle
15+
# 15 Cross
16+
# 16 Square
17+
18+
joy[1,8]axis1 = act_l_left, act_l_right
19+
joy[1,8]axis2 = act_l_up, act_l_down
20+
joy[1,8]axis3 = act_r_left, act_r_right
21+
joy[1,8]axis4 = act_r_up, act_r_down
22+
joy[1,8].axis_lx = 1
23+
joy[1,8].axis_ly = 2
24+
joy[1,8].axis_rx = 3
25+
joy[1,8].axis_ry = 4
26+
27+
joy[1,8]button1 = act_select
28+
joy[1,8]button2 = act_lstick
29+
joy[1,8]button3 = act_rstick
30+
joy[1,8]button4 = act_start
31+
joy[1,8]button5 = act_up
32+
joy[1,8]button6 = act_right
33+
joy[1,8]button7 = act_down
34+
joy[1,8]button8 = act_left
35+
joy[1,8]button9 = act_ltrigger
36+
joy[1,8]button10 = act_rtrigger
37+
joy[1,8]button11 = act_lshoulder
38+
joy[1,8]button12 = act_rshoulder
39+
joy[1,8]button13 = act_x
40+
joy[1,8]button14 = act_a
41+
joy[1,8]button15 = act_b
42+
joy[1,8]button16 = act_y

src/configure.c

+8
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@
8484
#define SAVE_SLOTS_DEFAULT true
8585
#endif
8686

87+
#ifdef CONFIG_PS2
88+
#define VIDEO_OUTPUT_DEFAULT "softscale"
89+
#define FULLSCREEN_WIDTH_DEFAULT 640
90+
#define FULLSCREEN_HEIGHT_DEFAULT 480
91+
#define FULLSCREEN_DEFAULT 1
92+
#define SAVE_SLOTS_DEFAULT true
93+
#endif
94+
8795
#ifdef CONFIG_WII
8896
#define AUDIO_SAMPLE_RATE 48000
8997
#define FULLSCREEN_DEFAULT 1

src/event_sdl.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -1650,10 +1650,11 @@ void __warp_mouse(int x, int y)
16501650

16511651
void initialize_joysticks(void)
16521652
{
1653-
#if !SDL_VERSION_ATLEAST(2,0,0) || defined(CONFIG_SWITCH) || defined(CONFIG_PSVITA)
1653+
#if !SDL_VERSION_ATLEAST(2,0,0) || defined(CONFIG_SWITCH) || defined(CONFIG_PSVITA) \
1654+
|| defined(CONFIG_PS2)
16541655
// SDL 1.2 doesn't have joystick added/removed events.
1655-
// Switch SDL doesn't seem to generate these events at all on startup. The vita
1656-
// appears to have the same issue.
1656+
// Switch SDL doesn't seem to generate these events at all on startup. The Vita
1657+
// and PS2 appear to have the same issue.
16571658
int i, count;
16581659

16591660
count = SDL_NumJoysticks();

0 commit comments

Comments
 (0)