Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
69 user(s) are online (41 user(s) are browsing Forums)

Members: 0
Guests: 69

more...

Headlines

 
  Register To Post  

« 1 (2)
Re: Devpac 3.x, AmigaOS 4.x and PowerPC
Quite a regular
Quite a regular


See User information
@Samurai_Crow : I second the Corto question.
How ?

Go to top
Re: Devpac 3.x, AmigaOS 4.x and PowerPC
Just popping in
Just popping in


See User information
@freddix

From disassembled code, it would be difficult to find the offsets because the interface, while it wouldn't be in a different register each time, would not use the same register for each library to offset from. You'd have to know which register each interface structure was referencing.

Here's kind of how it works in C:
#include "myscreen.h"
#include <protos/exec.h>
#include <protos/intuition.h>

struct Library *libptr;
struct Screen *myscreen;

int main()
{
  
libptr=iexec->OpenLibrary("intuition.library",51);
  if (
libptr!=NULL)
  {
     
iintuition=libptr->ObtainInterface("main", ...) // I'm not at my MicroA1-c right now
     // you'll have to look up the parameter list for the function call
    
myscreen=iintuition->OpenScreen(...);
...
    
iintuition->CloseScreen(myscreen);
    
iexec->DropInterface(iintuition);
    
iexec->CloseLibrary(libptr);
    return 
SUCCESS;
  }
  else
  {
    return 
FAIL;
  }
}


It's been a while since I've coded for OS4 and this pseudo code won't compile but i hope you get the idea. The iexec pointer variable is the interface to exec.library and iintuition is the interface to intuition.library. The libptr variable points to the library base of intuition.library but is only used to obtain the interface and the interface is used after that.

Normally when importing source code written for AmigaOS 3.x there is a pragma that is either defined at the beginning of the code or from the command line that will hide all of the interface usage behind a bunch of macros so you can call the functions without being aware of the interface stuff going on in the meantime.

Hopefully somebody can point you to a better example than this because I've loaned out my MicroA1-c to DiscreetFX to use in porting Aladdin4d to OS4.

Go to top
Re: Devpac 3.x, AmigaOS 4.x and PowerPC
Not too shy to talk
Not too shy to talk


See User information
I have found :)

System calls use interfaces under OS4 : an interface is a structure and an array of function pointers. The offset to call a function is equal to the entry index added by the structure size (58 rouded to 60 due to alignment).

Go to top

  Register To Post
« 1 (2)

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project