Welcome! Log In Create A New Profile

Advanced

AnyRegion Changer AHBPROT Problem

Posted by bg4545 
AnyRegion Changer AHBPROT Problem
November 18, 2010 10:12AM
I'm not a coder but I've been trying to modify the source of AnyRegion Changer to use < no_ios_reload/> and AHBPROT. I've added code from FTPii I believe and it seems to work but I can't initialize ISFS. I know that the iospatch.c works because I put:
static bool initialise() {
    printf("Initialising...\n");
    if (!IOSPATCH_Apply()) {
		printf("Unable to apply patch.\n");
        return 1;
	}
	else printf("So far so good.\n");
}
And it comes out good as long as < no ios reload/> is in the meta.xml.
Here's the rest of the code [from wiibasics.c in AnyRegion Changer below the above code I added]
void miscInit(void)
{
	int ret;
	
	// This function initialises the attached controllers
	WPAD_Init();
	
	PAD_Init();
	
	if (!initialise()) {
        printf("Unable to patch.\n");
        return 1;
    }

	
	Identify_SU();
	
	printf("Initializing Filesystem driver...");
	fflush(stdout);
	
	ret = ISFS_Initialize();
	if (ret < 0) {
		printf("\nError! ISFS_Initialize (ret = %d)\n", ret);
		wait_anyKey();
		exit(1);
	} else {
		printf("OK!\n");
	}
	
	//IdentSysMenu();
}

void IdentSysMenu(void){
	int ret;
	Identify_SysMenu();
	
	ret = ES_SetUID(TITLE_ID(1, 2));
	if (ret < 0){
		printf("SetUID fail %d", ret);
		wait_anyKey();
		exit(1);
	}
	
	printf("Initializing Filesystem driver...");
	fflush(stdout);
	
	ISFS_Deinitialize();
	ret = ISFS_Initialize();
	if (ret < 0) {
		printf("\nError! ISFS_Initialize (ret = %d)\n", ret);
		wait_anyKey();
		exit(1);
	} else {
		printf("OK!\n");
	}
}

void miscDeInit(void)
{
	fflush(stdout);
	ISFS_Deinitialize();
}

u32 getButtons(void)
{
	WPAD_ScanPads();
	return WPAD_ButtonsDown(0);
}

u32 wait_anyKey(void) {
	u32 pressed;
	while(!(pressed = getButtons())) {
		VIDEO_WaitVSync();
	}
	if (pressed & WPAD_BUTTON_HOME) exit(1);
	return pressed;
}

u32 wait_key(u32 button) {
	u32 pressed;
	do {
		VIDEO_WaitVSync();
		pressed = getButtons();
		if (pressed & WPAD_BUTTON_HOME) exit(1);
	} while(!(pressed & button));
	
	return pressed;
}
When running it with < no ios reload/> I get "Error! ISFS_Initialize" and if I continue anyways the screen gets all jumbled/wii crashes, which I believe is a bug from the HBC that hasn't been fixed yet. If I don't use < no ios reload/> then I get "Unable to apply patch." but the screen doesn't get jumbled or crash the Wii. I'm really not sure what's going on here.


