Click Here
home features news forums classifieds faqs links search
6071 members 
Amiga Q&A /  Free for All /  Emulation /  Gaming / (Latest Posts)
Login

Nickname

Password

Lost Password?

Don't have an account yet?
Register now!

Support Amigaworld.net
Your support is needed and is appreciated as Amigaworld.net is primarily dependent upon the support of its users.
Donate

Menu
Main sections
» Home
» Features
» News
» Forums
» Classifieds
» Links
» Downloads
Extras
» OS4 Zone
» IRC Network
» AmigaWorld Radio
» Newsfeed
» Top Members
» Amiga Dealers
Information
» About Us
» FAQs
» Advertise
» Polls
» Terms of Service
» Search

IRC Channel
Server: irc.amigaworld.net
Ports: 1024,5555, 6665-6669
SSL port: 6697
Channel: #Amigaworld
Channel Policy and Guidelines

Who's Online
27 crawler(s) on-line.
 102 guest(s) on-line.
 0 member(s) on-line.



You are an anonymous user.
Register Now!
 OlafS25:  43 mins ago
 Bruce72:  44 mins ago
 Rob:  1 hr 16 mins ago
 MEGA_RJ_MICAL:  1 hr 32 mins ago
 t0lkien:  1 hr 37 mins ago
 amigakit:  1 hr 57 mins ago
 OneTimer1:  2 hrs 11 mins ago
 Troels:  3 hrs 12 mins ago
 Gunnar:  3 hrs 27 mins ago
 zipper:  3 hrs 56 mins ago

/  Forum Index
   /  Amiga Development
      /  IDCMP is still use in modern amigaos/morphos?,and IExec etc
Register To Post

Goto page ( 1 | 2 Next Page )
PosterThread
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
Profile     Report this post  
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.
#endif

Last 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
Profile     Report this post  
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
Profile     Report this post  
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
Profile     Report this post  
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
Profile     Report this post  
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

@Vanhapolle

The includes are in base.lha

_________________
Email: thomas-rapp@web.de
Home: thomas-rapp.homepage.t-online.de

 Status: Offline
Profile     Report this post  
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
Profile     Report this post  
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
Profile     Report this post  
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
Profile     Report this post  
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
Profile     Report this post  
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
Profile     Report this post  
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
Profile     Report this post  
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
Profile     Report this post  
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
Profile     Report this post  
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
Profile     Report this post  
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
Profile     Report this post  
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
Profile     Report this post  
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
Profile     Report this post  
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)

@Vanhapolle

The Documentation wiki is found here: http://wiki.amigaos.net/wiki/Main_Page

The description of library interfaces is found at: http://wiki.amigaos.net/wiki/Programming_in_the_Amiga_Environment

You should read it carefully even if English is not your first language, as all the information is in there.

_________________
cheers
tony

Hyperion Support Forum: http://forum.hyperion-entertainment.biz/index.php

 Status: Offline
Profile     Report this post  
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
Profile     Report this post  
Goto page ( 1 | 2 Next Page )

[ home ][ about us ][ privacy ] [ forums ][ classifieds ] [ links ][ news archive ] [ link to us ][ user account ]
Copyright (C) 2000 - 2019 Amigaworld.net.
Amigaworld.net was originally founded by David Doyle