Welcome, Guest. Please login or register.
Amiga Kit Amiga Store Iridium Banner AMIStore App Store A600 Memory

AuthorTopic: AmiDARK Engine Flying Feather on AROS  (Read 1234 times)

0 Members and 1 Guest are viewing this topic.

Offline BSzili

Re: AmiDARK Engine Flying Feather on AROS
« Reply #15 on: June 10, 2014, 11:09:35 AM »
Ok, I didn't know you have had error handling somewhere else. Thanks for the code, I'll write a small test program to figure out why they wouldn't work. I see there MyCreateIORequest and CreateExtIO used interchangeably. Does MyCreateIORequest use CreateExtIO internally? I have the same question about  MyCreateMsgPort, I presume it's a wrapper around CreateMsgPort.
I see the jimmies have been rustled.
 

Offline AmiDARK

Re: AmiDARK Engine Flying Feather on AROS
« Reply #16 on: June 10, 2014, 11:22:34 AM »
Yes, they're wrapper :

Quote
struct IORequest * MyCreateIORequest( struct MsgPort * MyIOPort, int SizeRequest ){
  struct IORequest * MyIORequest;
  #if defined( __amigaos4__ )
    MyIORequest= IExec->CreateIORequest( MyIOPort, SizeRequest );
   #else
    MyIORequest = CreateIORequest( MyIOPort, SizeRequest );
   #endif
  return MyIORequest;
 }


Quote
struct MsgPort * MyCreateMsgPort( void ){
  struct MsgPort * MyMessagePort;
  #if defined( __amigaos4__ )
    MyMessagePort = IExec->CreateMsgPort();
   #else
    MyMessagePort = CreateMsgPort();
   #endif
  return MyMessagePort;
 }
 

Offline BSzili

Re: AmiDARK Engine Flying Feather on AROS
« Reply #17 on: June 10, 2014, 12:36:56 PM »
While that's a perfectly sound way of doing it, if you want to avoid wrapper functions like that, you can define __USE_INLINE__ on AmigaOS4. That will define you a bunch of compatibility macros, so you can use CreateMsgPort instead of IExec->CreateMsgPort.
Back to the AROS. This code doesn't look right to me:
Code: [Select]
if ( MyOpenDevice( "input.device", 0, (struct IORequest *)m_inputRequest, 0 ) ){
        #if defined( __amigaos4__ )
          InputBase = m_inputRequest->io_Device;
          m_IInput = (struct InputIFace *)MyGetInterface( ( struct Library *)InputBase, "main", 0 );
         #endif
        mReturn = TRUE;
       }
Unless you changed that in MyOpendevice, OpenDevice returns 0 if the device was opened successfully and an != 0 error code if it failed.
The second problem is InputBase. You only set it on AmigaOS4, which means it will be uninitialized on other platforms, unless a library auto-opener does it for you. Since you are already opening input.device, InputBase should be always initialized.
The same goes for TimerBase, the initializer function most likely segfaults on the first GetSysTime call, because TimerBase is not initialized, and holds a random value.
I see the jimmies have been rustled.
 

Offline AmiDARK

Re: AmiDARK Engine Flying Feather on AROS
« Reply #18 on: June 10, 2014, 12:43:45 PM »
Yes, I know that.
But, it exists few commands/functions in the AmigaOS4 that do not exist on other Amiga OSes and that need to be developed differently.
That's why I decided to keep this form. To be sure I never lose focus on AmigaOS4 specific commands/functions and other OSes ones ;)
 

Offline BSzili

Re: AmiDARK Engine Flying Feather on AROS
« Reply #19 on: June 10, 2014, 01:14:08 PM »
What about the second part of my post? E.g. the return value of OpenDevice, TimerBase and InputBase not being set, etc.
I see the jimmies have been rustled.
 

Offline AmiDARK

Re: AmiDARK Engine Flying Feather on AROS
« Reply #20 on: June 10, 2014, 01:49:41 PM »
I'll check these.