Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
c07156f
Revert "kernel_functions: Fix indentation"
joel16 Apr 9, 2025
91e22fa
Revert "audio_driver: Drop audio_driver in favour of kuKernelCall"
joel16 Apr 9, 2025
08b2135
Revert "module_driver: Fix indentation with ModuleMgrForKernel"
joel16 Apr 9, 2025
e41eff1
Revert "module_driver: Use module_driver to properly load other modul…
joel16 Apr 9, 2025
2864e86
Revert "app: Load kernel plugins from memory"
joel16 Apr 9, 2025
5224f23
app: Compile with -mno-gpopt and allow ci to run on module branch
joel16 Apr 9, 2025
9bf023a
launcher: PSP_LARGE_MEMORY is not required
joel16 Apr 9, 2025
aabb59c
ci: Use one upload action to upload binaries
joel16 Apr 9, 2025
00ee2d6
ci: Restructure artifacts
joel16 Apr 9, 2025
3d20ef0
texture: Clean up texture code and do not recalculate size when loadi…
joel16 Apr 10, 2025
ec09a7d
textures: Clean up logs
joel16 Apr 10, 2025
16a6427
libs: Update dr_wav to 0.14
joel16 Apr 10, 2025
81e988e
fs: Clean up/optimize FS code and minor code consistency changes
joel16 Apr 10, 2025
50430b5
textures: Use libpng from pspsdk and update libnsbmp to 0.17
joel16 Apr 10, 2025
d01ff1f
app: Remove unnecessary includes
joel16 Apr 10, 2025
f1f31f1
libs: Use updated libFLAC from pspsdk
joel16 Apr 10, 2025
bd141b5
libs: Use updated libmpg123 libogg libxmp from psp packages
joel16 Apr 10, 2025
87af18b
textures: Use libturbojpeg to view jpgs
joel16 Apr 10, 2025
d98e75e
textures: Update libnsgif to v1.00
joel16 Apr 10, 2025
a82dbe0
libs: Update libopus to 1.5.2
joel16 Apr 10, 2025
e6427df
options: Reduce repeated width calcs and cleanup code
joel16 Apr 11, 2025
eb2e885
lib: Use libzma from pspsdk
joel16 Apr 11, 2025
eb9857a
libs: Update glib2d
joel16 Apr 11, 2025
c3dd313
ci: Only build on next branch
joel16 Apr 11, 2025
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
14 changes: 11 additions & 3 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,16 @@ jobs:

- name: Compile project
run: make


- name: Prepare artifact folder
run: |
mkdir -p CMFileManagerPSP
cp audio_driver/audio_driver.prx CMFileManagerPSP/
cp display_driver/display_driver.prx CMFileManagerPSP/
cp fs_driver/fs_driver.prx CMFileManagerPSP/
cp app/EBOOT.PBP CMFileManagerPSP/

- uses: actions/upload-artifact@v4
with:
name: CMFileManager-PSP
path: app/EBOOT.PBP
name: CMFileManagerPSP
path: CMFileManagerPSP/
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ Mkfile.old
dkms.conf