On another note, I can't seem to compile bushing's AnyTitle Deleter AHBPROT mod. I always get:
c:/devkitPro/Projects/bushing-AnyTitle-Deleter-2de3a7b/source/utils.c: In function 'patch_isfs':
c:/devkitPro/Projects/bushing-AnyTitle-Deleter-2de3a7b/source/utils.c:55:5: warning: implicit declaration of function 'write16'
linking ... bushing-AnyTitle-Deleter-2de3a7b.elf
utils.o: In function `patch_isfs':
c:/devkitPro/Projects/bushing-AnyTitle-Deleter-2de3a7b/source/utils.c:55: undefined reference to `write16'
c:/devkitPro/Projects/bushing-AnyTitle-Deleter-2de3a7b/source/utils.c:64: undefined reference to `write16'
collect2: ld returned 1 exit status
So it won't compile because of the following code:
u32 patch_isfs(void) {
    u32 count = 0;
    if (!HAVE_AHBPROT) {
	printf("Sorry, AHBPROT not enabled!\n");
	return 0;
    }

    write16(MEM_PROT, 0);
    u16 *ptr;
    for (ptr= (u16 *)0x93400000; ptr < (u16 *)0x94000000; ptr ++)
	if (ptr[0] == isfs_old[0] && ptr[1] == isfs_old[1] && ptr[2] == isfs_old[2]) {
		ptr[1] = 0xE001;
		DCFlushRange(ptr, 64);
		count++;
		break;
	}
    write16(MEM_PROT, 1);

    return count;
}
Any ideas?


I'm sorry if this is a stupid post since, as I stated, I'm not a coder but I thought modifying existing source would be simple enough.



Edited 3 time(s). Last edit at 11/23/2010 07:24PM by bg4545.
Re: AnyRegion Changer AHBPROT Problem
November 23, 2010 04:07PM
For your second problem (undefined reference to `write16') that function is in a special header file, use
#include < ogc/machine/processor.h >
Re: AnyRegion Changer AHBPROT Problem
November 23, 2010 07:19PM
Thank you. That worked, it compiled perfectly. Still nothing on the first problem though.

EDIT: Actually, maybe I can use the second solution to fix the first problem.. Just need to test.



Edited 1 time(s). Last edit at 11/24/2010 12:11AM by bg4545.
Re: AnyRegion Changer AHBPROT Problem
November 24, 2010 04:00AM
Are you absolutely sure ISFS is working when you're not using AHBPROT?
Re: AnyRegion Changer AHBPROT Problem
November 24, 2010 04:43AM
ISFS doesn't work at all with the above code. I've tried adding bushing's code but I haven't been able to test (no Wii with HBC). When I tried last time, I got errors after "So far so good." (more specifically this -- printf("\nError! ISFS_Initialize (ret = %d)\n", ret); ) I don't know the exact error because I just tested very quickly. I will test again when I'm able to use the Wii by myself.



Edited 1 time(s). Last edit at 11/24/2010 04:44AM by bg4545.
Re: AnyRegion Changer AHBPROT Problem
November 28, 2010 10:50PM
Well I tested both apps. Bushing's AnyTitle Deleter worked fine, but my AnyRegion Changer still gave errors:
Identifying as SU...Error! ES_Identify (ret = -1017)
Initializing Filesystem driver...OK!
Error! ES_OpenTitleContent (ret = 1026)
[1]
and /!\ WARNING: AREA/SysMenu MISMATCH! /!\
[2]
I'm pretty sure it's because ARC needs more patches then ATD so I would need to fix the code.
Re: AnyRegion Changer AHBPROT Problem
November 29, 2010 08:17AM
AnyRegion Changer is a very dangerous program anyway, it can cause many odd problems later in a wii's lifetime like being unable to use wiiconnect24, access the shop channel, send/receive messages, add new wii friends etc. These problems are starting to appear more often as newer games use more features such as using the system friends list rather than game-specific friend codes, or game updates via a forced DLC download like Black Ops. Then there's also the 003 error caused by cheap korean systems being resold as US...
Re: AnyRegion Changer AHBPROT Problem
November 29, 2010 08:53AM
I haven't heard of those problems (except the 003 error) and the app could still be useful, especially for semi-bricks. The only bad thing that ever happened to me was that I had to delete my Shop Account (and all my purchases) because of region switching my Shop Channel before the Oct 23 2008 update (which is actually why I'm not 'allowed' to have the HBC on my Wii anymore). I still want to try to get this to work.
Re: AnyRegion Changer AHBPROT Problem
November 29, 2010 09:18AM
Do you still have to identify as SU when using AHBPROT? Don't you already have HBC's godmode access?
Re: AnyRegion Changer AHBPROT Problem
November 29, 2010 09:37AM
Hmm... Didn't think about that. But I do know that it still doesn't work as it is, I'd need to add an ES patch (ES_Identify I think).
Sorry, only registered users may post in this forum.

Click here to login