loading an irx from ee memory
Posted: Fri Dec 12, 2008 9:34 pm
EDIT: Problem Solved :)
Homebrew PS2, PSP & PS3 Development Discussions
https://forums.ps2dev.org./
Code: Select all
#include <tamtypes.h>
#include <debug.h>
#include <fileio.h>
#include <iopcontrol.h>
#include <kernel.h>
#include <loadfile.h>
#include <sbv_patches.h>
extern u32 ps2ips_irx;
extern u32 size_ps2ips_irx;
int main()
{
int ret;
init_scr();
SifLoadFileInit();
SifExecModuleBuffer(&ps2ips_irx, &size_ps2ips_irx, 0, NULL, &ret);
scr_printf("Module Loaded");
SleepThread();
}
Code: Select all
EE_BIN = test.elf
EE_OBJS = test.o ps2ips.o
EE_LDFLAGS = -s -Ttext 0x01800000 # Load ELF at 24 MB offset
EE_LIBS += -lps2ip -lc -ldebug -lpatches
EE_CFLAGS = -DRESETIOP #-DDEBUG
all: $(EE_BIN)
clean:
rm -f $(EE_BIN) ORG_$(EE_BIN) $(EE_OBJS) ps2ips.s
ps2ips.s:
bin2s ps2ips.irx ps2ips.s ps2ips_irx
$(EE_BIN) : $(EE_OBJS)
$(EE_CC) -mno-crt0 -T$(PS2SDK)/ee/startup/linkfile $(EE_LDFLAGS) \
-o ORG_$(EE_BIN) $(EE_OBJS) $(EE_LIBS)
ps2-packer-lite ORG_$(EE_BIN) $(EE_BIN)
include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal
Code: Select all
int main()
{
init_scr();
scr_printf(" Loading Modules...\n");
int ret;
SifLoadFileInit();
sbv_patch_enable_lmb();
SifExecModuleBuffer(&ps2ips_irx, &size_ps2ips_irx, 0, NULL, &ret);
scr_printf(" Loaded Modules...\n");
}