boys, we eating good tonight

This commit is contained in:
TheSola10 2025-04-02 20:16:43 +02:00
parent dca4cf09f4
commit adb2a3276d
Signed by: thesola10
GPG Key ID: 89245619BEBB95BA
6 changed files with 56 additions and 5 deletions

1
.ccls
View File

@ -4,6 +4,7 @@ gcc
-I/usr/local/pspdev/psp/include -I/usr/local/pspdev/psp/include
-I/usr/local/pspdev/psp/sdk/include -I/usr/local/pspdev/psp/sdk/include
-I. -I.
-I./librsync/src
-std=c99 -std=c99
-Os -Os
-G0 -G0

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ PARAM.SFO
*.elf *.elf
*.prx *.prx
*.a *.a
librsync

View File

@ -1,8 +1,12 @@
LIBRSYNC := librsync
CMAKE := psp-cmake
TARGET = umd_livepatch TARGET = umd_livepatch
C_OBJS = io_funcs.o main.o C_OBJS = io_funcs.o main.o
OBJS = $(C_OBJS) imports.o OBJS = $(C_OBJS) imports.o
all: $(TARGET).prx all: $(TARGET).prx
INCDIR = $(ARKROOT)/common/include $(ARKROOT)/core/systemctrl/include INCDIR = $(ARKROOT)/common/include $(ARKROOT)/core/systemctrl/include $(LIBRSYNC)/src
CFLAGS = -std=c99 -Os -G0 -Wall CFLAGS = -std=c99 -Os -G0 -Wall
ifdef DEBUG ifdef DEBUG
@ -10,7 +14,7 @@ CFLAGS += -DDEBUG=$(DEBUG)
endif endif
LDFLAGS = -nostartfiles -L . LDFLAGS = -nostartfiles -L .
LIBS = -lpspsystemctrl_kernel LIBS = -lpspsystemctrl_kernel -lrsync
PSP_FW_VERSION = 660 PSP_FW_VERSION = 660
@ -27,6 +31,15 @@ libpspsystemctrl_kernel.a:
$(MAKE) -C $(ARKROOT)/libs/SystemCtrlForKernel $(MAKE) -C $(ARKROOT)/libs/SystemCtrlForKernel
cp $(ARKROOT)/libs/SystemCtrlForKernel/libpspsystemctrl_kernel.a . cp $(ARKROOT)/libs/SystemCtrlForKernel/libpspsystemctrl_kernel.a .
librsync:
git clone https://github.com/librsync/librsync
librsync.a: $(LIBRSYNC)
mkdir rsync_build
cd rsync_build; $(CMAKE) $(shell realpath $(LIBRSYNC)); make
mv rsync_build/librsync.a .
rm -rf rsync_build
$(TARGET).prx:: libpspsystemctrl_kernel.a $(TARGET).prx:: libpspsystemctrl_kernel.a
include $(PSPSDK)/lib/build.mak include $(PSPSDK)/lib/build.mak

View File

@ -28,7 +28,7 @@ _impl_lp_lbaToAddr(struct LbaParams *param)
} }
static inline int static inline int
_impl_lp_readDiscHeader(PspIoDrvFileArg *arg, const char *devname, void *outdata) _impl_lp_readDiscHeader(PspIoDrvFileArg *arg, const char *devname)
{ {
int ret; int ret;
@ -44,7 +44,7 @@ _impl_lp_readDiscHeader(PspIoDrvFileArg *arg, const char *devname, void *outdata
}; };
ret = reserveUmdFuncs.IoDevctl(arg, devname, lp_UmdIoctl_READ_SECTORS, ret = reserveUmdFuncs.IoDevctl(arg, devname, lp_UmdIoctl_READ_SECTORS,
&param, sizeof param, outdata, ISO_SECTOR_SIZE); &param, sizeof param, &hdr, ISO_SECTOR_SIZE);
return ret; return ret;
} }
@ -60,7 +60,7 @@ _impl_lp_devctlRead(PspIoDrvFileArg *arg, const char *devname,
if (first_read) { if (first_read) {
ret = reserveUmdFuncs.IoDevctl(arg, devname, cmd, param, inlen, outdata, outlen); ret = reserveUmdFuncs.IoDevctl(arg, devname, cmd, param, inlen, outdata, outlen);
_impl_lp_readDiscHeader(arg, devname, &hdr); _impl_lp_readDiscHeader(arg, devname);
strncpy(umd_id, hdr + 0x373, 10); strncpy(umd_id, hdr + 0x373, 10);
umd_id[10] = 0; umd_id[10] = 0;
Kprintf("Disc ID obtained: '%s'\n", umd_id); Kprintf("Disc ID obtained: '%s'\n", umd_id);

16
rpatch.c Normal file
View File

@ -0,0 +1,16 @@
#include "io_funcs.h"
#include "rpatch.h"
#include <prototab.h>
int
lp_PatchSet_open(const char *path)
{
}
int
lp_PatchSet_covered(lp_PatchSet *ps, u32 offset)
{
}

20
rpatch.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef __RPATCH_H
#define __RPATCH_H
typedef struct {
long sector_start;
long sector_count;
/* If zero, block is unchanged */
long patch_start;
/* If smaller than sector_count, repeating data */
long patch_len;
} lp_Patch;
typedef struct {
} lp_PatchSet;
#endif //__RPATCH_H