Poster | Thread |
Vanhapolle
| |
IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 13-Dec-2014 15:30:25
| | [ #1 ] |
|
|
|
Regular Member |
Joined: 22-Sep-2014 Posts: 372
From: Unknown | | |
|
| is IDCMP still in use AmigaOS4->? of course i if made modern gui has own messages system. but basic window without gadgets and its closing gadget for example. and same for MorphOS ? what is point in modern amigaos these IExec,and IGfx? i found somewhere list of them but i forgotted where it is.
|
|
Status: Offline |
|
|
NutsAboutAmiga
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 13-Dec-2014 15:51:40
| | [ #2 ] |
|
|
|
Elite Member |
Joined: 9-Jun-2004 Posts: 12795
From: Norway | | |
|
| @Vanhapolle
Quote:
s IDCMP still in use AmigaOS4->? of course i if made modern gui has own messages system. but basic window without gadgets and its closing gadget for example. and same for MorphOS ? |
Yes.
If you don't like that and wont to do it more like the MS way. You might do a conversion table.
If (msg = GetMsg( window -> UserPort )) { For (n=0;n<sizeof(eventtable)/sizeof(struct eventtabledef);n++ ) { if (msg -> Class == eventtable[n].Class ) { eventtable[n].function( msg -> Code ); break; } } ReplyMsg(msg); }
Quote:
what is point in modern amigaos these IExec,and IGfx? i found somewhere list of them but i forgotted where it is. |
You should think of this as namespaces.
Exec.library has at least 3 interfaces, Debug Interface and the Main interface, MMU interface.
Etch of interface struct is for native AmigaOS4 functions, so on AmigaOS native routines can pass the arguments on stack instead of having the arguments in emulated 68k registers.
The JMP tabel also exists, but when ever a program calls a routine from there it calls a stub function that has to convert 680x0 register arguments to stack arguments, and call the native routines.
To keep your source code cross platform compatible you need to put a define like this:
#define __use_inline__
at the top of your source code or you can pass the -D__use_inline__ to GCC argument, this will hide the interfaces, but you will need to obtain the interfaces anyway, and release the interfaces before you close the library.
There is also a define to use the old TimeVal struct don't remember the name of the define, but you find in the header files in SDK.
Any code that is only for AmigaOS4 has to be wrapped inside a preprocess #if #else #endif statement.
#idef __amigaos4__ //OS4 special code goes here. #endifLast edited by NutsAboutAmiga on 13-Dec-2014 at 07:54 PM. Last edited by NutsAboutAmiga on 13-Dec-2014 at 06:22 PM. Last edited by NutsAboutAmiga on 13-Dec-2014 at 06:21 PM. Last edited by NutsAboutAmiga on 13-Dec-2014 at 06:20 PM. Last edited by NutsAboutAmiga on 13-Dec-2014 at 04:12 PM. Last edited by NutsAboutAmiga on 13-Dec-2014 at 04:05 PM. Last edited by NutsAboutAmiga on 13-Dec-2014 at 03:54 PM. Last edited by NutsAboutAmiga on 13-Dec-2014 at 03:53 PM. Last edited by NutsAboutAmiga on 13-Dec-2014 at 03:52 PM.
_________________ http://lifeofliveforit.blogspot.no/ Facebook::LiveForIt Software for AmigaOS |
|
Status: Offline |
|
|
Vanhapolle
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 13-Dec-2014 16:01:08
| | [ #3 ] |
|
|
|
Regular Member |
Joined: 22-Sep-2014 Posts: 372
From: Unknown | | |
|
| @NutsAboutAmiga
thanks but anyinfo where they are listed all in same time these IGfx,IExec etc.
|
|
Status: Offline |
|
|
NutsAboutAmiga
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 13-Dec-2014 16:11:51
| | [ #4 ] |
|
|
|
Elite Member |
Joined: 9-Jun-2004 Posts: 12795
From: Norway | | |
|
| @Vanhapolle
Quote:
thanks but anyinfo where they are listed all in same time these IGfx,IExec etc. |
the definitions for this you find in the SDK:include/includes/inline4, in this files you find the correct names.
IGfx is not the correct name if you wont to use __USE_INLINE__ it should be IGraphics I think, normally its the same as library name just with "I" front.
Remember this files are in most cases auto generated, from a XML file._________________ http://lifeofliveforit.blogspot.no/ Facebook::LiveForIt Software for AmigaOS |
|
Status: Offline |
|
|
Vanhapolle
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 13-Dec-2014 16:26:40
| | [ #5 ] |
|
|
|
Regular Member |
Joined: 22-Sep-2014 Posts: 372
From: Unknown | | |
|
| @NutsAboutAmiga
Thanks any ideas what file of lha packets what made sdk is this file? i try look sdk before i get os itself. at least in base archive ii is not correct even there is some includes. Or this file made when i install SDK to real AmigaOS4.1?
|
|
Status: Offline |
|
|
thomas
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 13-Dec-2014 18:57:21
| | [ #6 ] |
|
|
|
Super Member |
Joined: 28-May-2003 Posts: 1141
From: Germany | | |
|
| |
Status: Offline |
|
|
itix
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 13-Dec-2014 19:09:46
| | [ #7 ] |
|
|
|
Elite Member |
Joined: 22-Dec-2004 Posts: 3398
From: Freedom world | | |
|
| @Vanhapolle
(MorphOS) It is there in low level but if you used moden GUI toolkit you would not have to use such low level mechanism.
_________________ Amiga Developer Amiga 500, Efika, Mac Mini and PowerBook |
|
Status: Offline |
|
|
Vanhapolle
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 13-Dec-2014 20:17:30
| | [ #8 ] |
|
|
|
Regular Member |
Joined: 22-Sep-2014 Posts: 372
From: Unknown | | |
|
| @thomas
somehow i still dont found it such package. what i actually looked first. Very likely i found it but patch is different...
|
|
Status: Offline |
|
|
Hypex
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 14-Dec-2014 13:14:25
| | [ #9 ] |
|
|
|
Elite Member |
Joined: 6-May-2007 Posts: 11180
From: Greensborough, Australia | | |
|
| @NutsAboutAmiga
Quote:
IGfx is not the correct name if you wont to use __USE_INLINE__ it should be IGraphics I think, normally |
The Graphics subsystem was referred to as Gfx in the early days so IGfx is what they should be be using. However, using IGraphics would be typical as they use IIntuition which is a ridiculously long name to prepend to a function, but they seem to like using these long names for some reason.
Of course, these inline macros can be used, and might as well as they are more Amiga like. And since there is no naming conflicts with function names yet that I know of. They aren't fully seperated yet in cross-API functions. |
|
Status: Offline |
|
|
salass00
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 15-Dec-2014 22:28:09
| | [ #10 ] |
|
|
|
Elite Member |
Joined: 31-Oct-2003 Posts: 2707
From: Finland | | |
|
| @Hypex
The standard name for the graphics.library base variable still is GfxBase as it has AFAIK always been.
As for the standard names of interface variables in AmigaOS 4.x unless you are using __USE_INLINE__ you can call them whatever you want (and in case you are using __USE_INLINE__ the length of the standard names won't matter since you don't have to type them out then at all).
F.e. if typing IGraphics->SomeFunc(...) is too long for you, you could shorten it to G->SomeFunc() for instance if you wanted to. |
|
Status: Offline |
|
|
salass00
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 15-Dec-2014 22:31:56
| | [ #11 ] |
|
|
|
Elite Member |
Joined: 31-Oct-2003 Posts: 2707
From: Finland | | |
|
| @NutsAboutAmiga
Quote:
the definitions for this you find in the SDK:include/includes/inline4, in this files you find the correct names.
|
Better look in proto/*.h files as not all libraries will necessarily have inline4 macros. |
|
Status: Offline |
|
|
Vanhapolle
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 16-Dec-2014 0:13:50
| | [ #12 ] |
|
|
|
Regular Member |
Joined: 22-Sep-2014 Posts: 372
From: Unknown | | |
|
| @salass00
But these still list info what i need?
|
|
Status: Offline |
|
|
salass00
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 16-Dec-2014 7:32:04
| | [ #13 ] |
|
|
|
Elite Member |
Joined: 31-Oct-2003 Posts: 2707
From: Finland | | |
|
| @Vanhapolle
Depends on what information you are after. If you want information on library functions and what they do you should consult the AutoDocs. |
|
Status: Offline |
|
|
Vanhapolle
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 16-Dec-2014 7:49:27
| | [ #14 ] |
|
|
|
Regular Member |
Joined: 22-Sep-2014 Posts: 372
From: Unknown | | |
|
| @salass00
I mean these IExec etc names i mean these modern amigaos lib things IExec and all others what i mean starts I. How libs work i know basic info is autodocs but sometimes is not so clear. But lookslike i undetstand now but not yet tested how Datatypes work.
|
|
Status: Offline |
|
|
Hypex
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 16-Dec-2014 13:05:54
| | [ #15 ] |
|
|
|
Elite Member |
Joined: 6-May-2007 Posts: 11180
From: Greensborough, Australia | | |
|
| @salass00
Yes it's a matter of personal taste. Though perhaps best kept in your own code. As people can get up in arms about your personal style and claim it's not portable or will introduce mistakes. |
|
Status: Offline |
|
|
Hypex
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 16-Dec-2014 13:09:37
| | [ #16 ] |
|
|
|
Elite Member |
Joined: 6-May-2007 Posts: 11180
From: Greensborough, Australia | | |
|
| @NutsAboutAmiga
BTW I've never seen such strange code dealing with IDCMP flags! Though I can see the point I suppose I'm more of a case...switch type of man. |
|
Status: Offline |
|
|
Hypex
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 16-Dec-2014 13:30:57
| | [ #17 ] |
|
|
|
Elite Member |
Joined: 6-May-2007 Posts: 11180
From: Greensborough, Australia | | |
|
| @Vanhapolle
The IExec and related IGfx are an expansion on libraries brought into AmigaOS4 called interfaces which hold the actual functions or jump table. On 68K this table sat "in front of" the library base or before it in negative offsets. So you open the library, the pointer was put into a register (usually A6) and then call a function from a negative offset from the library base.
On OS4, they sought to expand on libraries, so one library could provide a subset of functions as well as the main functions. They called these interfaces. I thought they should have called them books.
Also, having functions at negative offsets and a JMP instruction was not very manageable for C language. As well as on a new CPU architecture. So they invented these interfaces.
It does mean on OS4 opening, closing and using library functions is more involved than on the original OS. And can complicate matters when porting as well as writing new code. More so when writing cross-Amiga code. This is because as well as the library being opened, one must then get the interface to the library (usually main interface), all the way checking for fails. Then the functions can be called, but for OS4 native code it is usually called as a method from the interface pointer, such as IExec.
So these interfaces are really the function table of the library. The original OS could keep these in the library base, OS4 keeps it in an interface. Last edited by Hypex on 20-Dec-2014 at 01:39 PM.
|
|
Status: Offline |
|
|
NutsAboutAmiga
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 20-Dec-2014 2:18:39
| | [ #18 ] |
|
|
|
Elite Member |
Joined: 9-Jun-2004 Posts: 12795
From: Norway | | |
|
| @Hypex
Quote:
BTW I've never seen such strange code dealing with IDCMP flags! Though I can see the point I suppose I'm more of a case...switch type of man.
|
I don't use code like that too often, some time it makes things easier, some time it make it more complicated.
Switch's are slow as you need to check for etch condition, tabel's can be faster, as all you need is a index, also you don't get so many levels of "{" and "}"
A table for button up event for example can easy simulate the mybutton_click(), MS like code, so sharing code between a MS project and Amiga project is possible, you just need put some effort into it I suppose.
Last edited by NutsAboutAmiga on 20-Dec-2014 at 12:15 PM. Last edited by NutsAboutAmiga on 20-Dec-2014 at 02:20 AM.
_________________ http://lifeofliveforit.blogspot.no/ Facebook::LiveForIt Software for AmigaOS |
|
Status: Offline |
|
|
tonyw
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 20-Dec-2014 7:28:43
| | [ #19 ] |
|
|
|
Elite Member |
Joined: 8-Mar-2003 Posts: 3240
From: Sydney (of course) | | |
|
| |
Status: Offline |
|
|
megol
| |
Re: IDCMP is still use in modern amigaos/morphos?,and IExec etc Posted on 20-Dec-2014 9:30:38
| | [ #20 ] |
|
|
|
Regular Member |
Joined: 17-Mar-2008 Posts: 355
From: Unknown | | |
|
| @NutsAboutAmiga
Compilers can translate switch statements to table lookup(s) or table lookup(s) + some extra checks. That applies to GCC, LLVM/CLANG, ICC etc.
|
|
Status: Offline |
|
|