diff --git a/Makefile b/Makefile index c40b6c7..4b2f26b 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ SUBDIRS = user \ all: #subdirs # user kernel + $(MAKE) $@ -C libs $(MAKE) $@ -C user $(MAKE) $@ -C kernel @mkdir -p $(UMDREGIONROOT)/dist/PSP/GAME/UMD_Region_Changer || true @@ -19,7 +20,7 @@ clean: $(MAKE) $@ -C user $(MAKE) $@ -C kernel @rm -rf $(UMDREGIONROOT)/dist *.zip - @find . -type f -name "*.o" -delete -o -name "*.elf" -delete -o -name "*.prx" -delete -o -name "*.PBP" -delete -o -name "*.SFO" -delete + @find . -type f -name "*.o" -delete -o -name "*.elf" -delete -o -name "*.prx" -delete -o -name "*.PBP" -delete -o -name "*.SFO" -delete -o -name "*.a" -delete @echo CLEAN pkg: package diff --git a/libs/KUBridge/KUBridge.S b/libs/KUBridge/KUBridge.S new file mode 100644 index 0000000..0015a93 --- /dev/null +++ b/libs/KUBridge/KUBridge.S @@ -0,0 +1,64 @@ + .set noreorder + +#include "pspimport.s" + +// Build files +// KUBridge_XXXX.o + +#ifdef F_KUBridge_0000 + IMPORT_START "KUBridge",0x40090000 +#endif +#ifdef F_KUBridge_0001 + IMPORT_FUNC "KUBridge",0x4C25EA72,kuKernelLoadModule +#endif +#ifdef F_KUBridge_0002 + IMPORT_FUNC "KUBridge",0x8E5A4057,kuKernelInitApitype +#endif +#ifdef F_KUBridge_0003 + IMPORT_FUNC "KUBridge",0x1742445F,kuKernelInitFileName +#endif +#ifdef F_KUBridge_0004 + IMPORT_FUNC "KUBridge",0xB0B8824E,kuKernelInitKeyConfig +#endif +#ifdef F_KUBridge_0005 + IMPORT_FUNC "KUBridge",0x60DDB4AE,kuKernelBootFrom +#endif +#ifdef F_KUBridge_0006 + IMPORT_FUNC "KUBridge",0xA2ABB6D3,kuKernelGetUserLevel +#endif +#ifdef F_KUBridge_0007 + IMPORT_FUNC "KUBridge",0xC4AF12AB,kuKernelSetDdrMemoryProtection +#endif +#ifdef F_KUBridge_0008 + IMPORT_FUNC "KUBridge",0x24331850,kuKernelGetModel +#endif +#ifdef F_KUBridge_0009 + IMPORT_FUNC "KUBridge",0x7A50075E,kuKernelPeekw +#endif +#ifdef F_KUBridge_0010 + IMPORT_FUNC "KUBridge",0x0E73A39D,kuKernelPokew +#endif +#ifdef F_KUBridge_0011 + IMPORT_FUNC "KUBridge",0x6B4B577F,kuKernelMemcpy +#endif +#ifdef F_KUBridge_0012 + IMPORT_FUNC "KUBridge",0xD0D05A5B,kuKernelGetUmdFile +#endif +#ifdef F_KUBridge_0013 + IMPORT_FUNC "KUBridge",0x1E9F0498,kuKernelLoadModuleWithApitype2 +#endif +#ifdef F_KUBridge_0014 + IMPORT_FUNC "KUBridge",0x4B321167,kuKernelFindModuleByName +#endif +#ifdef F_KUBridge_0015 + IMPORT_FUNC "KUBridge",0x9060F69D,kuKernelCall +#endif +#ifdef F_KUBridge_0016 + IMPORT_FUNC "KUBridge",0x5C6C3DBA,kuKernelCallExtendStack +#endif +#ifdef F_KUBridge_0017 + IMPORT_FUNC "KUBridge",0x219DE4D2,kuKernelIcacheInvalidateAll +#endif +#ifdef F_KUBridge_0018 + IMPORT_FUNC "KUBridge",0x501E983D,kuKernelInitMode +#endif diff --git a/libs/KUBridge/Makefile b/libs/KUBridge/Makefile new file mode 100644 index 0000000..326fd4a --- /dev/null +++ b/libs/KUBridge/Makefile @@ -0,0 +1,38 @@ +TARGET=libpspkubridge.a + +all: $(TARGET) +STUBSRC = KUBridge.S +OBJS = \ + KUBridge_0000.o \ + KUBridge_0001.o \ + KUBridge_0002.o \ + KUBridge_0003.o \ + KUBridge_0004.o \ + KUBridge_0005.o \ + KUBridge_0006.o \ + KUBridge_0007.o \ + KUBridge_0008.o \ + KUBridge_0009.o \ + KUBridge_0010.o \ + KUBridge_0011.o \ + KUBridge_0012.o \ + KUBridge_0013.o \ + KUBridge_0014.o \ + KUBridge_0015.o \ + KUBridge_0016.o \ + KUBridge_0017.o \ + KUBridge_0018.o \ + +PSPSDK=$(shell psp-config --pspsdk-path) + +CC=psp-gcc +INCDIR = +CFLAGS = -std=c99 -Os -G0 -Wall -fno-builtin-printf -I$(PSPSDK)/include +CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti +ASFLAGS = $(CFLAGS) +LDFLAGS=-nodefaultlibs + +LIBDIR = + +include $(UMDREGIONROOT)/common/make/global.mak +include $(UMDREGIONROOT)/common/make/beauty_stub.mak diff --git a/libs/Makefile b/libs/Makefile index 7c33dbb..e22ab05 100644 --- a/libs/Makefile +++ b/libs/Makefile @@ -7,15 +7,19 @@ all: subdirs $(MAKE) -C SystemCtrlForKernel $(MAKE) -C colordebugger $(MAKE) -C libpng + $(MAKE) -C KUBridge cp SystemCtrlForUser/*.a . cp SystemCtrlForKernel/*.a . cp colordebugger/*.a . cp libpng/*.a . + cp KUBridge/*.a . + distclean clean: $(MAKE) $@ -C SystemCtrlForUser $(OPT) $(MAKE) $@ -C SystemCtrlForKernel $(OPT) $(MAKE) $@ -C colordebugger $(OPT) $(MAKE) $@ -C libpng $(OPT) + $(MAKE) $@ -C KUBridge $(OPT) diff --git a/libs/SystemCtrlForKernel/libpspsystemctrl_kernel.a b/libs/SystemCtrlForKernel/libpspsystemctrl_kernel.a deleted file mode 100644 index f5f3281..0000000 Binary files a/libs/SystemCtrlForKernel/libpspsystemctrl_kernel.a and /dev/null differ diff --git a/libs/SystemCtrlForUser/libpspsystemctrl_user.a b/libs/SystemCtrlForUser/libpspsystemctrl_user.a deleted file mode 100644 index a1a99d1..0000000 Binary files a/libs/SystemCtrlForUser/libpspsystemctrl_user.a and /dev/null differ diff --git a/libs/colordebugger/libcolordebugger.a b/libs/colordebugger/libcolordebugger.a deleted file mode 100644 index 4b8fd66..0000000 Binary files a/libs/colordebugger/libcolordebugger.a and /dev/null differ diff --git a/libs/libcolordebugger.a b/libs/libcolordebugger.a deleted file mode 100644 index 2b159a6..0000000 Binary files a/libs/libcolordebugger.a and /dev/null differ diff --git a/libs/libpng.a b/libs/libpng.a deleted file mode 100644 index 59a86b6..0000000 Binary files a/libs/libpng.a and /dev/null differ diff --git a/libs/libpng/libpng.a b/libs/libpng/libpng.a deleted file mode 100644 index 4feab8d..0000000 Binary files a/libs/libpng/libpng.a and /dev/null differ diff --git a/libs/libpspsystemctrl_kernel.a b/libs/libpspsystemctrl_kernel.a deleted file mode 100644 index 35bf46a..0000000 Binary files a/libs/libpspsystemctrl_kernel.a and /dev/null differ diff --git a/libs/libpspsystemctrl_user.a b/libs/libpspsystemctrl_user.a deleted file mode 100644 index f072faa..0000000 Binary files a/libs/libpspsystemctrl_user.a and /dev/null differ diff --git a/user/Makefile b/user/Makefile index 5f085fc..0323e15 100644 --- a/user/Makefile +++ b/user/Makefile @@ -16,7 +16,7 @@ BUILD_PRX = 1 OBJS = main.o graphics.o -LIBS = -lpng -lz -lc -lm -lpspgu -lpspgum -lpspdebug -lpspsystemctrl_user +LIBS = -lpng -lz -lc -lm -lpspgu -lpspgum -lpspdebug -lpspsystemctrl_user -lpspkubridge LIBDIR=$(UMDREGIONROOT)/libs diff --git a/user/main.c b/user/main.c index 0b2a7a8..90aff9b 100644 --- a/user/main.c +++ b/user/main.c @@ -19,7 +19,7 @@ #include "graphics.h" -PSP_MODULE_INFO("UMD_REGION_CHANGER", 0, 1, 0); +PSP_MODULE_INFO("UMD_REGION_CHANGER", 0, 1, 1); PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER); PSP_HEAP_SIZE_KB(4096); @@ -34,19 +34,33 @@ int main(int argc, char *args[]) { sceDisplayWaitVblankStart(); - pspDebugScreenSetXY(17, 17); + pspDebugScreenSetXY(17, 5); pspDebugScreenSetTextColor(0xFF0000FF); printf("Presented by ARK-4 Team (c)2023"); - pspDebugScreenSetXY(26, 20); + pspDebugScreenSetXY(26, 10); pspDebugScreenSetTextColor(0xFF00FF00); - printf("Version 1.0"); + printf("Version 1.1"); - sceDisplayWaitVblank(); - sceKernelDelayThread(3000000); + if(kuKernelGetModel() == 4) { + pspDebugScreenClear(); + sceDisplayWaitVblank(); + pspDebugScreenSetTextColor(0xFF0000FF); + pspDebugScreenSetXY(25, 10); + printf("GO home your drunk."); + pspDebugScreenSetXY(10, 20); + printf("This is for UMD Movies... UMD does your GO have a UMD?"); + sceDisplayWaitVblank(); + + sceKernelDelayThread(5000000); + sceKernelExitGame(); + } + + sceDisplayWaitVblank(); + pspDebugScreenClear(); SceCtrlData pad;