Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .cppcheck-suppress
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Suppress warnings for third-party code and headers

# Third-party libraries that we don't modify
*:lib/giflib/*
*:lib/libintraFont/*
*:lib/libpspmath/*

Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "lib/giflib"]
path = lib/giflib
url = https://git.code.sf.net/p/giflib/code
[submodule "lib/libintraFont"]
path = lib/libintraFont
url = https://github.com/pspdev/libintraFont
Expand Down
1 change: 0 additions & 1 deletion .uncrustifyignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
lib/giflib/
lib/libintraFont/
lib/libpspmath/
12 changes: 0 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,12 @@ set_target_properties(${TARGET_LIB} PROPERTIES
include_directories(
INTERFACE PUBLIC_HEADER $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/lib/libintraFont/include>
INTERFACE PUBLIC_HEADER $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/lib/libpspmath/include>
INTERFACE PRIVATE_HEADER $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/lib/giflib>
src
src/adhoc
)

# Treat third-party library directories as system includes to suppress warnings
include_directories(SYSTEM
${PROJECT_SOURCE_DIR}/lib/giflib
${PROJECT_SOURCE_DIR}/lib/libintraFont/include
${PROJECT_SOURCE_DIR}/lib/libpspmath/include
)
Expand Down Expand Up @@ -89,14 +87,6 @@ set(PSPMATH_SOURCES
lib/libpspmath/src/vfpu_quaternion_sample_hermite.c
lib/libpspmath/src/vfpu_quaternion_hermite_tangent.c
)
set(GIFLIB_SOURCES
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call removing the vendored giflib. Just one concern, if we switch to external giflib, we must ensure CMake fails explicitly when giflib is not found, rather than silently disabling GIF support. Suggest find_package(GIF REQUIRED) when GIF is part of OSL_IMAGE_FORMAT_LOADERS.

lib/giflib/gif2rgb.c
lib/giflib/dgif_lib.c
lib/giflib/egif_lib.c
lib/giflib/gif_err.c
lib/giflib/gifalloc.c
lib/giflib/quantize.c
)
set(INTRAFONT_SOURCES
lib/libintraFont/src/intraFont.c
lib/libintraFont/src/libccc.c
Expand Down Expand Up @@ -156,7 +146,6 @@ set_source_files_properties(${SOURCE_DIR}/stub.S PROPERTIES LANGUAGE ASM)
# Suppress warnings for third-party library sources
set_source_files_properties(
${PSPMATH_SOURCES}
${GIFLIB_SOURCES}
${INTRAFONT_SOURCES}
PROPERTIES
COMPILE_FLAGS "-w"
Expand All @@ -166,7 +155,6 @@ set_source_files_properties(
target_sources(${TARGET_LIB} PRIVATE
${SFONT_SOURCES}
${PSPMATH_SOURCES}
${GIFLIB_SOURCES}
${INTRAFONT_SOURCES}
${LIB_SOURCES}
)
Expand Down
17 changes: 2 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,6 @@ INTRAFONTOBJS := \
$(LIB_DIR)/libintraFont/src/intraFont.o \
$(LIB_DIR)/libintraFont/src/libccc.o

GIFLIBOBJS := \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We removed GIFLIBOBJS and vendored includes, good cleanup. But -DOSL_IMAGE_LOADER_GIF is still defined while no -lgif is linked. This may cause linker errors or silently disable GIF. Suggest detecting giflib availability (via pkg-config or manual flag) and only enabling the macro + linking -lgif when it’s actually found.

Copy link
Contributor Author

@jopadan jopadan Oct 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, implementing IMG.cmake function for autotools or using an external image format library package like recoil, sail, or libvips should do the job.

$(LIB_DIR)/giflib/gif2rgb.o \
$(LIB_DIR)/giflib/dgif_lib.o \
$(LIB_DIR)/giflib/egif_lib.o \
$(LIB_DIR)/giflib/gif_err.o \
$(LIB_DIR)/giflib/gifalloc.o \
$(LIB_DIR)/giflib/quantize.o

LIBOBJS := \
$(SFONTOBJS) \
$(PSPMATHOBJS) \
Expand Down Expand Up @@ -131,12 +123,12 @@ LIBOBJS := \
$(SOURCE_DIR)/image/format/oslLoadImageFilePNG.o \
$(SOURCE_DIR)/image/format/oslWriteImageFilePNG.o \
$(SOURCE_DIR)/image/format/oslLoadImageFileJPEG.o \
$(SOURCE_DIR)/image/format/oslLoadImageFileGIF.o \
$(SOURCE_DIR)/image/oslLoadImageFile.o \
$(SOURCE_DIR)/image/oslWriteImageFile.o \
$(SOURCE_DIR)/splash/oslShowSplashScreen1.o \
$(SOURCE_DIR)/splash/oslShowSplashScreen2.o \
$(SOURCE_DIR)/mem/oslGetRamStatus.o
# $(SOURCE_DIR)/image/format/oslLoadImageFileGIF.o
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is $(SOURCE_DIR)/image/format/oslLoadImageFileGIF.o commented out?
Just confirming this isn't accidental.

Copy link
Contributor Author

@jopadan jopadan Oct 19, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably an intermediate state that should be fix by implementing IMG.cmake for autotools Makefile or an external image format library.


OBJS := $(LIBOBJS) $(INTRAFONTOBJS) $(GIFLIBOBJS)

Expand All @@ -147,7 +139,6 @@ OBJS := $(LIBOBJS) $(INTRAFONTOBJS) $(GIFLIBOBJS)
INCDIR := $(INCDIR) \
$(SOURCE_DIR) \
$(LIB_DIR)/libintraFont/include \
$(LIB_DIR)/giflib \
$(LIB_DIR)/libpspmath/include

#----------------------------------------------------------------------------
Expand Down Expand Up @@ -182,8 +173,8 @@ DEFINES := \
-DPSP \
-DOSL_IMAGE_LOADER_PNG \
-DOSL_IMAGE_LOADER_JPEG \
-DOSL_IMAGE_LOADER_GIF \
-DOSL_IMAGE_WRITER_PNG
# -DOSL_IMAGE_LOADER_GIF

#----------------------------------------------------------------------------
# Compiler settings
Expand Down Expand Up @@ -289,10 +280,6 @@ ghpages: gendoc
$(PSPMATHOBJS): %.o: %.c
$(CC) $(CFLAGS_THIRD_PARTY) $(addprefix -I,$(INCDIR)) -c $< -o $@

# giflib objects
$(GIFLIBOBJS): %.o: %.c
$(CC) $(CFLAGS_THIRD_PARTY) $(addprefix -I,$(INCDIR)) -c $< -o $@

# libintraFont objects
$(INTRAFONTOBJS): %.o: %.c
$(CC) $(CFLAGS_THIRD_PARTY) $(addprefix -I,$(INCDIR)) -c $< -o $@
8 changes: 6 additions & 2 deletions cmake/IMG.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,15 @@ foreach(IMAGE_FORMAT ${OSL_IMAGE_FORMATS_AVAILABLE})
list(APPEND OSL_IMAGE_FORMATS_SUPPORTED ${IMAGE_FORMAT})
if(${IMAGE_FORMAT} IN_LIST OSL_IMAGE_FORMAT_LOADERS)
add_compile_definitions(-DOSL_IMAGE_LOADER_${IMAGE_FORMAT})
include_directories(${${IMAGE_FORMAT}_INCLUDE_DIRS})
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice move dynamically wiring loaders/writers per format. But GIF is missing in the wiring — I see PNG/JPEG handled, but no conditional block for giflib (e.g. ${GIF_INCLUDE_DIRS}, ${GIF_LIBRARIES}). If OSL_IMAGE_FORMAT_LOADERS contains GIF, we should add both add_compile_definitions(...) and target_link_libraries(... GIF::GIF or ${GIF_LIBRARIES}). Otherwise we risk unintentional loss of GIF support.

include_directories(PUBLIC ${${IMAGE_FORMAT}_INCLUDE_DIRS})
link_directories(PUBLIC ${${IMAGE_FORMAT}_LIBRARY_DIRS})
link_libraries(PUBLIC ${${IMAGE_FORMAT}_LIBRARIES})
endif()
if(${IMAGE_FORMAT} IN_LIST OSL_IMAGE_FORMAT_WRITERS)
add_compile_definitions(-DOSL_IMAGE_WRITER_${IMAGE_FORMAT})
include_directories(${${IMAGE_FORMAT}_INCLUDE_DIRS})
include_directories(PUBLIC ${${IMAGE_FORMAT}_INCLUDE_DIRS})
link_directories(PUBLIC ${${IMAGE_FORMAT}_LIBRARY_DIRS})
link_libraries(PUBLIC ${${IMAGE_FORMAT}_LIBRARIES})
endif()
else()
list(REMOVE_ITEM OSL_IMAGE_FORMAT_WRITERS ${IMAGE_FORMAT})
Expand Down
1 change: 0 additions & 1 deletion lib/giflib
Submodule giflib deleted from 8bed39
12 changes: 9 additions & 3 deletions samples/OSK/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ OBJS = main.o
BUILD_PRX = 1
PSP_FW_VERSION=371

CFLAGS = -O2 -g -G0 -Wall
DEFINES := \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All samples now explicitly link PNG/JPEG (-lpng -ljpeg -lz) 👍.
However GIF is missing (-DOSL_IMAGE_LOADER_GIF and -lgif). From a user perspective this looks like GIF support got dropped. I recommend either:

adding GIF defines + -lgif to the relevant samples, or providing at least one dedicated GIF example to prove the loader is still supported.

-DPSP \
-DOSL_IMAGE_LOADER_PNG \
-DOSL_IMAGE_LOADER_JPEG \
-DOSL_IMAGE_WRITER_PNG

CFLAGS = -O2 -g -G0 -Wall ${DEFINES}
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =

MYLIBS=
STDLIBS= -losl -lpng -lz \
STDLIBS= -lm -losl -lpng -ljpeg -lz \
-lpsphprm -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspgum -lpspaudiolib -lpspaudio -lpsphttp -lpspssl -lpspwlan \
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl -lm -ljpeg
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl
LIBS=$(STDLIBS) $(MYLIBS)

LDFLAGS =
Expand Down
10 changes: 8 additions & 2 deletions samples/adhoc/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ OBJS = main.o
BUILD_PRX = 1
PSP_FW_VERSION=371

CFLAGS = -O2 -g -G0 -Wall
DEFINES := \
-DPSP \
-DOSL_IMAGE_LOADER_PNG \
-DOSL_IMAGE_LOADER_JPEG \
-DOSL_IMAGE_WRITER_PNG

CFLAGS = -O2 -g -G0 -Wall ${DEFINES}
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =

MYLIBS= -lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl
STDLIBS= -losl -lpng -lz \
STDLIBS= -lm -losl -lpng -ljpeg -lz \
-lpsphprm -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspgum -lpspaudiolib -lpspaudio -lpsphttp -lpspssl -lpspwlan -lm
LIBS=$(STDLIBS) $(MYLIBS)

Expand Down
12 changes: 9 additions & 3 deletions samples/dialog/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ OBJS = main.o
BUILD_PRX = 1
PSP_FW_VERSION=371

CFLAGS = -O2 -g -G0 -Wall
DEFINES := \
-DPSP \
-DOSL_IMAGE_LOADER_PNG \
-DOSL_IMAGE_LOADER_JPEG \
-DOSL_IMAGE_WRITER_PNG

CFLAGS = -O2 -g -G0 -Wall ${DEFINES}
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =

MYLIBS=
STDLIBS= -losl -lpng -lz \
STDLIBS= -lm -losl -lpng -ljpeg -lz \
-lpsphprm -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspgum -lpspaudiolib -lpspaudio -lpsphttp -lpspssl -lpspwlan \
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl -lm -ljpeg
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl
LIBS=$(STDLIBS) $(MYLIBS)

LDFLAGS =
Expand Down
12 changes: 9 additions & 3 deletions samples/helloWorld/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ OBJS = main.o
BUILD_PRX = 1
PSP_FW_VERSION=371

CFLAGS = -O2 -g -G0 -Wall
DEFINES := \
-DPSP \
-DOSL_IMAGE_LOADER_PNG \
-DOSL_IMAGE_LOADER_JPEG \
-DOSL_IMAGE_WRITER_PNG

CFLAGS = -O2 -g -G0 -Wall ${DEFINES}
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =

MYLIBS=
STDLIBS= -losl -lpng -lz \
STDLIBS= -lm -losl -lpng -ljpeg -lz \
-lpsphprm -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspgum -lpspaudiolib -lpspaudio -lpsphttp -lpspssl -lpspwlan \
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl -lm -ljpeg
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl
LIBS=$(STDLIBS) $(MYLIBS)

LDFLAGS =
Expand Down
12 changes: 9 additions & 3 deletions samples/internetBrowser/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ OBJS = main.o
BUILD_PRX = 1
PSP_FW_VERSION=371

CFLAGS = -O2 -g -G0 -Wall
DEFINES := \
-DPSP \
-DOSL_IMAGE_LOADER_PNG \
-DOSL_IMAGE_LOADER_JPEG \
-DOSL_IMAGE_WRITER_PNG

CFLAGS = -O2 -g -G0 -Wall ${DEFINES}
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =

MYLIBS=
STDLIBS= -losl -lpng -lz \
STDLIBS= -lm -losl -lpng -ljpeg -lz \
-lpsphprm -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspgum -lpspaudiolib -lpspaudio -lpsphttp -lpspssl -lpspwlan \
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl -lm -ljpeg
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl
LIBS=$(STDLIBS) $(MYLIBS)

LDFLAGS =
Expand Down
13 changes: 10 additions & 3 deletions samples/intraFont/makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
TARGET = testIntraFont
OBJS = main.o


DEFINES := \
-DPSP \
-DOSL_IMAGE_LOADER_PNG \
-DOSL_IMAGE_LOADER_JPEG \
-DOSL_IMAGE_WRITER_PNG

CFLAGS = -O2 -g -G0 -Wall ${DEFINES}
INCDIR =
CFLAGS = -O2 -g -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

Expand All @@ -13,9 +20,9 @@ LIBDIR =
LDFLAGS =

MYLIBS=
STDLIBS= -losl -lpng -lz \
STDLIBS= -lm -losl -lpng -ljpeg -lz \
-lpsphprm -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspgum -lpspaudiolib -lpspaudio -lpsphttp -lpspssl -lpspwlan \
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl -lm -ljpeg
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl
LIBS=$(STDLIBS) $(MYLIBS)

EXTRA_TARGETS = EBOOT.PBP
Expand Down
12 changes: 9 additions & 3 deletions samples/map/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ OBJS = main.o
BUILD_PRX = 1
PSP_FW_VERSION=371

CFLAGS = -O2 -g -G0 -Wall
DEFINES := \
-DPSP \
-DOSL_IMAGE_LOADER_PNG \
-DOSL_IMAGE_LOADER_JPEG \
-DOSL_IMAGE_WRITER_PNG

CFLAGS = -O2 -g -G0 -Wall ${DEFINES}
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =

MYLIBS=
STDLIBS= -losl -lpng -lz \
STDLIBS= -lm -losl -lpng -ljpeg -lz \
-lpsphprm -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspgum -lpspaudiolib -lpspaudio -lpsphttp -lpspssl -lpspwlan \
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl -lm -ljpeg
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl
LIBS=$(STDLIBS) $(MYLIBS)

LDFLAGS =
Expand Down
13 changes: 10 additions & 3 deletions samples/net/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,22 @@ OBJS = main.o
BUILD_PRX = 1
PSP_FW_VERSION=371

CFLAGS = -O2 -g -G0 -Wall

DEFINES := \
-DPSP \
-DOSL_IMAGE_LOADER_PNG \
-DOSL_IMAGE_LOADER_JPEG \
-DOSL_IMAGE_WRITER_PNG

CFLAGS = -O2 -g -G0 -Wall ${DEFINES}
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =

MYLIBS=
STDLIBS= -losl -lpng -lz \
STDLIBS= -lm -losl -lpng -ljpeg -lz \
-lpsphprm -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspgum -lpspaudiolib -lpspaudio -lpsphttp -lpspssl -lpspwlan \
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl -lm -ljpeg
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl
LIBS=$(STDLIBS) $(MYLIBS)

LDFLAGS =
Expand Down
12 changes: 9 additions & 3 deletions samples/rectAndFonts/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ OBJS = main.o
BUILD_PRX = 1
PSP_FW_VERSION=371

CFLAGS = -O2 -g -G0 -Wall
DEFINES := \
-DPSP \
-DOSL_IMAGE_LOADER_PNG \
-DOSL_IMAGE_LOADER_JPEG \
-DOSL_IMAGE_WRITER_PNG

CFLAGS = -O2 -g -G0 -Wall ${DEFINES}
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =

MYLIBS=
STDLIBS= -losl -lpng -lz \
STDLIBS= -lm -losl -lpng -ljpeg -lz \
-lpsphprm -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspgum -lpspaudiolib -lpspaudio -lpsphttp -lpspssl -lpspwlan \
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl -lm -ljpeg
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl
LIBS=$(STDLIBS) $(MYLIBS)

LDFLAGS =
Expand Down
12 changes: 9 additions & 3 deletions samples/saveAndLoad/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ OBJS = main.o
BUILD_PRX = 1
PSP_FW_VERSION=371

CFLAGS = -O2 -g -G0 -Wall
DEFINES := \
-DPSP \
-DOSL_IMAGE_LOADER_PNG \
-DOSL_IMAGE_LOADER_JPEG \
-DOSL_IMAGE_WRITER_PNG

CFLAGS = -O2 -g -G0 -Wall ${DEFINES}
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =

MYLIBS=
STDLIBS= -losl -lpng -lz \
STDLIBS= -lm -losl -lpng -ljpeg -lz \
-lpsphprm -lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspgum -lpspaudiolib -lpspaudio -lpsphttp -lpspssl -lpspwlan \
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl -lm -ljpeg
-lpspnet_adhocmatching -lpspnet_adhoc -lpspnet_adhocctl -lm
LIBS=$(STDLIBS) $(MYLIBS)

LDFLAGS =
Expand Down
Loading