# CMFileManager PSP Specific objects
app/drivers/audio_driver.S
app/drivers/display_driver.S
app/drivers/fs_driver.S
app/drivers/module_driver.S
app/drivers/input_driver.S
app/*.json
app/*.log
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SUBDIRS = display_driver fs_driver module_driver app launcher
SUBDIRS = audio_driver display_driver fs_driver app launcher

all:
@for dir in $(SUBDIRS); do $(MAKE) -C $$dir; done
Expand Down
32 changes: 14 additions & 18 deletions app/Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
TARGET = CMFileManager

SOURCES := data drivers source source/audio source/gui ../libs/libnsbmp ../libs/libnsgif
CFILES := $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.c))
SFILES := $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.S))
CPPFILES := $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.cpp))
FONTFILES := $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.pgf))
GFXFILES := $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.png))
PRXFILES := $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.prx))
CFILES := $(foreach dir,$(SOURCES), $(wildcard $(dir)/*.c))
SFILES := $(foreach dir,$(SOURCES), $(wildcard $(dir)/*.S))
CPPFILES := $(foreach dir,$(SOURCES), $(wildcard $(dir)/*.cpp))
GFXFILES := $(foreach dir,$(SOURCES), $(wildcard $(dir)/*.png))
FONTFILES := $(foreach dir,$(SOURCES), $(wildcard $(dir)/*.pgf))

OBJS := $(addsuffix .o,$(BINFILES)) $(CFILES:.c=.o) $(SFILES:.S=.o) $(CPPFILES:.cpp=.o) \
$(FONTFILES:.pgf=.o) $(GFXFILES:.png=.o) $(PRXFILES:.prx=.o)
OBJS := $(addsuffix .o,$(BINFILES)) \
$(CFILES:.c=.o) $(SFILES:.S=.o) $(CPPFILES:.cpp=.o) $(GFXFILES:.png=.o) $(FONTFILES:.pgf=.o)

VERSION_MAJOR := 4
VERSION_MINOR := 1
VERSION_MICRO := 0

INCDIR = ../libs/ ../libs/include ../libs/libnsbmp ../libs/libnsgif ../libs/include/opus include
CFLAGS = -Os -G0 -Wall -ffast-math -Wno-narrowing -Wno-unused-variable \
CFLAGS = -Os -mno-gpopt -Wall -ffast-math -Wno-narrowing -Wno-unused-variable \
-DVERSION_MAJOR=$(VERSION_MAJOR) -DVERSION_MINOR=$(VERSION_MINOR) -DVERSION_MICRO=$(VERSION_MICRO)
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti -std=gnu++17
ASFLAGS := $(CFLAGS)
Expand All @@ -26,22 +25,19 @@ BUILD_PRX = 1
LIBDIR = ../libs/lib
LDFLAGS =
LIBS = -lintrafont -lglib2d -lxmp -lmpg123 -lvorbisfile -lvorbis -lopusfile -lopus -lFLAC -logg \
-larchive -llzma -ljpeg -lpng16 -lstdc++ -lz \
-larchive -llzma -lturbojpeg -ljpeg -lpng16 -lstdc++ -lz \
-lpspkubridge -lpspsystemctrl_user -lpspusbdevice \
-lpspgu -lpspvram -lpspaudio -lpsppower -lpspreg -lpspusb -lpspusbstor -lpspumd

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = CM File Manager PSP v$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_MICRO)
PSP_EBOOT_ICON = ../ICON0.PNG
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = CM File Manager PSP v$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_MICRO)
PSP_EBOOT_ICON = ../ICON0.PNG

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak

%.o: %.pgf
bin2o -i $< $@ $(addsuffix _pgf, $(basename $(notdir $<) ))

%.o: %.png
bin2o -i $< $@ $(addsuffix _png, $(basename $(notdir $<) ))

%.o: %.prx
bin2o -i $< $@ $(addsuffix _prx, $(basename $(notdir $<) ))
%.o: %.pgf
bin2o -i $< $@ $(addsuffix _pgf, $(basename $(notdir $<) ))
2 changes: 1 addition & 1 deletion app/include/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace FS {
int MakeDir(const std::string &path);
int RecursiveMakeDir(const std::string &path);
int CreateFile(const std::string &path);
std::string GetFileExt(const std::string &filename);
const char* GetFileExt(const char *filename);
FileType GetFileType(const std::string &filename);
SceOff GetFileSize(const std::string &path);
char *GetFileTimestamp(SceIoStat &stat, FileTimestamp time);
Expand Down
6 changes: 1 addition & 5 deletions app/include/kernel_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ extern "C" {

#include <pspctrl.h>
#include <pspiofilemgr.h>
#include <pspmodulemgr.h>

// Kernel function prototypes

// audio_driver functions
int pspAudioSetFrequency(int frequency);
extern int pspAudioSetFrequency(int frequency);

// display_driver functions
extern int pspDisplayEnable(void);
Expand All @@ -34,9 +33,6 @@ extern int pspIoRename(const char *oldname, const char *newname);
extern int pspIoRemoveFile(const char *file);
extern int pspIoDevctl(const char *dev, unsigned int cmd, void *indata, int inlen, void *outdata, int outlen);

// module_driver functions
extern int pspKernelLoadModuleBuffer(SceSize size, void *buf, s32 flag, const SceKernelLMOption *option);

#if defined (__cplusplus)
}
#endif
2 changes: 1 addition & 1 deletion app/include/textures.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ extern g2dTexture *file_icons[NUM_FILE_ICONS], *icon_dir[NUM_THEMES], *icon_chec
namespace Textures {
g2dTexture *LoadImageBufferJPEG(unsigned char *data, int size);
g2dTexture *LoadImageBufferPNG(unsigned char *data, int size);
g2dTexture *LoadImage(const std::string &path);
g2dTexture *LoadImage(const std::string &path, int size);
void Load(void);
void Free(void);
}
38 changes: 21 additions & 17 deletions app/source/audio.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <pspaudio.h>
#include <pspthreadman.h>
#include <string.h>
#include <cstring>

#include "fs.h"
#include "kernel_functions.h"
Expand Down Expand Up @@ -37,32 +37,37 @@ namespace Audio {

static void Decode(void *buf, unsigned int length, void *userdata) {
if ((!playing) || (paused)) {
s16 *buf_s16 = static_cast<s16 *>(buf);
for (unsigned int count = 0; count < length * 4; count++)
*(buf_s16 + count) = 0;
std::memset(buf, 0, length * 4);
}
else
(* decoder.decode)(buf, length, userdata);
else {
(*decoder.decode)(buf, length, userdata);
}
}

void Init(const std::string &path) {
playing = true;
paused = false;
const char *ext = FS::GetFileExt(path.c_str());

std::string ext = FS::GetFileExt(path);

if (!ext.compare(".FLAC"))
if (strncasecmp(ext, "flac", 4) == 0) {
file_type = FILE_TYPE_FLAC;
else if (!ext.compare(".MP3"))
}
else if (strncasecmp(ext, "mp3", 3) == 0) {
file_type = FILE_TYPE_MP3;
else if (!ext.compare(".OGG"))
}
else if (strncasecmp(ext, "ogg", 3) == 0) {
file_type = FILE_TYPE_OGG;
else if (!ext.compare(".OPUS"))
}
else if (strncasecmp(ext, "opus", 4) == 0) {
file_type = FILE_TYPE_OPUS;
else if (!ext.compare(".WAV"))
}
else if (strncasecmp(ext, "wav", 3) == 0) {
file_type = FILE_TYPE_WAV;
else if ((!ext.compare(".IT")) || (!ext.compare(".MOD")) || (!ext.compare(".S3M")) || (!ext.compare(".XM")))
}
else if ((strncasecmp(ext, "it", 2) == 0) || (strncasecmp(ext, "mod", 3) == 0) || (strncasecmp(ext, "s3m", 3) == 0)
|| (strncasecmp(ext, "xm", 2) == 0)) {
file_type = FILE_TYPE_XM;
}

switch(file_type) {
case FILE_TYPE_FLAC:
Expand Down Expand Up @@ -184,9 +189,8 @@ namespace Audio {
(* decoder.term)();

// Clear metadata struct
if (metadata.has_meta) {
if (metadata.cover_image)
g2dTexFree(&metadata.cover_image);
if (metadata.has_meta && metadata.cover_image) {
g2dTexFree(&metadata.cover_image);
}

metadata = { 0 };
Expand Down
4 changes: 2 additions & 2 deletions app/source/audio/ogg.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <pspiofilemgr.h>
#include <vorbis/codec.h>
#include <vorbis/vorbisfile.h>

#include "audio.h"
#include "utils.h"
#include "vorbis/codec.h"
#include "vorbis/vorbisfile.h"

namespace OGG {
static OggVorbis_File ogg;
Expand Down
3 changes: 2 additions & 1 deletion app/source/audio/xm.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <xmp.h>

#include "audio.h"
#include "xmp.h"

namespace XM {
static xmp_context xmp;
Expand Down
Loading
Loading