Welcome! Log In Create A New Profile

Advanced

ES_LaunchTitle and VIDEO_SetPostRetraceCallback

Posted by whodares 
ES_LaunchTitle and VIDEO_SetPostRetraceCallback
October 18, 2008 12:18PM
I've managed to set a VI callback in my homebrew, but when I use ES_LaunchTitle to launch a VC title, it kills my callback. I'm assuming that's because the VC title will have it's own, and it'll just overwrite mine.

Any ideas how I can re-overload it with mine?
Re: ES_LaunchTitle and VIDEO_SetPostRetraceCallback
October 18, 2008 12:22PM
Eh.. what exactly are you trying to achieve here? Cheating in VC games? That's going to be a bit harder then setting up a VI callback in an OGC program and then launching the VC game from there.
Re: ES_LaunchTitle and VIDEO_SetPostRetraceCallback
October 18, 2008 12:28PM
Well, I was just trying to get some code running at the same time, for cheating and possibly other things (like adding USB keyboard support inside C64 games etc.)
Re: ES_LaunchTitle and VIDEO_SetPostRetraceCallback
October 18, 2008 12:35PM
You'll want to hook into the code then. Search for the geckoOS sourcecode and look at their hooking methods. (patchcode.c)
Re: ES_LaunchTitle and VIDEO_SetPostRetraceCallback
October 18, 2008 12:53PM
Yeah, I've been looking for that, but the link on Wiibrew doesn't work. Found it now though :-)
Re: ES_LaunchTitle and VIDEO_SetPostRetraceCallback
October 18, 2008 09:32PM
You. Are. God. Whodares. Good luck!
Re: ES_LaunchTitle and VIDEO_SetPostRetraceCallback
October 31, 2008 08:15AM
Quote
whodares
Well, I was just trying to get some code running at the same time, for cheating and possibly other things (like adding USB keyboard support inside C64 games etc.)

Someone interested in c64 :)

good luck!

especially look into the patchhook.S file.... and especially to the first hook in the file, the others are just patches to the relative places in the original code...
it searches near the target code for an "branch to link register/blr" instruction and upon finding calculates a new branch instruction to the preset location (800018A0) and for the modified code to take affect flushes the data and instruction cache...

.globl patchhook		# r3 address
patchhook:
	mtctr	r4
	lis	r6, 0x4E80
	ori	r6, r6, 0x0020	# blr
findblr:
	lwz	r5, 0(r3)
	cmpw	r6, r5
	beq	writebranch
	addi	r3, r3, 4	# next word
	bdnz	findblr		# loop length
	b	exit		# stop unhooked game hanging

writebranch:
	lis     r4, 0x8000	# 800018A0 hook location (source)
	ori     r4, r4, 0x18A8
	subf    r4, r3, r4	# subtract r3 from r4 and place in r4
	lis     r5, 0x3FF	
	ori     r5, r5, 0xFFFF	# 0x3FFFFFF
	and     r4, r4, r5
	lis     r5, 0x4800	# 0x48000000
	or      r4, r4, r5
	stw     r4, 0(r3)	# result in r3
	dcbf    r0, r3		# data cache block flush
	icbi    r0, r3
exit:
	blr                     # return



Edited 1 time(s). Last edit at 10/31/2008 08:28AM by WiiCrazy.
Re: ES_LaunchTitle and VIDEO_SetPostRetraceCallback
October 31, 2008 09:06AM
Cool! Thanks for that!
Sorry, only registered users may post in this forum.

Click here to login