Skip to content

Commit

Permalink
[PS2] Use ps2_drivers library for simplify frontend (#14724)
Browse files Browse the repository at this point in the history
* Use ps2_drivers

* improvements in frontend driver

* Resetting IOP drivers before load elf
  • Loading branch information
fjtrujy authored Dec 12, 2022
1 parent b2d73c9 commit b207ddb
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 534 deletions.
23 changes: 2 additions & 21 deletions Makefile.ps2
Original file line number Diff line number Diff line change
Expand Up @@ -84,29 +84,15 @@ $(error "Please set PS2SDK in your environment. export PS2SDK=<path to>ps2sdk")
endif

INCDIR = -I$(PS2DEV)/gsKit/include -I$(PS2SDK)/ports/include
INCDIR += -Ips2/include -Ilibretro-common/include -Ideps -Ideps/stb -Ideps/7zip
INCDIR += -Ilibretro-common/include -Ideps -Ideps/stb -Ideps/7zip

LDFLAGS += -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ports/lib -L.
# Lib cdvd is needed to get proper time
LIBS += -lpatches -lgskit -ldmakit -laudsrv -lmtap -lpadx -lz -lcdvd -lelf-loader -lfileXio -lpoweroff

LIBS += -lpatches -lgskit -ldmakit -lps2_drivers -lz -lelf-loader

CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) $(DEFINES) -DPS2 -ffast-math -fsingle-precision-constant
ASFLAGS = $(CFLAGS)

# IRX libs
IRX_FILES += sio2man.irx iomanX.irx fileXio.irx
IRX_FILES += mcman.irx mcserv.irx
IRX_FILES += usbd.irx bdm.irx bdmfs_vfat.irx usbmass_bd.irx
IRX_FILES += libsd.irx audsrv.irx
IRX_FILES += cdfs.irx
IRX_FILES += ps2dev9.irx ps2atad.irx ps2hdd.irx ps2fs.irx poweroff.irx
IRX_FILES += mtapman.irx padman.irx
EE_OBJS += $(IRX_FILES:.irx=_irx.o)

# Missing objecst on the PS2SDK
EE_OBJS += ps2/compat_files/ps2_devices.o

EE_OBJS += $(OBJ)

EE_CFLAGS = $(CFLAGS)
Expand All @@ -118,7 +104,6 @@ EE_INCS = $(INCDIR)
EE_BIN = $(TARGET).elf
EE_GPVAL = $(GPVAL)


all: $(EE_BIN)

clean:
Expand All @@ -139,10 +124,6 @@ debug: clean all run
release: all
ps2-packer $(EE_BIN) $(TARGET_RELEASE)

# IRX files
%_irx.c:
$(PS2SDK)/bin/bin2c $(PS2SDK)/iop/irx/$*.irx $@ $*_irx

#Include preferences
include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal_cpp
21 changes: 4 additions & 17 deletions Makefile.ps2.salamander
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ ifeq ($(MUTE_WARNINGS), 1)
endif

INCDIR = -Ilibretro-common/include
INCDIR += -Ips2/include
INCDIR += -I$(PS2SDK)/ports/include
CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) -ffast-math -fsingle-precision-constant
ASFLAGS = $(CFLAGS)

RARCH_DEFINES += -DPS2 -DIS_SALAMANDER -DRARCH_CONSOLE

LIBDIR =
LDFLAGS =
LIBS = -lelf-loader -lpatches -lfileXio -lpoweroff
LDFLAGS += -L$(PS2SDK)/ports/lib
LIBS = -lelf-loader -lps2_drivers -lpatches

ifeq ($(SCREEN_DEBUG), 1)
LIBS += -ldebug
Expand Down Expand Up @@ -60,16 +60,7 @@ EE_OBJS = frontend/frontend_salamander.o \
libretro-common/vfs/vfs_implementation.o \
libretro-common/hash/lrc_hash.o \
libretro-common/time/rtime.o \
verbosity.o \
ps2/compat_files/ps2_devices.o

# IRX libs
IRX_FILES += sio2man.irx iomanX.irx fileXio.irx
IRX_FILES += mcman.irx mcserv.irx
IRX_FILES += usbd.irx bdm.irx bdmfs_vfat.irx usbmass_bd.irx
IRX_FILES += cdfs.irx
IRX_FILES += ps2dev9.irx ps2atad.irx ps2hdd.irx ps2fs.irx poweroff.irx
EE_OBJS += $(IRX_FILES:.irx=_irx.o)
verbosity.o

EE_CFLAGS = $(CFLAGS)
EE_CXXFLAGS = $(CFLAGS)
Expand All @@ -93,10 +84,6 @@ run:
release: all
ps2-packer $(EE_BIN) $(TARGET_RELEASE)

# IRX files
%_irx.c:
$(PS2SDK)/bin/bin2c $(PS2SDK)/iop/irx/$*.irx $@ $*_irx

#Include preferences
include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal_cpp
Loading

0 comments on commit b207ddb

Please sign in to comment.