From b661ccb5516dc31a1f86e12c8df51899d7f27e00 Mon Sep 17 00:00:00 2001 From: "fix94.1" Date: Tue, 24 Jan 2012 22:09:33 +0000 Subject: [PATCH] -added dollz support for homebrew launching (-giving the possibility for the project to re-arrange and control everything properly :P) --- source/homebrew/homebrew.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/source/homebrew/homebrew.cpp b/source/homebrew/homebrew.cpp index 95e7cb6f..7a6763e1 100644 --- a/source/homebrew/homebrew.cpp +++ b/source/homebrew/homebrew.cpp @@ -25,6 +25,19 @@ static safe_vector Arguments; bool bootHB; +bool IsDollZ (u8 *buff) +{ + int ret; + + u8 dollz_stamp[] = {0x3C}; + int dollz_offs = 0x100; + + ret = memcmp (&buff[dollz_offs], dollz_stamp, sizeof(dollz_stamp)); + if (ret == 0) return true; + + return false; +} + void AddBootArgument(const char * argv) { std::string arg(argv); @@ -118,18 +131,17 @@ int BootHomebrew() if(homebrewsize == 0) return -1; struct __argv args; - SetupARGV(&args); + if (!IsDollZ(homebrewbuffer)) + SetupARGV(&args); memcpy(BOOTER_ADDR, app_booter_bin, app_booter_bin_size); DCFlushRange(BOOTER_ADDR, app_booter_bin_size); entrypoint entry = (entrypoint) BOOTER_ADDR; - if (args.argvMagic == ARGV_MAGIC) - { - memmove(ARGS_ADDR, &args, sizeof(args)); - DCFlushRange(ARGS_ADDR, sizeof(args) + args.length); - } + memmove(ARGS_ADDR, &args, sizeof(args)); + DCFlushRange(ARGS_ADDR, sizeof(args) + args.length); + SYS_ResetSystem(SYS_SHUTDOWN, 0, 0); entry();