What is the correct way to use Outpatch.exe?

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
steddy
Posts: 139
Joined: Mon Apr 04, 2005 3:53 am

What is the correct way to use Outpatch.exe?

Post by steddy »

I am trying to compile the RIN source code for version 1.17 to confirm the setup of my PS2Dev Toolchain. I can compile Hello PSP ok, but I am having problems with the Outpatch step in the RIN makefile.

I have placed outpatch.exe from HelloPSP into my C:\ps2dev\bin directory which is in the path, and its is found by the makefile but reports the following error:-
modulename not found
Looking at Outpatch.cpp it seems to have a hardcoded application name. Surely I don't have to recompile a new version of Outpatch for every application I want to compile (or do I?).

These are the lines from the RIN makefile I an referring too:-

Code: Select all

$(BINARY): $(OBJECTS)
	ee-ld -s -O0 $(OBJECTS) $(LIBRARY) -M -Ttext 8900000 -q -o $@ > rin.map
	outpatch
	elf2pbp outp "RIN GB/GBC Emulator"
The out file is created ok, but is not patched so the make fails.

Cheers
Steddy[/b]
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

Why don't you just add code to look at argv[1] to get the module name? Then you can pass it on the command line.
qubitz
Posts: 32
Joined: Sun Apr 03, 2005 10:30 am

Post by qubitz »

The module name that is used in startup.s is hard coded in outpatch.exe. If they do not match, outpatch will not work. So yes, you do have to recompile every time you change the module name. Unless of course, you change the source to take the module name as an argument.
steddy
Posts: 139
Joined: Mon Apr 04, 2005 3:53 am

Post by steddy »

Thanks Both

I just wondered to understand how it worked. Since the RIN sources didn't include a modified Outpatch.exe, I thought I was missing something.

I will change it to take a command line arg as stated.

Also, is there something I could hexedit in the toolchain to avoid this step entirely? I am not compiling anything other than PSP code with it.

Cheers
Steddy
Post Reply