[SOLVED] Method patch example request...ideas?

This forum is for general developer support questions.
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 218
Joined: Mon Aug 15, 2011 10:20 am
Location: Brisbane, QLD. Australia.

Re: Method patch example request...ideas?

Post by colinw »

Belxjander wrote:I'm aware of LoadSeg NewLoadSeg and InternalLoadSeg for 68K
Other than the LoadSeg documented in the Autofocus for DPS.library I have not seen other vectors...
Have a look at the; interfaces/dos.h file, there are 6 different loadseg vectors that can be called.

Excluding 68K loadables with OBSOLETEInternalLoadSeg(), you can reduce that to about 5 slots;
OBSOLETENewLoadSeg(), OBSOLETENewLoadSegTagList(), OBSOLETENewLoadSegTags(), OBSOLETELoadSeg(), LoadSeg()
Until dos.library 53.74 most of those were duplicate code and needed to be patches separately.

After 53.74, the OBSOLETENewLoadSegTags functions calls the OBSOLETENewLoadSegTagList function internally,
and those stubs now just call LoadSeg(), and if it is not an overlay hunk loadables, which calls OBSOLETELoadSeg(),
it will now call LoadSeg().

So, you really need to do version checks.
Belxjander
Posts: 315
Joined: Mon May 14, 2012 11:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

Re: Method patch example request...ideas?

Post by Belxjander »

@ColinW:

So in effect the majority of entrypoints now rely specifically on the "LoadSeg()" method of the DOS.Library main interface?

Just those comments alone I am thankful for... as I was intending to try and patch the bare minimum required.

@ThomasRapp: in your example

Code: Select all

/*----------------------------------------------------------------------------*/
/* New LoadSeg routine                                                        */
/*----------------------------------------------------------------------------*/

	BPTR newLoadSeg (struct DOSIFace *Self, CONST_STRPTR name)

	{
	// call original routine
	BPTR result = oldLoadSeg (Self,name);

	// send result as message to the main program
	send_msg (name,result);

	return (result);
	}
mostly differs from my own in the use of message passing...

Code: Select all

/*
	WARNING!!! RUNNING FROM dos.library/LoadSeg() CONTEXT!!! WARNING!!!
*/
BPTR LCALL_LoadSegVMM(struct DOSIFace *Self,CONST_STRPTR Name)
{
	BPTR rc=NULL;
	rc=XCALL_LoadSegDOS(Self,Name);
	return(rc);
}
yet my code... has some kind of self-calling setup happening... THAT is what I want to work out so that I can stop it...

This is driving me nuts...
User avatar
thomasrapp
Posts: 318
Joined: Sun Jun 19, 2011 12:22 am

Re: Method patch example request...ideas?

Post by thomasrapp »

Your code looks like it is used in a library (using SelfBase and so on). You know that to run a new version of your library you first have to expunge the old copy from memory? Usually closing all programs using the lib and then entering avail flush is sufficient, but to be really sure to use the new version you should reboot. Otherwise you are always testing the same old version, no matter how often you recompile.


Edit: here is a completed example which uses exactly your code: http://thomas-rapp.homepage.t-online.de ... r_filter.c
And it works. So the problem is not in the code you published but elsewhere.
Belxjander
Posts: 315
Joined: Mon May 14, 2012 11:26 pm
Location: 日本千葉県松戸市 / Matsudo City, Chiba, Japan
Contact:

[SOLVED] Method patch example request

Post by Belxjander »

@ThomasRapp: full reset of the machine every test.

If it is a failure elsewhere and that code is working properly then I need to look at shifting it into the process I embedded into the Library

I wonder if it is due the ramlib special context and opening DOS.library there?

I'll try again tonight

From the embedded "Polymorph-VMM" context... I make a different error... however... THIS IS NOW SOLVED...

Thank you all for your help in clarifying the problem.
Post Reply